 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Splizes Grandmaster Cheater Supreme
Reputation: 0
Joined: 21 Jun 2006 Posts: 1944 Location: Florida
|
Posted: Fri Oct 05, 2007 7:06 pm Post subject: Why |
|
|
Why wont this work?
this is the hotkey parts
| Code: |
#include "stdafx.h"
#include "Mahjong.h"
#include "MahjongDlg.h"
#include "Winuser.h"
#define VK_0 0x30 // 0 key
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//ON_MESSAGE(WM_HOTKEY, OnHotKey);
CMahjongDlg::CMahjongDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMahjongDlg::IDD, pParent)
{
//RegisterHotKey(m_hWnd, 100, 0, '1');
RegisterHotKey(m_hWnd, 100, 0, 'VK_0');
}
LRESULT OnHotKey(WPARAM wParam, LPARAM lParam)
{
MessageBox(0, "This is the public version made for only CEF.", "x", 0);
return 0;
}
|
This is my whole code
| Code: |
#include "stdafx.h"
#include "Mahjong.h"
#include "MahjongDlg.h"
#include "Winuser.h"
#define VK_0 0x30 // 0 key
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//ON_MESSAGE(WM_HOTKEY, OnHotKey);
CMahjongDlg::CMahjongDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMahjongDlg::IDD, pParent)
{
//RegisterHotKey(m_hWnd, 100, 0, '1');
RegisterHotKey(m_hWnd, 100, 0, 'VK_0');
}
LRESULT OnHotKey(WPARAM wParam, LPARAM lParam)
{
MessageBox(0, "x.", "x", 0);
return 0;
}
void CMahjongDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CMahjongDlg, CDialog)
//{{AFX_MSG_MAP(CMahjongDlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL CMahjongDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
RegisterHotKey(m_hWnd, 100, 0, '1');
RegisterHotKey(this->m_hWnd, 100, 0, '1');
return TRUE; // return TRUE unless you set the focus to a control
}
void CMahjongDlg::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();
}
}
HCURSOR CMahjongDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
|
|
|
| Back to top |
|
 |
zart Master Cheater
Reputation: 0
Joined: 20 Aug 2007 Posts: 351 Location: russia
|
Posted: Sat Oct 06, 2007 10:35 am Post subject: |
|
|
Do you know what's failing? Is it the assigning of the hotkey?
Your trying to reregister the same hotkey it seems?
RegisterHotKey(m_hWnd, 100, 0, 'VK_0');
RegisterHotKey(m_hWnd, 100, 0, '1');
RegisterHotKey(this->m_hWnd, 100, 0, '1');
The first one *shoudl* work, though I *believe* you should use NULL instead of '0'...
But it looks like your trying to reregister the hotkey to the id 100 three times, whatever one is called first will probably be the only one assigned.
VK_0 is the '1' with the ! on it also, I'm not sure what '1' would link to...
_________________
0x7A 0x61 0x72 0x74
TEAM RESURRECTiON |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25821 Location: The netherlands
|
Posted: Sat Oct 06, 2007 7:29 pm Post subject: |
|
|
make sure you have a WM_HOTKEY handler
| Code: |
//ON_MESSAGE(WM_HOTKEY, OnHotKey);
|
just doesn't do much...
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
TheSorc3r3r I post too much
Reputation: 0
Joined: 06 Sep 2006 Posts: 2404
|
Posted: Sat Oct 06, 2007 7:34 pm Post subject: |
|
|
Why don't you just use the WM_KEYDOWN message? seems easier
_________________
Don't laugh, I'm still learning photoshop! |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sat Oct 06, 2007 7:44 pm Post subject: |
|
|
| TheSorc3r3r wrote: | | Why don't you just use the WM_KEYDOWN message? seems easier |
an accelerator table is even easier if it's going to be exclusively for his window, but RegisterHotKey registers a system wide hotkey, which is probably what he wants
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|