Вниз
Скачать: 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.026 c
3-1169454228
Егоров А.Н.
2007-01-22 11:23
2007.04.15
Выражение CASE в операторе SELECT


3-1169214222
barakuda
2007-01-19 16:43
2007.04.15
програмная настройка БДЕ


15-1174307753
ocean
2007-03-19 15:35
2007.04.15
Технология UML


3-1169558058
tytus
2007-01-23 16:14
2007.04.15
Подключение к Oracle 10g в библиотеке


15-1174377722
boriskb
2007-03-20 11:02
2007.04.15
Новости о космических войсках




   Наверх