Jump to content

_GUIRegisterMsgEx() UDF - Register multiple functions with GUIRegisterMsg()


guinness
 Share

Recommended Posts

This UDF was created as part of Trac Ticket requests: #2624#2629 and one users attempt at creating something closely related to what was requested >> >GUIRegisterMsg UDF.

See the function below. Thanks.

PS As usual this doesn't use a global variable for maintaining the internal array. Like it or hate I don't mind.

; Initial idea by mLipok: http://www.autoitscript.com/forum/topic/162515-guiregistermsg-udf/
; Compared to mine, mLipok's idea was limited to a certain set of WM_MESSAGES and would call all the registered functions
; This UDF works as was suggested in the Trac Tickets: #2624 & #2629, where each WM_MESSAGE is associated with a function
; It's basically allowing GUIRegisterMsg() to register multiple messages

#include <GUIConstants.au3>
#include <StringConstants.au3>
#include <WindowsConstants.au3>

; Constants related to the UDF only
Global Const $GUIREGISTERMSGEX_GUID = '6CEDA13C-25F9-4F93-803E-5B0CB19B8F4F'
Global Enum $GUIREGISTERMSGEX_ADD = $WM_USER + 1, _
        $GUIREGISTERMSGEX_DELETE
Global Const $GUIREGISTERMSGEX = 0
Global Enum $GUIREGISTERMSGEX_FIRSTCOL_INDEX, _
        $GUIREGISTERMSGEX_MESSAGEINDEX, _
        $GUIREGISTERMSGEX_FIRSTROW_INDEX
Global Enum $GUIREGISTERMSGEX_COLUMN_UBOUND, _
        $GUIREGISTERMSGEX_ID, _
        $GUIREGISTERMSGEX_INDEX, _
        $GUIREGISTERMSGEX_RESETCOUNT, _
        $GUIREGISTERMSGEX_ROW_UBOUND, _
        $GUIREGISTERMSGEX_MESSAGESTRING, _
        $GUIREGISTERMSGEX_MAX
Global Const $GUIREGISTERMSGEX_CALL_ERROR = 0xDEAD
Global Const $GUIREGISTERMSGEX_CALL_PARAMS = 0xBEEF

#Region Example usage

Example()

Func Example() ; By Melba23
    Local $hGUI = GUICreate('Test', 500, 500)
    Local $idButton_R1 = GUICtrlCreateButton('Reg 1', 10, 10, 80, 30)
    Local $idButton_U1 = GUICtrlCreateButton('UnReg 1', 100, 10, 80, 30)
    GUICtrlCreateLabel('ConsoleWrite ''1'' if mouse moved', 200, 20, 300, 20)
    Local $idButton_R2 = GUICtrlCreateButton('Reg 2', 10, 50, 80, 30)
    Local $idButton_U2 = GUICtrlCreateButton('UnReg 2', 100, 50, 80, 30)
    GUICtrlCreateLabel('ConsoleWrite ''2'' if mouse moved', 200, 60, 300, 20)
    Local $idButton_R3 = GUICtrlCreateButton('Reg 3', 10, 90, 80, 30)
    Local $idButton_U3 = GUICtrlCreateButton('UnReg 3', 100, 90, 80, 30)
    GUICtrlCreateLabel('ConsoleWrite ''Left'' if left button pressed', 200, 100, 300, 20)
    Local $idButton_R4 = GUICtrlCreateButton('Reg 4', 10, 130, 80, 30)
    Local $idButton_U4 = GUICtrlCreateButton('UnReg 4', 100, 130, 80, 30)
    GUICtrlCreateLabel('ConsoleWrite ''Right'' if right button pressed', 200, 140, 300, 20)

    GUISetState(@SW_SHOW, $hGUI)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop

            Case $idButton_R1
                _GUIRegisterMsgEx($WM_MOUSEMOVE, _Move_1)
                ConsoleWrite(@CRLF)

            Case $idButton_U1
                _GUIRegisterMsgEx($WM_MOUSEMOVE, _Move_1, True)
                ConsoleWrite(@CRLF)

            Case $idButton_R2
                _GUIRegisterMsgEx($WM_MOUSEMOVE, _Move_2)
                ConsoleWrite(@CRLF)

            Case $idButton_U2
                _GUIRegisterMsgEx($WM_MOUSEMOVE, _Move_2, True)
                ConsoleWrite(@CRLF)

            Case $idButton_R3
                _GUIRegisterMsgEx($WM_LBUTTONDOWN, _Press_1)
                ConsoleWrite(@CRLF)

            Case $idButton_U3
                _GUIRegisterMsgEx($WM_LBUTTONDOWN, _Press_1, True)
                ConsoleWrite(@CRLF)

            Case $idButton_R4
                _GUIRegisterMsgEx($WM_RBUTTONDOWN, _Press_2)
                ConsoleWrite(@CRLF)

            Case $idButton_U4
                _GUIRegisterMsgEx($WM_RBUTTONDOWN, _Press_2, True)
                ConsoleWrite(@CRLF)

        EndSwitch
    WEnd
    GUIDelete($hGUI)
