본문 바로가기

Windows

Obtaining the title of another application

It's very easy to get pointer of CWnd instance.

Just use CWnd::FindWindow function.

and we can find the title using GetWindowText member function

 

This is an example code to get a title of VLC player.

The class of VLC player is 'QWidget'

 

 

CString str;

CWnd* pWnd = CWnd::FindWindow(_T("QWidget"), 0);

if (pWnd)

{

pWnd->GetWindowText(str);

}

 

if (str.Find(_T("VLC")) >= 0)

{

MessageBox(str);

}

'Windows' 카테고리의 다른 글

[MFC] Directory Dialog  (0) 2016.08.24
[VisualStudio] stl::map insert vs operator[]. Which is faster?  (0) 2016.06.22
VC6 Static control double click 처리하기  (0) 2016.06.22
[MFC] Double buffering  (0) 2016.05.27
[MFC] Draw Text  (0) 2016.05.27