Jump to content
Sign in to follow this  
Nologic

Menubar removal, delete, hide

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...