EndFunc   ;==>Example

Func _Move_1($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam, $lParam
    ConsoleWrite('1')
EndFunc   ;==>_Move_1

Func _Move_2($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam, $lParam
    ConsoleWrite('2')
EndFunc   ;==>_Move_2

Func _Press_1($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam, $lParam
    ConsoleWrite(' Left ')
EndFunc   ;==>_Press_1

Func _Press_2($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam, $lParam
    ConsoleWrite(' Right ')
EndFunc   ;==>_Press_2

#cs
    _GUIRegisterMsgEx($WM_COMMAND, CallbackFunction) ; Register CallbackFunction() when WM_COMMAND is called

    _GUIRegisterMsgEx($WM_COPYDATA, CallbackFunction)
    _GUIRegisterMsgEx($WM_COPYDATA, CallbackFunction) ; Duplicates won't be added to the GUIRegisterMsg()
    _GUIRegisterMsgEx($WM_COPYDATA, SomeFunc)

    _GUIRegisterMsgEx($WM_COPYDATA, CallbackFunction, True) ; Unregister the WM_COPYDATA message to call CallbackFunction()

    _GUIRegisterMsgEx($WM_SIZE, CallbackFunction)
    _GUIRegisterMsgEx($WM_SIZE, SomeFunc)
    _GUIRegisterMsgEx($WM_SIZE, CallbackFunction, True) ; Unregister the $WM_SIZE message to call CallbackFunction()
    _GUIRegisterMsgEx($WM_SIZE, CallbackFunction)

    Func CallbackFunction()
    EndFunc   ;==>CallbackFunction

    Func SomeFunc()
    EndFunc   ;==>SomeFunc
#ce
#EndRegion Example usage

Func _GUIRegisterMsgEx($iWM_MESSAGE, $fuDelegate, $bIsUnRegister = False) ; Returns True or False
    Return __GUIRegisterMsgEx_EVENTPROC($fuDelegate, $iWM_MESSAGE, ($bIsUnRegister ? $GUIREGISTERMSGEX_DELETE : $GUIREGISTERMSGEX_ADD), Null)
EndFunc   ;==>_GUIRegisterMsgEx

Func __GUIRegisterMsgEx_EVENTPROC($hWnd, $iMsg, $wParam, $lParam) ; $hWnd = Func, $iMsg = Windows (WM) message, $wParam = Internal message
    Local Static $aStorage[$GUIREGISTERMSGEX_FIRSTROW_INDEX][$GUIREGISTERMSGEX_MAX] ; Internal array for storing the WM_MESSAGE and the associated function to call

    If Not ($aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_ID] = $GUIREGISTERMSGEX_GUID) Then ; Initialise the internal array

        $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_ID] = $GUIREGISTERMSGEX_GUID

        $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_INDEX] = 0

        $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_RESETCOUNT] = 0

        $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_COLUMN_UBOUND] = $GUIREGISTERMSGEX_MAX
        $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_ROW_UBOUND] = $GUIREGISTERMSGEX_FIRSTROW_INDEX

        $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_MESSAGESTRING] = '|'
    EndIf

    Local $iIndex = Int(StringRegExp($aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_MESSAGESTRING] & '|' & Int($iMsg) & '*-1|', '\|' & Int($iMsg) & '\*(\-?\d+)\|', $STR_REGEXPARRAYGLOBALMATCH)[0])
    Switch $wParam
        Case $GUIREGISTERMSGEX_ADD
            If $iIndex < 0 Then
                $iIndex = $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_INDEX]
                $aStorage[$GUIREGISTERMSGEX_MESSAGEINDEX][$iIndex] = $GUIREGISTERMSGEX_MESSAGEINDEX
                $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_MESSAGESTRING] &= Int($iMsg) & '*' & $iIndex & '|'
                $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_INDEX] += 1
                GUIRegisterMsg($iMsg, __GUIRegisterMsgEx_EVENTPROC) ; Register the message. Note: Once registered this function will always be associated with that message
            EndIf

            Local $bIsDelegateExists = False
            For $i = $GUIREGISTERMSGEX_FIRSTROW_INDEX To $aStorage[$GUIREGISTERMSGEX_MESSAGEINDEX][$iIndex] ; Row count
                If $aStorage[$i][$iIndex] = $hWnd Then
                    $bIsDelegateExists = True
                    ExitLoop
                EndIf
            Next

            If Not $bIsDelegateExists Then
                $aStorage[$GUIREGISTERMSGEX_MESSAGEINDEX][$iIndex] += 1 ; Increase the count of the message column

                Local $bIsColAdd = ($iIndex + 1) >= $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_COLUMN_UBOUND], _ ; Re-size the internal array
                        $bIsRowAdd = $aStorage[$GUIREGISTERMSGEX_MESSAGEINDEX][$iIndex] >= $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_ROW_UBOUND]

                If $bIsColAdd Or $bIsRowAdd Then ; Re-size the internal storage if required
                    If $bIsColAdd Then $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_COLUMN_UBOUND] = Ceiling($iIndex * 1.5)
                    If $bIsRowAdd Then $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_ROW_UBOUND] = Ceiling($aStorage[$GUIREGISTERMSGEX_MESSAGEINDEX][$iIndex] * 1.5)
                    ReDim $aStorage[$aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_ROW_UBOUND]][$aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_COLUMN_UBOUND]]
                EndIf
                $aStorage[$aStorage[$GUIREGISTERMSGEX_MESSAGEINDEX][$iIndex]][$iIndex] = $hWnd
            EndIf

            Return Not $bIsDelegateExists

        Case $GUIREGISTERMSGEX_DELETE
            Local $bIsDeleted = False
            If $iIndex >= 0 Then
                For $i = $GUIREGISTERMSGEX_FIRSTROW_INDEX To $aStorage[$GUIREGISTERMSGEX_MESSAGEINDEX][$iIndex] ; Row count
                    If $aStorage[$i][$iIndex] = $hWnd Then
                        $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_RESETCOUNT] += 1
                        $aStorage[$i][$iIndex] = Null
                        $bIsDeleted = True
                    EndIf
                Next
                If $bIsDeleted And $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_RESETCOUNT] >= 0 Then ; Tidy the internal array by removing empty values
                    Local $iCurrentIndex = $GUIREGISTERMSGEX_FIRSTROW_INDEX
                    For $i = $GUIREGISTERMSGEX_FIRSTCOL_INDEX To $aStorage[$GUIREGISTERMSGEX][$GUIREGISTERMSGEX_INDEX] - 1 ; Column count
                        For $j = $GUIREGISTERMSGEX_FIRSTROW_INDEX To $aStorage[$GUIREGISTERMSGEX_MESSAGEINDEX][$i]
                            If $aStorage[$j][$i] = Null Then
                                $aStorage[$GUIREGISTERMSGEX_MESSAGEINDEX][$i] -= 1
                                ContinueLoop
                            EndIf
                            $aStorage[$iCurrentIndex][$i] = $aStorage[$j][$i]
                            $iCurrentIndex += 1
                        Next
                        $iCurrentIndex = $GUIREGISTERMSGEX_FIRSTROW_INDEX
                    Next
                EndIf
            EndIf

            Return $bIsDeleted

        Case Else ; WM_MESSAGE
            If $iIndex >= 0 And $aStorage[$GUIREGISTERMSGEX_MESSAGEINDEX][$iIndex] >= $GUIREGISTERMSGEX_FIRSTROW_INDEX Then
                For $i = $GUIREGISTERMSGEX_FIRSTROW_INDEX To $aStorage[$GUIREGISTERMSGEX_MESSAGEINDEX][$iIndex] ; Row count
                    ; If IsFunc($aStorage[$i][$iIndex]) Then
                    ; $aStorage[$i][$iIndex]($hWnd, $iMsg, $wParam, $lParam) ; Execute the registered functions
                    ; EndIf
                    If IsFunc($aStorage[$i][$iIndex]) Then
                        Call($aStorage[$i][$iIndex], $hWnd, $iMsg, $wParam, $lParam)
                        If (@error = $GUIREGISTERMSGEX_CALL_ERROR And @extended = $GUIREGISTERMSGEX_CALL_PARAMS) Then
                            Call($aStorage[$i][$iIndex], $hWnd, $iMsg, $wParam)
                            If (@error = $GUIREGISTERMSGEX_CALL_ERROR And @extended = $GUIREGISTERMSGEX_CALL_PARAMS) Then
                                Call($aStorage[$i][$iIndex], $hWnd, $iMsg)
                                If (@error = $GUIREGISTERMSGEX_CALL_ERROR And @extended = $GUIREGISTERMSGEX_CALL_PARAMS) Then
                                    Call($aStorage[$i][$iIndex], $hWnd)
                                    If (@error = $GUIREGISTERMSGEX_CALL_ERROR And @extended = $GUIREGISTERMSGEX_CALL_PARAMS) Then
                                        Call($aStorage[$i][$iIndex])
                                    EndIf
                                EndIf
                            EndIf
                        EndIf
                    EndIf
                Next
            EndIf

    EndSwitch

    Return $GUI_RUNDEFMSG
