delphi4arab منتديات دلفي للعرب
استعمال الدوس؟؟ - نسخة قابلة للطباعة

+- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum)
+-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3)
+--- قسم : سؤال و جواب حول دلفي (https://delphi4arab.net/forum/forumdisplay.php?fid=15)
+--- الموضوع : استعمال الدوس؟؟ (/showthread.php?tid=2118)



استعمال الدوس؟؟ - Benhlell - 17-06-2010

عند اختيار console Appliction من New Item كيف يمكني استدعاء الادوات مثل Indy او Timer


استعمال الدوس؟؟ - musvc - 18-06-2010

Benhlell كتب :عند اختيار console Appliction من New Item كيف يمكني استدعاء الادوات مثل Indy او Timer

:laugh:
[COLOR="Purple"]يمكنك اضافة الملف المسؤل عنها الى الـ Uses و من ثم استخدامها
لكن اتسائل لماذا تصنع برنامج Console في هذه ِ الحالة ؟؟
الحجم سيصبح كبيرا ً و كأنه تطبيق VCL, إلا اذا كنت تعرف بالبرمجة جيدا ً Smile
---
بشأن الـ Timer انضر هذا ربما يفيدك :
كود :
program Project2; {$APPTYPE CONSOLE} uses Windows, SysUtils, Messages; procedure MyTimer(hWnd: HWND; uMsg: Integer; idEvent: Integer; dwTime: Integer); stdcall; begin writeln('Timer Event'); end; procedure ProcessMessages; var Msg: TMsg; begin while PeekMessage(Msg, 0, 0, 0, PM_REMOVE) do begin if Msg.Message <> WM_QUIT then begin TranslateMessage(Msg); DispatchMessage(Msg); end else exit; end; end; var s: TDateTime; id: uint; begin id := SetTimer(0, 1, 1000, @MyTimer); s := Now; repeat Sleep(100); ProcessMessages; // <-- try it without this line until Now - s > EncodeTime(0, 0, 10, 0); KillTimer(0, id); end.


سلام[/COLOR]