Solved

Using PostMessage to make a TBitBtn's OnClick event fire

Posted on 2002-07-29
1
274 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 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