Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using PostMessage to make a TBitBtn's OnClick event fire

Posted on 2002-07-29
1
Medium Priority
?
284 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 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

721 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