Hey,

I want to give my applications the modern look of windows. I tried manifest files and c++ functions but when I use one of them the window does not show my button at all.

Here is the code:
Code:
#pragma comment( lib, "ComCtl32.lib" )

#define UNICODE

#include <Windows.h>
#include <CommCtrl.h>

InitCommonControls( );

CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "12_child_windows.manifest"

LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iShowingMode );

HINSTANCE hPublicInstance;

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iShowingMode )
{
	HWND		hWnd;
	MSG			msg;
	WNDCLASSW	wndClass;

	hPublicInstance = hInstance;

	wndClass.cbClsExtra		= 0;
	wndClass.cbWndExtra		= 0;
	wndClass.hbrBackground	= (HBRUSH) GetStockObject( WHITE_BRUSH );
	wndClass.hCursor		= LoadCursor( NULL, IDC_ARROW );
	wndClass.hIcon			= LoadIcon  ( NULL, IDI_WINLOGO );
	wndClass.hInstance		= hInstance;
	wndClass.lpfnWndProc	= WndProc;
	wndClass.lpszClassName	= L"Child Window";
	wndClass.lpszMenuName	= NULL;
	wndClass.style			= CS_VREDRAW | CS_HREDRAW;

	if( !RegisterClassW( &wndClass ) )
	{
		MessageBoxW( NULL, L"The program could not start!", L"Error", MB_OK );
		return -1;
	}

	hWnd = CreateWindow(	L"Child Window",
							L"Child Windows",
							WS_OVERLAPPEDWINDOW,
							CW_USEDEFAULT,
							CW_USEDEFAULT,
							CW_USEDEFAULT,
							CW_USEDEFAULT,
							NULL,
							NULL,
							hInstance,
							NULL
						);

	ShowWindow  ( hWnd, iShowingMode );
	UpdateWindow( hWnd );

	while( GetMessageW( &msg, NULL, 0, 0 ) )
	{
		TranslateMessage( &msg );
		DispatchMessage ( &msg );
	}

	return msg.lParam;
}

LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{

	static HWND		hWndChild;
	switch( msg )
	{
	case WM_CREATE:

		hWndChild = CreateWindow(	L"Button",
									L"Button",
									WS_CHILDWINDOW | WS_VISIBLE | BS_PUSHBUTTON,
									10,
									10,
									50,
									50,
									hWnd,
									NULL,
									hPublicInstance,
									NULL
								);

		return 0;
		break;


	case WM_DESTROY:

		PostQuitMessage( 0 );

		break;

	}

	return DefWindowProcW( hWnd, msg, wParam, lParam );
}
And here are the errors I get:
Code:
------ Build started: Project: 12_child_windows, Configuration: Debug Win32 ------
  main.cpp
c:\c++\12_child_windows\12_child_windows\main.cpp(8): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\c++\12_child_windows\12_child_windows\main.cpp(8): error C2556: 'int InitCommonControls(void)' : overloaded function differs only by return type from 'void InitCommonControls(void)'
          c:\program files\microsoft sdks\windows\v7.0a\include\commctrl.h(135) : see declaration of 'InitCommonControls'
c:\c++\12_child_windows\12_child_windows\main.cpp(8): error C2373: 'InitCommonControls' : redefinition; different type modifiers
          c:\program files\microsoft sdks\windows\v7.0a\include\commctrl.h(135) : see declaration of 'InitCommonControls'
c:\c++\12_child_windows\12_child_windows\main.cpp(10): error C2226: syntax error : unexpected type 'LPWSTR'
c:\c++\12_child_windows\12_child_windows\main.cpp(31): error C2065: 'WndProc' : undeclared identifier
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Does anybody know what I am doing wrong?

(I am using Visual Studio 2010)

Niklas