Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1017253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:40:29+00:00 2026-05-16T10:40:29+00:00

I have a console application from which I create a window. I can render

  • 0

I have a console application from which I create a window.

I can render stuff in the window just fine. But the window is unresponsive/uncontrollable by the user.

As soon as you mouse over the window you get the hourglass cursor and cannot move the window.

What might be causing this?

EDIT:

    WNDCLASSEX wndClass;         // Window class
    ZeroMemory(&wndClass, sizeof(wndClass)); // Clear the window class structure
    wndClass.cbSize = sizeof(WNDCLASSEX); 
    wndClass.style          = CS_HREDRAW | CS_VREDRAW | CS_CLASSDC;
    wndClass.lpfnWndProc    = DefWindowProc;
    wndClass.cbClsExtra     = 0;
    wndClass.cbWndExtra     = 0;
    wndClass.hInstance      = nullptr;
    wndClass.hCursor        = LoadCursor(NULL, IDC_ARROW);
    wndClass.hbrBackground  = (HBRUSH)(COLOR_WINDOW+1);
    wndClass.lpszMenuName   = NULL;//MAKEINTRESOURCE(IDR_MAINMENU);
    wndClass.lpszClassName  = _classname.c_str();
    wndClass.hIconSm        = 0;

    if (RegisterClassEx(&wndClass) == 0)// Attemp to register the window class
        throw std::exception("WINDOW ERROR: Failed to register the window class!");

    DWORD dwStyle = 0;              // Window styles
    DWORD dwExStyle = 0;            // Extended window styles

    dwStyle = WS_OVERLAPPEDWINDOW |        // Creates an overlapping window
              WS_CLIPCHILDREN |            // Doesn"t draw within child windows
              WS_CLIPSIBLINGS;              // Doesn"t draw within sibling windows

    //adjust window size
    RECT rMain;
    rMain.left = 0;
    rMain.right = width;
    rMain.top = 0;
    rMain.bottom = height;  

    AdjustWindowRect(&rMain, dwStyle, 0);

    // Attempt to create the actual window
    _hwnd = CreateWindowEx( dwExStyle,     
                            className,
                            windowTitle,      
                            dwStyle,         
                            0, 0,           
                            rMain.right - rMain.left,
                            rMain.bottom - rMain.top,  
                            nullptr,             
                            0,  
                            nullptr,
                            0); 


    ShowWindow(_hwnd, SW_SHOW);
    SetForegroundWindow(_hwnd);
    SetFocus(_hwnd);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T10:40:30+00:00Added an answer on May 16, 2026 at 10:40 am

    Since it’s already mentioned in comments, I’ll make this community wiki

    You need to get the messages for the window and dispatch them accordingly.

    /* 
     *  HWND hWnd: this is the handle to your window (that is returned from CreateWindow[Ex]
    */
    MSG msg;
    while (GetMessage(&msg, hWnd, NULL, NULL) > 0){
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
    

    If you don’t do this, your wndProc function will never get any messages, and Windows finds it unresponsive (thus the hourglass).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fairly intensive application, which I've just converted from a console application
I have a console application that is trying to load a CustomConfigurationSection from a
I have a console application in C++. I need to access a functionality from
I have written a console application in Delphi that queries information from several locations.
I have an (console, .NET 3.5, C#) application that I'm trying to call from
I have one application that prints messages from Test.exe in console .My java program
I have console application in c. I want to convert into window application, kindly
I am currently creating a console application which is reading from a folder which
I have an application, let's call it myapp.exe, which is dual-mode console/GUI, built as
As the question subject says. I have a console application in Delphi, which contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.