EndFunc   ;==>__GUIRegisterMsgEx_EVENTPROC

_GUIRegisterMsgEx_PE - PreExpanded.

#include <GUIConstants.au3>
#include <StringConstants.au3>
#include <WindowsConstants.au3>

Func _GUIRegisterMsgEx($iWM_MESSAGE, $fuDelegate, $bIsUnRegister = False)
    Return __GUIRegisterMsgEx_EVENTPROC($fuDelegate, $iWM_MESSAGE, ($bIsUnRegister ? 1026 : 1025), Null)
EndFunc   ;==>_GUIRegisterMsgEx

Func __GUIRegisterMsgEx_EVENTPROC($hWnd, $iMsg, $wParam, $lParam)
    Local Static $aStorage[2][6]
    If Not ($aStorage[0][1] = '6CEDA13C-25F9-4F93-803E-5B0CB19B8F4F') Then
        $aStorage[0][1] = '6CEDA13C-25F9-4F93-803E-5B0CB19B8F4F'
        $aStorage[0][2] = 0
        $aStorage[0][3] = 0
        $aStorage[0][0] = 6
        $aStorage[0][4] = 2
        $aStorage[0][5] = '|'
    EndIf
    Local $iIndex = Int(StringRegExp($aStorage[0][5] & '|' & Int($iMsg) & '*-1|', '\|' & Int($iMsg) & '\*(\-?\d+)\|', $STR_REGEXPARRAYGLOBALMATCH)[0])
    Switch $wParam
        Case 1025
            If $iIndex < 0 Then
                $iIndex = $aStorage[0][2]
                $aStorage[1][$iIndex] = 1
                $aStorage[0][5] &= Int($iMsg) & '*' & $iIndex & '|'
                $aStorage[0][2] += 1
                GUIRegisterMsg($iMsg, __GUIRegisterMsgEx_EVENTPROC)
            EndIf
            Local $bIsDelegateExists = False
            For $i = 2 To $aStorage[1][$iIndex]
                If $aStorage[$i][$iIndex] = $hWnd Then
                    $bIsDelegateExists = True
                    ExitLoop
                EndIf
            Next
            If Not $bIsDelegateExists Then
                $aStorage[1][$iIndex] += 1
                Local $bIsColAdd = ($iIndex + 1) >= $aStorage[0][0], $bIsRowAdd = $aStorage[1][$iIndex] >= $aStorage[0][4]
                If $bIsColAdd Or $bIsRowAdd Then
                    If $bIsColAdd Then $aStorage[0][0] = Ceiling($iIndex * 1.3)
                    If $bIsRowAdd Then $aStorage[0][4] = Ceiling($aStorage[1][$iIndex] * 1.3)
                    ReDim $aStorage[$aStorage[0][4]][$aStorage[0][0]]
                EndIf
                $aStorage[$aStorage[1][$iIndex]][$iIndex] = $hWnd
            EndIf
            Return Not $bIsDelegateExists
        Case 1026
            Local $bIsDeleted = False
            If $iIndex >= 0 Then
                For $i = 2 To $aStorage[1][$iIndex]
                    If $aStorage[$i][$iIndex] = $hWnd Then
                        $aStorage[0][3] += 1
                        $aStorage[$i][$iIndex] = Null
                        $bIsDeleted = True
                    EndIf
                Next
                If $bIsDeleted And $aStorage[0][3] >= 0 Then
                    Local $iCurrentIndex = 2
                    For $i = 0 To $aStorage[0][2] - 1
                        For $j = 2 To $aStorage[1][$i]
                            If $aStorage[$j][$i] = Null Then
                                $aStorage[1][$i] -= 1
                                ContinueLoop
                            EndIf
                            $aStorage[$iCurrentIndex][$i] = $aStorage[$j][$i]
                            $iCurrentIndex += 1
                        Next
                        $iCurrentIndex = 2
                    Next
                EndIf
            EndIf
            Return $bIsDeleted
        Case Else
            If $iIndex >= 0 And $aStorage[1][$iIndex] >= 2 Then
                For $i = 2 To $aStorage[1][$iIndex]
                    If IsFunc($aStorage[$i][$iIndex]) Then
                        Call($aStorage[$i][$iIndex], $hWnd, $iMsg, $wParam, $lParam)
                        If (@error = 0xDEAD And @extended = 0xBEEF) Then
                            Call($aStorage[$i][$iIndex], $hWnd, $iMsg, $wParam)
                            If (@error = 0xDEAD And @extended = 0xBEEF) Then
                                Call($aStorage[$i][$iIndex], $hWnd, $iMsg)
                                If (@error = 0xDEAD And @extended = 0xBEEF) Then
                                    Call($aStorage[$i][$iIndex], $hWnd)
                                    If (@error = 0xDEAD And @extended = 0xBEEF) Then
                                        Call($aStorage[$i][$iIndex])
                                    EndIf
                                EndIf
                            EndIf
                        EndIf
                    EndIf
                Next
            EndIf
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>__GUIRegisterMsgEx_EVENTPROC
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

