Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

Event when user does Windows Key+M ?

What event fires when the user presses Windows Key + M ? Aplication.OnMinimixe does not call for me. is there a way of trapping it in OnKeyDown or something?

Thanks, Tom.
0
boardtc
Asked:
boardtc
  • 4
  • 3
  • 2
1 Solution
 
atul_parmarCommented:
You won't get the onMinimize or any other message from the os because Window Key + M doesn't really minimize the window but functions same as when you click show desktop from taskbar.
0
 
atul_parmarCommented:
Here is one PAQ check if it works for you. because it behaves differently on different os. (me, xp, xp with sp2)
http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20340906.html
0
 
boardtcAuthor Commented:
Thanks. I tried
procedure SysCommand(var Message: TWMSYSCOMMAND); message WM_SYSCOMMAND;
as described but it was not called.

To test it, I tried the OnSize as well which was called but  SysCommand was not....

Tom.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Eddie ShipmanAll-around developerCommented:
The message sent to all windows when the Windows+M key is processed is WM_WINDOWPOSCHANGING.
Handle that message and you'll capture it.
0
 
boardtcAuthor Commented:
That message gets called at startup, how do I filter just Win+m in it?
0
 
Eddie ShipmanAll-around developerCommented:
no way.
0
 
boardtcAuthor Commented:
There is no solution for what I am trying to do then?
0
 
atul_parmarCommented:
Hi,

what'z problem with WM_SHOWWINDOW when the window is minimized its wParam has 0 so you can easily trap it.
0
 
atul_parmarCommented:
declare a message procedure e.g.
    procedure OnMinimize(var Msg : TMessage); message WM_SHOWWINDOW;
then implement it as

procedure TForm1.OnSize(var Msg: TMessage);
begin
  if Msg.WParam = 0 then
  begin
    // your implementation
  end
  else
    inherited;
end;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now