I have a DLL that has a function something like this:
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
{
switch( fdwReason )
{
case DLL_PROCESS_ATTACH:
{
g_hOle32Dll = LoadLibrary(_T("ole32.dll"));
pCoCreateInstance = (COCREATEINSTANCE)DetourFunc(
(BYTE*)GetProcAddress(g_hOle32Dll, "CoCreateInstance"),
(BYTE*)dtx_CoCreateInstance, 5);
hMyWindowHwnd = CreateDialog(hinstDLL, MAKEINTRESOURCE(IDD_MyWindow), NULL, MyWindowProc);
ShowWindow(hMyWindowHwnd, SW_SHOW);
break;
}
case DLL_PROCESS_DETACH:
{
RetourFunc((BYTE*)GetProcAddress(g_hOle32Dll, "CoCreateInstance"),
(BYTE*)pCoCreateInstance, 5);
DestroyWindow(hMyWindowHwnd);
break;
}
}
return TRUE;
}
HRESULT STDAPICALLTYPE my_CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter,
DWORD dwClsContext, REFIID riid, LPVOID* ppv)
{ /* ... function definition ... */ }
DllMain() should create and show a window. The Universal Injector does not make this window show (it does work with the "RTCW:ET" loader.exe). Is there another way to make my own popup window show?