Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 623723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:07:25+00:00 2026-05-13T19:07:25+00:00

I have a simple winforms application in VB.NET 2008. I am using a form

  • 0

I have a simple winforms application in VB.NET 2008. I am using a form with a completely custom look, so there is no title bar, thus no minimize, maximize, and close buttons. I’ve created custom controls to replace those.

If I have my app running, and I click the ‘Show Desktop’ shortcut, all the programs minimize properly, including mine. But, if I use the Windows + M shortcut, all the programs EXCEPT mine minimize. It seems that the lack of the built-in minimize button on the form causes my app to ignore Windows + M.

How can I detect Windows + M, especially if my app is not active, or how can I duplicate the functionality of the built-in Minimize button?

EDIT:

I’ve tried implementing the following code, with no success.

Const WM_SIZE As Integer = &H5
Const SIZE_MINIMIZED As Integer = &H1

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
  MyBase.WndProc(m)

  If m.Msg = WM_SIZE Then
     If m.WParam = SIZE_MINIMIZED Then
        //Minimize the form.
        Me.WindowState = FormWindowState.Minimized
     End If

  End If
End Sub

This seems like the right approach (thanks to SLaks), but my app doesn’t seem to be receiving any messages from Windows + M. Or, more likely, I’m not intercepting them properly.

EDIT:

I’ve checked out the messages that my app is receiving with Spy++ (thanks again SLaks) and it looks like the WM_SIZE message is not getting sent to my app. I tried a regular winforms app with the standard title bar and buttons, and it receives the WM_SIZE message as expected when Windows + M is pressed. Somehow the lack of a title bar is preventing the WM_SIZE message from being received in my custom form’s WndProc.

EDIT:

The more I dig into this, the more that I think there may not be a way around this behavior. I’ve confirmed that if the form does not have a border, no WM_SIZE message is received. The developer sitting next to me uses C++ in Qt, and the exact same behavior is exhibited: No form/window border = no message to minimize when Windows + M is pressed.
Windows + D does work to minimize everything, but I believe that is a duplicate of the Show Desktop button.

I’m coming to the conclusion that if a form has no border, Windows does not even generate a message, thus there is no way to intercept it. I’ve noticed that Windows Media Player exhibits this same behavior. When it is in skinned mode, Windows + M does not minimize it.

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:07:26+00:00Added an answer on May 13, 2026 at 7:07 pm

    Use Spy++ to check which Windows messages your app receives when Window+M is pressed, then check for that message in your form’s WndProc and minimze the form.

    It appears that Windows+M sends a WM_SIZE message with wParam set to SIZE_MINIMIZED.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 393k
  • Answers 393k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The .NET generics implementation can handle such a scenario easily… May 15, 2026 at 1:57 am
  • Editorial Team
    Editorial Team added an answer see Running a Package Programmatically on the Local Computer from… May 15, 2026 at 1:57 am
  • Editorial Team
    Editorial Team added an answer The fmt:message has a var attribute as well which does… May 15, 2026 at 1:57 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.