Nice guinness

I will look in it today night, and try to use in my script.

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

Great. I just updated by removing a redundant function that could be in-lined in the EVENTPROC() function.

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

Added an example by Melba23 to the first post.

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

Weird, what version of AutoIt are you using?

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

Fixed a stupid bug, though don't know if this solves your issue.

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

Am I missing something? Read about GUIRegisterMsg() as this is an extension of that in which it states a function should have 4 params.

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

Some suggestions:

- GUIRegisterMsgEx?

- No separated Register and Unregister functions?

GUIRegisterMsgEx($iWM_MESSAGE, $fuDelegate, $bUnregister = False)

OK. Thanks.

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

Run this, and click on "Reg 1":

; Initial idea by mLipok: http://www.autoitscript.com/forum/topic/162515-guiregistermsg-udf/
; Compared to mine mLipok's idea was limited to a certain set of WM_MESSAGES and would call all the registered functions.
; This UDF works as was suggested in the Trac Tickets: #2624 & #2629, where each WM_MESSAGE is associated with a function. It's basically
; allowing GUIRegisterMsg() to register multiple messages.

#include <GUIConstants.au3>
#include <StringConstants.au3>
#include <WindowsConstants.au3>

Global Const $GUIREGISTERMSG_GUID = 'E5D40BB9-0B3F-4515-8A75-225A9C3E9B43'
Global Enum $GUIREGISTERMSG_ADD = 1025, $GUIREGISTERMSG_DELETE ; 1025 = $WM_USER + 1
Global Const $GUIREGISTERMSG = 0
Global Enum $GUIREGISTERMSG_FIRSTCOL_INDEX, $GUIREGISTERMSG_MESSAGEINDEX, $GUIREGISTERMSG_FIRSTROW_INDEX
Global Enum $GUIREGISTERMSG_COLUMN_UBOUND, $GUIREGISTERMSG_ID, $GUIREGISTERMSG_INDEX, $GUIREGISTERMSG_RESETCOUNT, $GUIREGISTERMSG_ROW_UBOUND, $GUIREGISTERMSG_MESSAGESTRING, $GUIREGISTERMSG_MAX

