Вниз
Скачать: CL | DM;

Видимые окна   Найти похожие ветки 

← →
DagOT-R ©   (2007-07-04 05:20) [0]

Помогите, кто может, как узнать какие окна действительно видимы, т.е. те, которые отображаются только на TASK BAR (задолбался отсеивать всякие там типа "Program manager", а также окна типа "Закрыть" и "Свернуть" (Когда наводишь на кнопку Minimize [_] и System menu [X])! Заранее спасибо.


← →
Dib@zol ©   (2007-07-04 13:42) [1]

Попробуй после того как нашёл все окна, последовательно потестить их ф-цией IsWindowVisible. Теоретически, помогает...


← →
Dib@zol ©   (2007-07-04 13:47) [2]

Ах да. Также, против нахождения всякого рода контролов помогает GetWindowLong. Получаешь информацию о стилевых флагах, разбиваешь побитно и если биты 23 и 24 включены (те. присутствует флаг WS_CAPTION = $C00000 = WS_BORDER+WS_DLGFRAME) то это окно.


← →
DVM ©   (2007-07-04 16:15) [3]


function IsAppWindow(Wnd: HWND): BOOL;
var
Style, ExtStyle: LongInt;
hOwner, hParent: HWND;
begin
Result := true;
if not IsWindow(Wnd) then
  begin
    Result := false;
    exit;
  end;
Style := GetWindowLong(Wnd, GWL_STYLE);
ExtStyle := GetWindowLong(Wnd , GWL_EXSTYLE);
hOwner := GetWindow(Wnd, GW_OWNER);
hParent := GetParent(Wnd);
if (Style and WS_CHILD) <> 0 then result := false;
if (Style and WS_VISIBLE) = 0 then Result := false;
if not IsWindowVisible(Wnd) then Result := false;
if (ExtStyle and  WS_EX_TOOLWINDOW) <> 0 then Result := false;
if (ExtStyle and  WS_EX_MDICHILD) <> 0 then Result := false;

if (hOwner <> 0) and ((ExtStyle and WS_EX_APPWINDOW) = 0) then result := false;
if (hOwner <> 0) and Result then Result := not IsAppWindow(hOwner);

if hParent <> 0 then Result := false;
if GetWindowLong(Wnd , GWL_USERDATA) = MagicDWord then Result := false;
end; // End of function IsAppWindow;



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.014 c
15-1199714934
Parus
2008-01-07 17:08
2008.02.10
PHP: register_shutdown_function для рекламы


2-1200910941
Дмитрий_М
2008-01-21 13:22
2008.02.10
Clipboard


2-1200477243
Washington
2008-01-16 12:54
2008.02.10
Сворачивание формы


15-1200106713
sauron
2008-01-12 05:58
2008.02.10
BIOS?


2-1200304108
Washington
2008-01-14 12:48
2008.02.10
Перехват вызова контекстного меню




   Наверх