如题!
感激不禁!

解决方案 »

  1.   

    CWnd::GetActiveWindow.
    不知道这个能满足你的要求不。你是要取得整个系统当前哪个应用程序的哪个窗口被激活?
      

  2.   

    还有:static CWnd* PASCAL GetForegroundWindow( );
      

  3.   

    刚刚才找到个函数 IsWindowEnabled 基本上能完成这个任务
    但是 有没更好的办法来 获得当前激活的窗口,
    CWnd * pWnd = GetDesktopWindow();
    CWnd *pChildWnd=pWnd->GetWindow(GW_CHILD);
    ···
     //在这里怎么直接得到桌面下的当前被激活的窗口啊,而不要循环查找得到
      

  4.   

    This function retrieves the window handle to the active window associated with the thread that calls the function
    HWND GetActiveWindow(void);
    CWnd::GetTopWindow
    This method obtains a pointer to the top-level child window that belongs to this CWnd.CWnd* GetTopWindow( )
    const;