   Manipulating Windows
  Hello All,I am working on a small project and I am trying to have two windows on my screen simultaneously with different text on them. The problem I'm having is that when I open up my second window it is just an exact copy of the first window but I have them as different window classes. I am using Windows API and I am relatively new to this. Any help would be great thanks.apipher   
  Show a complete, but minimal, code sample that demonstrates your problem.   ;int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,    LPSTR lpCmdLine, int nCmdShow){WNDCLASSEX wc, wc2;    MSG Msg;srand( (unsigned)time( 0 ) );ZeroMemory(&wc, sizeof wc);wc.cbSize   = sizeof(WNDCLASSEX);    wc.style    = 0;    wc.lpfnWndProc   = WndProc;    wc.cbClsExtra    = 0;    wc.cbWndExtra    = 0;hInst= wc.hInstance;    wc.hIcon    = LoadIcon(NULL, IDI_APPLICATION);    wc.hCursor  = LoadCursor(NULL, IDC_ARROW);    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);    wc.lpszMenuName  = NULL;    wc.lpszClassName = g_szClassName;    wc.hIconSm  = LoadIcon(NULL, IDI_APPLICATION);if(!RegisterClassEx(&wc))    {   MessageBox(NULL, "Window 1 Registration Failed!", "Error!",  MB_ICONEXCLAMATION | MB_OK);   return 0;    }hwnd = CreateWindowEx( WS_EX_DLGMODALFRAME, g_szClassName, "Word Search", WS_OVERLAPPEDWINDOW, 200, 200, 384, 512, NULL, NULL, hInst, NULL );if(hwnd == NULL)    {   MessageBox(NULL, "Window 1 Creation Failed!", "Error!",  MB_ICONEXCLAMATION | MB_OK);   return 0;    }ZeroMemory(&wc2, sizeof wc2);wc2.cbSize   = sizeof(WNDCLASSEX);    wc2.style    = 0;    wc2.lpfnWndProc   = WndProc2;    wc2.cbClsExtra    = 0;    wc2.cbWndExtra    = 0;    hInst2  = wc2.hInstance;    wc2.hIcon    = LoadIcon(NULL, IDI_APPLICATION);    wc2.hCursor  = LoadCursor(NULL, IDC_ARROW);    wc2.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);    wc2.lpszMenuName  = NULL;    wc2.lpszClassName = g_szClassName2;    wc2.hIconSm  = LoadIcon(NULL, IDI_APPLICATION);if(!RegisterClassEx(&wc2))    {   MessageBox(NULL, "Window 2 Registration Failed!", "Error!",  MB_ICONEXCLAMATION | MB_OK);   return 0;    }hwnd2 = CreateWindowEx( WS_EX_DLGMODALFRAME, g_szClassName, "Word Search 2", WS_OVERLAPPEDWINDOW, 584, 200, 384, 512, hwnd, NULL, hInst2, NULL );if(hwnd2 == NULL)    {   MessageBox(NULL, "Window 2 Creation Failed!", "Error!",  MB_ICONEXCLAMATION | MB_OK);   return 0;    }    while(GetMessage(&Msg, NULL, 0, 0) > 0)    {   TranslateMessage(&Msg);   DispatchMessage(&Msg);    }    return (int) Msg.wParam;}This is my WinMain function.case WM_PAINT: BITMAP bm; PAINTSTRUCT ps; hDC = BeginPaint( hwnd, &ps ); for( int i = 0; (unsigned) i < strlen(animal); i++ ) {    int letter = (int) animal - 65;    HDC hdcMem = CreateCompatibleDC(hDC);    HBITMAP hbmOld = (HBITMAP) SelectObject(hdcMem, Alphabet[letter]);    GetObject(Alphabet[letter], sizeof(bm), &bm);    BitBlt(hDC, 16*i, 25, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);    SelectObject(hdcMem, hbmOld);    DeleteDC(hdcMem); } EndPaint( hwnd, &ps );This case statment is in my WndProc.To explain a bit. I have my two windows defined above and they are both shown in their own WndProc when ShowWindow() is called. This WM_PAINT is in the first window's WndProc. Whats happening is that when I run my program it paints the information on both windows when I want it to only paint on the first one but I still want the other window up because I will be wanting to paint other stuff up there while this is being painted on the first window.Thanks for any help. If this is not enough to tell whats going on I will post more I just don't know how much you need and I don't want to post my whole code.apipher.   ;  hwnd2 is a window created with the g_szClassName classname, not g_szClassName2.   ;  Thanks, that was a stupid mistake.   