Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do I create a keyboard shortcut to do this "show all windows" option?

take it as a general question given a tray icon right clicking it and going through submenus, i'd like to speed up the process and make a shortcut to this option.

and it is possible in theory. if something could for example record what setting the option changes.. and assign a keyboard shortcut to it.

alt text

share|improve this question
    
What app is providing that menu? –  Doug Harris Dec 17 '10 at 18:27
    
What's wrong with Alt+Tab or (if the OS is new enough) "Windows key" + tab? Please give us more information like Doug Harris is talking about. –  David Dec 17 '10 at 18:40
    
@Doug Harris Rainlendar. Can autohotkeys not do it? There is no minimize button, it uses one of those special skins.. and doesn't appear in alt-tab menu. there are probably quite a few apps like it. If there was a way to go through the menu as mentioned with a shortcut, that'd be a solution regardless of app. but if you know of another solution, that's not quite as good but if it works and there's no better one then fine. I don't mind you stating it in comment before knowing what app it is, since it may be of use to know. –  barlop Dec 18 '10 at 2:16
    
@David it's not even in Alt+Tab see comment above to Doug. –  barlop Dec 18 '10 at 2:16

1 Answer 1

up vote 3 down vote accepted

AutoHotkey has PostMessage and SendMessage commands that can send internal "messages" to windows or controls. Often programs use these types of messages for their menu commands. To find out the proper message values you need, you use a program like Winspector to log messages of possible interest.

For more information, see SendMessage Tutorial.

(This tutorial is also buried in the AutoHotkey help file: go to the bottom of the PostMessage/SendMessage page, and in the Related links, click on Message Tutorial.)


The program pictured in Barlop's question is Rainlendar.

Using the methods from the tutorial above, I made the following example AutoHotkey script that sets F11 to "Hide all windows" and F12 to "Show all windows".

WM_COMMAND := 0x111
SHOW_ALL := 598
HIDE_ALL := 599

DetectHiddenWindows, On

#IfWinExist Rainlendar2 Control Window ahk_class wxWindowClassNR

F11::
  window_id := WinExist("Rainlendar2 Control Window ahk_class wxWindowClassNR")
  PostMessage, %WM_COMMAND%,%HIDE_ALL%,,,ahk_id %window_id%
Return

F12::
  window_id := WinExist("Rainlendar2 Control Window ahk_class wxWindowClassNR")
  PostMessage, %WM_COMMAND%,%SHOW_ALL%,,,ahk_id %window_id%
Return

share|improve this answer
1  
(D'oh. Rainlendar has its own hotkey settings: OptionsHotkeys) –  Bavi_H Dec 18 '10 at 5:39
    
thanks, i'm using the hotkeys within rainlendar now but it'd be good to have the autohotkeys script working with rainlendar too. i'm not that familiar with autohotkeys , but I just saved that code as .ahk and double clicked it, it looks like it's loaded in autohotkeys. I am trying F11 and F12 but nothing happens. –  barlop Dec 18 '10 at 15:27
    
I just downloaded Rainlendar yesterday to play around with it. Perhaps the window name or command numbers are different in your version. You can try downloading the latest version of Rainlendar, or try using Winspector to find the values your version uses. –  Bavi_H Dec 19 '10 at 0:05
    
just tried your script on another computer and it worked first time.. tried it again on the funny one and it worked straight away.. so I guess I just copy/pasted wrong.. Great stuff. –  barlop Dec 19 '10 at 7:09
    
@Bavi_H By the way, out of interest, does that work by sending a message to the tray icon? or to the window that appears on the desktop? Is it to your knowledge possible to send it to the tray icon? –  barlop Dec 19 '10 at 7:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.