|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Registering hot-keys for your WinformI want to register a hotkey for my WinForm so that when I hold the,
say, Alt+M keys, it minimizes. How do I do that? I found the easiest way is to create a menu item to do this and then link
the "hot key" to the menu item. HTH Simon -- Show quoteHide quote================================ Simon Verona Dealer Management Service Ltd Stewart House Centurion Business Park Julian Way Sheffield S9 1GD Tel: 0870 080 2300 Fax: 0870 735 0011 "Water Cooler v2" <wtr_***@yahoo.com> wrote in message news:1151398725.694494.211400@75g2000cwc.googlegroups.com... >I want to register a hotkey for my WinForm so that when I hold the, > say, Alt+M keys, it minimizes. How do I do that? > "Simon Verona" <nom***@nomail.zzz> schrieb: ACK. Note that the menu item doesn't necessarily need to be visible.>I found the easiest way is to create a menu item to do this and then link > the "hot key" to the menu item. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Thanks! That is a nice tip I will surely use in the future. For now,
I'll be using the Win32 API to register the hotkey that is system-wide because this menu-item solution, I believe: 1. Will not be system-wide; and 2. Will not be able to restore the form once minimized. But a great tip I never thought of, really. Thanks a lot. Another related question: I've seen examples that use RegisterHotKey API without a global atom and some that do add a global atom for the key in the Global Atom database. Would someone tell me whether it is absolutely necessary to have a global atom for the hotkey? If not, what is the difference between the two approaches. Look at Francesco`s article regrding this
http://www.dotnet2themax.com/ShowContent.aspx?ID=103cca7a-0323-47eb-b210-c2bb7075ba78 the attom thingy well he tells it here : "you need to install the hotkey, which you do by calling the RegisterHotKey API function: this function takes a unique id, and MSDN docs explain that you should call GlobalAddAtom to get such an id. Besides, you must store this id in a form variable, because you need it later, to unregister the class and delete the global atom you created" so someone using the RegisterHotKey API function without the use of a doesn`t follow the MSDN rule for getting the unique id or doesn`t care about a good cleanup routine ( or isn`t aware that he should call GlobalAddAtom to get such an id ) regards Michel Posseth [MCP] Show quoteHide quote "Water Cooler v2" wrote: > Thanks! That is a nice tip I will surely use in the future. For now, > I'll be using the Win32 API to register the hotkey that is system-wide > because this menu-item solution, I believe: > > 1. Will not be system-wide; and > 2. Will not be able to restore the form once minimized. > > But a great tip I never thought of, really. Thanks a lot. > > > > Another related question: > > I've seen examples that use RegisterHotKey API without a global atom > and some that do add a global atom for the key in the Global Atom > database. Would someone tell me whether it is absolutely necessary to > have a global atom for the hotkey? If not, what is the difference > between the two approaches. > >
Controling Event Sequencing...
dataset and where clause Dates at Midnight Rewriting the Textbox DatagridView comboboxcolumn - assign cell value [Regular Expression] match a word with interpunctuation Getting saved values back to display after Update Serialize Treeview Control VB2003 dll Used in VB2005` Find out the MAC-Adress of a server |
|||||||||||||||||||||||