focusing messagebox
-
I'm trying to force a message box to keep keyboard and mouse focus at all times that way the user cannot do anything else until they finish with my program. The console window is hidden and only message boxes are the only thing visible. I'm using Dev-Cpp 4.9.9.2 and Windows XP and sometimes Vista.
-
I'm trying to force a message box to keep keyboard and mouse focus at all times that way the user cannot do anything else until they finish with my program. The console window is hidden and only message boxes are the only thing visible. I'm using Dev-Cpp 4.9.9.2 and Windows XP and sometimes Vista.
-
"There used to be a dialog box style (DS_SYSMODAL) that created a dialog box in system modal mode. But it is only there for compatibility with 16bit windows and doesn't prevent the user from clicking other items on the desktop. So I guess you will have to intercept the mouse messages. But even then the user will be able to move through dialogs using the Alt+Tab combination. So you better look at How to Disable Task Switching." Judging from that bit of information Modal dialog boxes would not work effectively.
-
"There used to be a dialog box style (DS_SYSMODAL) that created a dialog box in system modal mode. But it is only there for compatibility with 16bit windows and doesn't prevent the user from clicking other items on the desktop. So I guess you will have to intercept the mouse messages. But even then the user will be able to move through dialogs using the Alt+Tab combination. So you better look at How to Disable Task Switching." Judging from that bit of information Modal dialog boxes would not work effectively.
You can never block Ctrl+Alt+Delete.
«_Superman_» I love work. It gives me something to do between weekends.
-
You can never block Ctrl+Alt+Delete.
«_Superman_» I love work. It gives me something to do between weekends.
No, but I can use BlockInput() to stop all keyboard and mouse use except Ctrl+Alt+Del. I have also been able to have a program repeatedly use BlockInput() so even if the user opens task manager they still can't do anything. But that is besides the point
-
No, but I can use BlockInput() to stop all keyboard and mouse use except Ctrl+Alt+Del. I have also been able to have a program repeatedly use BlockInput() so even if the user opens task manager they still can't do anything. But that is besides the point
I don't think that is a good idea. My first thought would be to uninstall the application.
«_Superman_» I love work. It gives me something to do between weekends.
-
"There used to be a dialog box style (DS_SYSMODAL) that created a dialog box in system modal mode. But it is only there for compatibility with 16bit windows and doesn't prevent the user from clicking other items on the desktop. So I guess you will have to intercept the mouse messages. But even then the user will be able to move through dialogs using the Alt+Tab combination. So you better look at How to Disable Task Switching." Judging from that bit of information Modal dialog boxes would not work effectively.
I remember that long before I've done that in VB but that's a decade before :P. System-Modal concept is obsolete now in the 32Bit world. You cannot do that. MSDN: NOTE: An equivalent Win32 API function for SetSysModalWindow does not exist. System modal windows contradict the concept of multitasking and thus are not implemented in Win32. May be you can maximize your app screen & make that stay on top of every window.
SetWindowPos(&this->wndTopMost..
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
-
I'm trying to force a message box to keep keyboard and mouse focus at all times that way the user cannot do anything else until they finish with my program. The console window is hidden and only message boxes are the only thing visible. I'm using Dev-Cpp 4.9.9.2 and Windows XP and sometimes Vista.
I don't think you can "keep" the keyboard and mouse focus all times, but you can however keep your message-box on top of other windows by displaying it as system-modal.
It is a crappy thing, but it's life -^ Carlo Pallini
-
I don't think you can "keep" the keyboard and mouse focus all times, but you can however keep your message-box on top of other windows by displaying it as system-modal.
It is a crappy thing, but it's life -^ Carlo Pallini
Well I haven't actually taken any classes so I don't know how to define all the parameters to make a modal box. If you would be so gracious as to get me going feel free.
-
Well I haven't actually taken any classes so I don't know how to define all the parameters to make a modal box. If you would be so gracious as to get me going feel free.
Well, I am not sure if you just need a modal message box[^] or you would want to keep your application window system modal. If you just need a system modal message box:
::MessageBox(NULL, _T("Message text goes here"), _T("Messagebox Title"), MB_SYSTEMMODAL);
The
MB_SYSTEMMODAL
flag specify that the message box should be system modal (on top of all other windows, until dismissed). If it's your application that you want to set on top of other windows, you could call SetWindowPos()[^] and passHWND_TOPMOST
as the second parameter.It is a crappy thing, but it's life -^ Carlo Pallini