How to Popup Image window for Inverted Image in C++

I am a beginner in C++, and I’am using Visual Studio 2015.

I want to pop up an image where I invert the RGB values from the given input image, and I don’t want to use any third party libraries for that such as OpenCV. The output should be two popup image windows:
1. The input image.
2. The inverted RGB image of the input.

The problem is that the second popup image is same as the first popup image i.e the input image.

I have already debugged the following code and I think that the problem is at Draw_bitmap() and at HWND wnd1.

Please guide me with your valuable suggestions.

#include "stdafx.h"

#include <windows.h>
#include <gdiplus.h>
#include <iostream>
#include <map>
#include <agents.h>
#include <ppl.h>
#include<tchar.h>


#pragma comment (lib, "gdiplus")
//using namespace concurrency;
using namespace Gdiplus;
using namespace std;



HDC         imageDC,imagedc1;        // the DC to hold our image
HBITMAP     imageBmp,imagebmp1;       // the actual bitmap which contains the image (will be put in the DC)
HBITMAP     imageBmpOld,imagebmpold;    // the DC's old bitmap (for cleanup)

const int   screenSize_X = 640;
const int   screenSize_Y = 480;
static const wchar_t* filename = L"C://Users//nagiiii//Documents//Visual Studio 2015//Projects//test//data//input1.bmp";
void Draw_Bitmap(HINSTANCE inst);
//
/*         code that saves a red, green,lue image from an original image                    */      
//

Bitmap* bmp1;
Image*  bmp;
//Image* invert1;
Bitmap* green ;
Bitmap* red ;
Bitmap* blue ;
Bitmap* invert;


// Function to load the image into our DC so we can draw it to the screen
void loadImage(const wchar_t* filename)
{
    imageDC = CreateCompatibleDC(NULL);     // create an offscreen DC

    imageBmp = (HBITMAP)::LoadImage(         // load the bitmap from a file
        NULL,                           // not loading from a module, so this is NULL
        filename,                       // the path we're loading from
        IMAGE_BITMAP,                   // we are loading a bitmap
        0, 0,                            // don't need to specify width/height
        LR_DEFAULTSIZE | LR_LOADFROMFILE// use the default bitmap size (whatever the file is), and load it from a file
    );


    imageBmpOld = (HBITMAP)SelectObject(imageDC, imageBmp);  // put the loaded image into our DC
}

///////////////////////////////
// Function to clean up
void cleanUpImage()
{
    SelectObject(imageDC, imageBmpOld);      // put the old bmp back in our DC
    SelectObject(imagedc1, imagebmpold);
    DeleteObject(imageBmp);                 // delete the bmp we loaded
    DeleteDC(imageDC);                      // delete the DC we created
}

///////////////////////////////
///////////////////////////////
// The function to draw our image to the display (the given DC is the screen DC)
void drawImage(HDC screen)
{
    BitBlt(
        screen,         // tell it we want to draw to the screen
        0, 0,            // as position 0,0 (upper-left corner)
        screenSize_X,   // width of the rect to draw
        screenSize_Y,   // height of the rect
        imageDC,        // the DC to get the rect from (our image DC)
        0, 0,            // take it from position 0,0 in the image DC
        SRCCOPY         // tell it to do a pixel-by-pixel copy
    );
}


///////////////////////////////
///////////////////////////////
// A callback to handle Windows messages as they happen
LRESULT CALLBACK wndProc(HWND wnd, UINT msg, WPARAM w, LPARAM l)
{
    // what kind of message is this?
    switch (msg)
    {
        // we are interested in WM_PAINT, as that is how we draw
    case WM_PAINT:
    {
        PAINTSTRUCT ps;
        HDC screen = BeginPaint(wnd, &ps);   // Get the screen DC
        drawImage(screen);                  // draw our image to our screen DC
        EndPaint(wnd, &ps);                  // clean up
    }break;

    // we are also interested in the WM_DESTROY message, as that lets us know when to close the window
    case WM_DESTROY:
        PostQuitMessage(0);
        break;
    }

    // for everything else, let the default window message handler do its thing
    return DefWindowProc(wnd, msg, w, l);
}


