アプリケーションが常に左のモニタから開始されるようにしたい(1つ以上の接続がある場合)。Delphi - 左のモニタで開いているフォーム
どうすればいいですか?どのように左のモニタ番号を検出するのですか?
ありがとうございます!
アプリケーションが常に左のモニタから開始されるようにしたい(1つ以上の接続がある場合)。Delphi - 左のモニタで開いているフォーム
どうすればいいですか?どのように左のモニタ番号を検出するのですか?
ありがとうございます!
私たちは、このコードを使用:
if Screen.MonitorCount > 1 then
begin
MonList := TList<TMonitor>.Create;
for I := 0 to Screen.MonitorCount - 1 do
MonList.Add(Screen.Monitors[I]);
// sort by screen.monitor.left coordinate
MonList.Sort(TComparer<TMonitor>.Construct(
function(const L, R: TMonitor): Integer
begin
Result := L.Left - R.Left;
end));
_MonitorNum := TMonitor(MonList[0]).MonitorNum;
// free the list
MonList.Destroy;
end;
その後_MonitorNumは一番左のモニターの数を保持しています。
リストクラス、アンメソッド、並べ替えなどのインスタンスを作成する必要はありません。最も左にあるものを特定する。 'var MinValue、MinIndex:整数。 ... MinValue:= Screen.Monitors [0]。左; MinIndex:= 0; i = 1〜Screen.MonitorCount - 1の場合は、Screen.Monitors [i] .Left
@Davidそれは本当です。 – penarthur66
これはいいですね、私は明日これを試してみます。 – Chris
質問する前にウェブで検索する必要があります - http://docwiki.embarcadero.com/RADStudio/Seattle/en/Handling_the_Screen – RBA
ユーザーが自分の選択を許可したくない特別な理由モニターとポジションが優先されますか? –
あなたのアンインストールプログラムがうまくテストされていることを祈っています –