#Region Example usage.
Example()

Func Example() ; By Melba23
    Local $hGUI = GUICreate('Test', 500, 500)
    Local $idButton_R1 = GUICtrlCreateButton('Reg 1', 10, 10, 80, 30)
    Local $idButton_U1 = GUICtrlCreateButton('UnReg 1', 100, 10, 80, 30)
    GUICtrlCreateLabel('ConsoleWrite ''1'' if mouse moved', 200, 20, 300, 20)
    Local $idButton_R2 = GUICtrlCreateButton('Reg 2', 10, 50, 80, 30)
    Local $idButton_U2 = GUICtrlCreateButton('UnReg 2', 100, 50, 80, 30)
    GUICtrlCreateLabel('ConsoleWrite ''2'' if mouse moved', 200, 60, 300, 20)
    Local $idButton_R3 = GUICtrlCreateButton('Reg 3', 10, 90, 80, 30)
    Local $idButton_U3 = GUICtrlCreateButton('UnReg 3', 100, 90, 80, 30)
    GUICtrlCreateLabel('ConsoleWrite ''Left'' if left button pressed', 200, 100, 300, 20)
    Local $idButton_R4 = GUICtrlCreateButton('Reg 4', 10, 130, 80, 30)
    Local $idButton_U4 = GUICtrlCreateButton('UnReg 4', 100, 130, 80, 30)
    GUICtrlCreateLabel('ConsoleWrite ''Right'' if right button pressed', 200, 140, 300, 20)

    GUISetState(@SW_SHOW, $hGUI)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop

            Case $idButton_R1
                _GUIRegisterMsg($WM_MOUSEMOVE, _Move_1)
                ConsoleWrite(@CRLF)

            Case $idButton_U1
                _GUIUnRegisterMsg($WM_MOUSEMOVE, _Move_1)
                ConsoleWrite(@CRLF)

            Case $idButton_R2
                _GUIRegisterMsg($WM_MOUSEMOVE, _Move_2)
                ConsoleWrite(@CRLF)

            Case $idButton_U2
                _GUIUnRegisterMsg($WM_MOUSEMOVE, _Move_2)
                ConsoleWrite(@CRLF)

            Case $idButton_R3
                _GUIRegisterMsg($WM_LBUTTONDOWN, _Press_1)
                ConsoleWrite(@CRLF)

            Case $idButton_U3
                _GUIUnRegisterMsg($WM_LBUTTONDOWN, _Press_1)
                ConsoleWrite(@CRLF)

            Case $idButton_R4
                _GUIRegisterMsg($WM_RBUTTONDOWN, _Press_2)
                ConsoleWrite(@CRLF)

            Case $idButton_U4
                _GUIUnRegisterMsg($WM_RBUTTONDOWN, _Press_2)
                ConsoleWrite(@CRLF)

        EndSwitch
    WEnd
    GUIDelete($hGUI)
