ScriptJunky Posted June 17, 2018 Share Posted June 17, 2018 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) expandcollapse popup#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 Link to comment Share on other sites More sharing options...
spudw2k Posted June 18, 2018 Share Posted June 18, 2018 Thanks for sharing. Might I suggest appending SM_ to the constants? Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
ScriptJunky Posted June 19, 2018 Author Share Posted June 19, 2018 On 6/17/2018 at 7:39 PM, spudw2k said: Thanks for sharing. Might I suggest appending SM_ to the constants? Here ya go! expandcollapse popup#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 Link to comment Share on other sites More sharing options...
spudw2k Posted June 20, 2018 Share Posted June 20, 2018 So, turns out most of those constants are included in the <WindowsConstants.au3> include. I did some quick analysis and found the discrepancies: WindowsConstants.au3 is missing: Global Const $SM_CONVERTIBLESLATEMODE = 0x2003 Global Const $SM_CXFIXEDFRAME = 7 Global Const $SM_CXPADDEDBORDER = 92 Global Const $SM_CXSIZEFRAME = 32 Global Const $SM_CYFIXEDFRAME = 8 Global Const $SM_CYSIZEFRAME = 33 Global Const $SM_DIGITIZER = 94 Global Const $SM_MAXIMUMTOUCHES = 95 Global Const $SM_MOUSEHORIZONTALWHEELPRESENT = 91 WinAPISystemMetricsConstants.au3 is missing: Global Const $SM_CARETBLINKINGENABLED = 0x2002 Global Const $SM_CMETRICS = 90 Global Const $SM_RESERVED1 = 24 Global Const $SM_RESERVED2 = 25 Global Const $SM_RESERVED3 = 26 Global Const $SM_RESERVED4 = 27 and WinAPISystemMetricsConstants.au3 has a small typo: Global Const $SM_SERVERR = 289 should be Global Const $SM_SERVERR2 = 89 (included in WindowsConstants.au3) Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
mLipok Posted June 20, 2018 Share Posted June 20, 2018 MSDN reference link please. Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
spudw2k Posted June 20, 2018 Share Posted June 20, 2018 This is the MSDN page I am familiar with. https://msdn.microsoft.com/en-us/library/windows/desktop/ms724385(v=vs.85).aspx It is missing some of the constants in the WindowsConstants.au3 file listed above, so I am not sure where those came from. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now