Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Cheat Engine Forum Index
PostGo back to topic
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007
Posts: 1657

PostPosted: Tue Jul 24, 2007 11:03 am    Post subject: RegisterHotKey , WMHotkey tutorial

Welcome to the tutorial on RegisterHotkey using WMHotkey.

GetAsyncKeyState uses a timer, which uses more cpu power than a simple function w/o a timer.

Step 1) In the Type section you will see Private {private declations}.
So in the private declaration put this code
Code:
    Procedure WMHotkey(var msg: TWMHotkey);
      message WM_HOTKEY;

This code just declares WMHotkey procedure.

Step 2) RegisterHotkey. In FormCreate procedure put this code.
Code:
if not RegisterHotKey(Handle, 1, MOD_CONTROL, VK_f12) then
begin
ShowMessage('Cant Assign CTRL+F12 as hotkey!');
end;

This registers the HotKey to your window(handle), sets hotkey value to 1
(if your going to add another hotkey change this to 2,3,4 etc.) MOD_CONTROL is making sure the ctrl key is held down. VK_f12 is the key that must be pressed with ctrl.

You may add more HotKeys by repeating this code with different hotkey values.

Also if Ctrl + F12 is assigned already the ShowMessage will pop up.

Step 3) WMHotkey Function.
Code:
procedure TForm1.WMHotkey (Var msg: TWMHotkey);
begin
  if msg.HotKey = 1 then begin
//do something
    end;
end;


This procedure makes it so when you press the Hotkey assigned to 1, your actions are done.

3 Simple Steps.
No extra Cpu Power.
_________________
Back to top
View user's profile Send private message
Post reviews:   Approve 1
Author Review
Obitio
Review: Approve
Post reference:
ReviewPosted: Tue Sep 18, 2012 3:29 pm

Helped me make my delphi hack.Thanks Smile
Back to top
View user's profile Send private message
Display:  
Cheat Engine Forum Index


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites