簡體   English   中英

我如何知道Delphi IDE對象檢查器在哪個監視器上?

[英]How can I tell what monitor the Delphi IDE Object Inspector is on?

這是我如何獲得Delphi IDE的主表單的后續操作 我現在正在工作。

對於想使用經典非停靠桌面布局並且可能將Object Inspector放在與主要Delphi IDE窗體不同的屏幕上的用戶,我想更進一步,將我的設計器與Object Inspector放在同一表單上。

關於在設計時程序包中如何找到對象檢查器位於哪個監視器的任何想法?

無論屬性檢查器是否對接,這都應該起作用,因為它會退回到對接案例的主要形式:

function EnumWindowsProc(hwnd: HWND; lParam: LPARAM): Integer; stdcall;
var
  ClassName: string;
  PID: Cardinal;
begin
  Result := 1;
  GetWindowThreadProcessId(hwnd, PID);
  if PID = GetCurrentProcessId then 
  begin
    SetLength(ClassName, 64);
    SetLength(ClassName, GetClassName(hwnd, PChar(ClassName), Length(ClassName)));
    if ClassName = 'TPropertyInspector' then 
    begin
      PHandle(lParam)^ := hwnd;
      Result := 0;
    end;
  end;
end;

function GetPropertyInspectorMonitor: TMonitor;
var
  hPropInsp: HWND;
begin
  hPropInsp := 0;
  EnumWindows(@EnumWindowsProc, LPARAM(@hPropInsp));
  if hPropInsp = 0 then
    hPropInsp := Application.MainFormHandle;
  Result := Screen.MonitorFromWindow(hPropInsp);
end;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM