ok, I can simulate hardware key:

press down:
keybd_event(VK_F1, MapVirtualKey(VK_F1, 0), KEYEVENTF_SILENT, 0);

press (push) up:
keybd_event(VK_F1, MapVirtualKey(VK_F1, 0),
KEYEVENTF_SILENT|KEYEVENTF_KEYUP, 0);


BUT how to simulate that I press and hold the key down? Just longer.

I tried to separate the two of the above lines with timer and execute the
second after the specified timer - DONT WORK of course
I tried to execute the first of above lines multipled - DONT WORK

any suggestions?

Re: simulate hardware key pressed by Mobile

Mobile
Wed Jan 21 14:20:44 CST 2004

Try setting the second parameter to zero instead of passing a scan code.

Stephan
--
Stephan Sutter [MSFT]
Software Developer Shell UI
Mobile Devices Product Group

This information is provided "AS IS" with no warranties, and confers no
rights.

---------------------------------------------------------------------
"JGUI" <jginfo@infonet.com.pl> wrote in message
news:uJvSVuC3DHA.1632@TK2MSFTNGP12.phx.gbl...
> ok, I can simulate hardware key:
>
> press down:
> keybd_event(VK_F1, MapVirtualKey(VK_F1, 0), KEYEVENTF_SILENT, 0);
>
> press (push) up:
> keybd_event(VK_F1, MapVirtualKey(VK_F1, 0),
> KEYEVENTF_SILENT|KEYEVENTF_KEYUP, 0);
>
>
> BUT how to simulate that I press and hold the key down? Just longer.
>
> I tried to separate the two of the above lines with timer and execute the
> second after the specified timer - DONT WORK of course
> I tried to execute the first of above lines multipled - DONT WORK
>
> any suggestions?
>
>