EndFunc

;
;
; ---------- Here
;
;
Func _Move_1($hWnd, $iMsg, $wParam) ;Removed $lParam from Function's parameters
    #forceref $hWnd, $iMsg, $wParam
    ConsoleWrite('1')
EndFunc
;
;
; ---------- Here
;
;

Func _Move_2($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam, $lParam
    ConsoleWrite('2')
EndFunc

Func _Press_1($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam, $lParam
    ConsoleWrite(' Left ')
EndFunc

Func _Press_2($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam, $lParam
    ConsoleWrite(' Right ')
EndFunc

#cs
    _GUIRegisterMsg($WM_COMMAND, DummyFunction) ; Register DummyFunction() when WM_COMMAND is called.

    _GUIRegisterMsg($WM_COPYDATA, DummyFunction)
    _GUIRegisterMsg($WM_COPYDATA, DummyFunction) ; Duplicates won't be added to the GUIRegisterMsg().
    _GUIRegisterMsg($WM_COPYDATA, SomeFunc)

    _GUIUnRegisterMsg($WM_COPYDATA, DummyFunction) ; Unregister the WM_COPYDATA message to call DummyFunction()

    _GUIRegisterMsg($WM_SIZE, DummyFunction)
    _GUIRegisterMsg($WM_SIZE, SomeFunc)
    _GUIUnRegisterMsg($WM_SIZE, DummyFunction) ; Unregister the $WM_SIZE message to call DummyFunction()
    _GUIRegisterMsg($WM_SIZE, DummyFunction)

    Func DummyFunction()
    EndFunc   ;==>DummyFunction

    Func SomeFunc()
    EndFunc   ;==>SomeFunc
#ce
#EndRegion Example usage.

Func _GUIRegisterMsg($iWM_MESSAGE, $fuDelegate) ; Returns True or False.
    Return __GUIRegisterMsg_EVENTPROC($fuDelegate, $iWM_MESSAGE, $GUIREGISTERMSG_ADD, Null)
EndFunc

Func _GUIUnRegisterMsg($iWM_MESSAGE, $fuDelegate) ; Returns True or False.
    Return __GUIRegisterMsg_EVENTPROC($fuDelegate, $iWM_MESSAGE, $GUIREGISTERMSG_DELETE, Null)
EndFunc

Func __GUIRegisterMsg_EVENTPROC($hWnd, $iMsg, $wParam, $lParam) ; $hWnd = Func, $iMsg = Windows (WM) message, $wParam = Internal message.
    Local Static $aStorage[$GUIREGISTERMSG_FIRSTROW_INDEX][$GUIREGISTERMSG_MAX] ; Internal array for storing the WM_MESSAGE and the associated function to call.

    If Not ($aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_ID] = $GUIREGISTERMSG_GUID) Then ; Initialise the internal array.

        $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_ID] = $GUIREGISTERMSG_GUID

        $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_INDEX] = 0

        $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_RESETCOUNT] = 0

        $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_COLUMN_UBOUND] = $GUIREGISTERMSG_MAX
        $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_ROW_UBOUND] = $GUIREGISTERMSG_FIRSTROW_INDEX

        $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_MESSAGESTRING] = '|'
    EndIf

    Local $iIndex = Int(StringRegExp($aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_MESSAGESTRING] & '|' & Int($iMsg) & '*-1|', '\|' & Int($iMsg) & '\*(\-?\d+)\|', $STR_REGEXPARRAYGLOBALMATCH)[0])
    Switch $wParam
        Case $GUIREGISTERMSG_ADD
            If $iIndex < 0 Then
                $iIndex = $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_INDEX]
                $aStorage[$GUIREGISTERMSG_MESSAGEINDEX][$iIndex] = $GUIREGISTERMSG_MESSAGEINDEX
                $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_MESSAGESTRING] &= Int($iMsg) & '*' & $iIndex & '|'
                $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_INDEX] += 1
                GUIRegisterMsg($iMsg, __GUIRegisterMsg_EVENTPROC) ; Register the message. Note: Once registered this function will always be associated with that message.
            EndIf

            Local $bIsDelegateExists = False
            For $i = $GUIREGISTERMSG_FIRSTROW_INDEX To $aStorage[$GUIREGISTERMSG_MESSAGEINDEX][$iIndex] ; Row count.
                If $aStorage[$i][$iIndex] = $hWnd Then
                    $bIsDelegateExists = True
                    ExitLoop
                EndIf
            Next

            If Not $bIsDelegateExists Then
                $aStorage[$GUIREGISTERMSG_MESSAGEINDEX][$iIndex] += 1 ; Increase the count of the message column.

                Local $bIsColAdd = ($iIndex + 1) >= $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_COLUMN_UBOUND], _ ; Re-size the internal array.
                        $bIsRowAdd = $aStorage[$GUIREGISTERMSG_MESSAGEINDEX][$iIndex] >= $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_ROW_UBOUND]

                If $bIsColAdd Or $bIsRowAdd Then ; Re-size the internal storage if required.
                    If $bIsColAdd Then $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_COLUMN_UBOUND] = Ceiling($iIndex * 1.3)
                    If $bIsRowAdd Then $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_ROW_UBOUND] = Ceiling($aStorage[$GUIREGISTERMSG_MESSAGEINDEX][$iIndex] * 1.3)
                    ReDim $aStorage[$aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_ROW_UBOUND]][$aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_COLUMN_UBOUND]]
                EndIf
                $aStorage[$aStorage[$GUIREGISTERMSG_MESSAGEINDEX][$iIndex]][$iIndex] = $hWnd
            EndIf
            Return Not $bIsDelegateExists

        Case $GUIREGISTERMSG_DELETE
            Local $bIsDeleted = False
            If $iIndex >= 0 Then
                For $i = $GUIREGISTERMSG_FIRSTROW_INDEX To $aStorage[$GUIREGISTERMSG_MESSAGEINDEX][$iIndex] ; Row count.
                    If $aStorage[$i][$iIndex] = $hWnd Then
                        $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_RESETCOUNT] += 1
                        $aStorage[$i][$iIndex] = Null
                        $bIsDeleted = True
                    EndIf
                Next
                If $bIsDeleted And $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_RESETCOUNT] >= 0 Then ; Tidy the internal array by removing empty values.
                    Local $iCurrentIndex = $GUIREGISTERMSG_FIRSTROW_INDEX
                    For $i = $GUIREGISTERMSG_FIRSTCOL_INDEX To $aStorage[$GUIREGISTERMSG][$GUIREGISTERMSG_INDEX] - 1 ; Column count.
                        For $j = $GUIREGISTERMSG_FIRSTROW_INDEX To $aStorage[$GUIREGISTERMSG_MESSAGEINDEX][$i]
                            If $aStorage[$j][$i] = Null Then
                                $aStorage[$GUIREGISTERMSG_MESSAGEINDEX][$i] -= 1
                                ContinueLoop
                            EndIf
                            $aStorage[$iCurrentIndex][$i] = $aStorage[$j][$i]
                            $iCurrentIndex += 1
                        Next
                        $iCurrentIndex = $GUIREGISTERMSG_FIRSTROW_INDEX
                    Next
                EndIf
            EndIf
            Return $bIsDeleted

        Case Else ; WM_MESSAGE.
            If $iIndex >= 0 And $aStorage[$GUIREGISTERMSG_MESSAGEINDEX][$iIndex] >= $GUIREGISTERMSG_FIRSTROW_INDEX Then
                For $i = $GUIREGISTERMSG_FIRSTROW_INDEX To $aStorage[$GUIREGISTERMSG_MESSAGEINDEX][$iIndex] ; Row count.
                    If IsFunc($aStorage[$i][$iIndex]) Then
                        $aStorage[$i][$iIndex]($hWnd, $iMsg, $wParam, $lParam) ; Execute the registered functions.
                    EndIf
                Next
            EndIf

    EndSwitch

    Return $GUI_RUNDEFMSG
EndFunc
Link to comment
Share on other sites

I know the issue but there is nothing I can really do without using something like Call(). Since the docs say to declare a function with 4 params then this is what you should do.

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

See the first post. I have updated the UDF name and examples, plus removed the unregister function.

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

I know the issue but there is nothing I can really do without using something like Call(). Since the docs say to declare a function with 4 params then this is what you should do.

Yes, that's what I'm talking about and that's why you should maintain that callback functions MUST have 4 parameters.

How ever you can use Call() like this:

If IsFunc($aStorage[$i][$iIndex]) Then
                        Call($aStorage[$i][$iIndex], $hWnd, $iMsg, $wParam, $lParam)
                        If (@error = 0xDEAD And @extended = 0xBEEF) Then
                            Call($aStorage[$i][$iIndex], $hWnd, $iMsg, $wParam)
                            If (@error = 0xDEAD And @extended = 0xBEEF) Then
                                Call($aStorage[$i][$iIndex], $hWnd, $iMsg)
                                If (@error = 0xDEAD And @extended = 0xBEEF) Then
                                    Call($aStorage[$i][$iIndex], $hWnd)
                                    If (@error = 0xDEAD And @extended = 0xBEEF) Then
                                        Call($aStorage[$i][$iIndex])
                                    EndIf
                                EndIf
                            EndIf
                        EndIf
                    EndIf

It will be so useful because not all the registered messages require all of those 4 parameters.

 

See the first post. I have updated the UDF name and examples, plus removed the unregister function.

That rocks now.

Link to comment
Share on other sites

I didn't document it as I thought most who have used GUIRegisterMsg() would know so, but valid point. As for your suggestion it's just not my style -_0 You know that!

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

Well I hope you ammend to your taste too. Half the stuff I upload I don't use. I only do it for fun these days in AutoIt.

PS That table/map thing is going to blow people's minds. I guess you have some nice snippets lined up when it goes stable?

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

I know the issue but there is nothing I can really do without using something like Call(). Since the docs say to declare a function with 4 params then this is what you should do.

The help files says a maximum of 4 parameters, it doesn't say you have to use all 4. For example, if you're not using the LParam parameter in your function, there's no need to use it in the function call.

This is valid in AutoIt if not using LParam

Func MY_WM_COMMAND($hWnd, $iMsg, $wParam) ;, $lParam)

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

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...