Nologic Posted December 17, 2007 Share Posted December 17, 2007 I'm looking for a method in which I can remove say the menubar from Notepad while a script is running. I've seen stuff to add and remove items on the menubar...but thus far failed to find a way in which to remove the menubar its self. Thanks ahead of time. Link to comment Share on other sites More sharing options...
martin Posted December 17, 2007 Share Posted December 17, 2007 I have no idea, so in desperation I would do something like this #include <guiconstants.au3> #include <constants.au3> #include <misc.au3> HotKeySet("{F6}", "fake") While 1 WEnd Func fake() ConsoleWrite("in fake" & @LF) If Not WinExists("Untitled -") Then Exit While BitAND(WinGetState("Untitled"), 16) = 16 Sleep(80) WEnd $np = WinGetPos("Untitled -") $G = GUICreate("Untitled", $np[2], $np[3], $np[0], $np[1]) $cs = WinGetClientSize($G) GUISetState() $ed = GUICtrlCreateEdit("", 0, 0, $cs[0], $cs[1]) GUICtrlSetData($ed, ControlGetText("Untitled -", "", "Edit1")) ;winsetstate("Untitled -","",@SW_MINIMIZE) EndFunc ;==>fake and then I would hope no-one who would knows better is watching. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
GaryFrost Posted December 17, 2007 Share Posted December 17, 2007 #include <GuiMenu.au3> Opt('MustDeclareVars', 1) _Main() Func _Main() Local $hWnd, $hMain ; Open Notepad Run("Notepad.exe") WinWaitActive("Untitled - Notepad") $hWnd = WinGetHandle("Untitled - Notepad") $hMain = _GUICtrlMenu_GetMenu ($hWnd) For $x = _GUICtrlMenu_GetItemCount ($hMain) - 1 To 0 Step -1 ConsoleWrite("Removing: " & $x & @lf) _GUICtrlMenu_RemoveMenu ($hMain, $x) Next EndFunc ;==>_Main SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
martin Posted December 18, 2007 Share Posted December 18, 2007 #include <GuiMenu.au3> Opt('MustDeclareVars', 1) _Main() Func _Main() Local $hWnd, $hMain ; Open Notepad Run("Notepad.exe") WinWaitActive("Untitled - Notepad") $hWnd = WinGetHandle("Untitled - Notepad") $hMain = _GUICtrlMenu_GetMenu ($hWnd) For $x = _GUICtrlMenu_GetItemCount ($hMain) - 1 To 0 Step -1 ConsoleWrite("Removing: " & $x & @lf) _GUICtrlMenu_RemoveMenu ($hMain, $x) Next EndFunc ;==>_Main Damn, I just knew someone would be watching! Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
GaryFrost Posted December 18, 2007 Share Posted December 18, 2007 Damn, I just knew someone would be watching!Of course SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Squirrely1 Posted December 18, 2007 Share Posted December 18, 2007 Of course You gave me an idea with that function you wrote, about how to solve my problem at http://www.autoitscript.com/forum/index.php?showtopic=59684 Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
Nologic Posted December 18, 2007 Author Share Posted December 18, 2007 Many many thanks guys, it works wonderfully. 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