How to send keystroke: 'Windows key + M' to Windows?

Just starting out? Need help? Post your questions and find answers here.
T4r4ntul4
Enthusiast
Enthusiast
Posts: 119
Joined: Tue Mar 04, 2014 4:15 pm
Location: Netherlands

How to send keystroke: 'Windows key + M' to Windows?

Post by T4r4ntul4 »

Hi all,

I have searched alot on this forum but cant really find what iam looking for.
I just need to send the keystroke 'Windows key + M' to Windows, for minimizing all windows on the pc.

I saw posts who were sending one key, but not both keys at the same time.

How can i do that?

Any help is very appreciated!
User avatar
RSBasic
Moderator
Moderator
Posts: 1228
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: How to send keystroke: 'Windows key + M' to Windows?

Post by RSBasic »

You can simulate the keys with keybd_event_(), but for minimizing you can also execute the code:

Code: Select all

SendMessage_(FindWindow_("Shell_TrayWnd", ""), #WM_COMMAND, #MIN_ALL, 0)
Image
Image
T4r4ntul4
Enthusiast
Enthusiast
Posts: 119
Joined: Tue Mar 04, 2014 4:15 pm
Location: Netherlands

Re: How to send keystroke: 'Windows key + M' to Windows?

Post by T4r4ntul4 »

Just tested your snippet in my code and works perfect, thanks!!
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: How to send keystroke: 'Windows key + M' to Windows?

Post by Kwai chang caine »

Don't know this TIPS :shock:
Thanks RSBASIC 8)
ImageThe happiness is a road...
Not a destination
Post Reply