Sorry, I forgot to mention one thing:

I had added SetForegroundWindow(), SetActiveWindow() and SetFocusAPI()
to switch focus from the receiver back to the sender's hWnd.

If I didn't reset the focus/activewindow/foreground, the example codes
worked flawlessly.

On Wed, Mar 7, 2012 at 11:22 PM, Man-wai Chang <chan...@gmail.com> wrote:
> I found the original MSDN article suggesting your method.
> http://social.msdn.microsoft.com/Forums/en/visualfoxprogeneral/thread/f46be74c-c3b9-4c71-b1b5-d648626ca744
>
> I copied the codes from that MSDN.
>
> First time I hit the button, the keybd_event() worked.
> Then on the next button push to activate keybd_event() again, no response.
> Then I pushed the button again, it worked.
> And the things repeated.

-- 
 .~. Might, Courage, Vision. SINCERITY!
/ v \ 64-bit Ubuntu 9.10 (Linux kernel 2.6.39.3)
/( _ )\ http://sites.google.com/site/changmw
^ ^ May the Force and farces be with you!

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/CAGv=mjd0x0oyjexqr__lnwmge5y-divmcumb8bmvqfevjhu...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to