Вниз
Скачать: CL | DM;

pressed всегда истина хотя на самом деле нет. Почему?   Найти похожие ветки 

 
artist ©   (2003-06-25 16:35) [0]

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 16:55) [1]

При этом таже процедура но по Button1Click работает как положено. Без проблем.


 
clickmaker ©   (2003-06-25 17:49) [2]

А вообще по какому событию эта процедура должна срабатывать?


 
artist ©   (2003-06-25 20:30) [3]

Все. Вопрос решен. Разобрался. Дело не в процедуре. Я неправильно переменные объявил. Локальные вместо глобальных.



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

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.008 c
3-92040
AM$
2003-08-06 10:28
2003.08.28
Вопрос по Database Desktop


4-92305
Arhelon
2003-06-24 14:46
2003.08.28
Как вытащить иконку из открытого окна ???????


3-92012
Behemoth
2003-08-05 12:11
2003.08.28
Перенос всех данных


7-92268
Mortal
2003-06-14 13:14
2003.08.28
Несколько hook-ов в одной dll


6-92165
P@SHA
2003-06-22 21:55
2003.08.28
Апдейт своей проги




   Наверх