Форум: "Начинающим";
Текущий архив: 2009.02.22;
Скачать: [xml.tar.bz2];
ВнизОкно на поверхности Найти похожие ветки
← →
demon © (2009-01-11 04:14) [0]Как узнать не прикрыто ли моё окно сверху другими окноми?
← →
Rouse_ © (2009-01-11 10:23) [1]Как-то так:
unit Unit6;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm6 = class(TForm)
Memo1: TMemo;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
end;
var
Form6: TForm6;
implementation
{$R *.dfm}
procedure TForm6.Timer1Timer(Sender: TObject);
var
CurrentRect, OtherRect, IntersectedRect: TRect;
WndHandle, ForegrowndHandle: THandle;
OtherWindoCaption: String;
CaptionLength: Integer;
begin
if not Visible then
Exit
else
GetWindowRect(Handle, CurrentRect);
ForegrowndHandle := GetForegroundWindow;
if ForegrowndHandle <> Handle then
begin
WndHandle := GetNextWindow(Handle, GW_HWNDPREV);
repeat
if not IsWindowVisible(WndHandle) then
begin
WndHandle := GetNextWindow(WndHandle, GW_HWNDPREV);
Continue;
end;
GetWindowRect(WndHandle, OtherRect);
if IntersectRect(IntersectedRect, CurrentRect, OtherRect) then
begin
Memo1.Lines.Add("Найдено окно, расположенное поверх контрольного:");
Memo1.Lines.Add("Хэндл окна: " + IntToStr(WndHandle));
CaptionLength := SendMessage(WndHandle, WM_GETTEXTLENGTH, 0, 0);
if CaptionLength > 0 then
begin
Inc(CaptionLength);
SetLength(OtherWindoCaption, CaptionLength);
SendMessage(WndHandle, WM_GETTEXT, CaptionLength, Integer(@OtherWindoCaption[1]));
Memo1.Lines.Add("Заголовок окна: " + OtherWindoCaption);
end;
end;
WndHandle := GetNextWindow(WndHandle, GW_HWNDPREV);
until WndHandle = 0;
end;
end;
end.
← →
palva © (2009-01-11 12:57) [2]Если в окне что-то есть (главное меню, кнопка...) то оно всегда прикрыто другими окнами - окнами, которые отрисовывают эту кнопку и т. д.
← →
demon © (2009-01-11 17:42) [3]Rouse_, спасибо!
Страницы: 1 вся ветка
Форум: "Начинающим";
Текущий архив: 2009.02.22;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.005 c