If you take out everything from your app that relates to Gdi+, what you are left with is this:
#include "framework.h"
#include "myApp.h"
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
return (int) msg.wParam;
}
Which does ... nothing, pretty much.
At a guess, when you put the GDI stuff back in, you get compilation errors, so start here:
Using GDI+ - Win32 apps | Microsoft Learn[
^]