Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2010.03.28;
Скачать: CL | DM;

Вниз

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

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

Текущий архив: 2010.03.28;
Скачать: CL | DM;

Наверх




Память: 0.49 MB
Время: 0.012 c
1-1245208033
uniken1
2009-06-17 07:07
2010.03.28
Смена обоев рабочего стола


15-1262818935
Дмитрий С
2010-01-07 02:02
2010.03.28
DLL во все процессы.


3-1237110214
Den
2009-03-15 12:43
2010.03.28
Как узнать номер добавленной записи


2-1264684555
Valior
2010-01-28 16:15
2010.03.28
бд на дельфях


4-1231749793
kalexi
2009-01-12 11:43
2010.03.28
Как узнать место расоложения папки "Автозагрузка"?