Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "WinAPI";
Текущий архив: 2008.02.10;
Скачать: [xml.tar.bz2];

Вниз

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

 
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 вся ветка

Форум: "WinAPI";
Текущий архив: 2008.02.10;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.048 c
1-1193941965
Igor Zorkov
2007-11-01 21:32
2008.02.10
Запретить передачу фокуса окну по которому кликаешь


2-1200571334
_Shuler_
2008-01-17 15:02
2008.02.10
Winrar&amp;Delphi


15-1200021355
Slider007
2008-01-11 06:15
2008.02.10
С днем рождения ! 11 января 2008 пятница


2-1200390541
umbra
2008-01-15 12:49
2008.02.10
как лучше загрузить данные в базу? (ADO, Access)


15-1199691637
kernel
2008-01-07 10:40
2008.02.10
С чего начать?





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский