heiko0610
April 11th, 2009, 02:33 PM
i´m new on c++.
have a 3d engine, but want to draw some things by hooking this engine.
(should work as 2dengine.perhaps as addon(anytime if i better in coding with c++)
i need 2 functions in my dll.
1. Init2D
2. DeInit2D
based on the code down under, what i should write?
as information.....i can get the pointer of LPDIRECT3DDEVICE9 from the 3d engine with internal function GetDevice(). (perhaps its helpfully)
i only want to draw in the existing dx9 window....
could anybody help me to write this 2 functions for my dll.
excuse me for my bad english, and hope i can understand the help what i get here.
// Hook structure.
SDLLHook D3DHook =
{
"DDRAW.DLL",
false, NULL, // Default hook disabled, NULL function pointer.
{
{ "DirectDrawCreate", MyDirectDrawCreate },
{ NULL, NULL }
}
};
BOOL APIENTRY DllMain( HINSTANCE hModule,
DWORD fdwReason,
LPVOID lpReserved )
{
// When initializing....
if ( fdwReason == DLL_PROCESS_ATTACH )
{
hDLL = hModule;
// We don't need thread notifications for what we're doing.
// Thus, get rid of them, thereby eliminating some of the
// overhead of this DLL
DisableThreadLibraryCalls( hModule );
// Only hook the APIs if this is the Everquest process.
GetModuleFileName( GetModuleHandle( NULL ),
Work,
sizeof(Work) );
PathStripPath( Work );
if ( stricmp( Work, "myhooktarget.exe" ) == 0 )
HookAPICalls( &D3DHook );
}
return TRUE;
}
have a 3d engine, but want to draw some things by hooking this engine.
(should work as 2dengine.perhaps as addon(anytime if i better in coding with c++)
i need 2 functions in my dll.
1. Init2D
2. DeInit2D
based on the code down under, what i should write?
as information.....i can get the pointer of LPDIRECT3DDEVICE9 from the 3d engine with internal function GetDevice(). (perhaps its helpfully)
i only want to draw in the existing dx9 window....
could anybody help me to write this 2 functions for my dll.
excuse me for my bad english, and hope i can understand the help what i get here.
// Hook structure.
SDLLHook D3DHook =
{
"DDRAW.DLL",
false, NULL, // Default hook disabled, NULL function pointer.
{
{ "DirectDrawCreate", MyDirectDrawCreate },
{ NULL, NULL }
}
};
BOOL APIENTRY DllMain( HINSTANCE hModule,
DWORD fdwReason,
LPVOID lpReserved )
{
// When initializing....
if ( fdwReason == DLL_PROCESS_ATTACH )
{
hDLL = hModule;
// We don't need thread notifications for what we're doing.
// Thus, get rid of them, thereby eliminating some of the
// overhead of this DLL
DisableThreadLibraryCalls( hModule );
// Only hook the APIs if this is the Everquest process.
GetModuleFileName( GetModuleHandle( NULL ),
Work,
sizeof(Work) );
PathStripPath( Work );
if ( stricmp( Work, "myhooktarget.exe" ) == 0 )
HookAPICalls( &D3DHook );
}
return TRUE;
}