// HookTest.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
BOOL CALLBACK DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
LRESULT CALLBACK JournalRecordProc(int code,WPARAM wParam,LPARAM lParam);
LRESULT CALLBACK JournalPlaybackProc(int code,WPARAM wParam,LPARAM lParam);
void Clear();
HINSTANCE g_hInst;
HHOOK g_Record;
HHOOK g_Play;
HWND g_hWnd;
int g_nCount = 0;
int g_nCount1 = 0;
int g_nCount2 = 0;
struct EVENTMSG_NODE
{
EVENTMSG msg;
EVENTMSG_NODE *pNext;
};
EVENTMSG_NODE *g_pHead = NULL;
EVENTMSG_NODE *g_pEnd = NULL;
EVENTMSG_NODE *g_pLast;
EVENTMSG_NODE *g_pNext;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
g_hInst = hInstance;
HWND hWnd = CreateDialog(hInstance,MAKEINTRESOURCE(IDD_HOOK),NULL,DialogProc);
ShowWindow(hWnd,SW_SHOW);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
BOOL CALLBACK DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
{
g_hWnd = hWnd;
EnableWindow(GetDlgItem(hWnd, IDC_STOP),FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_PLAY),FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_RECORD),TRUE);
EnableWindow(GetDlgItem(hWnd, IDC_SAVE),FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_LOAD),TRUE);
}
break;
case WM_CLOSE:
DestroyWindow(hWnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
case WM_COMMAND:
//
#include "stdafx.h"
BOOL CALLBACK DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
LRESULT CALLBACK JournalRecordProc(int code,WPARAM wParam,LPARAM lParam);
LRESULT CALLBACK JournalPlaybackProc(int code,WPARAM wParam,LPARAM lParam);
void Clear();
HINSTANCE g_hInst;
HHOOK g_Record;
HHOOK g_Play;
HWND g_hWnd;
int g_nCount = 0;
int g_nCount1 = 0;
int g_nCount2 = 0;
struct EVENTMSG_NODE
{
EVENTMSG msg;
EVENTMSG_NODE *pNext;
};
EVENTMSG_NODE *g_pHead = NULL;
EVENTMSG_NODE *g_pEnd = NULL;
EVENTMSG_NODE *g_pLast;
EVENTMSG_NODE *g_pNext;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
g_hInst = hInstance;
HWND hWnd = CreateDialog(hInstance,MAKEINTRESOURCE(IDD_HOOK),NULL,DialogProc);
ShowWindow(hWnd,SW_SHOW);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
BOOL CALLBACK DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
{
g_hWnd = hWnd;
EnableWindow(GetDlgItem(hWnd, IDC_STOP),FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_PLAY),FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_RECORD),TRUE);
EnableWindow(GetDlgItem(hWnd, IDC_SAVE),FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_LOAD),TRUE);
}
break;
case WM_CLOSE:
DestroyWindow(hWnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
case WM_COMMAND: