只要不用mfc,其他什么方法都行.

解决方案 »

  1.   

    GetActiveWindow
    The GetActiveWindow function retrieves the window handle to the active window attached to the calling thread's message queue. HWND GetActiveWindow(VOID);
      

  2.   

    楼上说的不是特别准确GetForegroundWindow() 也可以的,不过有区别,这点你要好好看看了!!!!!!GetActiveWindow()            指(你的程序)当前激活的窗口。
    GetForegroundWindow()        是指(整个Windows系统)当前激活的窗口。