Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "KOL";
Текущий архив: 2007.04.15;
Скачать: [xml.tar.bz2];

Вниз

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

 
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 вся ветка

Форум: "KOL";
Текущий архив: 2007.04.15;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.038 c
2-1174742156
MASTAFA
2007-03-24 16:15
2007.04.15
Помогите с Паскалем. Нужно построить правильный 5-угольник.


2-1174745845
Михаил Н
2007-03-24 17:17
2007.04.15
Работа с датой


15-1174123434
Footballer
2007-03-17 12:23
2007.04.15
УКРФ


15-1173877098
ArchValentin
2007-03-14 15:58
2007.04.15
Delphi & WindowsVista


5-1151657849
Chuk
2006-06-30 12:57
2007.04.15
Доступ к свойствам класса на основе Interface в RTTI





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский