Jump to content

mike1234

Active Members
  • Posts

    23
  • Joined

  • Last visited

mike1234's Achievements

Seeker

Seeker (1/7)

0

Reputation

  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?
×
×
  • Create New...