jpm Posted July 2, 2004 Share Posted July 2, 2004 Before Jon optimized/cleaned the GUI codethe following was working case WM_NOTIFY:// AUT_DEBUGMSG("==> CGuiBox::WndProc : WM_NOTIFY\n") mynmhdr=(LPNMHDR)lParam; if(mynmhdr->code==TCN_KEYDOWN) { #ifdef _DEBUG Util_DebugMsg("==> CGuiBox::WndProc : WM_NOTIFY (Vk_Control=%.8X, Vk_Tab=%.8X)\n", GetKeyState( VK_CONTROL), GetKeyState(VK_TAB)); #endif if ( (GetKeyState(VK_CONTROL)<0) && (GetKeyState(VK_TAB)<0) ) { i = (int)SendMessage(mynmhdr->hwndFrom,TCM_GETCURSEL, 0,0); if (GetKeyState(VK_SHIFT)<0) --i; else ++i; ObjAction(mynmhdr->hwndFrom, GetControlID(mynmhdr->hwndFrom), i); } }Now when Ctrl + tab are type the GetKeyState(VK_TAB) is not returning anymore a negative value.How should we handle the the notification of the ctrl-tabThanks for the help Link to comment Share on other sites More sharing options...
Holger Posted July 2, 2004 Share Posted July 2, 2004 Hi jpm I don't really know, but the MSDN says: Return Values The return value specifies the status of the given virtual key, as follows: If the high-order bit is 1, the key is down; otherwise, it is up. If the low-order bit is 1, the key is toggled. A key, such as the caps lock key, is toggled if it is turned on. The key is off and untoggled if the low-order bit is 0. A toggle key's indicator light (if any) on the keyboard will be on when the key is toggled, and off when the key is untoggled. Is it maybe possible to use a bitshift-operation to check if the key is pressed? Hmmm... Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
jpm Posted July 2, 2004 Author Share Posted July 2, 2004 Hi jpm I don't really know, but the MSDN says: Return Values The return value specifies the status of the given virtual key, as follows: If the high-order bit is 1, the key is down; otherwise, it is up. If the low-order bit is 1, the key is toggled. A key, such as the caps lock key, is toggled if it is turned on. The key is off and untoggled if the low-order bit is 0. A toggle key's indicator light (if any) on the keyboard will be on when the key is toggled, and off when the key is untoggled. Is it maybe possible to use a bitshift-operation to check if the key is pressed? Hmmm... I read all of that but that does not explain why GetKeyState(VK_TAB) return 1 or 0. I am impossibility to tocheck that the TAB was pressed Link to comment Share on other sites More sharing options...
Holger Posted July 2, 2004 Share Posted July 2, 2004 (edited) @jpm: ahhhh....I see what you mean, I tested it with another key (VK_RIGHT) and that works...hmmm... Ohhh, my mistake...VK_RIGHT is not really good for testing... Edited July 2, 2004 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
Administrators Jon Posted July 2, 2004 Administrators Share Posted July 2, 2004 I read all of that but that does not explain why GetKeyState(VK_TAB) return 1 or 0.I am impossibility to tocheck that the TAB was pressed From what I read you have to test for TAB before the IsDialogMessage() / DispatchMessage() as that swallows it up. At this point I realised that you would have to change both message pumps and it would be a major hassle and I didn't think it was worth it. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
jpm Posted July 2, 2004 Author Share Posted July 2, 2004 From what I read you have to test for TAB before the IsDialogMessage() / DispatchMessage() as that swallows it up. At this point I realised that you would have to change both message pumps and it would be a major hassle and I didn't think it was worth it.Thanks Jon,I try a simple testing before the isDialogMessage but no successif ((msg.wparam == VK_TAB) && (GetKeystate(VK_CONTROL)>0)) Link to comment Share on other sites More sharing options...
jpm Posted July 6, 2004 Author Share Posted July 6, 2004 I chek with Spy the messages sent.I cannot understand why the VK_CONTROL is Notify but not the VK_TAB?Any idea to correct that<00355> -tabctl- P WM_KEYDOWN nVirtKey:VK_CONTROL cRepeat:1 ScanCode:1D fExtended:0 fAltDown:0 fRepeat:0 fUp:0<00356> -tabctl- S WM_GETDLGCODE<00357> -tabctl- R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARS<00358> -guiwin- S WM_NOTIFY idCtrl:0 pnmh:0012FA90<00359> -guiwin- R WM_NOTIFY<00360> -tabctl- P WM_KEYDOWN nVirtKey:VK_TAB cRepeat:1 ScanCode:0F fExtended:0 fAltDown:0 fRepeat:0 fUp:0<00361> -tabctl- S WM_GETDLGCODE<00362> -tabctl- R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTCHARSNO WM_NOTIFY<00363> -editctl S WM_GETDLGCODE<00364> -editctl R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS | DLGC_WANTALLKEYS | DLGC_HASSETSEL | DLGC_WANTCHARS<00365> -editctl S EM_SETSEL nStart:0 nEnd:2147483647<00366> -editctl R EM_SETSEL<00367> -tabctl- S WM_KILLFOCUS hwndGetFocus:002B03B8<00368> -tabctl- R WM_KILLFOCUS<00369> -editctl S WM_SETFOCUS hwndLoseFocus:-tabctl-<00370> -guiwin- S .WM_CTLCOLOREDIT hdcEdit:6F010DDF hwndEdit:-editctl <00371> -guiwin- R .WM_CTLCOLOREDIT hBrush:01100061<00372> -guiwin- S .WM_CTLCOLOREDIT hdcEdit:6F010DDF hwndEdit:-editctl Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now