
TuMbLeWeEd
Active Members-
Posts
119 -
Joined
-
Last visited
About TuMbLeWeEd
- Birthday 04/28/1970
Profile Information
-
Location
Belgium
-
WWW
http://joproject.sytes.net
TuMbLeWeEd's Achievements

Adventurer (3/7)
0
Reputation
-
I have this in vb code: Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long hWndMusic = GetWindowHandle prevWndproc = GetWindowLong(hWndMusic, -4) SetWindowLong hWndMusic, -4, AddressOf WndProc Function WndProc(ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long If Msg = &H202 Then MsgBox "OK" End If WndProc = CallWindowProc(prevWndproc, hwnd, Msg, wParam, lParam) End Function Is there a way to do this with DLLCall?
-
Downloaded the game and tested out some stuff.Once the game's screen is up (connected) No cursor control is possible. No mousemove or mouseclick, not even with a dllcall (thats the only one thats actualy failing, the standard autoit one's say there ok, but are not) The dllcall is working when you try it on a normal window, just comment out the game startup and you will see that it dous Don't know off a solution to do it. Run ("C:\Program Files\Webzen\Mu\Mu.exe", "C:\Program Files\Webzen\Mu") WinWaitActive("MU Auto Update","") While ControlGetText("MU Auto Update", "", "Static2") <> "Click connetion button to play game" sleep(100) WEnd While Not ControlCommand ( "MU Auto Update", "Connect", "Button2", "IsEnabled", "" ) sleep(100) WEnd ControlClick ( "MU Auto Update", "Connect", "Button2" ) WinWaitClose( "MU Auto Update","") WinWaitClose("MU launching","") Winwait("MU","") Sleep(20000);can try longer sleeps if the screen is not active yet $move = Mousemove(150,100,50) consolewrite("MouseMove = " & $move &@LF) $click = MouseClick("left", 512, 388, 2, 100) consolewrite("MouseClick = " & $click &@LF) $ret = DllCall("user32.dll","int","SetCursorPos","int",100,"int",100) consolewrite("DllCallMove = " & $ret[0] &@LF) Sleep(1000) WinSetState("MU","",@SW_MINIMIZE );the screen will flash for a second so you know when the script has ended
-
was just a quick copy of zeroZshadow's code + my function The "ReleaseCapture" is there because i grabed the code from the net (some VB code), it was used there and i dont know the purpose of it and never tested without. Maybe it has it's use in VB and not in AutoIt MSDN Doc's say: The ReleaseCapture function releases the mouse capture from a window in the current thread and restores normal mouse input processing. A window that has captured the mouse receives all mouse input, regardless of the position of the cursor, except when a mouse button is clicked while the cursor hot spot is in the window of another thread.
-
Just dont use the opt(OnEventMode,1) #include <GUIConstants.au3> Global Const $HTCAPTION = 2 Global Const $WM_NCLBUTTONDOWN = 0xA1 ;GUI $guiwin = GUICreate("GuiTest", 300,300,30,30,$WS_POPUP,0x00080000) $B2 = GUICtrlCreateButton("quit",200,100,50,50,-1,0x00000020) $Background = GUICtrlCreatePic("Back.gif",0,0,300,300,-1,0x00000020) GUISetState(@SW_SHOW) GuiCtrlSetState($B2,$GUI_FOCUS) While 1 $msg = GUIGetMsg() Select Case $msg = $B2 Exit Case $msg = $Background _GUISkinnedMove($Background,$guiwin) EndSelect sleep(10) WEnd ;=============================================================================== ; ; Description: _GUISkinnedMove ; Parameter(s): $ControlID ; $hwnd ; Requirement: None ; Return Value(s): None ; User CallTip: Event to handle the moving of a gui (for use of a _GUISkinnedCtrlCreateCaptionBar control) ; Author(s): TumbleWeed (tumbleweed_0999@hotmail.com) ; Note(s): None ; ;=============================================================================== Func _GUISkinnedMove($ControlID,$hwnd) ConsoleWrite('@@ (227) :(' & @MIN & ':' & @SEC & ') _GUISkinnedMove()' & @CR);### Trace Function $CursorInf = GUIGetCursorInfo($hwnd) While $CursorInf[2] DllCall("user32.dll", "long", "ReleaseCapture") DllCall("user32.dll", "long", "SendMessage", "hwnd", $hwnd, "int", $WM_NCLBUTTONDOWN, "int", $HTCAPTION, "int", 0) $CursorInf = GUIGetCursorInfo($hwnd) WEnd EndFunc ;==>_GUISkinnedMoveI'm making a GUISkinned UDF, the opt(OnEventMode,1) is to limmited for some stuff (this func is one off the 21 funcs i have now, some not woking the way i want it) Working on this for a while (somtimes that is )
-
GUICtrlGetState() return values...
TuMbLeWeEd replied to buzz44's topic in AutoIt General Help and Support
Try;ConsoleWrite("$GUI_ENABLE,$GUI_SHOW" & BitOr ($GUI_ENABLE,$GUI_SHOW) & @lf );80 ConsoleWrite("$GUI_DISABLE,$GUI_SHOW" & BitOr ($GUI_DISABLE,$GUI_SHOW) & @lf);144 ConsoleWrite("$GUI_ENABLE,$GUI_HIDE" & BitOr ($GUI_ENABLE,$GUI_HIDE) & @lf);96 ConsoleWrite("$GUI_DISABLE,$GUI_HIDE" & BitOr ($GUI_DISABLE,$GUI_HIDE) & @lf);160Explains it all -
Your Disadvantages are things that i dont like for future maintenance;-Defining arrays for all controls by hand=>mixing up array's with the wrong ControlID -To much global params for the GUI wich are not ControlID's: like $U, $cursorinfo -The same things are done at two different stages: in GUI loop and in Function (changing the images) To hard to find the logic behind the code that way (have tons of code made that way that i dont now where the logic is=> i think it left me and took off to some country far away :"> ) You gonna have some troubble if you don't comment it a bit (try to see what it does in a coupple of months, again experiance :"> ) Note it runs on the beta, so they change somthing=>it's hard to keep track what is going wrong Advantage: You made it, and it works (you know what to fix when it stops working) Everyting has it's disadvantages, mine has to: -I have to change the function strings in the skin string, they dont belong there -More Funtions to handle the click-events (no extra praram's) -The array in an array, if they stop supporting that=>Nothing is gonna work Advantage: (for me) -The array in an array is the only global var and it's made by the UDF, so the coder should not f*ck up the array -I see a simpler setup with my code (the end result should not deffer to much from a normal gui in code, if i get there ) -I understand my own logic better -I only had to rearange your code
-
Just try this one, beginning of a skinning UDF #include <GUIConstants.au3> Global $GUISkinnnedSkinArray[1] $main_gui = GUICreate("Test", 265, 264, -1, -1, $WS_POPUPWINDOW) $test0 = _GUISkinnedCtrlCreateButton("RU.bmp|RUO.bmp|RUC.bmp|RD.bmp|RDO.bmp|RDC.bmp|EventTest0|EventTest1",100, 100, 15, 15,True) $test1 = _GUISkinnedCtrlCreateButton("RU.bmp|RUO.bmp|RUC.bmp|EventTest2",115, 100, 15, 15) $test2 = _GUISkinnedCtrlCreateButton("RD.bmp|RDO.bmp|RDC.bmp|RU.bmp|RUO.bmp|RUC.bmp|EventTest1|EventTest0",130, 100, 15, 15,True) GUISetState(@SW_SHOW) While 1 $msg = _GUISkinnedGetMsg($main_gui) consolewrite("$msg = " & $msg & @lf ) If $msg = $test0 Then _GUISkinned_Button_Event($test0) ElseIf $msg = $test1 Then _GUISkinned_Button_Event($test1) ElseIf $msg = $test2 Then _GUISkinned_Button_Event($test2) EndIf Sleep(50) WEnd Func EventTest0() msgbox(0,"test","arrow up click event") EndFunc Func EventTest1() msgbox(0,"test","arrow down click event") EndFunc Func EventTest2() msgbox(0,"test","Button click single event") EndFunc Func _GUISkinnedCtrlCreateButton($Skin,$x,$y,$h,$w,$twoState = False) Local $array,$ControlID $Skin = "0|0|" & $Skin $array = StringSplit($Skin,"|") $array[0] = 0 If Ubound($array) < 11 and $twoState then;not a Two state button SetError(1) Return -1 ElseIf Ubound($array) < 7 and Not $twoState then SetError(1) Return -1 ElseIf Ubound($array) = 7 and Not $twoState then Redim $array[11] Local $tempevent = $array[6] $array[6] = $array[3] $array[7] = $array[4] $array[8] = $array[5] $array[9] = $tempevent $array[10] = $tempevent EndIf $ControlID = GUICtrlCreatePic($array[3],$x,$y,$h,$w) Redim $GUISkinnnedSkinArray[$ControlID + 1] $GUISkinnnedSkinArray[$ControlID] = $array Return $ControlID EndFunc Func _GUISkinnedGetMsg($main_gui) Local $CursorInfo $CursorInfo = GUIGetCursorInfo($main_gui) Return $CursorInfo[4] EndFunc Func _GUISkinned_Button_Event($ControlID) Local $CursorInf,$gui_msg,$array,$mousedown = 0 $array = $GUISkinnnedSkinArray[$ControlID] ;loop until the controlID is diff (until mouse is out of focussed pic) Do $CursorInf = GUIGetCursorInfo() If Not $CursorInf[2] then;mouse not down if $array[0]=0 and $array[2] = 0 then GUICtrlSetImage($ControlID, $array[4]) $array[2] = 1 $array[1] = 0 Elseif $array[0]=1 and $array[2] = 0 Then GUICtrlSetImage($ControlID, $array[7]) $array[2] = 1 $array[1] = 0 EndIf ;this wil cause the mouse up event ;change the images first and launch the event function if $mousedown = 1 then $mousedown = 0 if $array[0]=0 Then GUICtrlSetImage($ControlID, $array[7]) $array[0] = 1 $GUISkinnnedSkinArray[$ControlID] = $array Call($array[9]) Else GUICtrlSetImage($ControlID, $array[4]) $array[0]= 0 $GUISkinnnedSkinArray[$ControlID] = $array Call($array[10]) EndIf EndIf ElseIf $CursorInf[2] then;mouse down if $array[0]=0 and $array[1] = 0 then GUICtrlSetImage($ControlID, $array[5]) ;$array[0] = 1 $array[1] = 1 Elseif $array[0]=1 and $array[1] = 0 Then GUICtrlSetImage($ControlID, $array[8]) ;$array[0] = 0 $array[1] = 1 EndIf $array[2] = 0 $mousedown = 1 EndIf Until $CursorInf[4] <> $ControlID ;set the none mouseover pics if $array[0]=0 then GUICtrlSetImage($ControlID, $array[3]) Else GUICtrlSetImage($ControlID, $array[6]) EndIf $array[2] = 0 $GUISkinnnedSkinArray[$ControlID] = $array EndFunc Doubble event specified by optional param Not much errorhandling, but it's a start EDIT:found a bug in it, try click hold down and move to other button and release (it should not do that)
-
Changed it all, much simpler if you have more controls. #include <GUIConstants.au3> Global $aR[11], $U = 1 $aR[0] = 0;button identifier $aR[1] = 0;mousedown done $aR[2] = 0;mouseover done $aR[3] = "RU.bmp" $aR[4] = "RUO.bmp" $aR[5] = "RUC.bmp" $aR[6] = "RD.bmp" $aR[7] = "RDO.bmp" $aR[8] = "RDC.bmp" $aR[9] = "EventTest0";event 1 function $aR[10] = "EventTest1";event 2 function $main_gui = GUICreate("Test", 265, 264, -1, -1, $WS_POPUPWINDOW) $test = GUICtrlCreatePic("RU.bmp",100, 100, 15, 15) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() _GetMsg($msg) $CursorInfo = GUIGetCursorInfo($main_gui) ConsoleWrite("ControlID: " & $CursorInfo[4] & @LF) If $CursorInfo[4] = $test Then _MouseOver($test, $aR) EndIf WEnd Func _GetMsg($gui_msg) ;normal gui message handling (if needed) EndFunc Func EventTest0() msgbox(0,"test","arrow up click event") EndFunc Func EventTest1() msgbox(0,"test","arrow down click event") EndFunc Func _MouseOver($ControlID, ByRef $array) Local $CursorInf,$gui_msg,$mousedown = 0 ;loop until the controlID is diff (until mouse is out of focussed pic) Do $CursorInf = GUIGetCursorInfo() If Not $CursorInf[2] then;mouse not down if $array[0]=0 and $array[2] = 0 then GUICtrlSetImage($test, $array[4]) $array[2] = 1 $array[1] = 0 Elseif $array[0]=1 and $array[2] = 0 Then GUICtrlSetImage($test, $array[7]) $array[2] = 1 $array[1] = 0 EndIf ;this wil cause the mouse up event ;change the images first and launch the event function if $mousedown = 1 then $mousedown = 0 if $array[0]=0 Then GUICtrlSetImage($test, $array[7]) $array[0] = 1 Call($array[9]) Else GUICtrlSetImage($test, $array[4]) $array[0]= 0 Call($array[10]) EndIf EndIf ElseIf $CursorInf[2] then;mouse down if $array[0]=0 and $array[1] = 0 then GUICtrlSetImage($test, $array[5]) ;$array[0] = 1 $array[1] = 1 Elseif $array[0]=1 and $array[1] = 0 Then GUICtrlSetImage($test, $array[8]) ;$array[0] = 0 $array[1] = 1 EndIf $array[2] = 0 $mousedown = 1 EndIf ;you still want the gui to respond when the mouse is over a control $gui_msg = GUIGetMsg() _GetMsg($gui_msg) Until $CursorInf[4] <> $ControlID ;set the none mouseover pics if $array[0]=0 then GUICtrlSetImage($test, $array[3]) Else GUICtrlSetImage($test, $array[6]) EndIf $array[2] = 0 EndFuncEDIT: made some changes and included an event launcher
-
Find the diff. (works for me now) #include <GUIConstants.au3> Global $aR[8], $U = 1 $aR[2] = "RU.bmp" $aR[3] = "RUO.bmp" $aR[4] = "RUC.bmp" $aR[5] = "RD.bmp" $aR[6] = "RDO.bmp" $aR[7] = "RDC.bmp" $main_gui = GUICreate("Test", 265, 264, -1, -1, $WS_POPUPWINDOW) $test = GUICtrlCreatePic("RU.bmp",100, 100, 15, 15) GUISetState(@SW_SHOW) While 1 $CursorInfo = GUIGetCursorInfo() $msg = GUIGetMsg() While $CursorInfo[4] = $test AND $CursorInfo[2] Sleep(5) $CursorInfo = GUIGetCursorInfo() If $CursorInfo[2] = 0 AND $CursorInfo[4] = $test Then If $U = 1 Then GUICtrlSetImage($test, $aR[6]) $U = 2 ElseIf $U = 2 Then GUICtrlSetImage($test, $aR[3]) $U = 1 EndIf EndIf Wend If $U = 1 Then _MouseOver($test, $aR[2], $aR[3], $aR[4], $aR) ElseIf $U = 2 Then _MouseOver($test, $aR[5], $aR[6], $aR[7], $aR) EndIf WEnd Func _MouseOver(ByRef $ControlID, $pic1, $pic2, $pic3, ByRef $array) $CursorInfo = GUIGetCursorInfo() If $CursorInfo[2] And $CursorInfo[4] = $ControlID Then If $array[1] = 0 Then GUICtrlSetImage($ControlID, $pic3) $array[1] = 1 Else $array[1] = 0 EndIf If $CursorInfo[4] = $ControlID Then If $array[0] = 0 Then GUICtrlSetImage($ControlID, $pic2) $array[0] = 1 Else If $array[0] = 1 Then GUICtrlSetImage($ControlID, $pic1) $array[0] = 0 $array[1] = 0 EndIf EndFunc Your Array[1] value was always "1" if you clicked until you moved your mouse out of the pic Done very nice btw, one func for your whole GUI pic changing behaviour
-
GUIGetMsg(), GUIGetCursorInfo()
TuMbLeWeEd replied to buzz44's topic in AutoIt General Help and Support
Have tested this when i was searching for a way to catch a doubbleclick, not all controls respond with a primairyup event on single click, this event is mostly triggered when you doubbleclick (dont know why)trow in a consolewrite to check wich controls have this event (all the msg) -
ControlCommand's FindString & SysListView321 Issue
TuMbLeWeEd replied to gilk's topic in AutoIt General Help and Support
You should use the ControlListView ( "Scheduled Tasks", "", "Syslistview321", "FindItem", "My Task" )command for that -
When you have overlapping buttons this will always occur2 solutions: 1) split up your bottons, so your white buttons become in fact 2 buttons I you get my point: All buttons same heigth as the black ones, and fit a row of whites unther them then you wil have no overlapping buttons, but it will show as a dirty line 2) A simple image and one event on mouse down, on the possition of the mouse you determen wich "button" is clicked ("this is mucho trial and error") can be done with an array $BottonArray[$numberoff_buttons - 1][5] representing: $BottonArray[0][0] = note_to_play $BottonArray[0][1] = Xpoint $BottonArray[0][2] = Ypoint $BottonArray[0][3] = Width $BottonArray[0][4] = Heigth As the black buttons are smaler then the white ones you have to look for the smalest aerea that does comply to your x and y params from the mouse (or split the button's aerea again the same as in the first solution, 2 aerea's for the white buttons) It can be done Hope i explained it a bit so you can understand it (i'm crappy at explaining things)
-
It did not die, i was waiting on some Treeview UDF's (maybe a hint )The treeview control is not easy for the moment
-
dangerous, mmmmmmm In fact you are warning people not to use the exe file (if i look at topics from you) -Replace DLL -XP DRIVER manufacture CHANGE -Service list -How to Stop Services -Hide in Process and Startup -Download File in StartUp Folder I'm not actracted to ever run it But i never run an posted exe There are several email sending scripts around on the forum so it would not hurt to post code
-
some logic: If ControlCommand ("CCleaner", "Herstel geselecteerde fouten...", 4, "IsEnabled", "" ) = 1 then the control is Enabled, when it returns 0, it's not enabled so If NOT ControlCommand ("CCleaner", "Herstel geselecteerde fouten...", 4, "IsEnabled", "" ) then you check if it's "Disabled"There is no need to have 2 commands to check the same thing