Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/12/2024 in all areas

  1. #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) GUICreate("Mouse Click Detection", 300, 200) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUICtrlCreateLabel('ITEM 01',Default,Default,Default,Default) GUICtrlSetOnEvent(-1, "_Clicked") GUICtrlCreateLabel('ITEM 02',Default,40,Default,Default) GUICtrlSetOnEvent(-1, "_Clicked") GUICtrlCreateLabel('ITEM 03',Default,80,Default,Default) GUICtrlSetOnEvent(-1, "_Clicked") GUISetState() While 1 Sleep(100) WEnd Func _Exit() Exit EndFunc Func _Clicked() Local $id = @GUI_CtrlId ConsoleWrite("Clicked at label id " & $id & " with text '"&GUICtrlRead($id)&"'" & @CRLF) EndFunc
    2 points
  2. No longer the case, as I couldn't resist completing the code today, and trying it out successfully with several game downloads. And after tweaking it a bit it works well. One of the files was a 9GB Linux version game file, which like the rest downloaded in a satisfying portion of time. So now my program offers 4 different methods to download your purchases from GOG. 1. The original single thread gogcli.exe. 2. Single thread curl.exe. 3. Multi-thread aria2.exe with curl.exe. 4. Multi-thread fdm.exe with curl.exe.
    1 point
  3. @ioa747 Sure, if he have a series of label created one after another then your code would fit nicely or this variation that would target specific controls created in series. #include <GUIConstantsEx.au3> Global $aLabel[3] Global $hGUI = GUICreate("Mouse Click Detection", 300, 200) $aLabel[0] = GUICtrlCreateLabel('ITEM 01',Default,Default,Default,Default) $aLabel[1] = GUICtrlCreateLabel('ITEM 02',Default,40,Default,Default) $aLabel[2] = GUICtrlCreateLabel('ITEM 03',Default,80,Default,Default) GUISetState() While True $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $aLabel[0] To $aLabel[UBound($aLabel) - 1] ConsoleWrite('Clicked $aLabel[' & $nMsg - $aLabel[0] & ']' & @CRLF) EndSwitch WEnd @SEKOMD now you have a lot of ways to solve your problem 😄
    1 point
  4. alternately #include <GUIConstantsEx.au3> Global $hGUI = GUICreate("Mouse Click Detection", 300, 200) $a = GUICtrlCreateLabel('ITEM 01', Default, Default, Default, Default) ConsoleWrite("$a=" & $a & @CRLF) $b = GUICtrlCreateLabel('ITEM 02', Default, 40, Default, Default) $c = GUICtrlCreateLabel('ITEM 03', Default, 80, Default, Default) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case Else If $msg > 0 Then ConsoleWrite("Clicked on Control: ITEM " & StringFormat("%02s", $msg - 2) & " with text:" & GUICtrlRead($msg) & @CRLF) EndIf EndSwitch WEnd
    1 point
  5. If you create the labels you can keep track of them, otherwise you can use GUIGetCursorInfo() as in @ioa747 's example above or something like this: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPIConv.au3> Global $hGUI = GUICreate("Mouse Click Detection", 300, 200) GUICtrlCreateLabel('ITEM 01',Default,Default,Default,Default) GUICtrlCreateLabel('ITEM 02',Default,40,Default,Default) GUICtrlCreateLabel('ITEM 03',Default,80,Default,Default) GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND') GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam If _WinAPI_HiWord($wParam) = 0 Then ; STN_CLICKED ConsoleWrite(GUICtrlRead(_WinAPI_LoWord($wParam)) & @CRLF) EndIf EndFunc
    1 point
×
×
  • Create New...