SBrown Posted May 4, 2010 Share Posted May 4, 2010 How can i make a menu that auto hides, and shows with the ALT key (like msn messenger) I can use a checkbox or a button to toggle the menu if that's easier. Link to comment Share on other sites More sharing options...
exodius Posted May 5, 2010 Share Posted May 5, 2010 You're still pretty new, so allow me to explain how this works: 1. You want to accomplish something, so you try to do it yourself --> Check 2. You don't manage to do what you wanted, so you think to ask for help --> Check 3. You take the code that you tried and post it along with what you want to accomplish, and ask for help --> ????? 4. Someone looks at what you want to do, and what you tried, and sees what you need to do differently and tells you --> Step 3 pretty much always comes before Step 4 Link to comment Share on other sites More sharing options...
SBrown Posted May 5, 2010 Author Share Posted May 5, 2010 You're still pretty new, so allow me to explain how this works:1. You want to accomplish something, so you try to do it yourself --> Check2. You don't manage to do what you wanted, so you think to ask for help --> Check3. You take the code that you tried and post it along with what you want to accomplish, and ask for help --> ?????4. Someone looks at what you want to do, and what you tried, and sees what you need to do differently and tells you --> Step 3 pretty much always comes before Step 4its just a standard gui with a menu. The one in the help file under guictrlcreatemenu... Link to comment Share on other sites More sharing options...
SBrown Posted May 6, 2010 Author Share Posted May 6, 2010 (edited) thanks for all the help /sarcasm Edited May 6, 2010 by SBrown Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 6, 2010 Moderators Share Posted May 6, 2010 (edited) SBrown, Please remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. Be patient and someone will answer eventually. And taking that attitude will not help! M23 Edit: This is a real workaround and there must be a better way: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <Misc.au3> $dll = DllOpen("user32.dll") Global $fMenu_Showing = False ; Create Main GUI $hGUI = GUICreate("Test", 500, 500) GUISetState() ; Create Menu GUI Global $hMenu_Win = GUICreate("", 500, 20, -1, -1, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) ; Create menu Global $mFile_Menu = GUICtrlCreateMenu("&File") Global $hExit_Menu_Item = GUICtrlCreateMenuItem("&Exit", $mFile_Menu) Global $mHelp_Menu = GUICtrlCreateMenu("&?") Global $hAbout_Menu_Item = GUICtrlCreateMenuItem("&About", $mHelp_Menu) ; Move to correct position Local $aWin_Pos = WinGetPos($hGUI) Local $iBorder = _WinAPI_GetSystemMetrics(8) ; Border width Local $iBar = _WinAPI_GetSystemMetrics(4) ; Title bar height WinMove($hMenu_Win, "", $aWin_Pos[0] + $iBorder, $aWin_Pos[1] + $iBorder + $iBar) ; Set trans to less than full to prevent visual artefacts when sliding & dragging WinSetTrans($hMenu_Win, "", 250) ; Hide initially GUISetState(@SW_HIDE, $hMenu_Win) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $hExit_Menu_Item DllClose($dll) Exit Case $hAbout_Menu_Item _Menu_State() MsgBox(0, "AutoHide Menu", "Does this help?") EndSwitch ; Check if Alt key pressed If _WinAPI_GetFocus() = $hGUI Then If _IsPressed("12", $dll) Then _Menu_State() EndIf EndIf ; Hide menu if it loses focus If $fMenu_Showing Then If _WinAPI_GetFocus() <> $hMenu_Win Then _Menu_State() EndIf EndIf WEnd Func _Menu_State() If $fMenu_Showing Then GUISetState(@SW_HIDE, $hMenu_Win) $fMenu_Showing = False Else GUISetState(@SW_SHOW, $hMenu_Win) $fMenu_Showing = True EndIf EndFunc Edited May 6, 2010 by Melba23 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now