Menu: How do you hide only one of a menu's submenus?
Posted: 29 Nov 2022, 08:31
I want to show or hide a submenu depending on whether text is selected in a program called ComicRack. My current script works great (thank you AHK forums) but it only disables the submenu (it's greyed out) and I want to hide it entirely:
List of Menus:
Also, please feel free to suggest ways to make the script better.
Code: Select all
If WinActive("ahk_exe ComicRack.exe") {
Selected_Text := ""
ControlGet, Selected_Text, Selected,, WindowsForms10.EDIT.app.0.37e3228_r6_ad12, ahk_exe ComicRack.exe
If ErrorLevel {
MsgBox, 48, Error, Missing ControlGet.
Return
} If (Selected_Text = "") {
Menu,Comics,Disable,Search
Menu,Comics,Show
} Else if (Selected_Text)
Menu,Search,Show
} return
Code: Select all
Menu,Comics,Add,Formats,Function
Menu,Formats,Add,Artbook,FunctionFormat
Menu,Formats,Add,Graphic Novel,FunctionFormat
Menu,Formats,Add,TPB,FunctionFormat
Menu,Comics,Add,Genres,FunctionGenre
Menu,Genres,Add,Fantasy,FunctionGenre
Menu,Genres,Add,,FunctionGenre
Menu,Genres,Add,Superhero,FunctionGenre
Menu,Comics,Add,Search,Function
Menu,Search,Add,Google,SearchGoogle
Menu,Search,Add,Wikipedia,SearchWikipedia
Menu,Search,Add,Comicvine,SearchComicvine