Текущий архив: 2008.02.10;
Скачать: 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 вся ветка
Текущий архив: 2008.02.10;
Скачать: CL | DM;
Память: 0.45 MB
Время: 0.045 c