I have a simple dialog box created (IDD_DIALOG1) that I want to make as the sole window to the entire program. Everything works great except that being a dialog box no tab shows up in the taskbar when run, the user has to close all other open windows to find it. Here is my skimmed down code, is there an easy way to make it so my program can be accessed from the task bar without having to manually create a child window that looks like a dialog box? I'm using MSVC++ by the way. I feel like I'm missing something very simple...
Code:
#include <windows.h>
#include <process.h>
#include <vector>
#include <commctrl.h>
#include <shlobj.h>
#include <objbase.h>
#include <string>
#include <direct.h>
#include <time.h>
#include <shellapi.h>

#include <stdio.h>
#pragma comment(lib, "gdi32.lib")
#pragma comment(lib, "comctl32.lib")
#pragma comment(lib, "shell32.lib")
#pragma comment(lib, "ole32.lib")

#include "resource.h"

using namespace std;



LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK MainDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow)
{
	srand(time(NULL));
	static TCHAR szAppName[]=TEXT("Test");  // TCHAR=character string
	HWND hwnd;   // handle to a window
	MSG msg;   // message
	WNDCLASS wndclass;  // window class we are declaring


	// Now we set the attributes for our window
	wndclass.style=CS_HREDRAW | CS_VREDRAW;  // Style, in this case can be redrawn
	wndclass.lpfnWndProc=WndProc;  // window process name - handles message calls
	wndclass.cbClsExtra=0;  // Extra space for the window
	wndclass.cbWndExtra=0;  // ditto
	wndclass.hInstance=hInstance;  // program instance name passed to WinMain
	wndclass.hIcon=LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));  // Load icon for the tray
	wndclass.hCursor=LoadCursor(NULL, IDC_ARROW);  // Load icon for the mouse arrow
	wndclass.hbrBackground=(HBRUSH) GetStockObject(WHITE_BRUSH);  // Load background color
	wndclass.lpszMenuName=NULL;  // Set menu - none here
	wndclass.lpszClassName=szAppName;  // Sets window name, taken from above


	if (!RegisterClass(&wndclass))
	{
		MessageBox(NULL, TEXT("Unable to open program!"), szAppName, MB_ICONERROR);
		return 0;
	}



	hwnd=CreateWindow(szAppName, TEXT("Test"), WS_OVERLAPPEDWINDOW,
		CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL,
		hInstance, NULL);  // Create the window!  Name, Title, Style, x Position, y Position
	                       // X size, Y size, parent window handle, window menu handle, 
						   // program instance handle, creation parameters(passing variables)

	//ShowWindow(hwnd, iCmdShow);  // now show the window!
	UpdateWindow(hwnd);   // update it

	while (GetMessage(&msg, NULL, 0, 0))  // gets message from mouse and keyboard, always non
		                                  // zero until you quit the window
	{
		TranslateMessage(&msg);           // translates message from message queue (mouse/keyboard/etc)
		DispatchMessage(&msg);			  // sends to WndProc to translate and tell what to do!
	}

	return msg.wParam;

}

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	static HINSTANCE hInstance;
	static HWND hDlg;

	switch (message)
	{
	case WM_CREATE:
		hInstance=((LPCREATESTRUCT) lParam)->hInstance;
		DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), hwnd, MainDialogProc);
		PostQuitMessage(0);
		return 0;

	case WM_SIZE:
	
		return 0;

	case WM_PAINT:

		return 0;

	case WM_DESTROY:
		PostQuitMessage(0);
		return 0;

	}

	return DefWindowProc(hwnd, message, wParam, lParam);
}

BOOL CALLBACK MainDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{

	switch (message)
	{
	case WM_INITDIALOG:

		return TRUE;


	case WM_COMMAND:

		return TRUE;

	case WM_CLOSE:

		PostQuitMessage(0);
		return 0;

	case WM_DESTROY:
		PostQuitMessage(0);
		return 0;
	}

	return FALSE;
}