[lazarus] BitButton in Win32

Martin Smat martin.smat at tiscali.cz
Fri Sep 5 12:36:38 EDT 2003


Hi,
   I tried to implement the bitmap buttons under win32 interface to show 
correctly the image and the button caption (now the caption is not 
displayed - it's because the button is defined with flag BS_BITMAP). It 
should be defined with flag BS_OWNERDRAW and painted in processing 
WM_DRAWITEM message.
   In WM_DRAWITEM I filled the TLMDrawItems structure. The LM_DRAWITEM 
message is processed in procedure TCustomForm.WndProc but only for 
ODT_MENU. Can this procedure be extended about processing ODT_BUTTON?
   I think something like this:
...
if CtlType = ODT_BUTTON then
begin
   CNSendMessage(LM_DRAWITEM, TObject(GetProp(hwndItem ,'WinControl')), 
Pointer(TheMessage.LParam)); { or calling an interface function - what 
would be better? }
end;
...

When processing ODT_BUTTON will be there I will make the rest and send a 
patch.

Martin Smat.






More information about the Lazarus mailing list