Jump to content

Leaderboard

Popular Content

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

  1. @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
  2. Well, I've not done that yet, due to wanting to import the code to my GOGcli GUI program, which I have now done and tweaked and tested a lot, and it works well. That is, the aria2 with curl portion of my code, and it took some tweaking to get it exactly how I wanted ... progress feedback and all. At this stage, I have only done the preliminary work for Free Download Manager support, so not available for use yet. In a way, I felt I no longer need it, so I just did some elements as a start in case it is ever needed. I no longer feel quite that way, as I have come across a limitation with aria2 ... the numbers of threads you can use with GOG, which appears to be a maximum of five. Five threads will give me somewhere around 5 Megabytes a second, but usually less on average ... some days and times are clearly better than others. On the other hand, I could get a fair bit more with Free Download Manager 5, which must be doing something tricky to get around that seeming 5 thread limitation. I know I can bump the threads in FDM5 up to about 11 and get close to 7 Megabytes a second at times. The aria2 program reports on how many threads is in use, and I have never seen it above 5, and the speed indicates that too. So it is very clear when using FDM5, that it can be faster. Here's the latest screenshot of the downloading window of my GOGcli GUI program, after I reworked it a bit to fit some new or changed elements in. I've grabbed over 74 game updates in the last few days, most of them either demos or prologues ... 118 GB worth. So finally I have made a start and dent on all the updates I need to get at GOG ... more than 100 still to go, of mostly full games ... so a lot of gigabytes. Anyway ... I will eventually get back to tidying up that code example and providing here.
    1 point
  3. Is there any particular reason why you use $GUI_EVENT_PRIMARYDOWN to check if a specific control was clicked? Why not simply this: #include <GUIConstantsEx.au3> Global $hGUI = GUICreate("Mouse Click Detection", 300, 200) $a = GUICtrlCreateLabel('ITEM 01',Default,Default,Default,Default) $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 $a MsgBox(0, '', 'Yayyy! You clicked ITEM 01') EndSwitch WEnd
    1 point
  4. #include <GUIConstantsEx.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) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_PRIMARYDOWN $aCtrl = GUIGetCursorInfo($hGUI) MsgBox(0, "Mouse Click Detected", "Clicked on Control: " & GUICtrlRead($aCtrl[4])) EndSwitch WEnd
    1 point
  5. Subz

    Excel - Freeze the top row

    Couple of ways: #include <Excel.au3> ;~ Example 1 Local $oExcel = _Excel_Open() $oExcel.ActiveWindow.FreezePanes = False Local $sWorkbook = @ScriptDir & "\FileName.xlsx" Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook) $oWorkbook.ActiveSheet.Range("B2").Select $oExcel.ActiveWindow.FreezePanes = True ;~ Example 2 Local $oExcel = _Excel_Open() $oExcel.ActiveWindow.FreezePanes = False Local $sWorkbook = @ScriptDir & "\FileName.xlsx" Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook) _Excel_FreezePanes($oExcel, 2, 2) Func _Excel_FreezePanes($oExcel, $iCol = 0, $iRow = 1) If Not IsObj($oExcel) Or ObjName($oExcel, 1) <> "_Application" Then Return $oExcel.ActiveWindow.SplitColumn = $iCol $oExcel.ActiveWindow.SplitRow = $iRow $oExcel.ActiveWindow.FreezePanes = True EndFunc
    1 point
×
×
  • Create New...