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 6899775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:27:51+00:00 2026-05-27T07:27:51+00:00

On Windows, when I display a dialog box (either a custom one, or a

  • 0

On Windows, when I display a dialog box (either a custom one, or a standard open/save file dialog), and move the dialog box around over the parent window, the parent window does not redraw, leaving trails of the dialog behind as it’s dragged. (The parent window uses OpenGL to draw, but not sure this is relevant.) How do I get the main window to redraw as the dialog is moved in front of it?

I tried adding a call to redraw my main window whenever the dialog’s callback is sent a message, but this only causes redrawing to occur whenever a button is pushed or an edit field is typed in. It doesn’t redraw when the dialog’s window is moved. How can I detect this movement?

  • 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-27T07:27:51+00:00Added an answer on May 27, 2026 at 7:27 am

    I suspect your opengl app is just using a window for the explicit purposes of rendering via opengl onto it, and then goes into a tight loop of checking for mouse/kb input followed by a redraw of the opengl surface. An I’m guessing you are not pumping messages after drawing a frame. And more importantly, that little stub WndProc you setup for your window, probably doesn’t have a WM_PAINT handler.

    Two things to consider. Your WndProc for your main window needs to catch WM_PAINT, redraw, and validate the surface. That is….

    LRESULT __stdcall YourMainWndProcHandler(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
    {
        switch (uMsg)
        {
            ...
            case WM_PAINT:
            {
                PAINTSTRUCT ps;
                BeginPaint(hwnd, &ps);
                EndPaint(hwnd, &ps);
                // redraw your stuff here
                return 0;
            }
            ...
        }
    }
    

    Instead of calling BeginPaint/EndPaint to handle WM_APINT above you could likely just call ValidateRect.

    And preferably, you are catching other window messages in your draw loop. That way, if a window gets obscured by something else outside of your app (e.g. resize operation, minimize/restore, other windows app takes foreground, etc…), then you can handle the repaint notifications as well.

    A typical game tries to pump 1 message per drawing frame.

    void MainLoop()
    {
        MSG msg;
        if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
    
        // your code to simulate and render below
        DrawScreen();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to have my VBScript display the Windows Save As dialog box, but
Im using System.Windows.MessageBox.Show() to display a dialog to the user. One overload lets me
On Windows the user has an option to display/hide file extensions when viewing files.
Any ideas how to display a PDF file in a WPF Windows Application? I
I am using jquery ui dialog box to display a form.When i click on
About Gtk Dialog box Behavior... I am using GtkBuilder +Glade to display a top
I am writing a java program that needs a file open dialog. The file
I have a v simple dialog box that I would like to display as
I am using a function to display a dialog box that asks the users
I am new to JQuery and trying to display a Yes/No confirmation dialog box

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.