Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2002-12

Extending TToolButton Messages

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Smat

Hi,
In procedure TToolbar.WndProc are defined two messages (LM_INSERTTOOLBUTTON and LM_DELETETOOLBUTTON) in CNSendMessage and both messages have their second parameter (Data) nil. Can we use this parameter for something more usefull?
I suggest in case LM_INSERTTOOLBUTTON the Data be as TTBButton structure (Pointer(Message.LParam)) and in case LM_DELETETOOLBUTTON the Data be the number of deleted Toolbarbutton (@(Message.WParam)). This would be very usefull for creating toolbarbuttons in Win32 API.

Martin Smat.

Reply by email

Mattias Gaertner
to Martin Smat
Show quoted text 9 lines
Hi, In procedure TToolbar.WndProc are defined two messages (LM_INSERTTOOLBUTTON and LM_DELETETOOLBUTTON) in CNSendMessage and both messages have their second parameter (Data) nil. Can we use this parameter for something more usefull? I suggest in case LM_INSERTTOOLBUTTON the Data be as TTBButton structure (Pointer(Message.LParam)) and in case LM_DELETETOOLBUTTON the Data be the number of deleted Toolbarbutton (@(Message.WParam)). This would be very usefull for creating toolbarbuttons in Win32 API.

AFAIK both messages do not exist under Delphi. I think, we should replace them with interface calls (for readability and smart linking).

Mattias

Reply by email