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

Вниз

Handle окна   Найти похожие ветки 

 
Ted ©   (2002-01-29 09:33) [0]

Объясните, плиз, почему мое приложение сворачивается вместе с остальными???

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls;

type
TForm1 = class(TForm)
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormHide(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
Hand: HWnd;


implementation
{$R *.DFM}


procedure CloseWnd;
stdcall;
begin
Hand:=GetForegroundWindow;

repeat
if (hand <> application.handle) and (IsWindowVisible (hand)) then PostMessage (hand, WM_SYSCOMMAND, SC_MINIMIZE, 0); //postmessage(hand ,wm_close,0,0);
Hand:=GetNextWindow(Hand,GW_HWNDNEXT);
until Hand=0
end;



procedure TForm1.Timer1Timer(Sender: TObject);
begin
CloseWnd;
end;

procedure TForm1.FormShow(Sender: TObject);
begin
SystemParametersInfo(SPI_SCREENSAVERRUNNING, 1, nil, 0);
end;

procedure TForm1.FormHide(Sender: TObject);
begin
SystemParametersInfo(SPI_SCREENSAVERRUNNING, 0, nil, 0);
end;

end.


 
Виктор Щербаков ©   (2002-01-29 09:51) [1]

if (hand <> Form1.handle) and (IsWindowVisible (hand)) then ...


 
Ted ©   (2002-01-29 10:44) [2]

>Виктор Щербаков
Вставил в программу Form1.handle все равно не фурычит :((


 
Виктор Щербаков ©   (2002-01-29 11:00) [3]

Вот так должно работать:
if (hand <> application.handle) and
(hand <> Form1.handle) and (IsWindowVisible (hand)) then ...


 
Ted ©   (2002-01-29 11:02) [4]

>Виктор Щербаков
Большое спасибо...........



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

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

Наверх




Память: 0.47 MB
Время: 0.012 c
1-90952
kingom
2002-03-13 14:16
2002.03.28
Почему в консольном приложении нельзя использовать COM?


4-91117
star
2002-01-28 12:23
2002.03.28
Кто-нибудь писал ловушки (hooks)? Подскажите ...


1-90854
SlavaS
2002-03-16 21:35
2002.03.28
Неудаётся найти файл *.bpl


3-90805
lightix
2002-03-04 15:36
2002.03.28
Помогите с БД + Quick REPORT


6-91028
SemFLY
2002-01-10 04:08
2002.03.28
Компоненты Indy -> TIdTCPServer и TIdTCPClient