![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
pressed всегда истина хотя на самом деле нет. Почему?
artist © (2003-06-25 16:35:00)
procedure TForm1.myhoook(var Message: TMessage);
var
ihandle, handle1: HWND;
t: string;
ihdc: hdc;
begin
count:=0;
ihandle:=FindWindow(nil,"Adobe Illustrator");
if ihandle<>0 then
begin
EnumWindows(@EnumWindowsProc,0);
GetWindowRect(ihandle, Rct);
ihdc:=GetDC(ihandle);
if ( GetSysColor(COLOR_BTNFACE)=GetPixel(ihdc, 4, 4)) then pressed:=false else pressed:=true;
releaseDC(ihandle, ihdc);
end;
if pressed=true then
begin
Edit1.Font.Color:=clWindowText;
handle1:=FindWindow(nil,"Color");
total:=0;
flag:=false;
count:=0;
if handle1<>0 then
begin
t:=GetText(handle1);
enumChildWindows(handle1, @ChldWin, 0);
end;
t:=FloattoStr(total);
if (total>(StrToFloat(InkLimit))) then Edit1.Font.Color:=clRed;
Edit1.Text:=t;
end;
pressed:=false;
end;
artist (2003-06-25 20:30:00) [1]
Все. Вопрос решен. Разобрался. Дело не в процедуре. Я неправильно переменные объявил. Локальные вместо глобальных.
clickmaker (2003-06-25 17:49:00) [2]
А вообще по какому событию эта процедура должна срабатывать?
artist (2003-06-25 16:55:00) [3]
При этом таже процедура но по Button1Click работает как положено. Без проблем.