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

  • Home
  • SEARCH
  • 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 4016678
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:46:09+00:00 2026-05-20T09:46:09+00:00

I’m writing a plug-in for an app; the plug-in is to display a modal

  • 0

I’m writing a plug-in for an app; the plug-in is to display a modal dialog. It displays just fine, but when I move it, it leaves a trail on the screen, i.e. the window below doesn’t redraw. Some parts of it do redraw (all standard Windows controls, e.g. toolbar or scrollbar), but the rest of the client area does not.

I’m using DialogBoxIndirectParam; the hWnd is the top window of the app, the template I construct on the fly and the dialog flags are WS_POPUP | WS_CAPTION | DS_MODALFRAME | DS_SETFONT | WS_SYSMENU, plus the function sets some flags itself, e.g. WS_CLIPSIBLINGS. The dialog class is standard (CS+DBLCLKS,CS_SAVEBITS) The dialog procedure is very basic, it only handles the WM_CLOSE message at the moment.

I tried Google but didn’t manage find anything directly relevant. I tried to compare my dialog class with other dialogs of the same app and also checked the messages logs, but I didn’t see any drastic differences.

Why doesn’t the parent/owner redraw and how do I fix it?

Update. Here’s the relevant calls.

Calling the dialog:

class Dialog(object):
    def run(self):
        t = cast(c_char_p(self.template()), LPCDLGTEMPLATE)
        p = GetActiveWindow()
        r = DialogBoxIndirectParamW(0, t, p, dialog_proc_2, py_object(self))

Window procedure:

def dialog_proc(window, message, wparam, lparam):
    if message == WM_CLOSE:
        EndDialog(window, IDCANCEL);
        return 1
    return 0

This is Python code 🙂 it’s embedded Python working via ctypes. The plug-in runs in the main thread; the host application makes a synchronous call, i.e it waits for the called function to return. self.template() returns DLGTEMPLATEEX data I prepare on the fly; I believe I do this correctly, because the dialog displays and when I check it with Spy all flags seems to be set (except that there’s a few more). I don’t use the instance handle, because I don’t load anything from resources. I believe I correctly wrapped all functions and constants, but I can post the definitions too. GetActiveWindow (or GetForegroundWindow) returns the pointer to the app’s main window; it’s a MDI app and it repaints everything except the client area of a MDI window:

Screenshot of the problem showing the trail

Here I moved the window over all the visible windows (toolbars, buttons, etc.) and the only part that doesn’t repaint is the client area of the MDI doc.

  • 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-20T09:46:10+00:00Added an answer on May 20, 2026 at 9:46 am

    You need the message queue to be pumped to make the paint cycle works. It seems that there is some pumping occurring (you say that some controls re-draw).

    Since modal dialogs run their own message pump, I’m going to take a wild guess that the host for your plugin has some special treatment of messages, quite possibly erroneous, in its message pump and that your standard dialog box message pump does things differently.

    I’m guessing and making large leaps of faith, but I suspect your host app’s message loop isn’t of the standard TranslateMessage / DispatchMessage form. If so then you are truly hosed.

    Without more details it’s really impossible to say anything with much certainty. As Hans says, a minimal reproduction would make the problem easy to solve.

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

Sidebar

Related Questions

I am writing an app with both english and french support. The app requests
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.