hey guys i tryed today to make a simple messagebox detourfunc hook for a sample but it still wont work maybe some one of you can get me through what i did wrong here comes the code 
forget to say that i use Detour 1.5 and the lib
C++:
#include "detours.h"
#pragma comment(lib, "detours.lib")
int (__stdcall* InsertDateTime)(int x); //Function prototype
int MyInsertDateTime(int x) //Our function
{
//Messagebox
MessageBoxA(NULL, "InsertDateTime Just Got Called", "InsertDateTime", MB_OK);
return InsertDateTime(x); //Return the origional function
}
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
InsertDateTime = (int (__stdcall*)(int))DetourFunction((PBYTE)0x0100978A, (PBYTE)MyInsertDateTime);
Beep(1000,1000);
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
DetourRemove((PBYTE)0x0100978A, (PBYTE)InsertDateTime);
break;
}
return TRUE;
}