有 1 筆資料符合您搜尋的條件

aarontu
2008年 11月 27日, 17:16
版面: C/C++
主題: 將視窗提到最前面的方式
回覆: 0
觀看: 8930

將視窗提到最前面的方式

window 2000之後版本,需要先取得該視窗焦點才可以SetForegroundWindow,最後在釋放
實作如下:
AttachThreadInput(GetWindowThreadProcessId(::GetForegroundWindow(),NULL),GetCurrentThreadId(),TRUE);
SetForegroundWindow();
AttachThreadInput(GetWindowThreadProcessId(::GetForegroundWindow(),NULL),GetCurrentThreadId(),FALSE);