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

Укажите ошибку (почему прга не реагирует на мессаги) .   Найти похожие ветки 

← →
case   (2006-08-20 15:39) [0]

Появилась необходимость написать очень компактное приложение.  
Подскажите, пожалуйста, где моя ошибка (не реагирует на мессаги) или как выполнить эту задачу правильно.


uses Windows, Messages, Kol;

const pass="qwerty";

var box:pcontrol;

function press(var Msg: tagMSG; var Rslt: Integer):Boolean;
begin
 if (msg.message=wm_keydown) and (msg.wparam=vk_return) then begin
   if (box.text=pass) then showmessage("True")
     else showmessage("Wrong");
 end;

 result:=false;
end;

begin
 Applet:=NewForm(Nil,"Enter Password").setsize(200,50);
 Applet.Border:=0;
 Applet.CenterOnParent;
 Applet.CanResize:=false;

 Box:=neweditbox(applet,[eoPassword]).setalign(caclient);
 Box.onmessage:=tonmessage(MakeMethod(box,@press));

 Run(Applet);
end.


← →
thaddy   (2006-08-20 18:08) [1]

Better read the documentation for makemethod!!!!


program Project1;
uses Windows, Messages, Kol;

const pass="qwerty";

var box:pcontrol;

function press(dummy:pointer;var Msg: tagMSG; var Rslt: Integer):Boolean;
begin
if (msg.message=wm_keydown) and (msg.wparam=vk_return) then begin
  if (box.text=pass) then showmessage("True")
    else showmessage("Wrong");
end;

result:=false;
end;

begin
Applet:=NewForm(Nil,"Enter Password").setsize(200,50);
Applet.Border:=0;
Applet.CenterOnParent;
Applet.CanResize:=false;

Box:=neweditbox(applet,[eoPassword]).setalign(caclient);
Box.onmessage:=tonmessage(MakeMethod(box,@press));

Run(Applet);
end.



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

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



Память: 0.45 MB
Время: 0.027 c
2-1174820574
aht
2007-03-25 15:02
2007.04.15
Обнуление "счетчика" в Access


15-1174216878
ProgRAMmer Dimonych
2007-03-18 14:21
2007.04.15
Прибежали в избу дети, Второпях зовут отца...


15-1173985485
tesseract
2007-03-15 22:04
2007.04.15
херай - японские басни. очень понравились


1-1171681447
Стего
2007-02-17 06:04
2007.04.15
шифрование пароля


15-1174296854
Jolik
2007-03-19 12:34
2007.04.15
Delphi for PHP




   Наверх