ShowWindow not working from a DLL on a 64-bit OS?

Posted by Auto Roast on Stack Overflow See other posts from Stack Overflow or by Auto Roast
Published on 2012-06-16T20:51:38Z Indexed on 2012/06/16 21:16 UTC
Read the original article Hit count: 438

Filed under:
|
|
|
|

I have a process that calls SetWindowsHook to catch keyboard events. In the DLL that processes the events, I conditionally call ShowWindow on the handle of the window of the process who set the hook.

That code works perfectly on a 32-bit OS (XP) and as a 32-bit application on a 64-bit OS, but when compiled to 64-bit, the window is not showing.

The code to make the window visible is:

if (idx == passlen) {
    HWND h = FindWindow(NULL,windowNameToShow);
    ShowWindow(h,SW_SHOW);
    idx = 0;
    logger->backerase(passlen - 1);
    nextCharToMatch = passPointer;
}

© Stack Overflow or respective owner

Related posts about c++

Related posts about dll