Solved

Using PostMessage to make a TBitBtn's OnClick event fire

Posted on 2002-07-29
1
270 Views
Last Modified: 2010-04-16
Hi,

I have a TBitBtn, is it possible to programmatically make its OnClick event fire with PostMessage (without the user actually clicking on the button)?  If so, could you please give me an example.

I would like to use PostMessage rather than calling OnClick directly so it adds it to the message queue rather than firing it immediately in the current event.

Thanks in Advance,

Richard
0
Comment
Question by:Richard2000
1 Comment
 
LVL 12

Accepted Solution

by:
Lee_Nover earned 50 total points
ID: 7185507
sure

PostMessage(ButtonHandle, WM_LBUTTONDOWN, 0, 0);
PostMessage(ButtonHandle, WM_LBUTTONUP, 0, 0);

where ButtonHandle is the buttons handle
eg. Button1.Handle

:)
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now