Hi I want to blit an image bitmap1.bmp using a code snippet I found online. I've tried with both windows 7 and windows 8.1

As I've understood it, GDI is still supported on these operating systems. I wonder what is wrong, all I get is an empty window with no blitting whatsoever. Maybe you can compile it and try to find what's wrong if you have experience with win32/gdi

Thanks

Click for an image of the program with the empty window

Code:
#include <windows.h>


HINSTANCE hInst;

LRESULT CALLBACK WindProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);



INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,

                   LPSTR lpCmdLine, int nCmdShow)

{

    WNDCLASSEX  WndCls;

    static char szAppName[] = "BitmapIntro";

    MSG         Msg;



	hInst       = hInstance;

    WndCls.cbSize        = sizeof(WndCls);

    WndCls.style         = CS_OWNDC | CS_VREDRAW | CS_HREDRAW;

    WndCls.lpfnWndProc   = WindProcedure;

    WndCls.cbClsExtra    = 0;

    WndCls.cbWndExtra    = 0;

    WndCls.hInstance     = hInst;

    WndCls.hIcon         = LoadIcon(NULL, IDI_APPLICATION);

    WndCls.hCursor       = LoadCursor(NULL, IDC_ARROW);

    WndCls.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);

    WndCls.lpszMenuName  = NULL;

    WndCls.lpszClassName = szAppName;

    WndCls.hIconSm       = LoadIcon(hInstance, IDI_APPLICATION);

    RegisterClassEx(&WndCls);



    CreateWindowEx(WS_EX_OVERLAPPEDWINDOW,

                          szAppName,

                          "Bitmaps Fundamentals",

                          WS_OVERLAPPEDWINDOW | WS_VISIBLE,

                          CW_USEDEFAULT,

                          CW_USEDEFAULT,

                          CW_USEDEFAULT,

                          CW_USEDEFAULT,

                          NULL,

                          NULL,

                          hInstance,

                          NULL);



    while( GetMessage(&Msg, NULL, 0, 0) )

    {

        TranslateMessage(&Msg);

        DispatchMessage( &Msg);

    }



    return (int)(Msg.wParam);

}



LRESULT CALLBACK WindProcedure(HWND hWnd, UINT Msg,

			   WPARAM wParam, LPARAM lParam)

{

    HDC hDC, MemDCExercising;

    PAINTSTRUCT Ps;

    HBITMAP bmpExercising;



    switch(Msg)

    {

	case WM_DESTROY:

	    PostQuitMessage(WM_QUIT);

	    break;

	case WM_PAINT:

	    hDC = BeginPaint(hWnd, &Ps);



	    // Load the bitmap from the resource

	    bmpExercising = LoadBitmap(hInst, "bitmap1.bmp");

	    // Create a memory device compatible with the above DC variable

	    MemDCExercising = CreateCompatibleDC(hDC);

             // Select the new bitmap

             SelectObject(MemDCExercising, bmpExercising);



	    // Copy the bits from the memory DC into the current dc

	    BitBlt(hDC, 10, 10, 450, 400, MemDCExercising, 0, 0, SRCCOPY);



	    // Restore the old bitmap

	    DeleteDC(MemDCExercising);

	    DeleteObject(bmpExercising);

	    EndPaint(hWnd, &Ps);

	    break;

	default:

	    return DefWindowProc(hWnd, Msg, wParam, lParam);

    }

    return 0;

}