R
raym
Hi, I'm trying to figure out how to get a windows forms application I
just made with my visual studio wizard to respond to global hotkeys
I put this code in my Form1.h file:
public:
ATOM nAtom;
Form1(void)
{
InitializeComponent();
nAtom = GlobalAddAtom(L"TypematicHotkey");
UnregisterHotKey((HWND) this->Handle.ToPointer(), this->nAtom);
BOOL bRet = RegisterHotKey((HWND) this->Handle.ToPointer(), nAtom,
MOD_CONTROL, 'A');
bRet = (bRet)|1;
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
UnregisterHotKey((HWND) this->Handle.ToPointer(), this->nAtom);
GlobalDeleteAtom(this->nAtom);
delete components;
}
}
and so far as I can tell it's registering the hotkey, but I don't know
how to do anything once the hotkey is pressed
How do I add an OnHotKey handler, if indeed that's what I'm supposed
to be doing?
Thanks for your time,
- Ray
just made with my visual studio wizard to respond to global hotkeys
I put this code in my Form1.h file:
public:
ATOM nAtom;
Form1(void)
{
InitializeComponent();
nAtom = GlobalAddAtom(L"TypematicHotkey");
UnregisterHotKey((HWND) this->Handle.ToPointer(), this->nAtom);
BOOL bRet = RegisterHotKey((HWND) this->Handle.ToPointer(), nAtom,
MOD_CONTROL, 'A');
bRet = (bRet)|1;
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
UnregisterHotKey((HWND) this->Handle.ToPointer(), this->nAtom);
GlobalDeleteAtom(this->nAtom);
delete components;
}
}
and so far as I can tell it's registering the hotkey, but I don't know
how to do anything once the hotkey is pressed
How do I add an OnHotKey handler, if indeed that's what I'm supposed
to be doing?
Thanks for your time,
- Ray