カテゴリー
アーカイブ
2021/06/01 / コンソール AP のウィンドウハンドル への1件のコメント
GetOpenFileName を調べていて,コンソール AP のウィンドウハンドルが必要になった.
ofn.hwndOwner の NULL の指定では,モードレスの動作になってしまう.
CFileDialog は DoModal 内で設定していて,通常の AP であればうまく動作する様になっている.

「コンソール AP ウィンドウハンドル」で検索すると次のものがあった.
How to obtain a Console Window Handle (HWND)
そこにあったサンプルを,関数として抜き出し.
con_wnd.hxx
2023/08/02
2023/03 に ::GetConsoleWindow を使用したので,その関連のまとめ.
VC 7 以降,WinCon.h に ::GetConsoleWindow が追加されている.

それで,con_wnd.hxx では VC 6 やそれ以降のものでもうまく通る様に変更している.
Is this 投稿 useful?
Useful
Useless
0 of 0 people say this 投稿 is useful.