|
-
Oct 19th, 2001, 04:56 PM
#1
Thread Starter
Frenzied Member
Press Button on Key Press
In this program, the 'X' key is registered using RegisterHotKey( )
and the form is subclassed to process the message when
the 'X' key is pressed. How can I show a button press of the button
on the form when the key is pressed? I tried to SendMessage( )
WM_LBUTTONDOWN and WM_LBUTTONUP, but that is done so
fast that the keypress can't be seen. This is a poor solution.
Any Ideas?
-
Oct 20th, 2001, 11:59 AM
#2
So you're trying to graphically display a button being pressed? Why not send the BM_SETSTATE message? Just pause for about 100 milliseconds between the 2 messages so that you can see it.
-
Oct 20th, 2001, 12:27 PM
#3
Thread Starter
Frenzied Member
Use a timer? Yeah, that works.
Is there a better way?
-
Oct 21st, 2001, 10:32 AM
#4
No, don't use the Timer componet. What I meant was create your own pause routine e.g.
VB Code:
Sub Pause(amount As Integer)
Start = Timer
Do While Timer < Start + amount
DoEvents
Loop
End Sub
Then to pause for 100 ms, you would use:
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|