///////////////////////////////
///////////////////////////////
// A function to create the window and get it set up
HWND createWindow(HINSTANCE inst)
{
    WNDCLASSEX wc = { 0 };        // create a WNDCLASSEX struct and zero it
    wc.cbSize = sizeof(WNDCLASSEX);     // tell windows the size of this struct
    wc.hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW));        // tell it to use the normal arrow cursor for this window
    wc.hInstance = inst;                   // give it our program instance
    wc.lpfnWndProc = wndProc;                // tell it to use our wndProc function to handle messages
    wc.lpszClassName = TEXT("DisplayImage");   // give this window class a name.

    RegisterClassEx(&wc);           // register our window class with Windows

                                    // the style of the window we want... we want a normal window but do not want it resizable.
    int style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU;    // normal overlapped window with a caption and a system menu (the X to close)

                                                            // Figure out how big we need to make the window so that the CLIENT area (the part we will be drawing to) is
                                                            //  the desired size
    RECT rc = { 0,0,screenSize_X,screenSize_Y };      // desired rect
    AdjustWindowRect(&rc, style, FALSE);              // adjust the rect with the given style, FALSE because there is no menu

    return CreateWindow(            // create the window
        TEXT("DisplayImage"),       // the name of the window class to use for this window (the one we just registered)
        TEXT("Display an Image"),   // the text to appear on the title of the window
        style | WS_VISIBLE,         // the style of this window (OR it with WS_VISIBLE so it actually becomes visible immediately)
        100, 100,                    // create it at position 100,100
        rc.right - rc.left,         // width of the window we want
        rc.bottom - rc.top,         // height of the window
        NULL, NULL,                  // no parent window, no menu
        inst,                       // our program instance
        NULL);                      // no extra parameter

}

LRESULT CALLBACK wndProc1(HWND wnd1, UINT msg1, WPARAM w, LPARAM l)
{
    // what kind of message is this?
    switch (msg1)
    {
        // we are interested in WM_PAINT, as that is how we draw
    case WM_PAINT:
    {
        PAINTSTRUCT ps;
        HDC screen = BeginPaint(wnd1, &ps);   // Get the screen DC
        drawImage(screen);                  // draw our image to our screen DC
        EndPaint(wnd1, &ps);                  // clean up
    }break;

    // we are also interested in the WM_DESTROY message, as that lets us know when to close the window
    case WM_DESTROY:
        PostQuitMessage(0);
        break;
    }

    // for everything else, let the default window message handler do its thing
    return DefWindowProc(wnd1, msg1, w, l);
}

HWND createWindow1(HINSTANCE inst)
{
    WNDCLASSEX wc1 = { 0 };        // create a WNDCLASSEX struct and zero it
    wc1.cbSize = sizeof(WNDCLASSEX);     // tell windows the size of this struct
    wc1.hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW));        // tell it to use the normal arrow cursor for this window
    wc1.hInstance = inst;                   // give it our program instance
    wc1.lpfnWndProc = wndProc1;                // tell it to use our wndProc function to handle messages
    wc1.lpszClassName = TEXT("invertImage");   // give this window class a name.

    RegisterClassEx(&wc1);           // register our window class with Windows

                                    // the style of the window we want... we want a normal window but do not want it resizable.
    int style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU;    // normal overlapped window with a caption and a system menu (the X to close)

                                                            // Figure out how big we need to make the window so that the CLIENT area (the part we will be drawing to) is
                                                            //  the desired size
    RECT rc = { 0,0,screenSize_X,screenSize_Y };      // desired rect
    AdjustWindowRect(&rc, style, FALSE);              // adjust the rect with the given style, FALSE because there is no menu

    return CreateWindow(            // create the window
        TEXT("inverttImage"),       // the name of the window class to use for this window (the one we just registered)
        TEXT("invert Image"),   // the text to appear on the title of the window
        style | WS_VISIBLE,         // the style of this window (OR it with WS_VISIBLE so it actually becomes visible immediately)
        100, 100,                    // create it at position 100,100
        rc.right - rc.left,         // width of the window we want
        rc.bottom - rc.top,         // height of the window
        NULL, NULL,                  // no parent window, no menu
        inst,                       // our program instance
        NULL);                      // no extra parameter

}


