Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Form auf anderen Desktop anzeigen (https://www.delphipraxis.net/30491-form-auf-anderen-desktop-anzeigen.html)

SleepyMaster 25. Sep 2004 16:19


Form auf anderen Desktop anzeigen
 
Hi ihrs


mit folgendem Code versuche ich ein VCL Fenster auf einem anderen Desktop anzuzeigen.
Der Desktop wird zwar erstellt, bleibt aber leer, da dass Fenster auf dem Standartdesktop angezeigt wird. Mit einem NonVCL Fenster funktioniert der Code aber.

Delphi-Quellcode:
program Project1;

uses
  Windows,
  Forms,
  Unit1 in 'Unit1.pas' {Form1};

{$R *.res}

var
  OldDesktop, Desktop: HDESK;

begin
  OldDesktop:=GetThreadDesktop(GetCurrentProcessId);
  Desktop:= CreateDesktop('NewDesk', nil, nil, DF_ALLOWOTHERACCOUNTHOOK, GENERIC_ALL, nil);
  SetThreadDesktop(Desktop);
  switchdesktop(Desktop);

  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;

  SetThreadDesktop(OldDesktop);
  switchdesktop(OldDesktop);
  CloseDesktop(Desktop);
end.
Wie kann ich ein VCL Fenster auf dem neuerstellten Desktop anzeigen???

Vielen Dank


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:52 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 by Thomas Breitkreuz