>>605
GetForegroundWindowでアクティブウィンドハンドルを取得して、
GetWindowThreadProcessIdでそのウィンドウが属するスレッドのIDを取得して、
AttachThreadInputでそのスレッドにアタッチして、
SetForegroundWindowで自アプリのウィンドウを最前面にして、
AttachThreadInputでデタッチしておわり。