I have something for you. This might help you. The following is the code for F11 and F12. After applying your F11 and F12 button will function as you were wishing it to work. Just do the adjustments in your source code as I have suggested below:
Code:
HWND handles[10];
int i;
BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam) { return (BOOL)(handles[i++] = hwnd); }
LRESULT CALLBACK WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
...
case WM_KEYDOWN:
{
if (wParam == VK_F11)
{
EnumChildWindows(hMU, EnumChildProc, 0);
i = 0;
}
else if (wParam == VK_F12)
{
POINT pt;
pt.x = 100;
pt.y = 100;
ScreenToClient(hMU, &pt);
SendMessage(handles[i], WM_RBUTTONDOWN, 0, MAKELPARAM(pt.x, pt.y));
SendMessage(handles[i++], WM_RBUTTONUP, 0, MAKELPARAM(pt.x, pt.y));
}
else if (wParam == VK_F1)
{
char index[2];
sprintf(index, "%d", i);
MessageBox(NULL, index, NULL, 0);
}
break;
Bookmarks