2

I am trapping WM_SYSCOMMAND messages in WinForm in a C# application for reasons that are not relevant. Sometimes, my handler receives a WM_SYSCOMMAND message with the wParam 0xF063.

There is no 0xF063 in the documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/ms646360(v=vs.85).aspx

Passing it to the base Form class's WndProc seems to close the window which I suppose makes sort-of sense as the wParam is almost 0xF060, the SC_CLOSE message.

So... what exactly is this 0xF063 message and what distinguishes it from the normal SC_CLOSE? Why even have it if it seems to do the exact same thing as SC_CLOSE? There seems to be no documentation regarding this value.

KatDevsGames
  • 1,109
  • 10
  • 21
  • Does this help: #define SC_CLOSE_OPEN 61539 // 0xF063 Close and Popup already opened, see https://github.com/manuelcalerosolis/Gestool/blob/master/prg/Window.prg – Samuel Dec 27 '14 at 19:13
  • What does "Close and Popup already opened" mean though (as opposed to simply "Close")? – KatDevsGames Dec 28 '14 at 15:17

1 Answers1

7

Yes, it is the SC_CLOSE command. From the MSDN article for WM_SYSCOMMAND:

In WM_SYSCOMMAND messages, the four low-order bits of the wParam parameter are used internally by the system. To obtain the correct result when testing the value of wParam, an application must combine the value 0xFFF0 with the wParam value by using the bitwise AND operator.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536