47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#include "stdafx.h"
|
|
#include "HookProcedure.h"
|
|
|
|
|
|
extern HHOOK g_hHook;
|
|
|
|
//----------------------------------------------------------------------
|
|
//
|
|
//----------------------------------------------------------------------
|
|
LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
|
|
{
|
|
char szPath[MAX_PATH] = {0,};
|
|
char *p = NULL;
|
|
|
|
//------------------------------
|
|
//
|
|
//------------------------------
|
|
TCHAR szCaptureWindowName[] = "MFC_PIDINFO_Training";
|
|
|
|
HWND hWindowToFind = NULL;
|
|
HWND hCurrTopWindowHandle = NULL;
|
|
|
|
TCHAR szMessage[ 128 ] = { 0, };
|
|
|
|
if( ( wParam == VK_F12 ) && !( lParam & FLAG_KEYDOWN ) )
|
|
{
|
|
hWindowToFind = FindWindow( NULL, szCaptureWindowName );
|
|
|
|
if( hWindowToFind != NULL )
|
|
{
|
|
// 해당 프로세스에게 메시지를 날린다
|
|
|
|
SendMessage( hWindowToFind, WM_USER + 10000, (WPARAM)0, (LPARAM)0 );
|
|
|
|
#if defined( _DEBUG_MODE_ )
|
|
MessageBox( NULL, "Send Message","", MB_OK );
|
|
#endif
|
|
}
|
|
else
|
|
{
|
|
#if defined( _DEBUG_MODE_ )
|
|
MessageBox( NULL, "No Found!","", MB_OK );
|
|
#endif //
|
|
}
|
|
}
|
|
return CallNextHookEx(g_hHook, nCode, wParam, lParam);
|
|
} |