(Gast)
n/a Beiträge
|
Re: LuckieDIPS
18. Feb 2005, 14:52
Zitat von Luckie:
Nein noch nicht. Nico will sich das wohl mal angucken.
Folgender Code dürfte das Problem mit dem 'Active Desktop' lösen...
Delphi-Quellcode:
function IsActiveDesktopActive: Boolean;
var
Progman: HWND;
DefView: HWND;
begin
Result := False;
Progman := FindWindow('Progman', nil);
if Progman <> HWND(nil) then
begin
DefView := FindWindowEx(Progman, HWND(nil), 'SHELLDLL_DefView', nil);
if DefView <> HWND(nil) then
Result := FindWindowEx(DefView, HWND(nil), 'HTML_Internet Explorer', nil)
<> HWND(nil);
end;
end;
function GetDesktopListView: HWND;
var
Progman: HWND;
DefView: HWND;
function EnumDefViewProc(Wnd: HWND; out DefView: HWND): BOOL; stdcall;
var
ClassName: array [0..255] of Char;
begin
DefView := Wnd;
ClassName[0] := #0;
GetClassName(Wnd, ClassName, 255);
Result := StrComp(ClassName, 'SHELLDLL_DefView') <> 0;
end;
begin
Result := HWND(nil);
Progman := FindWindow('Progman', nil);
if Progman <> HWND(nil) then
begin
DefView := FindWindowEx(Progman, HWND(nil), 'SHELLDLL_DefView', nil);
if DefView <> HWND(nil) then
begin
if IsActiveDesktopActive then
EnumChildWindows(DefView, @EnumDefViewProc, LPARAM(@DefView));
Result := FindWindowEx(DefView, HWND(nil), 'SysListView32', nil);
end;
end;
if Result = HWND(nil) then
MessageBox(HWND(nil), PChar(ERROR_GETDESKTOPHANDLE), APPNAME, MB_ICONERROR);
end;
Gruss Nico
|
|
Zitat
|