- , , . , , , , EnumWindows, () , .. IsWindowVisible False (, Inspector.Activate , ).
- , ( ), .
: , , (Delphi) . , , , , .
function GetWindowClassName(const AHandle: HWND): String;
var
lClass: array[0..255] of Char;
begin
if GetClassName(AHandle, lClass, SizeOf(lClass)) > 0 then
Result := lClass
else
Result := '';
end;
type
TWordSearchInfo = record
Result: HWND;
end;
PWordSearchInfo = ^TWordSearchInfo;
function CheckWnd(AWnd: HWND; ASearchInfo: PWordSearchInfo): Boolean; stdcall;
begin
Result := True;
try
if GetWindowClassName(AWnd) = 'OpusApp' then
if not IsWindowVisible(AWnd) then
begin
ASearchInfo.Result := AWnd;
Exit(False);
end;
except
//plop!
end;
end;
function GetNewestWordHandle: Cardinal;
var
lSearchInfo: TWordSearchInfo;
begin
lSearchInfo.Result := 0;
EnumWindows(@CheckWnd, Integer(@lSearchInfo));
Result := lSearchInfo.Result;
end;
: Activate -event Outlook < 12, IsWordMail -property True.