Solved

Event when user does Windows Key+M ?

Posted on 2006-06-20
9
195 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:tomcorcoran
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:tomcorcoran
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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:tomcorcoran
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:tomcorcoran
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 50 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 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