![]() |
|
Модераторы: feodorv, GremlinProg, xvr, Fixin |
![]()
|
|
| Ivanych |
|
|||
|
Unregistered |
Коллеги!
We have main application window (hWnd) which has 4 child windows. hWnd has WS_EX_CONTROLPARENT style set and its child windows have WS_TABSTOP style. We also create another overlapped (not child) window (hwndExtra) which also has one child window (hwndShow). We want focus to be switched between main window children when we press TAB key. And we want accelerators to work properly. But situation is not clear... See what we get- ------------------------------------------- SITUATION 1 (standart message loop used) // Main message loop: while (GetMessage(&msg, NULL, 0, 0)) { if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg) { TranslateMessage(&msg); DispatchMessage(&msg); } } Accelerators work in extra window and in main window, but they do not work if focus is set to one of the main window children. TAB key does not work. ------------------------------------------- SITUATION 2 (we use hWnd instead of msg.hwnd) // Main message loop: while (GetMessage(&msg, NULL, 0, 0)) { if (!TranslateAccelerator(hWnd, hAccelTable, &msg) { TranslateMessage(&msg); DispatchMessage(&msg); } } Accelerators now work in main window even when focus set to a child window. TAB key also works. BUT! Accelerators do not work in extra window, even if it has focus. ------------------------------------------- SITUATION 3 (modified message loop) // Main message loop: while (GetMessage(&msg, NULL, 0, 0)) { if (!TranslateAccelerator(hWnd, hAccelTable, &msg) || !TranslateAccelerator(hwndExtra, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } Aceelerators work fine for all windows, but TAB key in main window does not work!!! Any ideas? |
|||
|
||||
![]()
|
| Правила форума "C/C++: Системное программирование и WinAPI" | |
|
|
На данный раздел распространяются Правила форума и Правила раздела С++:Общие вопросы . Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Chipset, Step, Fixin, GremlinProg, xvr. feodorv. |
| 0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей) | |
| 0 Пользователей: | |
| « Предыдущая тема | C/C++: Системное программирование и WinAPI | Следующая тема » |
|
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |