Solved

Using PostMessage to make a TBitBtn's OnClick event fire

Posted on 2002-07-29
1
281 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
[X]
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
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

734 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