jennico Posted December 24, 2010 Share Posted December 24, 2010 hi there and merry christmas !from helpfile:expandcollapse popup#include <GUIConstantsEx.au3> #include <StaticConstants.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $defaultstatus, $status, $filemenu, $fileitem, $helpmenu, $saveitem Local $infoitem, $exititem, $recentfilesmenu, $separator1, $viewmenu Local $viewstatusitem, $okbutton, $cancelbutton, $statuslabel, $msg, $file GUICreate("My GUI menu", 300, 200) Global $defaultstatus = "Ready" Global $status $filemenu = GUICtrlCreateMenu("&File") $fileitem = GUICtrlCreateMenuItem("Open", $filemenu) GUICtrlSetState(-1, $GUI_DEFBUTTON) $helpmenu = GUICtrlCreateMenu("?") $saveitem = GUICtrlCreateMenuItem("Save", $filemenu) GUICtrlSetState(-1, $GUI_DISABLE) $infoitem = GUICtrlCreateMenuItem("Info", $helpmenu) $exititem = GUICtrlCreateMenuItem("Exit", $filemenu) $recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu, 1) $separator1 = GUICtrlCreateMenuItem("", $filemenu, 2) ; create a separator line $viewmenu = GUICtrlCreateMenu("View", -1, 1) ; is created before "?" menu $viewstatusitem = GUICtrlCreateMenuItem("Statusbar", $viewmenu) GUICtrlSetState(-1, $GUI_CHECKED) $okbutton = GUICtrlCreateButton("OK", 50, 130, 70, 20) GUICtrlSetState(-1, $GUI_FOCUS) $cancelbutton = GUICtrlCreateButton("Cancel", 180, 130, 70, 20) $statuslabel = GUICtrlCreateLabel($defaultstatus, 0, 165, 300, 16, BitOR($SS_SIMPLE, $SS_SUNKEN)) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $fileitem Then $file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)") If @error <> 1 Then GUICtrlCreateMenuItem($file, $recentfilesmenu) EndIf If $msg = $viewstatusitem Then If BitAND(GUICtrlRead($viewstatusitem), $GUI_CHECKED) = $GUI_CHECKED Then GUICtrlSetState($viewstatusitem, $GUI_UNCHECKED) GUICtrlSetState($statuslabel, $GUI_HIDE) Else GUICtrlSetState($viewstatusitem, $GUI_CHECKED) GUICtrlSetState($statuslabel, $GUI_SHOW) EndIf EndIf If $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton Or $msg = $exititem Then ExitLoop If $msg = $infoitem Then MsgBox(0, "Info", "Only a test...") WEnd GUIDelete() EndFunc ;==>Examplethe ampersand should show "File" on the menu, but it doesn't on my computer, neither in my scripts. can anyone make a suggestion, while the underline does not show ? the ampersand itself doesn't show either, the menu text is just "File". what can i do, please ?thx j. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
jennico Posted December 25, 2010 Author Share Posted December 25, 2010 (edited) oops you're right.... i didn't know that. i was definitely thinking the underline should always be showing. maybe it can be set by windows somewhere.... thx a lot j. Edited December 25, 2010 by jennico Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
rover Posted December 25, 2010 Share Posted December 25, 2010 (edited) removed Edited December 25, 2010 by rover I see fascists... Link to comment Share on other sites More sharing options...
Zedna Posted December 26, 2010 Share Posted December 26, 2010 There is option in Windows system for defining that. In TweakUI it's called "Switch off underline of chars in menu of programs" Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Mat Posted December 26, 2010 Share Posted December 26, 2010 (edited) As far as forcing a window to show them: WM_CHANGEUISTATE would be my initial item of research (it looks promising)As far as the OS setting goes, its tucked away nicely (vista):Control Panel >> Ease of Access >> Ease of Access Center >> Make the keyboard easier to use >> Underline keyboard shortcuts and access keysEdit: Better still:[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer] "NoChangeKeyboardNavigationIndicators"=dword:00000001dword:00000001 shows the underlines,dword:00000000 hides the underlines.source Edited December 26, 2010 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
Mat Posted December 27, 2010 Share Posted December 27, 2010 That's definitely the topic you want... I should have known Melba had already done it AutoIt Project Listing 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