Jump to content

hvymetal

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by hvymetal

  1. I had the same problem here is function that I wrote to select a string from the comboxes' that use comboLbox. What it does is opens the dropdown listbox control in the combobox and sets the cursor in the listbox. This causes editbox portion of the combobox to update allowing you to read the string and compare it. #Include <GuiComboBox.au3> #Include <GuiEdit.au3> #Include <GuiListBox.au3> Func ComboLBox_SelectString($Window,$WindowText,$ControlID, $SelectString, $fPartialOK = True) Local $tInfo $returnVal=False $hCombo=ControlGetHandle($Window, $WindowText,$ControlID) If _GUICtrlComboBox_GetComboBoxInfo($hCombo, $tInfo) Then $hEdit=DllStructGetData($tInfo, "hEdit") $hList=DllStructGetData($tInfo, "hList") $EditTxt=_GUICtrlEdit_GetText($hEdit) If (((StringInStr($EditTxt, $SelectString)>0) AND $fPartialOK) Or((StringCompare($EditTxt, $SelectString)=0) AND NOT $fPartialOK)) Then $returnVal=True Else ;Open ListBox Control _GUICtrlComboBox_ShowDropDown($hCombo, True) ;Find SetText and Select $i=0 $ListEnd=_GUICtrlListBox_GetCount($hList) - 1 While($i<=$ListEnd AND NOT $returnVal) _GUICtrlListBox_SetCurSel($hList,$i) $EditTxt=_GUICtrlEdit_GetText($hEdit) If (((StringInStr($EditTxt, $SelectString)>0) AND $fPartialOK) Or((StringCompare($EditTxt, $SelectString)=0) AND NOT $fPartialOK)) Then $returnVal=True _GUICtrlListBox_ClickItem($hList,$i) EndIf $i=$i+1 WEnd _GUICtrlComboBox_ShowDropDown($hCombo, False) EndIf EndIf Return $returnVal EndFunc
  2. I posted this over at the DoxBox forum. Since I got a lot of help form reading the forum I figured I share it here also. To test it you need to version DOSBox 0.70 that you can download off their site:dosbox.sourceforge.net I use dosbox for older serial based PLC programs. I missed the copy and paste function of the older win98 dos windows. So I came up with this AutoIt wrapper that has mouse selections, icons, and copy paste hotkeys. This solution does not modify DosBox code in anyway it is just creates a wrapper around the window. I'll provide a little information how it works. First it must run a TSR program called xpcmouse.exe in dosbox. This provides the selectable text inside the DosBox. When the user selects text in DosBox and press the Copy Icon or Ctrl+c it will write to a file that is on mapped drive. Then AutoIt reads the file and places the copied information into the Windows Clipboard. When the user paste using Ctrl+v or the Paste icon it will send keys to the dos window with whatever is in the windows Clipboard. Also I provided an Icon to hide the status window. This code should work in any version but the windows titles will have to be changed in clip.ini. Right now it is fixed for DOSBox 0.70. To upgrade in the future just change to the newer names. To install just unzip to your current DosBox directory into a subdirectory called clip. Run clip.exe. I also included the clip.au3 if any one is curious about the code. I worked hard on this so if it is helpful for anyone please leave me feedback I'm willing to see what you think. I just want to thank Qbix for a great program without it my older programs would never work in XP. DosBox and AutoIt are the best two programs on the Internet. clip.zip
  3. When I'm in the VB6 and run my program autoit commands work properly but when I compile the program and run it it does not run any auto commands. It is like it skips over them. Anyone have any ideas?
  4. Frogonalog, As I said in my orginal post the dos program stays open. So you can not just pipe it to a file. That only works on programs that run once and then exit. The program that I'm trying to automate is an OLD dos based PLC software. I want to be able to automate the process of downloading the program to the PLC. To automate it correctly I need status that I have serial commucation to the device. This information is showed on the screen so my idea is keep copying the screen and parse the result to look for the keywords if everything is ok.
  5. CyberSlug You were right I replaced the ControlSend with Send and it worked correctly. So if anyone wonders what I used here it is. WinActivate ( "C:\") send("!{space}ek{SHIFTDOWN}{PGDN}{RIGHT 80}{SHIFTUP}{ENTER}") I just wished that there was a key like PGDN that would arrow over with one key and not using "{right 80}". The reason is that you can see the selection scan across the screen in the dosbox. So if anyone knows a better way I'm willing to listen. All in all it works but I wish that Autoit had a way of getting the text from a dosbox built in. It would help out in the automation of Dos programs.
  6. Ok it didn't work completely. It only selects the first line and not the full dos box window. I tried using the Mark command in the window and and sending controlsend("C:\","","","!{space}ek") controlsend("C:\","","","{SHIFTDOWN}{PGDN}{RIGHT 80}{SHIFTUP}{ENTER}") but for some reason the {SHIFTDOWN} does not work.
  7. That will work. I just wish it didn't show the menu bar popping up. In any case it will work just not as hidden as I like it to be. Thanks for the tip.
  8. Is there anyway to copy the full text from a dos window to the clipboard. There should be a way since it is possible do it manual using the mouse to select the window and copying to the clipboard. I want to be able to copy all the text in the dos window to parse it for certian pharses to use as feedback in my scripts. Since Autoit has the abiltiy to send keys to the dos window it should also have a way look for feedback whats going in the running program. The program that I'm using stays open so I can't just pipe the output to a text file. The program runs in a dos window and is all text based so when I manually copy and pasted it using the mouse to notepad all the information is in text form. I tried to search the forum and did not have any luck on coming up with any answers. So if someone could suggest a way I would be very thankfull.
×
×
  • Create New...