![]() |
SetWindowPos und Frames
Hallo,
hab schon Google schon fleißig bemüht, aber leider keine Lösung gefunden. Ich habe ein Frame erstellt und möchte dies gerne an einer beliebigen Stelle anzeigen. Habe dafür folgende Prozedur erstellt: procedure TFrameMyFrame.SetVisible(const Value: Boolean); var i : Integer; begin FVisible := Value; if HandleAllocated then begin if FVisible then SetWindowPos(Handle, HWND_TOPMOST, Left, Top, Width, Height, SWP_SHOWWINDOW or SWP_NOACTIVATE) else SetWindowPos(Handle, HWND_TOPMOST, Left, Top, Width, Height, SWP_HIDEWINDOW or SWP_NOACTIVATE); InvalidateRect(Handle, nil, True); end; end; Außerdem: procedure TFrameMyFrame.CreateParams(var Params: TCreateParams); begin inherited CreateParams(Params); with Params do begin Style := WS_POPUP;{ or WS_BORDER;} WindowClass.Style := WindowClass.Style or CS_SAVEBITS; ExStyle := WS_EX_TOOLWINDOW or WS_EX_NOACTIVATE; AddBiDiModeExStyle(ExStyle); end; end; Wenn ich visible auf True setze wird mir an der Stelle nur ein graues Rechteck angezeigt. Wie kann ich auch die Komponenten auf dem Frame anzeigen lassen? Ich benutze Delphi 2007. Vielen Dank schonmal. Gruß Jörg |
Re: SetWindowPos und Frames
Verstehe ich das richtig? Du willst ein TFrame als Fenster anzeigen? Warum nimmst du kein Formular? :gruebel:
|
Re: SetWindowPos und Frames
AFAIK kann ein TFrame nicht allein als Fenster agieren. Dafür gibt es TForm.
|
Re: SetWindowPos und Frames
Hallo,
ich hatte gehofft, dass ich es so schaffe, dass dem Hauptformular nicht der Fokus geklaut wird, wenn man auf das neue Fenster klickt. Funktioniert allerdings auch nicht mit einem Frame, wenn ich auf das neue Fenster klicke wird das Hauptformular trotzdem inaktiv. Wie kann ich es sonst schaffen, dass immer nur das Hauptformular aktiv ist? Ähnlich wie ein Popup. Gruß Jörg |
Re: SetWindowPos und Frames
Machs nicht anklickbar...disabled oder so.
Wenn es allerdings Controls enthält, die bedient werden sollen dann geht das nicht, ist dann allerdings auch nicht sinnvoll. Sherlock |
Re: SetWindowPos und Frames
Naja, eigentlich sollte das schon gehen:
WS_EX_NOACTIVATE Windows 2000/XP: A top-level window created with this style does not become the foreground window when the user clicks it. The system does not bring this window to the foreground when the user minimizes or closes the foreground window. To activate the window, use the SetActiveWindow or SetForegroundWindow function. Aber das funktioniert leider nicht :? Gruß Jörg |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:03 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz