Page 1 of 1

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

Posted: Wed Dec 05, 2018 3:32 pm
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!

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

Posted: Wed Dec 05, 2018 3:37 pm
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)

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

Posted: Wed Dec 05, 2018 3:43 pm
by T4r4ntul4
Just tested your snippet in my code and works perfect, thanks!!

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

Posted: Thu Dec 06, 2018 11:39 am
by Kwai chang caine
Don't know this TIPS :shock:
Thanks RSBASIC 8)