Registriert seit: 14. Aug 2004
32 Beiträge
|
Re: Eigener Desktop???
23. Aug 2004, 13:32
Habs das mit den Desktops jetzt hinbekommen:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
hWinSta: THandle;
begin
Listbox1.Clear;
hWinSta := GetProcessWindowStation;
EnumDesktops(hWinSta, @EnumDesktopsCallback, Integer(Listbox1));
CloseWindowStation(hWinSta);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
switchdesktop(opendesktop(PChar(listbox1.Items.Strings[listbox1.ItemIndex]),
DF_ALLOWOTHERACCOUNTHOOK,
true,
DESKTOP_CREATEMENU or
DESKTOP_CREATEWINDOW or
DESKTOP_ENUMERATE or
DESKTOP_HOOKCONTROL or
DESKTOP_JOURNALPLAYBACK or
DESKTOP_JOURNALRECORD or
DESKTOP_READOBJECTS or
DESKTOP_SWITCHDESKTOP or
DESKTOP_SWITCHDESKTOP));
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
createdesktop('Oliver', nil, nil, DF_ALLOWOTHERACCOUNTHOOK,
DESKTOP_CREATEMENU or
DESKTOP_CREATEWINDOW or
DESKTOP_ENUMERATE or
DESKTOP_HOOKCONTROL or
DESKTOP_JOURNALPLAYBACK or
DESKTOP_JOURNALRECORD or
DESKTOP_READOBJECTS or
DESKTOP_SWITCHDESKTOP or
DESKTOP_SWITCHDESKTOP, nil);
end;
Jetzt stellt sich nur noch die Frage, warum kein neues Fenster erzeugt wird...
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin
CreateDesktop('Oliver',
nil,
nil,
DF_ALLOWOTHERACCOUNTHOOK,
DESKTOP_CREATEMENU or
DESKTOP_CREATEWINDOW or
DESKTOP_ENUMERATE or
DESKTOP_HOOKCONTROL or
DESKTOP_JOURNALPLAYBACK or
DESKTOP_JOURNALRECORD or
DESKTOP_READOBJECTS or
DESKTOP_SWITCHDESKTOP or
DESKTOP_SWITCHDESKTOP,
nil);
SetThreadDesktop(Opendesktop('Oliver',
DF_ALLOWOTHERACCOUNTHOOK,
true,
DESKTOP_CREATEMENU or
DESKTOP_CREATEWINDOW or
DESKTOP_ENUMERATE or
DESKTOP_HOOKCONTROL or
DESKTOP_JOURNALPLAYBACK or
DESKTOP_JOURNALRECORD or
DESKTOP_READOBJECTS or
DESKTOP_SWITCHDESKTOP or
DESKTOP_SWITCHDESKTOP));
shellexecute(application.Handle,
'open',
'C:\Programme\Borland\Delphi7\Projects\Desktops\DesktopClosedpr.dpr',
nil,
nil,
sw_shownormal);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
switchdesktop(Opendesktop('Oliver',
DF_ALLOWOTHERACCOUNTHOOK,
true,
DESKTOP_CREATEMENU or
DESKTOP_CREATEWINDOW or
DESKTOP_ENUMERATE or
DESKTOP_HOOKCONTROL or
DESKTOP_JOURNALPLAYBACK or
DESKTOP_JOURNALRECORD or
DESKTOP_READOBJECTS or
DESKTOP_SWITCHDESKTOP or
DESKTOP_SWITCHDESKTOP));
end;
MFG Doc
|
|
Zitat
|