现在的位置: 首页 > 综合 > 正文

GetActiveWindow与GetForegroundWindow的区别

2014年11月14日 ⁄ 综合 ⁄ 共 222字 ⁄ 字号 评论关闭
 

  GetActiveWindow()   是你的程序的当前激活的窗口。  
  GetForegroundWindow()   是整个Windows系统的当前激活的窗口。

VC关于获得窗体标题的具体做法
CString str;
HWND pWnd =::GetForegroundWindow();
::GetWindowText(pWnd,str.GetBuffer(256),256);
::SetDlgItemText(pWnd,IDC_ADDRESS,str);

抱歉!评论已关闭.