Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2007.04.15;
Скачать: 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 вся ветка

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

Наверх




Память: 0.46 MB
Время: 0.056 c
3-1170010074
Slaviq
2007-01-28 21:47
2007.04.15
Delphi +SomeEmbidedDB + xBundle (Themedia)


15-1174093517
XProger
2007-03-17 04:05
2007.04.15
Новшества Delphi 2007


15-1174275673
Slider007
2007-03-19 06:41
2007.04.15
С днем рождения ! 18 марта


1-1171982933
BlackCat
2007-02-20 17:48
2007.04.15
INFO: Анонс Delphi 2007


2-1174909971
tar
2007-03-26 15:52
2007.04.15
Управление клавиатурой