Last Updated 2002/10/29
Programming Tips Visual C++ API  索 引 
Win16からのSetForegroundWindow
2002/10/29

Win16 である VC++1.5 では SetForegroundWindow() の宣言がない.
これは宣言がないだけで USER.EXE で Export されている.

    [*.h]
        #ifdef __cplusplus
        extern "C" {
        #endif
        BOOL    WINAPI  SetForegroundWindow(HWND);
        #ifdef __cplusplus
        }
        #endif
    [*.def]
        IMPORTS
            USER.SetForegroundWindow

これで使用できるようになる.

また,
    SendMessage(WM_SYSCOMMAND, SC_HOTKEY, MAKELONG(hWnd, 0));
とすると SetForegroundWindow() と同じような動きをする.


参照
前後のTips
Win16からのSetForegroundWindow

DSS ProgrammingTipsCGI Ver2.02