/////


//Splitting the RGB Images, inverting RGB images
void GetRgb() {
    bmp = Image::FromFile(filename);
    bmp1 = new Bitmap(L"C://Users//nagiiii//Documents//Visual Studio 2015//Projects//test//data//input1.bmp");
     invert = new Bitmap(bmp->GetWidth(), bmp->GetHeight());//
     green = new Bitmap(bmp->GetWidth(), bmp->GetHeight());//Assigning intial width and height using GetWidth &GetHeight
     red = new Bitmap(bmp->GetWidth(), bmp->GetHeight());
     blue = new Bitmap(bmp->GetWidth(), bmp->GetHeight());

    for (int x = 0; x < 640; x++)
    {
        for (int y = 0; y < 480; y++)
        {
            Color pxl; //creates a color object

            //spliting the Image into rgb sub images
            bmp1->GetPixel(x, y, &pxl);
            //Color newColor = FromArgb(pxl.GetR, 0, 0);
            Color redPxl = pxl.GetRed();
            Color grnPxl = pxl.GetGreen();
            Color bluePxl = pxl.GetBlue();

            //Inverting sub-images
            int invert_r = 255 - pxl.GetR();// Inverting red pixel
            int invert_g = 255 - pxl.GetG();// Inverting green pixel
            int invert_b = 255 - pxl.GetBlue();//Inverting blue pixel
                                               //COLORREF x(invert_r, invert_g, invert_b);
            Color ired(invert_r, invert_g, invert_b);

            red->SetPixel(x, y, redPxl); //setting red pixel
            green->SetPixel(x, y, grnPxl);//setting green pixel
            blue->SetPixel(x, y, bluePxl);//setting blue pixel
            /*cout << "red value:" << (int)pxl.GetR() << endl;
            cout << "green value:" << (int)pxl.GetG() << endl;
            cout << "blue value:" << (int)pxl.GetB() << endl;*/
            invert->SetPixel(x, y, ired);
            /*cout << "red value at x:"<< x<<"y :"<<y<<"is::"<< (int)ired.GetBlue() << endl;
            cout << "green value:x:" << x << "y :" << y << "is::" << (int)ired.GetRed() << endl;
            cout << "blue value:x:" << x << "y :" << y << "is::" << (int)ired.GetGreen() << endl;*/

        }
    }


}

void Draw_Bitmap(HINSTANCE inst) {

    imagedc1 = CreateCompatibleDC(NULL);
    Color color;
    invert->GetHBITMAP(color, &imagebmp1);
    SelectObject(imagedc1, imagebmp1);

}


int main(HINSTANCE inst, HINSTANCE prev, LPSTR cmd, int show){

    // GDI plus
    GdiplusStartupInput gdiplusStartupInput;
    ULONG_PTR gdiplusToken;

    GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);

    // load our image
    loadImage(filename);
    HWND wnd = createWindow(inst);   // create our window

    GetRgb();
    Draw_Bitmap(prev);
    HWND wnd1 = createWindow1(prev);

    // Do the message pump!  keep polling for messages (and respond to them)
    //  until the user closes the window.
    MSG msg,msg1;
    while (GetMessage(&msg, wnd, 0, 0)) // while we are getting non-WM_QUIT messages...
    {
        TranslateMessage(&msg);     // translate them
        DispatchMessage(&msg);      // and dispatch them (our wndProc will process them)
    }

    while (GetMessage(&msg1, wnd1, 0, 0)) // while we are getting non-WM_QUIT messages...
    {
        TranslateMessage(&msg1);     // translate them
        DispatchMessage(&msg1);      // and dispatch them (our wndProc will process them)
    }




    GdiplusShutdown(gdiplusToken);      // once the user quits....

    return 0;
    }