The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Ratch on May 28, 2006, 03:57:40 AM

Title: WM_MEASUREITEM
Post by: Ratch on May 28, 2006, 03:57:40 AM
To the Ineffable All,
     I don't receive a WM_MEASUREITEM when I do a CreateWindow for a "button" window.  Its style is BS_OWNERDRAW OR WS_VISIBLE OR WS_CHILD.  I see a lot of blab on the web about a bug or something in regard to this message, but the solution has such a heavy C++/MFC flavor that I cannot understand it.  Does anyone know a workaround using MASM?  Ratch
Title: Re: WM_MEASUREITEM
Post by: zooba on May 28, 2006, 05:47:34 AM
According to MSDN, "The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created".

For an ownerdrawn button, the owner window will receive WM_DRAWITEM.

Hope this helps,

Zooba :U
Title: Re: WM_MEASUREITEM
Post by: Ratch on May 28, 2006, 09:37:14 PM
zooba,

Quote
According to MSDN, "The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created".

For an ownerdrawn button, the owner window will receive WM_DRAWITEM.

     I do indeed receive a WM_DRAWITEM. But I expect to receive a WM_MEASUREITEM for my owner-drawn button according to the quote from the following MS link.  Ratch

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceshellui5/html/wce50lrfwmmeasureitem.asp

Quote
This message is sent to the owner window of an owner-drawn button or menu item when the control or menu is created.
Title: Re: WM_MEASUREITEM
Post by: KSS on May 29, 2006, 10:02:01 AM
I open page http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceshellui5/html/wce50lrfwmmeasureitem.asp
At up of the page (on blue background) write some interecting:
"Platform Builder for Microsoft Windows CE 5.0"
Title: Re: WM_MEASUREITEM
Post by: Ratch on May 30, 2006, 01:02:28 AM
KSS,

     Right you are.  It appears that CE 5.0 has more freatures for that API than XP does.  Ratch
Title: Re: WM_MEASUREITEM
Post by: zooba on May 30, 2006, 12:52:53 PM
Quote from: Ratch on May 30, 2006, 01:02:28 AM
Right you are.  It appears that CE 5.0 has more freatures for that API than XP does.  Ratch

Or more accurately, Microsoft had a chance to change the behaviour of their API without breaking older applications.

Read The Old New Thing (http://blogs.msdn.com/oldnewthing/). Raymond talks a lot about the compatibility issues Microsoft deal with.

Cheers,

Zooba :U