Jump to content

GUIRegisterMsg replacement for GUICtrlSetOnEvent and GUIGetMsg


BrewManNH
 Share

Recommended Posts

@azjio

Nice, I like the GUI interface for showing the commands for the controls used. Very handy.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Just to be clear on the blocking function. Does this only have to do with loops or blocks like msgbox inside the result of a registerMsg.

Blocking means that you don't return from the function, which means that you are blocking with _aboutPage() here. You must make it Return in a timely manner or you will get trouble.
Link to comment
Share on other sites

  • 1 month later...
  • 8 months later...

Maybe replacing the 'magic numbers' would be a good option.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

The OP code has been updated to remove all "magic numbers" and they have been replaced with the actual Windows constants that should be used.

Unfortunately, there is no listing for the codes returned when clicking on the sides/bottom/corner of the GUI when you're resizing it, so I took the only documented variable that was found and added the difference to that variable to get the correct number. If anyone knows what the documented variable names are for those messages returned by those actions, please let me know so I can update the code.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • 1 year later...
  • 2 months later...

I am often asked this file, so I recently made a reference constant. The problem may be due to the server.

 

Link now is OK

(and content of file is OK too.... :thumbsup: )

Thanks

Bye

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

  • 1 month later...

I am revisiting this topic as it came up a couple of times in posts recently. I ran the code from the original post on Windows 7 x64 and the window sizing commands didn't appear to be detected as the same values as they were when I wrote this. Can someone test this code on various versions of Windows and let me know if anything is working incorrectly? I only have access to Windows 7 x64 machines these days so I can't really test it reliably except on this computer.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

