CWnd::FromHandleで、ウィンドウハンドルからCWndオブジェクトポインタを一時的に取得できる。
CWinApp_.cppで、
ウィンドウクラスにメニューリソース指定有。
CFrameWnd_.hで、
メンバに子ウィンドウハンドルm_hChildを追加。
CFrameWnd_.cppで、
OnCreateで子ウィンドウ生成しm_hChildを取得したら、OnItem1_1でCWnd::FromHandleを使ってpChildを取得し、pChild->SetWindowTextで"Item1-1"をセット。
![最初はこう](https://cdn-ak.f.st-hatena.com/images/fotolife/B/BG1/20240522/20240522153143.png)
最初はこう。
![こうして](https://cdn-ak.f.st-hatena.com/images/fotolife/B/BG1/20240522/20240522153236.png)
こうして、
![こうなる。](https://cdn-ak.f.st-hatena.com/images/fotolife/B/BG1/20240522/20240522153322.png)
こうなる。
Sample/mfc/CWnd/FromHandle/src/CWnd at master · bg1bgst333/Sample · GitHub