Now for some specifics from your project:
Make sure you include every thing you need
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <commctrl.h> //<-Gotta have this
#include "GUITest.h"
Make sure you register all of the window components you'll need and load the windows class struct from the built in dialog definition
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){
InitCommonControls(); //<- Don't forget
WNDCLASSEX wc;
HWND hwnd;
MSG Msg;
int error;
wc.cbSize = sizeof(WNDCLASSEX);
if (!GetClassInfoEx(NULL, MAKEINTRESOURCE(32770), &wc)) //<-Must do this for dialog app
return 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, MAKEINTRESOURCE(ID_MAINICON));
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wc.lpszClassName = g_szClassName;
wc.hIconSm = LoadIcon(NULL, MAKEINTRESOURCE(ID_MAINICON));
if(!RegisterClassEx(&wc)) {
MessageBox(NULL, "Window Registration Failed!", "Error!",MB_ICONEXCLAMATION | MB_OK);
return 0;
}
Use the proper CALLBACK for Dialogs
BOOL CALLBACK DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){
switch(msg) {
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return FALSE;
}
return FALSE;
}
Make sure to assign the class name to the dialog in the properties