minimize all windows
-
i use the code to mininmize all open windows ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(415,0),0); ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(416,0),0); but the dialog box on which button to minimize all does not minmimize. that is all open windows minimize except the dialog box containing button .and i do coding on this button thanks Ashish Dogra MCA Noida
-
i use the code to mininmize all open windows ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(415,0),0); ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(416,0),0); but the dialog box on which button to minimize all does not minmimize. that is all open windows minimize except the dialog box containing button .and i do coding on this button thanks Ashish Dogra MCA Noida
why not call ShowWindow(SW_MINIMIZE)after your ::PostMessage commands?
-
why not call ShowWindow(SW_MINIMIZE)after your ::PostMessage commands?
postmessage does not take one parameter and i want to minimize all open windows not only one , thanks for your reply. Ashish Dogra MCA Noida
-
postmessage does not take one parameter and i want to minimize all open windows not only one , thanks for your reply. Ashish Dogra MCA Noida
You can accomplish this in three calls then...the PostMessage commands you have (will minimize all windows except the dialog calling it). Then use ShowWindow(SW_MINIMIZE) to minimize the current window.
-
You can accomplish this in three calls then...the PostMessage commands you have (will minimize all windows except the dialog calling it). Then use ShowWindow(SW_MINIMIZE) to minimize the current window.
thanks but it does not minimize all windows it minimize only itself and one window. and also tell me if button is on third dialog then last two dialog are not minimized Ashish Dogra MCA Noida
-
i use the code to mininmize all open windows ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(415,0),0); ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(416,0),0); but the dialog box on which button to minimize all does not minmimize. that is all open windows minimize except the dialog box containing button .and i do coding on this button thanks Ashish Dogra MCA Noida
ashish dogra wrote:
but the dialog box on which button to minimize all does not minmimize. that is all open windows minimize except the dialog box containing button
Doesn't this mean that the only window not minimized is the one with the "button" on it? At this point in your program, you only have 1 window left open? If so, call the ShowWindow now and this one window will minimize.
-
i use the code to mininmize all open windows ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(415,0),0); ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(416,0),0); but the dialog box on which button to minimize all does not minmimize. that is all open windows minimize except the dialog box containing button .and i do coding on this button thanks Ashish Dogra MCA Noida
Why not something as simple as:
keybd_event(VK_LWIN, 0, 0, 0);
keybd_event(77, 0, 0, 0);
keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0);
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
-
i use the code to mininmize all open windows ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(415,0),0); ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(416,0),0); but the dialog box on which button to minimize all does not minmimize. that is all open windows minimize except the dialog box containing button .and i do coding on this button thanks Ashish Dogra MCA Noida
That's a terrible technique. You need to check if applications have a systembox and, if so, if the minimize button is visible. Otherwise you are risking sending an application a message it specifically chooses not to handle, often triggering unexpected states in the code. earl
-
i use the code to mininmize all open windows ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(415,0),0); ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(416,0),0); but the dialog box on which button to minimize all does not minmimize. that is all open windows minimize except the dialog box containing button .and i do coding on this button thanks Ashish Dogra MCA Noida
ashish dogra wrote:
.and i do coding on this button
call PostMessage(HWND_BROADCAST,WM_SYSCOMMAND,SC_MINIMIZE,0);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You