EDN Admin
Well-known member
I need to emulate pressing <F5> by using PostMessage. But I cant find out how to get the Repeat=1 and the ScanCode=3F.
Here is latest code:
unsigned
vk = 0x3f;
unsigned
scan = MapVirtualKey(vk, 0);
LPARAM lparam = 0x00000001 | (LPARAM)(scan << 16);
// Scan code, repeat=1
PostMessage(focus_1st_child_handler, WM_KEYDOWN, vk, lparam);
// Key down
PostMessage( color_mode_handler, WM_KEYUP, VK_F5, 0);
//
Here is what I need to send (it is the SPI log of when the <F5> is pressed when running the target program:
<
00003> 00040CD4 P WM_KEYDOWN nVirtKey:VK_F5 cRepeat:1 ScanCode:3F fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<
00004> 00070524 P WM_KEYUP nVirtKey:VK_F5 cRepeat:1 ScanCode:3F fExtended:0 fAltDown:0 fRepeat:1 fUp:1
software developer
View the full article
Here is latest code:
unsigned
vk = 0x3f;
unsigned
scan = MapVirtualKey(vk, 0);
LPARAM lparam = 0x00000001 | (LPARAM)(scan << 16);
// Scan code, repeat=1
PostMessage(focus_1st_child_handler, WM_KEYDOWN, vk, lparam);
// Key down
PostMessage( color_mode_handler, WM_KEYUP, VK_F5, 0);
//
Here is what I need to send (it is the SPI log of when the <F5> is pressed when running the target program:
<
00003> 00040CD4 P WM_KEYDOWN nVirtKey:VK_F5 cRepeat:1 ScanCode:3F fExtended:0 fAltDown:0 fRepeat:0 fUp:0
<
00004> 00070524 P WM_KEYUP nVirtKey:VK_F5 cRepeat:1 ScanCode:3F fExtended:0 fAltDown:0 fRepeat:1 fUp:1
software developer
View the full article