MsgBox(0, "MY_WM_COMMAND", "GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                            "MsgID" & @TAB & ":" & $msg & @LF & _

$msg 

or 

$iMsg ?

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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"
:naughty:  :ranting:, 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

I'm guessing that was supposed to be $iMsg.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

When you return 0

Case $SC_MOVE
                    ConsoleWrite("!System menu Move Option pressed" & @LF)
                    Return 0

then you can not move window

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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"
:naughty:  :ranting:, 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

here is what I got after some testing and modyfication

I replace Consolewrite with TrayTip - to test on compiled version

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <MenuConstants.au3>

Global $_hGUI, $_iButton1, $_iButton2, $_iSlider, $_hSlider
Global $_fExit = False

MakeGui()

While 1
    Sleep(10)
    If $_fExit Then
        DeleteGui()
        Exit
    EndIf
WEnd

Func MakeGui()

    $_hGUI = GUICreate("Test GUI", 200, 200, -1, -1, BitOR($WS_THICKFRAME, $GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_MAXIMIZEBOX))
    $_iButton1 = GUICtrlCreateButton("Test 1", 20, 20)
    $_iButton2 = GUICtrlCreateButton("Another Test2", 20, 100)
    $_iSlider = GUICtrlCreateSlider(20, 60, 150)
    $_hSlider = GUICtrlGetHandle($_iSlider)
    GUIRegisterMsg($WM_COMMAND, "_WM_EXTRACTOR")
    GUIRegisterMsg($WM_SYSCOMMAND, "_WM_EXTRACTOR")
    GUIRegisterMsg($WM_HSCROLL, "_WM_EXTRACTOR")
    GUISetState()

EndFunc   ;==>MakeGui

Func DeleteGui()
    GUIDelete($_hGUI)
EndFunc   ;==>DeleteGui

Func _WM_EXTRACTOR($hWnd, $iMsg, $wParam, $lParam)

    If $hWnd = $_hGUI Then
        Local $nNotifyCode = BitShift($wParam, 16)
        Local $nID = BitAND($wParam, 0x0000FFFF)
        Local $hCtrl = $lParam
        #forceref $hWnd, $iMsg, $wParam, $lParam
        Switch $iMsg
            Case $WM_HSCROLL
                Switch $lParam

                    Case $_hSlider
                        TrayTip("Testing $WM_HSCROLL : $_hSlider", _
                                "Slider moved to: " & GUICtrlRead($_iSlider) & @LF & _
                                "-----------------------------" & @LF & _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_HSCROLL - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)

                    Case Else
                        TrayTip("Testing", "$WM_HSCROLL:  ", 10)

                EndSwitch ; $lParam
            Case $WM_VSCROLL

            Case $WM_COMMAND
                Switch $nID

                    Case $_iButton1
                        TrayTip("Testing $WM_COMMAND : Button 'Test1' pressed", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_COMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)


                    Case $_iButton2
                        TrayTip("Testing $WM_COMMAND : Button 'Another Test2' pressed", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_COMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)


                    Case Else
                        TrayTip("Testing $WM_COMMAND : Case Else", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_COMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)

                        MsgBox(0, "MY_WM_COMMAND : Case Else", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_COMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl)

                EndSwitch ; $nID

            Case $WM_SYSCOMMAND
                Local $test = BitAND($wParam, 0xFFF0)

                Switch $test

                    Case $SC_CLOSE
                        TrayTip("Testing $WM_SYSCOMMAND", "Exit pressed", 10)
                        MsgBox(0, "$WM_SYSCOMMAND : $SC_CLOSE", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl)
                        $_fExit = True

                    Case $SC_CONTEXTHELP
                        TrayTip("Testing $WM_SYSCOMMAND : $SC_CONTEXTHELP", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)

                    Case $SC_DEFAULT
                        TrayTip("Testing $WM_SYSCOMMAND : $SC_DEFAULT", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)

                    Case $SC_HOTKEY
                        TrayTip("Testing $WM_SYSCOMMAND : $SC_HOTKEY", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)


                    Case $SC_HSCROLL
                        TrayTip("Testing $WM_SYSCOMMAND : $SC_HSCROLL", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)


                    Case $SC_KEYMENU
                        TrayTip("Testing $WM_SYSCOMMAND : $SC_KEYMENU", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)


                    Case $SC_MAXIMIZE
                        TrayTip("Testing $WM_SYSCOMMAND : Maximize Window ($SC_MAXIMIZE)", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)

                    Case $SC_MINIMIZE
                        TrayTip("Testing $WM_SYSCOMMAND : Minimize Window ($SC_MINIMIZE)", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)

                    Case $SC_MONITORPOWER
                        TrayTip("Testing $WM_SYSCOMMAND : $SC_MONITORPOWER", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)


                    Case $SC_MOUSEMENU
                        TrayTip("Testing $WM_SYSCOMMAND : $SC_MOUSEMENU", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)


                    Case $SC_MOVE
                        TrayTip("Testing $WM_SYSCOMMAND : $SC_MOVE", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)
;~                      Return 0

                    Case $SC_NEXTWINDOW
                        TrayTip("Testing $WM_SYSCOMMAND", "$SC_NEXTWINDOW", 10)

                    Case $SC_PREVWINDOW
                        TrayTip("Testing $WM_SYSCOMMAND", "$SC_PREVWINDOW", 10)

                    Case $SC_RESTORE
                        TrayTip("Testing $WM_SYSCOMMAND : $SC_RESTORE", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)
                    Case $SC_SCREENSAVE
                        TrayTip("Testing $WM_SYSCOMMAND : $SC_SCREENSAVE", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)
                    Case $SC_SIZE
                        TrayTip("Testing $WM_SYSCOMMAND : $SC_SIZE", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)
;~                      Return 0

                    Case $SC_TASKLIST
                        TrayTip("Testing $WM_SYSCOMMAND : $SC_TASKLIST", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)

                    Case $SC_VSCROLL
                        TrayTip("Testing $WM_SYSCOMMAND : $SC_VSCROLL", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl, 10)

                    Case $SC_MOUSEMENU + 3
                        TrayTip("Testing $WM_SYSCOMMAND", "System menu pressed", 10)

                    Case $SC_MOUSEMENU + 2 ; This and the following case statements are only valid when the GUI is resizable
                        TrayTip("Testing $WM_SYSCOMMAND", "Right side of GUI clicked", 10)
;~                      Return 0

                    Case $SC_MOUSEMENU + 1
                        TrayTip("Testing $WM_SYSCOMMAND", "Left side of GUI clicked", 10)
;~                      Return 0

                    Case $SC_MOUSEMENU + 8
                        TrayTip("Testing $WM_SYSCOMMAND", "Lower Right corner of GUI clicked", 10)
;~                      Return 0

                    Case $SC_MOUSEMENU + 7
                        TrayTip("Testing $WM_SYSCOMMAND", "Lower Left corner of GUI clicked", 10)
;~                      Return 0

                    Case $SC_MOUSEMENU + 6
                        TrayTip("Testing $WM_SYSCOMMAND", "Bottom side of GUI clicked", 10)
;~                      Return 0

                    Case Else
                        TrayTip("Testing", "$WM_SYSCOMMAND:  ", 10)
                        MsgBox(0, "$WM_SYSCOMMAND", _
                                "$hWnd = GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                "$MsgID" & @TAB & ":" & $iMsg & @LF & _
                                "$wParam" & @TAB & ":" & $wParam & @LF & _
                                "$lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                "WM_SYSCOMMAND - Infos:" & @LF & _
                                "-----------------------------" & @LF & _
                                "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                "CtrlID" & @TAB & ":" & $nID & @LF & _
                                "CtrlHWnd" & @TAB & ":" & $hCtrl)

                EndSwitch ; $test

        EndSwitch ; $iMsg
    EndIf

    Return $GUI_RUNDEFMSG

EndFunc   ;==>_WM_EXTRACTOR

EDIT: script modyfication

Edited by mLipok

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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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"
:naughty:  :ranting:, 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

My question wasn't in how to extend the demo, my question was do the values still work for resizing? That's all I need to know, and anything else is nice to have, but irrelevant to the quesion I have.

EDIT: BTW, I intentionally disabled moving and resizing the window by returning 0, it's a demo to show how to use GUIRegisterMsg in a script, not a GUI that I expect anyone to use.

Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

The $SC_MOUSEMENUs aren't picked up in Windows 8.1 64-bit.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Seems like they've changed since I wrote this,I think it was originally written on an XP machine.

Here's a version that correctly identifies the clicks on the borders and all 4 corners as well as the title bar.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <MenuConstants.au3>
GUIRegisterMsg($WM_COMMAND, "_WM_EXTRACTOR")
GUIRegisterMsg($WM_SYSCOMMAND, "_WM_EXTRACTOR")
GUIRegisterMsg($WM_HSCROLL, "_WM_EXTRACTOR")
$GUI = GUICreate("Test GUI", 200, 200, -1, -1, BitOR($WS_THICKFRAME, $gui_ss_default_gui))
$Button = GUICtrlCreateButton("Test", 20, 20)
$Button2 = GUICtrlCreateButton(" Another Test ", 20, 100)
$Slider = GUICtrlCreateSlider(20, 60, 150)
$hSlider = GUICtrlGetHandle($Slider)
GUISetState()
While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $Button
            MsgBox(0, "", "You pressed the button marked TEST")
        Case $Button2
            MsgBox(0, "", "You pressed the button marked 'Another Test'")
    EndSwitch
WEnd
Func _WM_EXTRACTOR($hWnd, $iMsg, $wParam, $lParam)
    Local $nNotifyCode = BitShift($wParam, 16)
    Local $nID = BitAND($wParam, 0x0000FFFF)
    Local $hCtrl = $lParam
    Local $nCommand = BitAND($wParam, 0x000f)
    $wParam1 = BitAND($wParam, 0xfff0)
    #forceref $hWnd, $iMsg, $wParam, $lParam
    Switch $iMsg
        Case $WM_HSCROLL
            Switch $lParam
                Case $hSlider
                    ConsoleWrite("+Slider moved to: " & GUICtrlRead($Slider) & @LF)
            EndSwitch
        Case $WM_VSCROLL
        Case $WM_COMMAND
            Switch $nID
                Case $Button
                    ConsoleWrite(">Button Test pressed" & @LF)
                Case $Button2
                    ConsoleWrite(">Button Another Test pressed" & @LF)
                Case Else
                    MsgBox(0, "WM_COMMAND", "GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                            "MsgID" & @TAB & ":" & $iMsg & @LF & _
                            "wParam" & @TAB & ":" & $wParam & @LF & _
                            "lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                            "WM_COMMAND - Infos:" & @LF & _
                            "-----------------------------" & @LF & _
                            "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                            "CtrlID" & @TAB & ":" & $nID & @LF & _
                            "CtrlHWnd" & @TAB & ":" & $hCtrl)
            EndSwitch
        Case $WM_SYSCOMMAND
            Switch $wParam
                Case $SC_CLOSE
                    ConsoleWrite("!Exit pressed" & @LF)
                    Exit
                Case $SC_RESTORE
                    ConsoleWrite("!Restore window" & @LF)
                Case $SC_MINIMIZE
                    ConsoleWrite("!Minimize Window" & @LF)
                Case $SC_MOUSEMENU + 3
                    ConsoleWrite("!System menu pressed" & @LF)
                Case $SC_MOVE
                    ConsoleWrite("!System menu Move Option pressed" & @LF)
                    Return 0
                Case $SC_MOVE + 2
                    ConsoleWrite("!Title bar clicked" & @LF)
                Case $SC_SIZE
                    ConsoleWrite("!System menu Size Option pressed" & @LF)
                Case Else
                    Switch ($wParam - $wParam1)
                        Case 1
                            ConsoleWrite("!Left side of GUI clicked" & @LF)
                        Case 2; This and the following case statements are only valid when the GUI is resizable
                            ConsoleWrite("!Right side of GUI clicked" & @LF)
                        Case 3
                            ConsoleWrite("!Top border clicked" & @LF)
                        Case 4
                            ConsoleWrite("!Top Left corner of GUI clicked" & @LF)
                        Case 5
                            ConsoleWrite("!Top Right corner of GUI clicked" & @LF)
                        Case 6
                            ConsoleWrite("!Bottom side of GUI clicked" & @LF)
                        Case 7
                            ConsoleWrite("!Lower Left corner of GUI clicked" & @LF)
                        Case 8
                            ConsoleWrite("!Lower Right corner of GUI clicked" & @LF)
                        Case Else
                            MsgBox(0, "WM_SYSCOMMAND", "GUIHWnd" & @TAB & ":" & $hWnd & @LF & _
                                    "MsgID" & @TAB & ":" & $iMsg & @LF & _
                                    "wParam" & @TAB & ":" & $wParam & @LF & _
                                    "lParam" & @TAB & ":" & $lParam & @LF & @LF & _
                                    "WM_COMMAND - Infos:" & @LF & _
                                    "-----------------------------" & @LF & _
                                    "Code" & @TAB & ":" & $nNotifyCode & @LF & _
                                    "CtrlID" & @TAB & ":" & $nID & @LF & _
                                    "CtrlHWnd" & @TAB & ":" & $hCtrl)
                    EndSwitch

            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>_WM_EXTRACTOR

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

It works now.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

click on window borders are not detected on win7 x64.
They are instead detected on "Windows Virtual PC - XP Mode" (running on win7 x64)

anyway, also if the border click is detected, also if you drag the mouse no resizing of the window is performed.

EDIT:

I was testing your code from post #4 and in the while there were 2 new posts.

new code from post# 37 works on win7 x64

edit2:

and also works on "Windows Virtual PC - XP Mode" (running on win7 x64)

Edited by Chimp

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

@BrewManNH

That's better my friend!

Let's keep this thread updated with more information, I'll exhaustive tests on various versions of Windows since I have VMware and I can test it!

JS

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...