Jump to content

mike1234

Active Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by mike1234

  1. What's this? I have a program that stores an input box to an access database “memo” field. Does anyone have any suggestions on how I turn this into an input box that accepts line carriages? I currently have multiline mode turned on but it doesn’t allow for a carriage return from the enter key… and if it did I’m not sure if it would stick when I sent it to the access database. Thanks
  2. So heres my on screen keyboard didnt really spend that much time on it (doesnt have a spacebar, backspace etc yet). Any suggestions on parsing out what button was clicked (FunKey)? I like how short it is but I'm not sure if there will be a situation in which the control IDs might change. Any suggestions for a more effecient keyboard? #include <GuiConstants.au3> #include <windowsconstants.au3> Opt("GUIOnEventMode", 1) $keyboardwidth = 850 $keyboardheight = 650 $buffer = 20 $keybuffer = 20 $keyboardlocx = 20 $keyboardlocy = 200 $font = "Bodoni MT Black" $fontsize = 60 $fontcolor = 0xffffff $keywidth = $keyboardwidth/11 $keyheight = $keyboardheight/6 $row1 = "Q-W-E-R-T-Y-U-I-O-P" $row2 = "A-S-D-F-G-H-J-K-L" $row3 = "Z-X-C-V-B-N-M" $keys = "0-1-2-3-4-5-6-7-8-9-Q-W-E-R-T-Y-U-I-O-P-A-S-D-F-G-H-J-K-L-Z-X-C-V-B-N-M" $controls = 2 ;number of control IDs registered $row1array = StringSplit($row1,"-") $row2array = StringSplit($row2,"-") $row3array = StringSplit($row3,"-") $keyarray = StringSplit($keys,"-") GUISetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) $pos = MouseGetPos() $keyboard = GUICreate("Keyboard", $keyboardwidth + 10*$buffer,$keyboardheight + 4*$buffer,$keyboardlocx,$keyboardlocy, $WS_POPUP);$WS_EX_TOPMOST GUISetFont(20, 400, 4, $font) $i = 0 While $i < 10 GUICtrlCreateButton($i,$i*$keywidth,0,$keywidth,$keyheight) GUICtrlSetOnEvent(-1,"FunKey") $i = $i+1 Wend $i = 1 While $i < $row1array[0]+1 GUICtrlCreateButton($row1array[$i],$i*$keywidth-$keywidth,$keyheight,$keywidth,$keyheight) GUICtrlSetOnEvent(-1,"FunKey") $i = $i+1 Wend $i = 1 While $i < $row2array[0]+1 GUICtrlCreateButton($row2array[$i],$i*$keywidth-$keywidth*.5,$keyheight*2,$keywidth,$keyheight) GUICtrlSetOnEvent(-1,"FunKey") $i = $i+1 Wend $i = 1 While $i < $row3array[0]+1 GUICtrlCreateButton($row3array[$i],$i*$keywidth,$keyheight*3,$keywidth,$keyheight) GUICtrlSetOnEvent(-1,"FunKey") $i = $i+1 Wend GUISetState(@SW_SHOW) GUISetControlsVisible($keyboard) While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd Func FunKey() Msgbox(0,"",$keyarray[@GUI_CtrlId - $controls]) EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func GUISetControlsVisible($hWnd) Local $aClassList, $aM_Mask, $aCtrlPos, $aMask $aClassList = StringSplit(_WinGetClassListEx($hWnd), @LF) $aM_Mask = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", 0, "long", 0, "long", 0, "long", 0) For $i = 1 To UBound($aClassList) - 1 $aCtrlPos = ControlGetPos($hWnd, '', $aClassList[$i]) If Not IsArray($aCtrlPos) Then ContinueLoop $aMask = DllCall("gdi32.dll", "long", "CreateRectRgn", _ "long", $aCtrlPos[0], _ "long", $aCtrlPos[1], _ "long", $aCtrlPos[0] + $aCtrlPos[2], _ "long", $aCtrlPos[1] + $aCtrlPos[3]) DllCall("gdi32.dll", "long", "CombineRgn", "long", $aM_Mask[0], "long", $aMask[0], "long", $aM_Mask[0], "int", 2) Next DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hWnd, "long", $aM_Mask[0], "int", 1) EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func _WinGetClassListEx($sTitle) Local $sClassList = WinGetClassList($sTitle) Local $aClassList = StringSplit($sClassList, @LF) Local $sRetClassList = "", $sHold_List = "|" Local $aiInHold, $iInHold For $i = 1 To UBound($aClassList) - 1 If $aClassList[$i] = "" Then ContinueLoop If StringRegExp($sHold_List, "\|" & $aClassList[$i] & "~(\d+)\|") Then $aiInHold = StringRegExp($sHold_List, ".*\|" & $aClassList[$i] & "~(\d+)\|.*", 1) $iInHold = Number($aiInHold[UBound($aiInHold)-1]) If $iInHold = 0 Then $iInHold += 1 $aClassList[$i] &= "~" & $iInHold + 1 $sHold_List &= $aClassList[$i] & "|" $sRetClassList &= $aClassList[$i] & @LF Else $aClassList[$i] &= "~1" $sHold_List &= $aClassList[$i] & "|" $sRetClassList &= $aClassList[$i] & @LF EndIf Next Return StringReplace(StringStripWS($sRetClassList, 3), "~", "") EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3. Hooray thank you.
  4. I have a rather large file that is saved as hex ascii ie a=61 so basically the file would read "616263646566", I would like to convert that to "abcdef" but the chr function only converts decimal ascii values. Right now when I read it I get 61 = "=". Is there a way to toggel this so it converts hex and is that the most effecient way of converting it? The file is quite large. Thanks
  5. Must have missed that, thanks a bunch.
  6. For some reason when I create a background all of the controls above arent enabled. When I comment out the background the control intializes fine. There is something about the picture being there that makes it so you cant click on the button or label, you can see it fine but when you click on it there is no animation of a button press and no initilization of a function in the case of set on event. Any ideas? $childwin = GuiCreate("Test",$testpicturex,$testpicturey,$testpicturelocx,$testpicturelocy, $WS_BORDER+$WS_EX_LAYERED,$win) $testpicture = GuiCtrlCreatePic("testbk.bmp",$testpicturelocx,$testpicturelocy,$testpicturex,$testpicturey) GUISetBkColor(0x374437) $font="Bodoni MT Black" GUISetFont (30, 400, "", $font) $testquestion = GUICtrlCreateLabel("",$testquestionx,$testquestiony,$testquestionwidth,$testquestionheight) GUICtrlSetColor ( $testquestion, 0xffffff) $button1 = GUICtrlCreateButton("asdas",200,400) GUICtrlSetOnEvent(-1,"FunMsgBox") GuiSetState(@SW_SHOW)
  7. NM found the problem looks like it doesnt work with the ,$WS_EX_TOOLWINDOW property set, once I removed it it seemed to register. Thanks.
  8. Could anyone tell me how to detect the state of a gui, wingetstate does not work and I cannot find a guigetstate or anything that returns if the window is hidden or visible. Is there a function that can check for gui visbility? Thanks
  9. Excelent should be all the info I need. Thanks
  10. But doesnt _IsPressed only monitor for clicks. The right click still registers on the system so for instance in the app I am trying to interface with the right click menu still launches.
  11. I have tried to do my due diligance but can not find a way to use the mouse click as a qualifier for logic in code. Can anyone give me an example of using right and/or left mouse click as an intilizer of a function. Similar to a hot key can I say if the user right clicks at anywhere in these coordinates do function A, if they left click in any of these coordinates do function B? Thanks
  12. I've noticed a few posts where the command Return 'GUI_RUNDEFMSG' is used. It implies that output is stored in a hidden gui. How does one access this information? Sorry for the simple question but I could not find anything on how to read this. Thanks
  13. That would be cool the first Autoit DICOM viewer. If you figure it out can you post your code? Thanks
  14. Well thats kind of the problem I can't have a loop that waits for the mouse to be up when I send a mouse up command in the loop. Effectivly it only goes thru one iteration. Is there a way of waiting for a 2nd mouse up or is there a way of designating a user's mouse up command versus the program's?
  15. This is a pretty random question but if I sent the mouseup command (so that I can do a function that the game wont allow me to do with the mouse held down) how do I know when the user actually releases the mouse button? Effectivly I want to make a loop that releases the left mouse button (so that I can do my function) but waits for the user to release it before it exits the loop. in pseduo code while mousedown("left")=1 Mouseup("left") ;the mouse up I need to send to perform my function insert function here Wend
  16. You might want to be a little more specific for what you want the bot to do.
  17. I cant find _ispressed in the help file.
  18. I am trying to have a loop occur while a window is active. Basically whenever the window "search" search is open/active I want the code to constantly check for certain control fields. Once the window closes I want it to end the loop. The problem is I couldn't find the right syntax to do this. Here is some of the pseudo code that I am using. Any help would be great, Thanks Dim $Last ;control id 213 Dim $First ;control id 211 Dim $DOB ;control id 220 Dim $Text ;while WinWaitActive("search") sleep(100) $Last = ControlGetText ( "search", "", 213 ) $First = ControlGetText ( "search", "", 211 ) $DOB = ControlGetText ( "search", "", 220 ) ;wend WinWaitClose("search") msgbox(0,"here it is", $Last & $First & $DOB) exit
  19. I would also suggest checking out AU3Info.exe Open up the app (should be in your autoit folder). This is a default app that extracts the info from whatever app your trying to operate. I will tell you everything from window names to control ids. Good luck
  20. I am trying to find the location of text/controls so that I can reference them later. I am trying to interact with a program (that I did not design) that has multiple instances of the same control ID so control ID 3718 might appear 5 times on the screen but I would like to arrange them into an array so that I can sort them by x and y position that way I know which is which (since they share both control ID and text). I have tried doing this using both the controlgetpos and controlclick command but I could not figure out how to reference these controls and seperatly (it only logs the first one). Any suggestions? Thanks
  21. Thanks, I ran it and there are multiple duplicates. hmmm...
  22. I am attempting to reference a control but the id is shared by more than one instance of this control. Is there a way to reference a control based upong position for instance selecting the control with the smallest y coordinate. I tried this using controllistview and and controlgetpos but I could not figure out how to make them work. Any help would be great. Thanks,
×
×
  • Create New...