MessageBox verschwindet einfach im Hintergrund
-
Hallo,
ich habe ein Programm geschrieben, dass am Anfang eine InputBox, danach eine MessageBox und dann noch eine MessageBox ausgibt. Doch die 2. MessageBox, die das Programm darstellen soll, schickt Windows einfach in den Hintergrund, warum? Das heißt, wenn ich mein Programm aus dem Explorer heraus starte dann muss ich bei der 2. MessageBox den Explorer erst minimieren um diese zu sehen.
Warum passiert das und wie kann ich das umgehen?Thx im voraus!
-
Hi,
bin mir nicht sicher, aber du koenntest versuchen, bei dem letzten Paramter von Message Box zusaetzlich MB_SETFOREGROUND und/oder MB_TOPMOST zu verwenden.
MB_SETFOREGROUND sollte eigentlich den gewuenschten Effekt bringen, da es das Fenster (die MessageBox) in den Vordergrund holt.Gruss,
DeSoVoDaMu
-
du musst ein parent für die msg box angeben.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/dialogboxes/dialogboxreference/dialogboxfunctions/messagebox.aspansonsten kannst du a bissi mit der parametern spielen
msdn schrieb:
MB_APPLMODAL
The user must respond to the message box before continuing work in the window identified by the hWnd parameter. However, the user can move to the windows of other threads and work in those windows.Depending on the hierarchy of windows in the application, the user may be able to move to other windows within the thread. All child windows of the parent of the message box are automatically disabled, but popup windows are not.
MB_APPLMODAL is the default if neither MB_SYSTEMMODAL nor MB_TASKMODAL is specified.
MB_SYSTEMMODAL
Same as MB_APPLMODAL except that the message box has the WS_EX_TOPMOST style. Use system-modal message boxes to notify the user of serious, potentially damaging errors that require immediate attention (for example, running out of memory). This flag has no effect on the user's ability to interact with windows other than those associated with hWnd.
MB_TASKMODAL
Same as MB_APPLMODAL except that all the top-level windows belonging to the current thread are disabled if the hWnd parameter is NULL. Use this flag when the calling application or library does not have a window handle available but still needs to prevent input to other windows in the calling thread without suspending other threads.To specify other options, use one or more of the following values.
-
Ok, dankeschön!