Fenster Frage
-
Hallo Zusammen,
wie muss ich ein Fenster initialisieren, dass man seine Größe nicht ändern kann?
Und wie bring ich das Fenster bei einem bestimmten Event in den Vordergrund?
-
Also wenn ein Fenster seine größe nicht verändern soll dann darf das Fenster nicht WS_SIZEBOX oder WS_THICKFRAME als Style haben (so lies ich das aus der MSDN)
Für in den Vordergrund probier mal SetForegroundWindow(...);[edit] Nur so für die Zukunft, den Titel kann man noch ein bissel besser wählen
[\edit]
MfG schirrmie
-
mr. tompkins schrieb:
Hallo Zusammen,
wie muss ich ein Fenster initialisieren, dass man seine Größe nicht ändern kann?Bzw.: http://msdn2.microsoft.com/en-us/library/ms632626.aspx
-
Danke für die schnelle Antwort.
Die Sache mit der Größenänderung hat funktioniert aber mit SetForegroundWindow blinkt das Fenster in der Taskleiste kommt aber nicht in den Vordergrund.
-
mr. tompkins schrieb:
aber mit SetForegroundWindow blinkt das Fenster in der Taskleiste kommt aber nicht in den Vordergrund.
MSDN schrieb:
Windows 98/Me: The system restricts which processes can set the foreground window. A process can set the foreground window only if one of the following conditions is true:
- The process is the foreground process.
- The process was started by the foreground process.
- The process received the last input event.
- There is no foreground process.
- The foreground process is being debugged.
- The foreground is not locked (see LockSetForegroundWindow).
- The foreground lock time-out has expired (see SPI_GETFOREGROUNDLOCKTIMEOUT in SystemParametersInfo).
- Windows 2000/XP: No menus are active.
With this change, an application cannot force a window to the foreground while the user is working with another window. Instead, Foreground and Background Windows will activate the window (see SetActiveWindow) and call the function to notify the user.
Das ist IMHO eine Art Schutzmechanismus, damit Du mit Deinem Programm dem Benutzer nicht einfach auf die Nerven gehen kannst, in dem Du Dein Programm(-fenster) immer in den Vordergrund holst. Wie siehts mit SetActiveWindow aus?
-
CodeFinder schrieb:
. Wie siehts mit SetActiveWindow aus?
Funktionioniert komischerweise einmal danach nichtmehr.
-
Hmm dann probiers mal mit SetWindowPos in Verbindung mit HWND_TOP.
