Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Event when user does Windows Key+M ?

Posted on 2006-06-20
9
Medium Priority
?
200 Views
Last Modified: 2010-04-05
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
Comment
Question by:boardtc
  • 4
  • 3
  • 2
9 Comments
 
LVL 10

Expert Comment

by:atul_parmar
ID: 16943621
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
 
LVL 10

Expert Comment

by:atul_parmar
ID: 16943689
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
 

Author Comment

by:boardtc
ID: 16943845
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 26

Expert Comment

by:EddieShipman
ID: 16946743
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
 

Author Comment

by:boardtc
ID: 16950358
That message gets called at startup, how do I filter just Win+m in it?
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 16952144
no way.
0
 

Author Comment

by:boardtc
ID: 16958170
There is no solution for what I am trying to do then?
0
 
LVL 10

Expert Comment

by:atul_parmar
ID: 16958219
Hi,

what'z problem with WM_SHOWWINDOW when the window is minimized its wParam has 0 so you can easily trap it.
0
 
LVL 10

Accepted Solution

by:
atul_parmar earned 200 total points
ID: 16958232
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

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question