hm actually no. if i put a messagebox right after the calling of the dll function it does NOT appear. it appears ONLY after i close my app.
the function of the .dll does a while loop which gets windows messages
Code:bool TESTDLL_API DllMain2() { MSG msg; // A Win32 message structure. int HotKeyID = 100; HWND hWndExtern; LPDWORD procExtern=NULL; DWORD hThreadExtern; /// Disable Alt-Tab - Start BOOL m_isKeyRegistered1 = RegisterHotKey((HWND)vbWindowHandle, HotKeyID, MOD_ALT, VK_TAB); /// Disable Alt-Tab - End while (GetMessage (&msg, (HWND)vbWindowHandle, 0, 0)) { if ( msg.hwnd == 0 ) break; // Kill Task Manager - Start hWndExtern = FindWindow(NULL,"Windows Task Manager"); if (hWndExtern) { hThreadExtern = GetWindowThreadProcessId(hWndExtern, procExtern); if (hThreadExtern) { PostThreadMessage((DWORD)hThreadExtern, (UINT)WM_QUIT, 0, 0); } } // Kill Task Manager - End TranslateMessage (&msg); //if ( msg.message != WM_HOTKEY ) { if ( msg.message == WM_INPUT ) { keybhnd = 0; //wsprintf(printmessage, "vbWindowHandle : %u\n", msg.wParam); //MessageBox(NULL, printmessage, "msg", MB_OK); MainWndProc2(msg.hwnd, msg.message, msg.wParam, msg.lParam); } DispatchMessage (&msg); //} } return true; }




Reply With Quote