Jump to content

ScriptJunky

Members
  • Posts

    10
  • Joined

  • Last visited

ScriptJunky's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Here ya go! #include-once ; #INDEX# ======================================================================================================================= ; Title .........: WinAPI GetSystemMetrics Constants ; AutoIt Version : 3.3.14.5 ; Language ......: English ; Description ...: Constants for _WinAPI_GetSystemMetrics(). ; Author(s) .....: ScriptJunky ; =============================================================================================================================== ; #CONSTANTS# =================================================================================================================== ; _WinAPI_GetSystemMetrics() Global Const $SM_ARRANGE = 56 Global Const $SM_CLEANBOOT = 67 Global Const $SM_CMONITORS = 80 Global Const $SM_CMOUSEBUTTONS = 43 Global Const $SM_CONVERTIBLESLATEMODE = 0x2003 Global Const $SM_CXBORDER = 5 Global Const $SM_CXCURSOR = 13 Global Const $SM_CXDLGFRAME = 7 Global Const $SM_CXDOUBLECLK = 36 Global Const $SM_CXDRAG = 68 Global Const $SM_CXEDGE = 45 Global Const $SM_CXFIXEDFRAME = 7 Global Const $SM_CXFOCUSBORDER = 83 Global Const $SM_CXFRAME = 32 Global Const $SM_CXFULLSCREEN = 16 Global Const $SM_CXHSCROLL = 21 Global Const $SM_CXHTHUMB = 10 Global Const $SM_CXICON = 11 Global Const $SM_CXICONSPACING = 38 Global Const $SM_CXMAXIMIZED = 61 Global Const $SM_CXMAXTRACK = 59 Global Const $SM_CXMENUCHECK = 71 Global Const $SM_CXMENUSIZE = 54 Global Const $SM_CXMIN = 28 Global Const $SM_CXMINIMIZED = 57 Global Const $SM_CXMINSPACING = 47 Global Const $SM_CXMINTRACK = 34 Global Const $SM_CXPADDEDBORDER = 92 Global Const $SM_CXSCREEN = 0 Global Const $SM_CXSIZE = 30 Global Const $SM_CXSIZEFRAME = 32 Global Const $SM_CXSMICON = 49 Global Const $SM_CXSMSIZE = 52 Global Const $SM_CXVIRTUALSCREEN = 78 Global Const $SM_CXVSCROLL = 2 Global Const $SM_CYBORDER = 6 Global Const $SM_CYCAPTION = 4 Global Const $SM_CYCURSOR = 14 Global Const $SM_CYDLGFRAME = 8 Global Const $SM_CYDOUBLECLK = 37 Global Const $SM_CYDRAG = 69 Global Const $SM_CYEDGE = 46 Global Const $SM_CYFIXEDFRAME = 8 Global Const $SM_CYFOCUSBORDER = 84 Global Const $SM_CYFRAME = 33 Global Const $SM_CYFULLSCREEN = 17 Global Const $SM_CYHSCROLL = 3 Global Const $SM_CYICON = 12 Global Const $SM_CYICONSPACING = 39 Global Const $SM_CYKANJIWINDOW = 18 Global Const $SM_CYMAXIMIZED = 62 Global Const $SM_CYMAXTRACK = 60 Global Const $SM_CYMENU = 15 Global Const $SM_CYMENUCHECK = 72 Global Const $SM_CYMENUSIZE = 55 Global Const $SM_CYMIN = 29 Global Const $SM_CYMINIMIZED = 58 Global Const $SM_CYMINSPACING = 48 Global Const $SM_CYMINTRACK = 35 Global Const $SM_CYSCREEN = 1 Global Const $SM_CYSIZE = 31 Global Const $SM_CYSIZEFRAME = 33 Global Const $SM_CYSMCAPTION = 51 Global Const $SM_CYSMICON = 50 Global Const $SM_CYSMSIZE = 53 Global Const $SM_CYVIRTUALSCREEN = 79 Global Const $SM_CYVSCROLL = 20 Global Const $SM_CYVTHUMB = 9 Global Const $SM_DBCSENABLED = 42 Global Const $SM_DEBUG = 22 Global Const $SM_DIGITIZER = 94 Global Const $SM_IMMENABLED = 82 Global Const $SM_MAXIMUMTOUCHES = 95 Global Const $SM_MEDIACENTER = 87 Global Const $SM_MENUDROPALIGNMENT = 40 Global Const $SM_MIDEASTENABLED = 74 Global Const $SM_MOUSEPRESENT = 19 Global Const $SM_MOUSEHORIZONTALWHEELPRESENT = 91 Global Const $SM_MOUSEWHEELPRESENT = 75 Global Const $SM_NETWORK = 63 Global Const $SM_PENWINDOWS = 41 Global Const $SM_REMOTECONTROL = 0x2001 Global Const $SM_REMOTESESSION = 0x1000 Global Const $SM_SAMEDISPLAYFORMAT = 81 Global Const $SM_SECURE = 44 Global Const $SM_SERVERR = 289 Global Const $SM_SHOWSOUNDS = 70 Global Const $SM_SHUTTINGDOWN = 0x2000 Global Const $SM_SLOWMACHINE = 73 Global Const $SM_STARTER = 88 Global Const $SM_SWAPBUTTON = 23 Global Const $SM_TABLETPC = 86 Global Const $SM_XVIRTUALSCREEN = 76 Global Const $SM_YVIRTUALSCREEN = 77 WinAPISystemMetricsConstants.au3
  2. I noticed a lack of a constants file for _WinAPI_GetSystemMetrics() so I made this for anyone who wants to add it to their library. Enjoy! (file attached below) #include-once ; #INDEX# ======================================================================================================================= ; Title .........: WinAPI GetSystemMetrics Constants ; AutoIt Version : 3.3.14.5 ; Language ......: English ; Description ...: Constants for _WinAPI_GetSystemMetrics(). ; Author(s) .....: ScriptJunky ; =============================================================================================================================== ; #CONSTANTS# =================================================================================================================== ; _WinAPI_GetSystemMetrics() Global Const $ARRANGE = 56 Global Const $CLEANBOOT = 67 Global Const $CMONITORS = 80 Global Const $CMOUSEBUTTONS = 43 Global Const $CONVERTIBLESLATEMODE = 0x2003 Global Const $CXBORDER = 5 Global Const $CXCURSOR = 13 Global Const $CXDLGFRAME = 7 Global Const $CXDOUBLECLK = 36 Global Const $CXDRAG = 68 Global Const $CXEDGE = 45 Global Const $CXFIXEDFRAME = 7 Global Const $CXFOCUSBORDER = 83 Global Const $CXFRAME = 32 Global Const $CXFULLSCREEN = 16 Global Const $CXHSCROLL = 21 Global Const $CXHTHUMB = 10 Global Const $CXICON = 11 Global Const $CXICONSPACING = 38 Global Const $CXMAXIMIZED = 61 Global Const $CXMAXTRACK = 59 Global Const $CXMENUCHECK = 71 Global Const $CXMENUSIZE = 54 Global Const $CXMIN = 28 Global Const $CXMINIMIZED = 57 Global Const $CXMINSPACING = 47 Global Const $CXMINTRACK = 34 Global Const $CXPADDEDBORDER = 92 Global Const $CXSCREEN = 0 Global Const $CXSIZE = 30 Global Const $CXSIZEFRAME = 32 Global Const $CXSMICON = 49 Global Const $CXSMSIZE = 52 Global Const $CXVIRTUALSCREEN = 78 Global Const $CXVSCROLL = 2 Global Const $CYBORDER = 6 Global Const $CYCAPTION = 4 Global Const $CYCURSOR = 14 Global Const $CYDLGFRAME = 8 Global Const $CYDOUBLECLK = 37 Global Const $CYDRAG = 69 Global Const $CYEDGE = 46 Global Const $CYFIXEDFRAME = 8 Global Const $CYFOCUSBORDER = 84 Global Const $CYFRAME = 33 Global Const $CYFULLSCREEN = 17 Global Const $CYHSCROLL = 3 Global Const $CYICON = 12 Global Const $CYICONSPACING = 39 Global Const $CYKANJIWINDOW = 18 Global Const $CYMAXIMIZED = 62 Global Const $CYMAXTRACK = 60 Global Const $CYMENU = 15 Global Const $CYMENUCHECK = 72 Global Const $CYMENUSIZE = 55 Global Const $CYMIN = 29 Global Const $CYMINIMIZED = 58 Global Const $CYMINSPACING = 48 Global Const $CYMINTRACK = 35 Global Const $CYSCREEN = 1 Global Const $CYSIZE = 31 Global Const $CYSIZEFRAME = 33 Global Const $CYSMCAPTION = 51 Global Const $CYSMICON = 50 Global Const $CYSMSIZE = 53 Global Const $CYVIRTUALSCREEN = 79 Global Const $CYVSCROLL = 20 Global Const $CYVTHUMB = 9 Global Const $DBCSENABLED = 42 Global Const $DEBUG = 22 Global Const $DIGITIZER = 94 Global Const $IMMENABLED = 82 Global Const $MAXIMUMTOUCHES = 95 Global Const $MEDIACENTER = 87 Global Const $MENUDROPALIGNMENT = 40 Global Const $MIDEASTENABLED = 74 Global Const $MOUSEPRESENT = 19 Global Const $MOUSEHORIZONTALWHEELPRESENT = 91 Global Const $MOUSEWHEELPRESENT = 75 Global Const $NETWORK = 63 Global Const $PENWINDOWS = 41 Global Const $REMOTECONTROL = 0x2001 Global Const $REMOTESESSION = 0x1000 Global Const $SAMEDISPLAYFORMAT = 81 Global Const $SECURE = 44 Global Const $SERVERR = 289 Global Const $SHOWSOUNDS = 70 Global Const $SHUTTINGDOWN = 0x2000 Global Const $SLOWMACHINE = 73 Global Const $STARTER = 88 Global Const $SWAPBUTTON = 23 Global Const $TABLETPC = 86 Global Const $XVIRTUALSCREEN = 76 Global Const $YVIRTUALSCREEN = 77 WinAPISystemMetricsConstants.au3
  3. I would like to suggest an addition to this UDF. I noticed an issue where if you specify there to not be any horizontal width to the aperture, or have a smaller width aperture than the gui, then when you create the scrollbars, it does not show a horizontal bar, but after minimizing using _GUIScrollbars_Minimize() and then restoring with _GUIScrollbars_Restore() it, by default, adds in the horizontal scrollbar (with no scroll range) unless you specify the third parameter of _GUIScrollbars_Restore() as False (and the same goes for vertical scrolling) but maybe perhaps adding in an internal check to see if there is a horizontal/vertical scroll to begin with, maybe something like this: Func _GUIScrollbars_Restore($hWnd, $fVert = True , $fHorz = True) ; Get client area dimensions $hWnd Local $a = DllStructCreate("struct;long;long;long;long;endstruct") Local $b=DllCall("user32.dll","bool","GetClientRect","hwnd",$hWnd,"struct*",$a) Local $c[2]=[DllStructGetData($b,3)-DllStructGetData($b,1),DllStructGetData($b,4)-DllStructGetData($b,2)] ; If the aperture dimensions are smaller than the client dimensions, disable the corresponding dimension's scrollbar Local $aAperture[2] = [$iH_Scroll, $iV_Scroll] ; replace this with values from _GUIScrollbars_Generate() or wherever they're stored If $aAperture[0] <= $c[0] then $fHorz = False ; possibly subtract the width of the vertical scroll bar using the value from GetSystemMetrics ?? If $aAperture[1] <= $c[1] then $fVert = False ; possibly subtract the height of the horizontal scroll bar using the value from GetSystemMetrics ?? As for now, without editing the UDF, I made a workaround for this issue: Local $aV=DllCall("user32.dll","bool","GetScrollRange","hwnd",$hwnd,"int",1,"int*",0,"int*",0),$v=1 Local $aH=DllCall("user32.dll","bool","GetScrollRange","hwnd",$hwnd,"int",0,"int*",0,"int*",0),$h=1 If $aV[4]=100 Then $v=0 If $aH[4]=100 Then $h=0 _GUIScrollbars_Restore($hwnd,$v,$h) Anyways, regarding the last 3 posts, I have decided just to remove the ability to maximize from my script until I can figure out whats going on
  4. Sorry I keep posting so much, but in addition to the last 2 post, I re-created the error, then un-maximized it after maximizing then the aperture increases in size like 3-fold. Hope that helps somehow in figuring out the problem
  5. Oh I forgot to mention, in this trial, after the maximizing part, I was only able to scroll to the 76th label, and there was a bunch of empty space above where the screenshot was taken.
  6. Mission Accomplished! I have succeeded in breaking it again. Ok so this time, in the screenshot, i added 99 labels, scrolled down to the bottom, maximized, and this was the result: (I would also like to note that, after it glitched like this, I minimized it then restored it back to its maximized state and it fixed itself. Furthermore I would like to note that I am a magnet for bugs )
  7. It will be my pleasure Ill give it a go and see if it works for me. Thank you so much for your assistance. Sadly, I have been scripting in autoit since about 2003-ish (was one of the first languages that I ever learned) and I've never taken the time to properly learn scrollbars. I never even used them until this UDF was release way back when, and even now in 2018 its still my go to for scroll bars . Thanks again!
  8. Unfortunately, this solution, just changes the problem. It corrects the extra space at the top, but the bottom is still cutoff substantially. In the following screenshot I added 99 labels, and after scrolling down then maximizing, the area is cutoff at the 33rd label, so 2/3rd's are missing somewhere.
  9. I tried this but I didn't notice the optional parameters, I was just using the winhandle. What exactly do the second and third parameters define? (sorry im not at my desk, otherwise I would figure it out myself 🤗)
  10. I found a pretty fatal bug in this UDF. It is present in the examples provided in the .zip and is present anytime I use this UDF in my own scripts. To show you how to re-create this bug, just follow these steps exactly, using one of the examples provided with the UDF: 1) run the script "GUIScrollbars_Size_Example_2.au3" 2) scroll to the bottom 3) maximize the window 4) scroll up At this point the scrollbars re-generate as if I was scrolled all the way up, but the vertical scroll bar is still at the bottom, so now, the bottom part of the previously scrollable area is cutoff, and when you scroll up, there is an equally sized area of blank space at the top. (in the screenshot I added more labels than the default to show the extent of the issue)
×
×
  • Create New...