Solved

Event when user does Windows Key+M ?

Posted on 2006-06-20
9
193 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
  • 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mydac connection data base issue 3 156
Communication Between RC4 Delphi <-> PHP 3 113
Using idhttp to login to instagram 2 89
can't find the executable in Simulator 1 90
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

786 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