mon probleme doit venir d`ailleurs alors.
voila la prog de mon projet dll (si tu as qqch a dire):
#include <windows.h>
# define DLLEXPORT __declspec (dllexport)
# define DLLIMPORT __declspec (dllimport)
HINSTANCE moduleCourant;
HHOOK hookClavier;
LRESULT CALLBACK InterceptionCombinaisonsClavier(int nCode, WPARAM wParam, LPARAM lParam)
{
if(nCode == HC_ACTION)
{
KBDLLHOOKSTRUCT kbStruct = *((KBDLLHOOKSTRUCT *)lParam);
switch(wParam)
{
case WM_KEYDOWN:
if (kbStruct.vkCode == VK_LWIN || kbStruct.vkCode == VK_RWIN) // bloque touches windows
return 1;
if (kbStruct.vkCode == VK_ESCAPE && GetAsyncKeyState(VK_CONTROL)) // bloque control+echap
return 1;
if (kbStruct.vkCode == VK_MENU || kbStruct.vkCode == VK_TAB) // alt+tab
return 1;
if (kbStruct.vkCode == VK_MENU || kbStruct.vkCode == VK_F4) // alt+f4
return 1;
}
}
return CallNextHookEx(hookClavier, nCode, wParam, lParam);
}
void DLLEXPORT InitHook()
{
hookClavier = SetWindowsHookEx(WH_KEYBOARD_LL, InterceptionCombinaisonsClavier, moduleCourant, 0);
}
void DLLEXPORT EndHook()
{
UnhookWindowsHookEx(hookClavier);
}
BOOL APIENTRY DllMain (HINSTANCE hDll, DWORD dwReason, LPVOID Reserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
moduleCourant = hDll;
}
if (dwReason == DLL_PROCESS_DETACH)
{
EndHook();
}
return 1;
}
et j`ai fais une appli console comme dans l`exemple que tu m`as donne, et ajoute le .a au projet.