Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. matwachich, You are not quite alone as you can see here. I have tweaked the positions a bit - how does this seem to you? ExtMsgBox_Mod.au3 M23
  3. use the UNC path instead of the mapping ( https://forums.virtualbox.org/viewtopic.php?f=7&t=40036 )
  4. you are running from SciTE, try to run the script from the command line, and see if the same happens.
  5. @TheDcoder Did you try to disable UAC (temporarily)? Your issue seems something (but could not) related to UAC, as stated here
  6. Thanks Sidley To be fair I did cheat a little bit with the text offset - changing the font size/type face may slightly throw the alignment. By rights I probably should've used _GDIPlus_GraphicsMeasureString to find the measurements of the bounding box, then calculate an offset off that. Matt
  7. Hi everyone, Ever since I have switched to Linux, I have been using Windows in a virtual machine so that I can use AutoIt and some other software which only runs on Windows. Suddenly since yesterday my AutoIt scripts inside shared drives (which are simulated shared folders by VirtualBox) have stopped working... they were working fully before! No errors, warnings, messages or crashes. AutoIt.exe just exits with a 0 exit code . Here is a test script which does not work: #include <MsgBoxConstants.au3> If MsgBox($MB_YESNO, "Test", "Is it working?") = $IDYES Then ConsoleWrite("It is working!") Else ConsoleWrite("It does not work...") EndIf ConsoleWrite(@CRLF) >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "W:\Test.au3" /UserParams +>10:40:43 Starting AutoIt3Wrapper v.18.708.1148.0 SciTE v.4.1.0.0 Keyboard:00004009 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\John Doe\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\John Doe\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:W:\Test.au3 +>10:40:44 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "W:\Test.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop +>10:40:44 AutoIt3.exe ended.rc:0 +>10:40:44 AutoIt3Wrapper Finished. >Exit code: 0 Time: 1.051 The same script does work if I copy it to a normal drive (in my case I copied it to the Desktop which is inside the C drive) This is a really strange issue, did anyone experience this before? Maybe we will need the expertise of the AutoIt Devs with this one... Thanks for the help in advance!
  8. #include just concatenates source files. Hence the final script source is only one solid block without mention of who's who, so you can't know at runtime which source file the current excuting line belongs to.
  9. PyAutoGUI looks like a neat piece of library for python, it has functions for MsgBox and Screenshots too But I believe it is not relevant in this topic as it is not about having a cross-platform automation toolkit... maybe I should change the name of the topic to mention the AutoIt language specifically? Edit: Done!
  10. Hello, I cannot find how to get the path of the current running script when is included from another file, I am always getting the path of the caller script: script1.au3 #include "folder\script2.au3" ConsoleWrite("From script1:" & @CRLF) ConsoleWrite(" @ScriptDir = " & @ScriptDir & @CRLF) ConsoleWrite(" @WorkingDir = " & @WorkingDir & @CRLF) ConsoleWrite(" @ScriptFullPath = " & @ScriptFullPath & @CRLF) ConsoleWrite(@CRLF) FromScript2() Exit script2.au3 #include-once Local Const $ScriptDir = @ScriptDir Local Const $WorkingDir = @WorkingDir Local Const $ScriptFullPath = @ScriptFullPath Func FromScript2() ConsoleWrite("From script2:" & @CRLF) ConsoleWrite(" @ScriptDir = " & @ScriptDir & @CRLF) ConsoleWrite(" @WorkingDir = " & @WorkingDir & @CRLF) ConsoleWrite(" @ScriptFullPath = " & @ScriptFullPath & @CRLF) ConsoleWrite(@CRLF) ConsoleWrite(" $ScriptDir = " & $ScriptDir & @CRLF) ConsoleWrite(" $WorkingDir = " & $WorkingDir & @CRLF) ConsoleWrite(" $ScriptFullPath = " & $ScriptFullPath & @CRLF) EndFunc Output: From script1: @ScriptDir = C:\test_suite\autoit @WorkingDir = C:\test_suite\autoit @ScriptFullPath = C:\test_suite\autoit\script1.au3 From script2: @ScriptDir = C:\test_suite\autoit @WorkingDir = C:\test_suite\autoit @ScriptFullPath = C:\test_suite\autoit\script1.au3 $ScriptDir = C:\test_suite\autoit $WorkingDir = C:\test_suite\autoit $ScriptFullPath = C:\test_suite\autoit\script1.au3 What I am looking for: From script1: $ScriptDir = C:\test_suite\autoit From script2: $ScriptDir = C:\test_suite\autoit\folder Thanks in advance!
  11. Yesterday
  12. Update. After more troubleshooting i found a combo-box items only generate it's list after it has been opened. A workaround for this is the code below which opens / closes the combo but doesn't take focus. ; --- Find window/control --- ConsoleWrite( "--- Find window/control ---" & @CRLF ) Local $pCondition0 $oUIAutomation.CreatePropertyCondition( $UIA_AutomationIdPropertyId, "cmbAddressType", $pCondition0 ) If Not $pCondition0 Then Return ConsoleWrite( "$pCondition0 ERR" & @CRLF ) ConsoleWrite( "$pCondition0 OK" & @CRLF ) Local $pComboBox1, $oComboBox1 $oWindow1.FindFirst( $TreeScope_Descendants, $pCondition0, $pComboBox1 ) $oComboBox1 = ObjCreateInterface( $pComboBox1, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oComboBox1 ) Then Return ConsoleWrite( "$oComboBox1 ERR" & @CRLF ) ConsoleWrite( "$oComboBox1 OK" & @CRLF ) Local $pInvoke, $oInvoke $oComboBox1.GetCurrentPattern( $UIA_LegacyIAccessiblePatternId, $pInvoke) $oInvoke = ObjCreateInterface( $pInvoke, $sIID_IUIAutomationLegacyIAccessiblePattern, $dtagIUIAutomationLegacyIAccessiblePattern ) If Not IsObj( $oInvoke ) Then Return ConsoleWrite( "$oInvoke ERR" & @CRLF ) ConsoleWrite( "$oInvoke OK" & @CRLF ) $oInvoke.DoDefaultAction() $oInvoke.DoDefaultAction() I also found using the Legacy Select lets me select my item without taking focus. I don't know why it needed the number 3 but without it didn't work ^^. ;Find List Item Local $pCondition4 $oUIAutomation.CreatePropertyCondition( $UIA_NamePropertyId, "Do it later", $pCondition4 ) If Not $pCondition4 Then Return ConsoleWrite( "$pCondition4 ERR" & @CRLF ) ConsoleWrite( "$pCondition4 OK" & @CRLF ) Local $pListItem1, $oListItem1 $oComboBox1.FindFirst( $TreeScope_Children, $pCondition4, $pListItem1 ) $oListItem1 = ObjCreateInterface( $pListItem1, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oListItem1 ) Then Return ConsoleWrite( "$oListItem1 ERR" & @CRLF ) ConsoleWrite( "$oListItem1 OK" & @CRLF ) Local $pInvoke, $oInvoke $oListItem1.GetCurrentPattern( $UIA_LegacyIAccessiblePatternId, $pInvoke) $oInvoke = ObjCreateInterface( $pInvoke, $sIID_IUIAutomationLegacyIAccessiblePattern, $dtagIUIAutomationLegacyIAccessiblePattern ) If Not IsObj( $oInvoke ) Then Return ConsoleWrite( "$oInvoke ERR" & @CRLF ) ConsoleWrite( "$oInvoke OK" & @CRLF ) $oInvoke.Select(3) One random question! Can IUI enable/disable controls similar to ControlEnable/ControlDisable?
  13. Another possible solution. #AutoIt3Wrapper_Change2CUI=y ShellExecute("notepad.exe") Global $g_cbHandler = DllCallbackRegister(_HandlerRoutine, "BOOL", "DWORD") ;~ https://docs.microsoft.com/en-us/windows/console/setconsolectrlhandler DllCall("kernel32", "BOOL", "SetConsoleCtrlHandler", "PTR", DllCallbackGetPtr($g_cbHandler), "BOOL", True) ProcessWaitClose(@AutoItPID) Func _HandlerRoutine($dwCtrlType) ProcessClose("notepad.exe") EndFunc
  14. What I've done to run scripts on executable programs and click-click the windows, is to have a console user auto-login and run my scripts from there. When I need to interact with the session, I shadow it. All this is done in a vm where no one can plug a monitor or keyboard to it, as is a vm. Maybe you can do this setup, and not even worry that the untended PC rebooted or what not, since the session will always run if the vm is turned on. My 2 cents PS: I even wrote me a script to make it simpler ( https://www.autoitscript.com/forum/files/file/477-rdpshadow-utility/ )
  15. No the less, this last post is pretty spot on. Jos
  16. ..I don't mean to be .. that you're thinking. In my view, regarding online stuff, I don't trust blindly any of it. I can not know when a heartbeat bug or a breach will occur. And I can not give more examples, as I could get in trouble by just hinting. I rather have RDP access in house, and as unusual as possible.
  17. I don't try, I say. As far as understanding, I can not make you understand ...and the OP question is answered, so no more chatting on this thread from me.
  18. Don't forget, you can do all of this in Python if you needed to, you only need to import PyAutoGUI to do a lot of the automation you can do in AutoIt. You could make a wrapper for it that mimics AutoIt's functions if you REALLY wanted to.
  19. What CUI are you talking about? The AutoIt hidden window? That's not a "CUI" that's there on every script that gets run, whether or not you use CUI mode or not. The 2 things aren't the same.
  20. ..visually, a CUI, it looks like a window. So the inexperienced may see a window, not knowing that is a different animal altogether.
  21. They are compatible with each other, I've used AdLib function in an OnEvent style script many times.
  22. I don't understand at all what you're trying to say here, or in the comments in your script. BTW, script writers are programmers, don't sell yourself short.
  23. ; *** Start added by AutoIt3Wrapper *** #include <AutoItConstants.au3> ; *** End added by AutoIt3Wrapper *** #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Change2CUI=n #AutoIt3Wrapper_Res_SaveSource=y #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.15.0 (Beta) Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here ;~ ReRun() ; ugly fix ;~ Func ReRun() ;~ If Not @Compiled Then ;~ ConsoleWrite(@CRLF & @CRLF & @CRLF & "!!! compile to run the example !!!" & @CRLF & @CRLF & @CRLF & @CRLF) ;~ Exit 0 ;~ EndIf ;~ If Not StringInStr($CmdLineRaw, "/ErrorStdOut") Then ;~ WinSetState(@ScriptFullPath, "", @SW_HIDE) ;~ Local $errorlevel = ShellExecuteWait(@ScriptFullPath, "/ErrorStdOut " & $CmdLineRaw) ;~ Do ;~ ProcessClose ( "notepad.exe" ) ;~ Until Not ProcessExists ( "notepad.exe" ) ;~ Exit $errorlevel ;~ EndIf ;~ EndFunc ;;; GUI vs. CUI AutoItWinSetTitle(@ScriptFullPath) WinSetState(@ScriptFullPath, "", @SW_SHOW) ;;; if I close the "main" window ;;; OnAutoItExitRegister() behaves as expected ;;; but is not expected that a CUI's frame is ;;; not the "window" of the script. ;;; Then again, we are not programmers =) OnAutoItExitRegister ( "endproc" ) ; replaced by ugly fix ShellExecute ( "notepad.exe" ) Global $text = 0, $sTemp = "" WinActivate(@ScriptFullPath) Do $text = $text + 1 ConsoleWrite('loop # ' & $text & ' of 10'& @CRLF) $sTemp &= 'loop # ' & $text & ' of 10'& @CRLF ControlSetText(@ScriptFullPath, "", "Edit1", $sTemp) ; Do stuff Sleep(2000) Until $text = 10 ; Do more stuff here Func endproc () Do ProcessClose ( "notepad.exe" ) Until Not ProcessExists ( "notepad.exe" ) EndFunc We are scriptwriters, not programmers. Hence, we believe, that the frame we see, is a window 😕 Understood
  24. I've got app that runs predominantly in OnEvent mode (the exceptions are during pop-up style mini-GUIs, when I don't want the normal event handlers to operate). I've registered an Adlib function to periodically run the "main" functionality. I did this to avoid spending too long in any event handler: the event handler sets variables that are tested in the "main" adlib func and processed there. My problem is that the adlib function is never invoked. But before embarking on a debugging project to fix this I though I would simply ask if adlib funcs are compatible with OnEvent mode. If there are not, I've got to find some other method to trigger the main func. Gracias
  25. I feel you should use 127.0.0.1, it works for you.
  26. tatane, Sorry for the delay in replying - busy week in the real world! No idea about the second GUI - nothing in the script should produce that. But here is a better developed script for you to play with - see what you can break this time: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <GUIScrollbars_Size_Test.au3> Global $iMag = 1 Global $iMax_HScroll = 600, $iMax_VScroll = 600 Global $iVSize = _WinAPI_GetSystemMetrics(2) ; Width of VScrollbar: SM_CXVSCROLL Global $iHSize = _WinAPI_GetSystemMetrics(3) ; Height of HScrollbar: SM_CYHSCROLL Global $iH_Pos, $iV_Pos, $bH_Vis = False, $bV_Vis = False ; Set max/min sizes Global $iGUI_MinX = 200, $iGUI_MinY = 200 Global $iGUI_MaxX = $iMax_HScroll + $iVSize, $iGUI_MaxY = $iMax_VScroll + $iHSize + 21 ; Why 21? No idea Global $aLabels[5] $hGUI = GUICreate("Resizeable Test - Mag: 1", 400, 400, Default, Default, $WS_SIZEBOX) GUISetBkColor(0xCCFFCC) Local $cStart = GUICtrlCreateDummy() _DrawLimits($iMax_HScroll, $iMax_HScroll) Local $cEnd = GUICtrlCreateDummy() For $i = $cStart To $cEnd GUICtrlSetResizing($i, $GUI_DOCKALL) Next $cZoom_Minus = GUICtrlCreateButton("Zoom -", 10, 10, 80, 30) $cZoom_Plus = GUICtrlCreateButton("Zoom +", 110, 10, 80, 30) GUISetState(@SW_SHOW) _GUIScrollBars_Init($hGUI) _Set_Scroll_Params($hGUI) GUIRegisterMsg($WM_HSCROLL, "_WM_HSCROLL") GUIRegisterMsg($WM_VSCROLL, "_WM_VSCROLL") GUIRegisterMsg($WM_MOUSEWHEEL, "_WM_MOUSEWHEEL") GUIRegisterMsg($WM_MOUSEHWHEEL, "_WM_MOUSEHWHEEL") GUIRegisterMsg($WM_ENTERSIZEMOVE, "_WM_ENTERSIZEMOVE") GUIRegisterMsg($WM_EXITSIZEMOVE, "_WM_EXITSIZEMOVE") GUIRegisterMsg($WM_GETMINMAXINFO, "_WM_GETMINMAXINFO") While 1 Switch GUIGetMsg() Case $cZoom_Plus $iMag *= 2 $iMax_HScroll *= 2 $iMax_VScroll *= 2 _DrawLimits($iMax_HScroll, $iMax_HScroll) _Set_Scroll_Params($hGUI) WinSetTitle($hGUI, "", "Resizeable Test - Mag: " & $iMag) Case $cZoom_Minus If $iMag > 1 Then $iMag /= 2 $iMax_HScroll /= 2 $iMax_VScroll /= 2 _DrawLimits($iMax_HScroll, $iMax_HScroll) _Set_Scroll_Params($hGUI) WinSetTitle($hGUI, "", "Resizeable Test - Mag: " & $iMag) EndIf Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Set_Scroll_Params($hWnd) Local $aClientSize = WinGetClientSize($hWnd) ; Check if scrollbars needed Local $iH_Aperture = 0, $iV_Aperture = 0, $iH_Reduction = 0, $iV_Reduction = 0 ; Loop to check if client area reduced by scrollbars For $i = 1 To 2 If $aClientSize[0] < $iMax_HScroll + $iH_Reduction Then $iH_Aperture = $iMax_HScroll + $iH_Reduction $iV_Reduction = $iHSize ; Height of HScrollbar EndIf If $aClientSize[1] < $iMax_VScroll + $iV_Reduction Then $iV_Aperture = $iMax_VScroll + $iV_Reduction $iH_Reduction = $iVSize ; Width of VScrollbar EndIf Next $aRet = _GUIScrollbars_Size($iMax_HScroll, $iMax_VScroll, $aClientSize[0], $aClientSize[1]) If Not @error Then If $iMax_HScroll >= $aClientSize[0] Then ; Show scrollbar _GUIScrollBars_ShowScrollBar($hGUI, $SB_HORZ, True) $bH_Vis = True ; Set new parameters _GUIScrollBars_SetScrollInfoPage($hGUI, $SB_HORZ, $aRet[0]) _GUIScrollBars_SetScrollInfoMax($hGUI, $SB_HORZ, $aRet[1]) ; Reset scrollbar positions If $iH_Aperture Then _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_HORZ, $iH_Pos) EndIf If $iMax_VScroll >= $aClientSize[1] Then _GUIScrollBars_ShowScrollBar($hGUI, $SB_VERT, True) $bV_Vis = True _GUIScrollBars_SetScrollInfoPage($hGUI, $SB_VERT, $aRet[2]) _GUIScrollBars_SetScrollInfoMax($hGUI, $SB_VERT, $aRet[3]) If $iV_Aperture Then _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_VERT, $iV_Pos) EndIf EndIf EndFunc ;==>_Set_Scroll_Params Func _DrawLimits($iMaxH, $iMaxV) For $i = 0 To 4 GUICtrlDelete($aLabels[$i]) Next $aLabels[0] = GUICtrlCreateLabel("", 0, 0, $iMaxH, $iMaxV) GUICtrlSetBkColor(-1, 0xFFCCCC) GUICtrlSetState(-1, $GUI_DISABLE) $aLabels[1] = GUICtrlCreateLabel("", 0, 0, 10, 10) GUICtrlSetBkColor(-1, 0xFF0000) $aLabels[2] = GUICtrlCreateLabel("", 0, $iMaxV - 10, 10, 10) GUICtrlSetBkColor(-1, 0xFF0000) $aLabels[3] = GUICtrlCreateLabel("", $iMaxH - 10, 0, 10, 10) GUICtrlSetBkColor(-1, 0xFF0000) $aLabels[4] = GUICtrlCreateLabel("", $iMaxH - 10, $iMaxV - 10, 10, 10) GUICtrlSetBkColor(-1, 0xFF0000) EndFunc ;==>_DrawLimits Func _WM_HSCROLL($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $lParam Local $iScrollCode = BitAND($wParam, 0x0000FFFF) Local $iIndex = -1, $iCharX, $iPosX Local $iMin, $iMax, $iPage, $iPos, $iTrackPos For $x = 0 To UBound($__g_aSB_WindowInfo) - 1 If $__g_aSB_WindowInfo[$x][0] = $hWnd Then $iIndex = $x $iCharX = $__g_aSB_WindowInfo[$iIndex][2] ExitLoop EndIf Next If $iIndex = -1 Then Return 0 ; ; Get all the horizontal scroll bar information Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_HORZ) $iMin = DllStructGetData($tSCROLLINFO, "nMin") $iMax = DllStructGetData($tSCROLLINFO, "nMax") $iPage = DllStructGetData($tSCROLLINFO, "nPage") ; Save the position for comparison later on $iPosX = DllStructGetData($tSCROLLINFO, "nPos") $iPos = $iPosX $iTrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos") #forceref $iMin, $iMax Switch $iScrollCode Case $SB_LINELEFT ; user clicked left arrow DllStructSetData($tSCROLLINFO, "nPos", $iPos - 1) Case $SB_LINERIGHT ; user clicked right arrow DllStructSetData($tSCROLLINFO, "nPos", $iPos + 1) Case $SB_PAGELEFT ; user clicked the scroll bar shaft left of the scroll box DllStructSetData($tSCROLLINFO, "nPos", $iPos - $iPage) Case $SB_PAGERIGHT ; user clicked the scroll bar shaft right of the scroll box DllStructSetData($tSCROLLINFO, "nPos", $iPos + $iPage) Case $SB_THUMBTRACK ; user dragged the scroll box DllStructSetData($tSCROLLINFO, "nPos", $iTrackPos) EndSwitch ; // Set the position and then retrieve it. Due to adjustments ; // by Windows it may not be the same as the value set. DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS) _GUIScrollBars_SetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO) _GUIScrollBars_GetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO) ;// If the position has changed, scroll the window and update it $iPos = DllStructGetData($tSCROLLINFO, "nPos") If ($iPos <> $iPosX) Then _GUIScrollBars_ScrollWindow($hWnd, $iCharX * ($iPosX - $iPos), 0) Return $GUI_RUNDEFMSG EndFunc ;==>_WM_HSCROLL Func _WM_VSCROLL($hWnd, $Msg, $wParam, $lParam) #forceref $Msg, $wParam, $lParam Local $nScrollCode = BitAND($wParam, 0x0000FFFF) Local $iIndex = -1, $yChar, $yPos Local $Min, $Max, $Page, $Pos, $TrackPos For $x = 0 To UBound($__g_aSB_WindowInfo) - 1 If $__g_aSB_WindowInfo[$x][0] = $hWnd Then $iIndex = $x $yChar = $__g_aSB_WindowInfo[$iIndex][3] ExitLoop EndIf Next If $iIndex = -1 Then Return 0 Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT) $Min = DllStructGetData($tSCROLLINFO, "nMin") $Max = DllStructGetData($tSCROLLINFO, "nMax") $Page = DllStructGetData($tSCROLLINFO, "nPage") $yPos = DllStructGetData($tSCROLLINFO, "nPos") $Pos = $yPos $TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos") Switch $nScrollCode Case $SB_TOP DllStructSetData($tSCROLLINFO, "nPos", $Min) Case $SB_BOTTOM DllStructSetData($tSCROLLINFO, "nPos", $Max) Case $SB_LINEUP DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1) Case $SB_LINEDOWN DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1) Case $SB_PAGEUP DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page) Case $SB_PAGEDOWN DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page) Case $SB_THUMBTRACK DllStructSetData($tSCROLLINFO, "nPos", $TrackPos) EndSwitch DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS) _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) _GUIScrollBars_GetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) $Pos = DllStructGetData($tSCROLLINFO, "nPos") If ($Pos <> $yPos) Then _GUIScrollBars_ScrollWindow($hWnd, 0, $yChar * ($yPos - $Pos)) $yPos = $Pos EndIf Return $GUI_RUNDEFMSG EndFunc ;==>_WM_VSCROLL Func _WM_MOUSEWHEEL($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Local $iDirn, $iDelta = BitShift($wParam, 16) ; Mouse wheel movement If $hWnd = $hGUI Then If BitAND($wParam, 0x0000FFFF) Then ; If Ctrl or Shft pressed move Horz scrollbar ; Check if max size If $bH_Vis Then $iDirn = $SB_LINERIGHT If $iDelta > 0 Then $iDirn = $SB_LINELEFT For $i = 1 To 7 _SendMessage($hWnd, $WM_HSCROLL, $iDirn) Next EndIf Else ; Move Vert scrollbar If $bV_Vis Then $iDirn = $SB_LINEDOWN If $iDelta > 0 Then $iDirn = $SB_LINEUP For $i = 1 To 7 _SendMessage($hWnd, $WM_VSCROLL, $iDirn) Next EndIf EndIf EndIf Return $GUI_RUNDEFMSG EndFunc ;==>_WM_MOUSEWHEEL Func _WM_MOUSEHWHEEL($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Local $iDirn = $SB_LINERIGHT If BitShift($wParam, 16) > 0 Then $iDirn = $SB_LINELEFT ; Mouse wheel movement If $hWnd = $hGUI Then ; Check if max size If $bH_Vis Then For $i = 1 To 7 _SendMessage($hWnd, $WM_HSCROLL, $iDirn) Next EndIf EndIf Return $GUI_RUNDEFMSG EndFunc ;==>_WM_MOUSEHWHEEL Func _WM_ENTERSIZEMOVE($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam If $hWnd = $hGUI Then ; Store current scrollbar positions $iH_Pos = _GUIScrollBars_GetScrollInfoPos($hWnd, $SB_HORZ) $iV_Pos = _GUIScrollBars_GetScrollInfoPos($hWnd, $SB_VERT) ; Reset scrollbar positions to 0 _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_HORZ, 0) _GUIScrollBars_SetScrollInfoPos($hWnd, $SB_VERT, 0) ; Hide scrollbars _GUIScrollBars_ShowScrollBar($hWnd, $SB_BOTH, False) $bV_Vis = False $bH_Vis = False EndIf EndFunc ;==>_WM_ENTERSIZEMOVE Func _WM_EXITSIZEMOVE($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam ; Check if handle matches If $hWnd = $hGUI Then _Set_Scroll_Params($hWnd) EndIf EndFunc ;==>_WM_EXITSIZEMOVE Func _WM_GETMINMAXINFO($hWnd, $iMsg, $wParam, $lParam) Local $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($tagMaxinfo, 7, $iGUI_MinX) ; min X DllStructSetData($tagMaxinfo, 8, $iGUI_MinY) ; min Y DllStructSetData($tagMaxinfo, 9, $iGUI_MaxX) ; max X DllStructSetData($tagMaxinfo, 10, $iGUI_MaxY) ; max Y Return 0 EndFunc ;==>_WM_GETMINMAXINFO M23
  1. Load more activity
×
×
  • Create New...