How do I send/post messages?

Posted on 1998-10-31
Last Modified: 2010-08-05
I have a main form with 3 panels. I would like one panel to send a new WM message to the other panels.
I found some help about adding event handlers but I don't know how to actually send the message (after filling the lParam and wParam parametrs).
An example would be very helpful.

Question by:tommyq
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Author Comment

ID: 1345175
Edited text of question

Accepted Solution

ZifNab earned 50 total points
ID: 1345176
Hi tommyq,

you can use PostMessage or SendMessage.

SendMessage waits until message is processed, postmessage puts the message in the qeue and returns.

With Objects you can also use Perform. (like sendmessage, it waits until message is processed) :

RetVal := ObjectName.Perform(MessageID, wParam, lParam);


 SendMessage(hWnd, MessageID, wParam, lParam);

 PostMessage(hWnd, MessageID, wParam, lParam);

Regards, Zif.

Author Comment

ID: 1345177
Thanks for your prompt reply, ZifNab.

How do I get the hWnd of a certain control?


Expert Comment

ID: 1345178
Hi tommyq,

eg. Form1.Handle

Regards, Zif.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help on project with Soap 10 70
QRReport  TQrmemo vertical stretching 1 67
Microsoft Access 97 and Delphi XE2 9 85
Delphi android app hide keyboard 3 83
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question