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

Вниз

Определение самого верхнего окна в выделенной области экрана   Найти похожие ветки 

 
dmitry_12_08_73 ©   (2008-11-25 15:43) [0]

Подскажите, как можно определить handle самого верхнего окна в выделенной области экрана, если на экране много открытых перекрывающихся окон.


 
Сергей М. ©   (2008-11-25 15:50) [1]


> в выделенной области экрана


В это области запросто может оказаться несколько "самых верних" окон.

тебя какое из них интересует ?


 
Сергей М. ©   (2008-11-25 17:03) [2]


> dmitry_12_08_73


Пусть окно А перекрывает окно В, а окно С перекрывает окно D.

Окна А и С, являясь неперекрывающими одно другое "верхними" окнами, попадают (частично или полностью) в "выделенную область".

Вопрос на засыпку: какое из окон является "самым верхним" - А или С ?


 
Palladin ©   (2008-11-25 18:27) [3]

у которого Z-order больше :)


 
dmitry_12_08_73 ©   (2008-11-25 18:40) [4]

а как определить Z-order окна


 
Сергей М. ©   (2008-11-25 20:31) [5]


> у которого Z-order больше


А с  какого перепугу он будет у них разный ?)


 
DVM ©   (2008-11-25 22:43) [6]


> А с  какого перепугу он будет у них разный ?)

У всех top-level окон разный z-order.


> dmitry_12_08_73 ©   (25.11.08 18:40) [4]
>
> а как определить Z-order окна

Никак. Надо перебрать все топ-левел окна, выделить среди них те, что попадают в твой прямоугольник. Перебирать надо функцией GetNextWindow(). Она движется как раз по списку окон по оси z.


The Z order of a window indicates the window"s position in a stack of overlapping windows. This window stack is oriented along an imaginary axis, the z-axis, extending outward from the screen. The window at the top of the Z order overlaps all other windows. The window at the bottom of the Z order is overlapped by all other windows.

Windows maintains the Z order in a single list. Windows are added to the Z order based on whether they are topmost windows, top-level windows, or child windows. A topmost window overlaps all other non-topmost windows, regardless of whether it is the active or foreground window. A topmost window has the WS_EX_TOPMOST style. All topmost windows appear in the Z order before any non-topmost windows. A child window is grouped with its parent in Z order.
When an application creates a window, Windows puts it at the top of the Z order for windows of the same type. You can use the BringWindowToTop function to bring a window to the top of the Z order for windows of the same type. You can rearrange the Z order by using the SetWindowPos and DeferWindowPos functions.

The user changes the Z order by activating a different window. Windows positions the active window at the top of the Z order for windows of the same type. When a window comes to the top of Z order, so do its child windows. You can use the GetTopWindow function to search all child windows of a parent window and return the handle of the child window that is highest in Z order. The GetNextWindow function retrieves the handle of the next or previous window in Z order.


 
dmitry_12_08_73 ©   (2008-11-25 23:11) [7]

Большое спасибо


 
Palladin ©   (2008-11-25 23:41) [8]


> Сергей М. ©  (25.11.08 20:31) [5]

хто позже bringtofront"нулся у того и больше :)
но есть паршивые исключения из правил хди...
в виде оверлеев, tskmanager"а, dx приложений, ogl приложений...

сплошной беспредел, да ты вообще лучше меня знаешь :)


 
DVM ©   (2008-11-26 11:33) [9]


> Palladin ©   (25.11.08 23:41) [8]


> в виде оверлеев

это не окно же


> tskmanager"а

Обычное окно, и перекрыть его можно тоже.


> dx приложений, ogl приложений...

Они же работают тоже на, скажем так, поверхности обычных окон.

Так что из исключений только менюшка монитора :)


 
имя   (2009-01-12 12:02) [10]

Удалено модератором



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

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

Наверх





Память: 0.47 MB
Время: 0.005 c
2-1264495718
Цукор5
2010-01-26 11:48
2010.03.28
Утечка памяти


15-1263046404
Алекс555
2010-01-09 17:13
2010.03.28
Кто-то очень много ест .... памяти


15-1262727024
Юрий
2010-01-06 00:30
2010.03.28
С днем рождения ! 6 января 2010 среда


2-1264427732
webpauk
2010-01-25 16:55
2010.03.28
Отображение элементов


1-1246863401
WeX
2009-07-06 10:56
2010.03.28
Реализовать систему плагинов





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский