참조 : http://hyacinth.byus.net/moniwiki/wiki.php/C%2B%2B/%28Windows%29Z-Order%20%EC%83%81%EC%9C%84%20%EC%9C%88%EB%8F%84%20%EB%B9%84%EA%B5%90
- int GetZIndex(HWND hTarget)
- {
- int index = 0;
- HWND hNext = ::GetTopWindow(NULL);
- do
- {
- hNext = ::GetNextWindow(hNext, GW_HWNDNEXT);
- if (hNext == hTarget)
- break;
- ++index;
- } while (hNext);
- return index;
- }
- // 예
- HWND hWnd1 = ::FindWindow(NULL, L"Daum - 모으다 잇다 흔들다 - Internet Explorer");
- HWND hWnd2 = ::FindWindow(NULL, L"Google - Internet Explorer");
- CString str;
- str.Format(_T("Daum %d; Google %d"), GetZIndex(hWnd1), GetZIndex(hWnd2));
- OutputDebugString(str.GetBuffer(0));
빠른번호일수록 위라고 한다.
'프로그래밍 > 리서치결과' 카테고리의 다른 글
atan2를 사용하여 각도를 구하기 (0) | 2014.09.01 |
---|---|
빅엔디안, 리틀엔디안 (0) | 2013.11.19 |
string to LPCWSTR (0) | 2013.09.26 |
warning c4819 the file contains a character that cannot be represented in the current code page (0) | 2013.08.06 |
QT setBackgroundBrsh에 대한 error 확인. (0) | 2013.05.27 |