DonationCoder.com Software > Post New Requests Here
IDEA: program menu printing
ares09x:
Greetings,
Perhaps this program already exists, but I have not yet found it ...
A friend of mine asked me to print out all of the menus in a particular program (in this case, it was MSN Premium) and write out explanations of what each of them does. I would like to have a program that is capable of printing all of the menus that another program makes available in some kind of outline form, even just plain text, so that I can annotate each one with additional information. I know that I can go through manually and capture the menu pages using something like SnagIt, and add annotations, but that seems like a very manual process to go through for a lot of menus.
As an example, the results for the File menu for MSN might look like this:
File
• New
* Mail Message - Ctrl+N
* Window - Ctrl+Shift+N
* Appointment - Ctrl+Shift+A
* Contact - Ctrl+Shift+C • Open... - Ctrl+O
• Save As...
• Appointment - Ctrl+Shift+A
• Copy E-mail...
• Print... - Ctrl+P
• Print Preview...
• Send Link by E-mail
• Close - Alt+F4
I would want to invoke the program and then point it to a .exe file, or else drop a desktop shortcut onto its desktop shortcut to generate an output - it would ask what the output's filename should be and where it should be stored (maybe with some default?). There might be some options like the format of the output (eg, .txt, RTF, Excel/CSV, etc), but I'd love to start with something basic that will generate this kind of output automatically.
Any ideas about existing programs, or how hard it would be to create such a program?
Thanks,
Bob Y.
mmdoogie:
You might want to give the EXE a look with one of these first.
http://angusj.com/resourcehacker/
http://www.wilsonc.demon.co.uk/d10resourceeditor.htm
One way menus can be stored is as resources in the EXE.
If its done this way, there should be a entries for the menus; however, there are lots of other ways to make menus work too.
Its been a while since I've used either, so I don't remember how easy it is to copy the info out, but I think you can save it as a text file or copy and paste it or something.
From the program side, I have an idea of how to go about it, but don't really have time to mash it out right now.
For the other coders out there: with WINAPI you can use GetCursorPos to get the cursor position, then WindowFromPoint to get the hWnd for the window under that point. From there, you can do GetMenu to get the hMenu. Then, just recurse through the menu structures to print out the names.
Hope this helps.
--matt
mouser:
It's a nice idea to use a resource editor, but it probably wont help you too much with menus..
Another thing you could do is record a screencast movie of you opening all the menus, and then just print the frames of your choice (or send them the video if that is sufficient).
It would'nt be too hard to use a screenshot program like Screenshot Captor to capture an image of each menu in turn using a hotkey.. i still think that still might be your best way to go. So pulldown menu, hit hotkey, pulldown next menu, hit hotkey, etc.. Sometimes the manual approaches are the most efficient. You'd just want to make sure you have Screenshot Captor configured in the autosave mode so it doesn't prompt you after each screenshot.
skrommel:
:) Try GetMenus!
Press F1 to extract the menus of the active window to a text file.
Skrommel
--- ---;GetMenus.ahk
; Press F1 to extract the menus of the active window to a text file
;Skrommel @ 2009
#SingleInstance,Force
SetBatchLInes,-1
AutoTrim,Off
F1::
WinGet,hWnd,ID,A
wholemenu=
space=
hMenu:=DllCall("user32\GetMenu","UInt",hWnd)
GETMENU(hMenu)
FileDelete,%A_Temp%\Menus.txt
FileAppend,%wholemenu%,%A_Temp%\Menus.txt
Run,%A_Temp%\Menus.txt
Return
GETMENU(hMenu)
{
nMaxCount=100
uFlag:=0x0400 ;MF_BYPOSITION
global wholemenu
global space
menuitemcount:=DllCall("GetMenuItemCount",UInt,hMenu)
Loop,%menuitemcount%
{
nPos:=A_Index-1
VarSetCapacity(lpString,100,0) ; line inserted on 2008-02-18 -- Hope you dont mind Skrommel! - Moderator!
length:=DllCall("user32\GetMenuString","UInt",hMenu,"UINT",nPos,"STR",lpString,"int",nMaxCount,"UINT",uFlag)
wholemenu=%wholemenu%%nPos%%A_Tab%%space%%lpString%`n
hSubMenu:=DllCall("user32\GetSubMenu","UInt",hMenu,"int",nPos)
If hSubMenu>-1
{
Loop,3
space=%space%%A_Space%
GETMENU(hSubMenu)
StringTrimRight,space,space,3
}
}
Return
}
cranioscopical:
Brilliant! :up: :up:
Navigation
[0] Message Index
[#] Next page
Go to full version