drmusti Posted January 26, 2021 Posted January 26, 2021 how can gui background set icon "hand" and how can gui background click action gui close?
Moderators Melba23 Posted January 26, 2021 Moderators Posted January 26, 2021 Moved to the appropriate forum, as the AutoIt Example Scripts forum very clearly states: Quote Share your cool AutoIt scripts, UDFs and applications with others. Do not post general support questions here, instead use the AutoIt Help and Support forums. Moderation Team 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
drmusti Posted January 26, 2021 Author Posted January 26, 2021 how can gui background set windows hand icon "hand" and how can gui background click action gui close?
Moderators Melba23 Posted January 26, 2021 Moderators Posted January 26, 2021 drmusti, Please stick to just the one thread - merged. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
drmusti Posted January 26, 2021 Author Posted January 26, 2021 3 hours ago, Melba23 said: drmusti, Please stick to just the one thread - merged. M23 dear sory im newbie i cant because im newbie sorry much dear admin
Moderators Melba23 Posted January 26, 2021 Moderators Posted January 26, 2021 drmusti, No problem. As to your questions: Look at GUISetCursor. Not sure what you mean - do you want the GUI to close whenever a click is made within it? M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
drmusti Posted January 27, 2021 Author Posted January 27, 2021 16 hours ago, Melba23 said: drmusti, No problem. As to your questions: Look at GUISetCursor. Not sure what you mean - do you want the GUI to close whenever a click is made within it? M23 expandcollapse popup#include <GUIConstantsEx.au3> Global $g_iIDC = -1, $g_iNewIDC = 0 Example() Func Example() Local $hMainGUI =GUICreate("Press ESC to Increment", 300, 100, 300, 500) GUICtrlSetOnEvent($hMainGUI, "CLOSEButton") GUISetState(@SW_SHOW) While GUIGetMsg() <> $GUI_EVENT_CLOSE If $g_iNewIDC <> $g_iIDC Then $g_iIDC = $g_iNewIDC GUISetCursor("Hand") EndIf ;;ToolTip("GUI Cursor #" & $g_iIDC & " (" & $g_aArray[$g_iIDC] & ")") WEnd GUIDelete() EndFunc ;==>Example Func CLOSEButton() ; Note: At this point @GUI_CtrlId would equal $GUI_EVENT_CLOSE, ; and @GUI_WinHandle would equal $hMainGUI MsgBox($MB_OK, "GUI Event", "You selected CLOSE! Exiting...") Exit EndFunc GUICtrlSetOnEvent($hMainGUI, "CLOSEButton") dont action.
FrancescoDiMuro Posted January 27, 2021 Posted January 27, 2021 @drmusti That's because you're using GUICtrlSetOnEvent() instead of GUISetOnEvent() Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Nine Posted January 27, 2021 Posted January 27, 2021 Also and very importantly, you did not set the appropriate Opt. Please review carefully this wiki : https://www.autoitscript.com/wiki/Managing_Multiple_GUIs Especially the part about OnEvent mode. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
drmusti Posted January 27, 2021 Author Posted January 27, 2021 5 hours ago, FrancescoDiMuro said: @drmusti That's because you're using GUICtrlSetOnEvent() instead of GUISetOnEvent() i cant make main gui onclick action. how can main gui click action. no button etc close etc. onclick main gui.. possible?
Nine Posted January 27, 2021 Posted January 27, 2021 @drmusti did you read the link I provided you with ? It is all very well explained there... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
drmusti Posted January 27, 2021 Author Posted January 27, 2021 6 hours ago, Nine said: Also and very importantly, you did not set the appropriate Opt. Please review carefully this wiki : https://www.autoitscript.com/wiki/Managing_Multiple_GUIs Especially the part about OnEvent mode. yes but no gui click on parent window a action. $GUI_EVENT_CLOSE etc. and buttons.
Moderators Melba23 Posted January 27, 2021 Moderators Posted January 27, 2021 drmusti, In the original script you posted you were not setting OnEvent mode, but trying (with incorrect syntax) to set an event for the GUI [X] button. You CANNOT mix OnEvent and MessageLoop modes in the same script (unless you are very careful and know exactly what you are doing). Here is your basic script rewritten with copious comments: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Opt("GUIOnEventMode", 1) ; Set OnEvent mode Example() ; This is the main idle loop - in OnEvent mode you should ALWAYS return here ASAP While 1 ; You cannot use GUIGetMsg here because you are in OnEvent mode Sleep(10) ; You need this to prevent the CPU from overheating - in MessageLoop mode, GUIGetMsg does this for you automatically WEnd Func Example() Local $hMainGUI = GUICreate("Press ESC to Increment", 300, 100, 300, 500) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEButton") GUISetState(@SW_SHOW) ; Return to the main idle loop - do not wait in the function EndFunc ;==>Example Func CLOSEButton() MsgBox($MB_OK, "GUI Event", "You selected CLOSE! Exiting...") Exit EndFunc ;==>CLOSEButton Now the [X] button works. Please ask if you have any more questions. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
drmusti Posted January 27, 2021 Author Posted January 27, 2021 (edited) Edited January 27, 2021 by Melba23 Removed quote,
Moderators Melba23 Posted January 27, 2021 Moderators Posted January 27, 2021 drmusti, When you reply in future, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - responders know what they wrote and it just pads the thread unnecessarily. Thanks in advance for your cooperation. Quote click over gui . no close icon I asked you that question earlier in the thread but you never gave a coherent reply. If you want to close the GUI by clicking within the GUI itself then I suggest a using label to fill the GUI and then setting an event to the label to run the CLOSEButton function - like this: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Opt("GUIOnEventMode", 1) Example() While 1 ; GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd Func Example() Local $hMainGUI = GUICreate("Press ESC to Increment", 300, 100, 300, 500) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEButton") $cLabel = GUICtrlCreateLabel("", 0, 0, 300, 500) GUICtrlSetOnEvent($cLabel, "CLOSEButton") GUISetState(@SW_SHOW) EndFunc ;==>Example Func CLOSEButton() MsgBox($MB_OK, "GUI Event", "You selected CLOSE! Exiting...") Exit EndFunc ;==>CLOSEButton However, that means you cannot have any other controls in the GUI. You decide if that is what you really want. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now