Need help for 2 generic windows programming questions
-
I am learning to write Windows program by using C only. Recently, I bumped into 2 problems that I cannot solve, I tried to search the MSDN for help, but got nothing. Hopefully, somebody on this board can give some help. 1. I was designing a dialog box with controls and child windows. I want to use TAB key to navigate the dialog box, but it looks like it always go through the controls first then the child windows. I used a static control to reserve a space on the dialog for my child windows, then I created all the child windows at WM_INITDIALOG. I tried to use DS_CONTROL and WS_EX_CONTROLPARENT style for my child windows, but this only allow the TAB key to tab through the child windows AFTER all the controls on the parent windows. Any help? 2. What's the combo box style that allow the mouse move (up and down) to highlight the selection without click or hold? I saw some applications have this kind of behavior -- after open the dropdown list, move the mouse can scroll the selection. But I cannot get this effect, my mouse movement has no effect at all. Any help very be greatly appreciated. :confused:
-
I am learning to write Windows program by using C only. Recently, I bumped into 2 problems that I cannot solve, I tried to search the MSDN for help, but got nothing. Hopefully, somebody on this board can give some help. 1. I was designing a dialog box with controls and child windows. I want to use TAB key to navigate the dialog box, but it looks like it always go through the controls first then the child windows. I used a static control to reserve a space on the dialog for my child windows, then I created all the child windows at WM_INITDIALOG. I tried to use DS_CONTROL and WS_EX_CONTROLPARENT style for my child windows, but this only allow the TAB key to tab through the child windows AFTER all the controls on the parent windows. Any help? 2. What's the combo box style that allow the mouse move (up and down) to highlight the selection without click or hold? I saw some applications have this kind of behavior -- after open the dropdown list, move the mouse can scroll the selection. But I cannot get this effect, my mouse movement has no effect at all. Any help very be greatly appreciated. :confused:
I want to use TAB key to navigate the dialog box, but it looks like it always go through the controls first then the child windows. You need to place your child dialog in the correct spot in the tab order:
HWND hwndPrevCtrl = ...; // Set this to the control that comes right before the child dialog
SetWindowPos ( hwndChildDlg, hwndPrevCtrl, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE );
This resets the child dialog's position in the Z-order, which for dialogs is also the tab order. --Mike-- http://home.inreach.com/mdunn/ Time is an illusion. Lunch time, doubly so.
-
I am learning to write Windows program by using C only. Recently, I bumped into 2 problems that I cannot solve, I tried to search the MSDN for help, but got nothing. Hopefully, somebody on this board can give some help. 1. I was designing a dialog box with controls and child windows. I want to use TAB key to navigate the dialog box, but it looks like it always go through the controls first then the child windows. I used a static control to reserve a space on the dialog for my child windows, then I created all the child windows at WM_INITDIALOG. I tried to use DS_CONTROL and WS_EX_CONTROLPARENT style for my child windows, but this only allow the TAB key to tab through the child windows AFTER all the controls on the parent windows. Any help? 2. What's the combo box style that allow the mouse move (up and down) to highlight the selection without click or hold? I saw some applications have this kind of behavior -- after open the dropdown list, move the mouse can scroll the selection. But I cannot get this effect, my mouse movement has no effect at all. Any help very be greatly appreciated. :confused:
What's the combo box style that allow the mouse move (up and down) to highlight the selection without click or hold? You need to write and write code using the message WM_MOUSEMOVE. I'm Sorry.:-O Carlos Antollini.