Solved

Using PostMessage to make a TBitBtn's OnClick event fire

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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month7 days, 22 hours left to enroll

617 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