View Full Version : C++ VK_Hotkeys
Dxt-Cobra
09-02-2007, 10:10 PM
Hotkeys for C++
by cobra
(hexadecimal) Keyboard (or mouse) equivalent
VK_LBUTTON 01 Left mouse button
VK_RBUTTON 02 Right mouse button
VK_CANCEL 03 Control-break processing
VK_MBUTTON 04 Middle mouse button (three-button mouse)
VK_BACK 08 BACKSPACE key
VK_TAB 09 TAB key
VK_CLEAR 0C CLEAR key
VK_RETURN 0D ENTER key
VK_SHIFT 10 SHIFT key
VK_CONTROL 11 CTRL key
VK_MENU 12 ALT key
VK_PAUSE 13 PAUSE key
VK_CAPITAL 14 CAPS LOCK key
VK_ESCAPE 1B ESC key
VK_SPACE 20 SPACEBAR
VK_PRIOR 21 PAGE UP key
VK_NEXT 22 PAGE DOWN key
VK_END 23 END key
VK_HOME 24 HOME key
VK_LEFT 25 LEFT ARROW key
VK_UP 26 UP ARROW key
VK_RIGHT 27 RIGHT ARROW key
VK_DOWN 28 DOWN ARROW key
VK_SELECT 29 SELECT key
VK_PRINT 2A PRINT key
VK_EXECUTE 2B EXECUTE key
VK_SNAPSHOT 2C PRINT SCREEN key
VK_INSERT 2D INS key
VK_DELETE 2E DEL key
VK_HELP 2F HELP key
30 0 key
31 1 key
32 2 key
33 3 key
34 4 key
35 5 key
36 6 key
37 7 key
38 8 key
39 9 key
41 A key
42 B key
43 C key
44 D key
45 E key
46 F key
47 G key
48 H key
49 I key
4A J key
4B K key
4C L key
4D M key
4E N key
4F O key
50 P key
51 Q key
52 R key
53 S key
54 T key
55 U key
56 V key
57 W key
58 X key
59 Y key
5A Z key
VK_NUMPAD0 60 Numeric keypad 0 key
VK_NUMPAD1 61 Numeric keypad 1 key
VK_NUMPAD2 62 Numeric keypad 2 key
VK_NUMPAD3 63 Numeric keypad 3 key
VK_NUMPAD4 64 Numeric keypad 4 key
VK_NUMPAD5 65 Numeric keypad 5 key
VK_NUMPAD6 66 Numeric keypad 6 key
VK_NUMPAD7 67 Numeric keypad 7 key
VK_NUMPAD8 68 Numeric keypad 8 key
VK_NUMPAD9 69 Numeric keypad 9 key
VK_SEPARATOR 6C Separator key
VK_SUBTRACT 6D Subtract key
VK_DECIMAL 6E Decimal key
VK_DIVIDE 6F Divide key
VK_F1 70 F1 key
VK_F2 71 F2 key
VK_F3 72 F3 key
VK_F4 73 F4 key
VK_F5 74 F5 key
VK_F6 75 F6 key
VK_F7 76 F7 key
VK_F8 77 F8 key
VK_F9 78 F9 key
VK_F10 79 F10 key
VK_F11 7A F11 key
VK_F12 7B F12 key
VK_F13 7C F13 key
VK_F14 7D F14 key
VK_F15 7E F15 key
VK_F16 7F F16 key
VK_F17 80H F17 key
VK_F18 81H F18 key
VK_F19 82H F19 key
VK_F20 83H F20 key
VK_F21 84H F21 key
VK_F22 85H F22 key
VK_F23 86H F23 key
VK_F24 87H F24 key
VK_NUMLOCK 90 NUM LOCK key
VK_SCROLL 91 SCROLL LOCK key
VK_LSHIFT A0 Left SHIFT key
VK_RSHIFT A1 Right SHIFT key
VK_LCONTROL A2 Left CONTROL key
VK_RCONTROL A3 Right CONTROL key
VK_LMENU A4 Left MENU key
VK_RMENU A5 Right MENU key
VK_PLAY FA Play key
VK_ZOOM FB Zoom key
Example: if (GetKeyState(VK_RBUTTON) &1)
{
//Code here
}
Make program stay on top
if (GetKeyState(VK_NUMPAD9) &1)
{
SetWindowPos(&this->wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
}
Not sure how to hide the trainer //need to work on that part
More tuts to come
Str8Soulja
09-02-2007, 10:40 PM
Thanks i was just about to post this
magelv1
09-03-2007, 02:18 AM
Well what we got here:
Edit Nice tut.
Also posting tut about creating c++ modul tut ? to create very own , maybe awsome idea
Gellin
09-03-2007, 11:23 AM
i wanna see hidden content
kanata93
09-03-2007, 12:10 PM
ncie man thanks alot
§§p1un§§
09-08-2007, 04:04 PM
hmmmmm i really nedded this for my for ym warrock trainers thxs
stefan
09-09-2007, 10:18 PM
nice tut dudy. Good coding
Dejavu
09-16-2007, 12:02 PM
Thx! I really need it.
DRILLKID122
09-16-2007, 12:07 PM
nice one.lol
sk1nhead
11-12-2007, 02:00 PM
I've tried to make a rightclick-hotkey for my scope hack. but when i paste this code:
if (GetKeyState(VK_RBUTTON) &1)
{
Writelong(0xADD126, 1);
}
then i get these errors when trying to rebuild them all:
Deleting intermediate files and output files for project 'Hack - Win32 Debug'.
--------------------Configuration: Hack - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
Hack.cpp
HackDlg.cpp
C:Program FilesMicrosoft Visual StudioMyProjectsHackHackDlg.cpp(198) : error C2143: syntax error : missing ';' before 'if'
C:Program FilesMicrosoft Visual StudioMyProjectsHackHackDlg.cpp(199) : error C2143: syntax error : missing ';' before '{'
C:Program FilesMicrosoft Visual StudioMyProjectsHackHackDlg.cpp(199) : error C2447: missing function header (old-style formal list?)
Generating Code...
Error executing cl.exe.
Hack.exe - 3 error(s), 0 warning(s)
The person wich helps me gets the addies for unlimited ammo:D (and yes i've really got them;))
sailerboy
11-12-2007, 03:26 PM
do you have it in a timer? if not, put it in one.
sk1nhead
11-12-2007, 11:15 PM
do you have it in a timer? if not, put it in one.
It's a scope hack....they don't need any timers
Dxt-Cobra
11-13-2007, 08:16 AM
no but a hotkey does!!!,so you have to put the hotkey and stam code in a timer to work.Then you have to Do
SetTimer(yourtimerhere,1,NULL); //put this in intdialog to call the timer on when the trainer is open.
sk1nhead
11-13-2007, 08:59 AM
no but a hotkey does!!!,so you have to put the hotkey and stam code in a timer to work.Then you have to Do
SetTimer(yourtimerhere,1,NULL); //put this in intdialog to call the timer on when the trainer is open.
Can you post an example of a right-click hotkey for scope?:(
sailerboy
11-13-2007, 09:52 AM
I have been working on without no success, it always zooms in, but not out
Dxt-Cobra
11-13-2007, 03:24 PM
Here's how i do it in a timer
{
if (GetAsyncKeyState(VK_RBUTTON)&1<< 0xF)
Scope(1);
else
Scope(0);
}
<< 0xF is checking if key is still pressed.
Scope(1); and this is how i did scope,i have made a scope function for this
normally u do
WriteLong(0xaddie,1);
sailerboy
11-13-2007, 05:11 PM
I want the users to push right click for the scope. I want to read the value of the memory and compare it, for example, tell me what is wrong with this
if (button10==true){
if ((GetKeyState(VK_RBUTTON) &1) == 1){
dfsupidfspjdfs(0xADD126, result);
if (result==0){
adfjspjkpjdfkpj(0xADD126, 1);
}
if (result==1){
adfjspjkpjdfkpj(0xADD126, 0);
}
}
}
adfjspjkpjdfkpj = writelong
dfsupidfspjdfs = Readlong
yes it is in a timer, yes i use 1 timer to make things simpler, and make button X true or false depending on what button is pressed, and it works for everything. This zooms in, but not out
sk1nhead
11-15-2007, 11:16 AM
Okay, i've tried to make a hotkey for scope. But i got a little problem.
This is my code:
// ScopeDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Scope.h"
#include "ScopeDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
DWORD proc_id;
HANDLE hProcess;
void memory()
{
HWND hWnd = FindWindow(0, "WarRock");
GetWindowThreadProcessId(hWnd, &proc_id);
hProcess = OpenProcess(PROCESS_ALL_ACCESS|PROCESS_VM_OPERATIO N|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_I NFORMATION, FALSE, proc_id);
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CScopeDlg dialog
CScopeDlg::CScopeDlg(CWnd* pParent /*=NULL*/)
: CDialog(CScopeDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CScopeDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CScopeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CScopeDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CScopeDlg, CDialog)
//{{AFX_MSG_MAP(CScopeDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTON1, OnScopeOn)
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CScopeDlg message handlers
BOOL CScopeDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
void CScopeDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CScopeDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CScopeDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void Writelong(long addy, long value)
{
memory();
WriteProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &value, sizeof(value), NULL);
}
void WritePointerFloat(long addy, short offset, float value)
{
long maddy;
long saddy;
memory();
ReadProcessMemory(hProcess, (LPVOID*)(DWORD) addy, &maddy, sizeof(maddy), NULL);
saddy = maddy + offset;
WriteProcessMemory(hProcess, (LPVOID*)(DWORD) saddy, &value, sizeof(value), NULL);
}
void CScopeDlg::OnScopeOn()
{
Writelong(0xADD126, 1);
}
void CScopeDlg::OnTimer(UINT nIDEvent)
{
if (GetAsyncKeyState(VK_RBUTTON)&1<< 0xF)
WriteLong(0xADD126,1);
else
WriteLong(0xADD126,0);
}
This is the error i get:
Deleting intermediate files and output files for project 'Scope - Win32 Debug'.
--------------------Configuration: Scope - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
Scope.cpp
ScopeDlg.cpp
C:Program FilesMicrosoft Visual StudioMyProjectsScopeScopeDlg.cpp(207) : error C2065: 'WriteLong' : undeclared identifier
Generating Code...
Error executing cl.exe.
Scope.exe - 1 error(s), 0 warning(s)
I'm very good with vb6...but I really don't understand a F*CK about this:eek:
LegendaryHacker
11-15-2007, 12:04 PM
see your function in the if else:
WriteLong (you wrote it with a capital "L")
sk1nhead
11-15-2007, 12:07 PM
see your function in the if else:
WriteLong (you wrote it with a capital "L")
Oh lmfao...okay, now it's official...i'm a dumb ass:(
Thanks;)
sk1nhead
11-15-2007, 12:39 PM
Okay, that error is gone...but if i try it in-game....the rclick doesnt work....
LegendaryHacker
11-15-2007, 01:55 PM
you didnt enable the timer ???
sk1nhead
11-15-2007, 02:02 PM
you didnt enable the timer ???
How i do that lol?:p
Sry...but vb6 is SO f*cking different then c++ http://www.warrockhacking.org/images/smilies/cry.gif
How i enable the times? lol:D
My timer still doesnt work....wtf is wrong with it? must i enable it or something? and if so...how?:confused:
Any1 there? HELP?>_<
johanson75
11-23-2007, 03:55 PM
Im just as confused sk1n:confused:
jimdrie
11-28-2007, 07:56 AM
open From1.h [Design] and click the timer. Now you will see on the right or the left side properties. Now click Disabled and change it to Enabled. below it is Interval, set it to 1.
wr194t
11-28-2007, 08:00 AM
open From1.h [Design] and click the timer. Now you will see on the right or the left side properties. Now click Disabled and change it to Enabled. below it is Interval, set it to 1.This sounds like VB6. This is C++ if you didn't know.
zezima
12-12-2007, 05:53 PM
how do i add a new timer in c++?:confused::(
DutchHelFire
12-15-2007, 09:39 AM
http://www.dxth4x.com/forums/showthread.php?t=421 xD
Haxer43
01-16-2008, 03:14 PM
how would you make a hotkey for the key F
liek this?
if (GetAsyncKeyState(VK_KEYL)&1<< 0xF)
g4mh4n4n
04-04-2008, 06:09 PM
how would you make a hotkey for the key F
liek this?
if (GetAsyncKeyState(VK_KEYL)&1<< 0xF)
try
if (GetAsyncKeyState(46)&1<< 0xF)
madazn
02-22-2009, 11:11 PM
Hmm, took me forever to figure this out lol, maybe I'm just dumb, but well
if(GetAsyncKey('A')&1
{
//you pressed the A key
}
hopefully this may help soem fellow noobs, and cobra add the your post please because frankly, i was stupid and couldn;t figure out how to use letter keys!
clipster15
02-23-2009, 12:05 AM
It's also possible to do this with mouse clicks.
Durrcookie
02-23-2009, 07:41 AM
Hmm, took me forever to figure this out lol, maybe I'm just dumb, but well
if(GetAsyncKey('A')&1
{
//you pressed the A key
}
hopefully this may help soem fellow noobs, and cobra add the your post please because frankly, i was stupid and couldn;t figure out how to use letter keys!
you forgot a )
emyeusss7
03-19-2009, 07:24 AM
thanks..................................sr sp !
LetItRock
04-02-2009, 08:33 PM
Sweet Im Saving This To A .txt To remember. Thankx!
ggzzzzzz
07-31-2010, 11:34 AM
thank you
calamansi
07-31-2010, 11:56 AM
thank you ^_^
atilaelias
08-11-2010, 12:35 AM
como fasso ?
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.