![]() |
Exe auf eigenem Panel
Hallo,
ich hänge bei meinem Plugin-System mal wieder an einer Kleinigkeit. Mit nachfolgender Sequenz weise ich einer gestarteten Exe ein Panel als Parent zu.
Delphi-Quellcode:
MainWindowHandle ist eine eigene Funktion und bestimmt das Handle des sichtbaren Fensters in meinem Plugin.
Wnd := MainWindowHandle(ExeName);
if Wnd <>0 then begin Windows.SetParent(Wnd,aParent.Handle); SetWindowLong(wnd,GWL_STYLE,(GetWindowLong(wnd,GWL_STYLE) AND NOT WS_CAPTION) or WS_CHILD); WPM.Length:=SizeOf(WPM); GetWindowPlacement(Wnd,@WPM); WPM.ShowCmd:=SW_ShowMaximized; WPM.rcNormalPosition:=Classes.Rect(0,0,aParent.Width,aParent.Height); SetWindowPlacement(Wnd,@WPM); end; Das funktioniert auch. Allerdings sind alle Komponenten im Fenster des eingeblendeten Plugin readonly. Das Fenster kann keinen Focus erhalten. Was mache ich falsch? Mit Gruß Peter |
Re: Exe auf eigenem Panel
Interessant,
wenn ich den Parent in der Kommandozeile übergebe und die gleiche Sequenz auf der Plugin-Seite abarbeite, dann geht es. Jetzt auf der Clientseite.
Delphi-Quellcode:
procedure SetClientParent(wnd, Parent: THandle);
var WPM : TWindowPlacement; w,h : integer; begin Windows.SetParent(wnd, Parent); SetWindowLong(wnd,GWL_STYLE,(GetWindowLong(wnd,GWL_STYLE) AND NOT WS_CAPTION) or WS_CHILD); WPM.Length:=SizeOf(WPM); GetWindowPlacement(Parent,@WPM); w := wpm.rcNormalPosition.right - wpm.rcNormalPosition.left; h := wpm.rcNormalPosition.bottom - wpm.rcNormalPosition.top; WPM.ShowCmd:=SW_ShowMaximized; WPM.rcNormalPosition:=Classes.Rect(0,0,w,h); SetWindowPlacement(wnd,@WPM); end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:14 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