Jump to content

$GUI_RUNDEFMSG and $fDblClk


Recommended Posts

I hope someone can share some light on this. the variable "$GUI_RUNDEFMSG" is often used as a RETURN-TO function and works in conjunction with "$fDblClk"....What i would like to know is, nowhere can i find to WHAT this variable is assigned to, but it works.

I admit I'm no fundi on this, but it seems to me it has something to do with the "DllStructGetData"...where can i read up more about the $GUI_RUNDEFMSG and also "$fDblClk" if it IS related to the DllStructGetData? (not how to use it, but how it actually works)

Link to comment
Share on other sites

I don't see $GUI_RUNDEFMSG in my help file, and I'm not sure I really understand what you wrote. Are you asking how $GUI_RUNDEFMSG interacts with $fDblClk?

I hope someone can share some light on this. the variable "$GUI_RUNDEFMSG" is often used as a RETURN-TO function and works in conjunction with "$fDblClk"....What i would like to know is, nowhere can i find to WHAT this variable is assigned to, but it works.

I admit I'm no fundi on this, but it seems to me it has something to do with the "DllStructGetData"...where can i read up more about the $GUI_RUNDEFMSG and also "$fDblClk" if it IS related to the DllStructGetData? (not how to use it, but how it actually works)

Link to comment
Share on other sites

I don't see $GUI_RUNDEFMSG in my help file, and I'm not sure I really understand what you wrote. Are you asking how $GUI_RUNDEFMSG interacts with $fDblClk?

Here is a small snippet from another member

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>


Global $fDblClk = False

$hGUI = GUICreate("Test", 500, 500)

$ListView = GUICtrlCreateListView("Entry Name|Category", 5, 75, 195, 280, BitOR($LVS_SORTASCENDING, $LVS_SINGLESEL))
$hLV_Handle = GUICtrlGetHandle(-1)

GUICtrlCreateListViewItem("Name 2|Category 2", $ListView)

GUISetState()

GUIRegisterMsg($WM_NOTIFY, "MY_WM_NOTIFY")

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

    If $fDblClk Then
        $fDblClk = False
        MsgBox(0,"Double Clicked",_GUICtrlListView_GetItemText($hLV_Handle, _GUICtrlListView_GetSelectedIndices($hLV_Handle)))
    EndIf
WEnd

; React to double clicks on  ListView
Func MY_WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)

    #forceref $hWnd, $iMsg, $wParam
    Local $tNMHDR = DllStructCreate("int;int;int", $lParam)
    If @error Then Return
    If DllStructGetData($tNMHDR, 1) = $hLV_Handle Then
        If DllStructGetData($tNMHDR, 3) = $NM_DBLCLK Then $fDblClk = True
    EndIf
    $tNMHDR = 0
    Return $GUI_RUNDEFMSG

EndFunc

if you look at the "Return $GUI_RUNDEFMSG"...where does the $GUI_RUNDEFMSG come into play as its only mentioned once ?

Link to comment
Share on other sites

The variable "$GUI_RUNDEFMSG" is defined in the include file "GUIConstantsEx.au3".

Global Const $GUI_RUNDEFMSG = 'GUI_RUNDEFMSG'

O ok...thanks a bunch. Tell me, is there a place where a person can read about all the "hidden" functions in the "includes" and what they do?
Link to comment
Share on other sites

  • Moderators

Hi guys,

That is my code MariusN is quoting, so I hope you do not mind me butting in! :evil:

You can find out about $GUI_RUNDEFMSG on the Help file page for GUIRegisterMsg. Basically it allows AutoIt to run it's internal handler for a message once you have finished with it. If you do not want the internal handler to run, just Return 0.

The $fDblClk was an internal flag in the script, so you will find no reference in the Help file! I often use flags in the message handlers because of this warning (from the same page in the Help file:

"Warning: blocking of running user functions which executes window messages [...] can lead to unexpected behavior, the return to the system should be as fast as possible !!!"

So rather than run a long function in the message handler itself, I use it to set a flag to "True" and then run the function from my While...WEnd loop (I ususally use GetMessage mode so there is always one about somewhere!) using something like this:

If $fFlag = True Then
    $fFlag = False ; to prevent it running every time!
    Function()
EndIf

I hope that is clear. Please ask if you are still unsure about anything. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Thanubis,

The key words are "as fast as possible". It all depends what you have in your 30 lines that count. A Switch statement on its own will not cause a problem as it only runs the lines associated with the valid condition. It is what those few lines do that matter - I have seen a case where the handler ran a function that took over 30 secs (mostly Sleep()!) to complete = guaranteed crash every time! :evil:

Using OnEvent mode is not a big problem if you want to try the flag idea - just use an Adlib function to check at intervals if the flag is set. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Thanubis,

If it does not crash.....it is fast enough! :evil:

Seriously, I do not think there is any need to worry unless you put in MsgBoxes or seriously long functions like the 30secs one I mentioned earlier.

I just try and keep any message handler as short as possible - if I can do the necessary things outside then I do. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

I don't have that, nor have I ever seen it, care to attach it to the forum temporarily?

There should be a file in the AutoIt installation directory named "UDFs3.chm". That is the UDF help file. It lists all of the documented UDF functions just like the regular help file lists the standard functions.

Link to comment
Share on other sites

  • Moderators

gte,

Help for the UDFs is included in AutoIt3.chm. The smaller Autoit.chm holds the builtin functions only.

Like you, I have never seen or heard of UDFs3.chm until now - I can only imagine it was included in a much earlier version of AutoIt. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Agreed Melba, that would have been awesome!

I'm going to have to update my version now :evil:

gte,

Help for the UDFs is included in AutoIt3.chm. The smaller Autoit.chm holds the builtin functions only.

Like you, I have never seen or heard of UDFs3.chm until now - I can only imagine it was included in a much earlier version of AutoIt. ;)

M23

Link to comment
Share on other sites

  • Moderators

Thanubis,

Apologies. I have not looked in the folder for ages and never realised how many different Help files there were! I just run a script (what else? ;) ) which starts AutoIt3Help.exe and get it all in one place!

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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