The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: msmith on July 22, 2006, 07:55:48 PM

Title: WM_SYSCOMMAND return codes
Post by: msmith on July 22, 2006, 07:55:48 PM
I was trying to trap SC_MOVE and SC_SIZE today using 0f010h and 0f000h and having no success.

I put a message in the code and found that move returns 0f012h while size returns 0f006h. The other codes I tried (WM_CLOSE etc.) matched windows.inc and winuser.h

I am using XP home version.
Title: Re: WM_SYSCOMMAND return codes
Post by: zooba on July 23, 2006, 12:41:10 AM
Quote from: MSDNIn 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.

Cheers,

Zooba :U
Title: Re: WM_SYSCOMMAND return codes
Post by: msmith on July 23, 2006, 01:05:17 AM
zooba,

Thanks.

Your quoted text was in the remarks section of my page.

It is unusual though that you cannot take declared constants at face value without processing.

Mike
Title: Re: WM_SYSCOMMAND return codes
Post by: zooba on July 23, 2006, 01:18:42 AM
Quote from: msmith on July 23, 2006, 01:05:17 AM
Your quoted text was in the remarks section of my page.

It is unusual though that you cannot take declared constants at face value without processing.

That's where it was in mine also. It pays to read the remarks section before using a new API, though in this case it probably should be in the parameter description.
Title: Re: WM_SYSCOMMAND return codes
Post by: msmith on July 23, 2006, 02:02:15 AM
I have been using that API for over 3 years. All of the other constants that I ever used never had any of the 4 lower bits turned on. Just lucky.. or unlucky depending on how you look at it. No one ever accused MS of consistancy.