0

I want to minimize a specific window, say Discord for example. Would this be achievable easily, or would it be a large hassle? I am on Windows 10.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • Related: https://stackoverflow.com/questions/9858958/sendmessage-to-3-different-processes-in-c – paddy Dec 10 '21 at 04:34

1 Answers1

6

If you have the window handle, such as from FindWindow(), you can use PostMessage to send it a WM_SYSCOMMAND message with an wParam of SC_MINIMIZE.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Mark Ransom
  • 299,747
  • 42
  • 398
  • 622