実は、WM_CREATE時に限っては、GetWindowLongとGWL_HINSTANCEを使わなくても、CREATESTRUCT.hInstanceという形でアプリケーションインスタンスハンドルを取得できる。
CREATESTRUCTA (winuser.h) - Win32 apps | Microsoft Docs
CREATESTRUCT.cppで、
lParamをLPCREATESTRUCT型のlpCreateStructにキャストして、lpCreateStruct->hInstanceを文字列変換し表示。
![まずは_tWinMain](https://cdn-ak.f.st-hatena.com/images/fotolife/B/BG1/20210108/20210108180217.png)
まずは_tWinMain。
![こちらはWindowProc内のWM_CREATEのlpCreateStruct->hInstance。](https://cdn-ak.f.st-hatena.com/images/fotolife/B/BG1/20210108/20210108180418.png)
こちらはWindowProc内のWM_CREATEのlpCreateStruct->hInstance。
![ウィンドウ表示は変わらない](https://cdn-ak.f.st-hatena.com/images/fotolife/B/BG1/20210108/20210108180713.png)
ウィンドウ表示は変わらない。
Sample/winapi/CREATESTRUCT/hInstance/src/CREATESTRUCT at master · bg1bgst333/Sample · GitHub