i have some windows or some dialog boxes contained edit control that run concurrently. So there is just one window that active or got focus. how can we move the focus from the current active window to the other without clicked those window that i wanted tobe active ? i mean for example if the active window has a menu namely move focus and when we choosed that menu the focus must be moved to the other window that i wanted. how can we do that ?
SetFocus may be the API for you!
SetFocus will put the keyboard focus on the window provided in its only argument, and its return value is (if it succeeds) is the hwnd of the previous window to have focus. Mirno
invoke SetFocus, hOtherWindow mov hOldWindow, eax
how can i got the handle of the window that i want it tobe active ? what is the function to get the window handle especially in another instances ?
hi, use FindWindow or FindWindowEx for child windows
If you've created them yourself you already have their handles(returned by CreateWindow, CreateDialogParam,etc.. calls). If they are controls on a dialog box use GetDlgItem,hDlg,IDC_WHATEVER. Then you just have to call SetFocus and voila!
FindWindow need to know about the name of class and window name. what about if i don't know about that information or where can i find the info about class paired with the name of the window ? is there any simpler way ?