![]() |
|
بخصوص الدالة GetAsyncKeyState - نسخة قابلة للطباعة +- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum) +-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3) +--- قسم : سؤال و جواب حول دلفي (https://delphi4arab.net/forum/forumdisplay.php?fid=15) +--- الموضوع : بخصوص الدالة GetAsyncKeyState (/showthread.php?tid=3865) |
بخصوص الدالة GetAsyncKeyState - abdelali91 - 10-02-2012 السلام عليكم وجدت كود لبرنامج keylogger لكن لم أفهم سطر من الكود الكود على النحو التالي: كود : procedure TForm1.Timer1Timer(Sender: TObject);
var
keyloop, KeyResult : Integer;
begin
keyloop := 0;
repeat
KeyResult := GetAsyncKeyState(keyloop);
if KeyResult = -32767 then
begin
case keyloop of
8:Memo1.Text:=.Memo1.Text+ ' [BACKSPACE] ';
.
.
.
etcالسطر الذي لم أفهمه هو if KeyResult = -32767 then مادلالة هذا الرقم؟ بخصوص الدالة GetAsyncKeyState - kachwahed - 10-02-2012 وعليكم السلام ورحمة الله تابع GetAsyncKeyState هو API Windows يعيد النتيجة: كود : Return Values
If the function succeeds, the return value specifies whether the key was pressed since the last call to GetAsyncKeyState, and whether the key is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState. The return value is zero if a window in another thread or process currently has the keyboard focus.كود : Smallint -32768..32767PHP كود : if KeyResult = Low(SmallInt) then بخصوص الدالة GetAsyncKeyState - abdelali91 - 11-02-2012 شكرا أخي kachwahed على الرد لكن في الحقيقة لم افهم جيدا إذا كان بإمكانك ان توضع ما هو قائدة إضافة الشرط if KeyResult = -32767 then بخصوص الدالة GetAsyncKeyState - abdelmalek - 11-02-2012 السلام عليكم ورحمة الله وبركاته إقتباس :ما هو قائدة إضافة الشرطهي معرفة حالة المفتاح هل هو مضغوط او لا (if Key is down or no) . نعطي مثال عملى : [COLOR="Red"]نريد دراسة حالة قفل الايسر للماوس هل ثم الضغط عليه ام لا (button left of mouse is down or no) . نستخدم دالة دراسة حالة المفاتيح GetAsyncKeyState ونمرر لها قيمة المفتاح الايسر للماوس هكدا :[/COLOR] PHP كود : GetAsyncKeyState(VK_LBUTTON) و تعيد لنا القيمة -32767 إدا كان مضغوط . فإدا وضعنا هدا الكود : PHP كود : KeyResult := GetAsyncKeyState(VK_LBUTTON);وسلام عليكم ورحمة الله وبركاته بخصوص الدالة GetAsyncKeyState - kachwahed - 11-02-2012 الأفضل المقارنة إلى "أصغر من صفر": كود : http://support.microsoft.com/kb/277916/enليست بالضرورة -32767 فقط. بخصوص الدالة GetAsyncKeyState - abdelali91 - 13-02-2012 شكرا للجميع على الإفادة |