Jump to content

Controls are not repainting until mouseover


Guest TX_

Recommended Posts

Hello guys!

This is my situation : I have standard MFC dialog, which I "inject" into another dialog of other process, with SetParent(this->GetSafeHwnd(), hwndRemoteDialog);. So my dialog (and all of it's controls) appear as part of that other dialog. To be more precise, I'm actually "injecting" it into one of the tabpage of that remote window. Now this is the problem : when I change tab to other, and then change back to that tab which now owns my window, some of the controls of my window (buttons, editboxes...) are not repainting - they are invisible until I hover the mouse over their location, when they re-appear again. This happens randomly to random controls, not to all.

As we all know, during changing current tab, the old tab-page gets hidden (not destroyed), and after switching back to that tab the tabpage gets visible. So during this switch-back when ShowWindow(SW_SHOW) occures for that tabpage (which is the parent of my injected dialog), my dialog (some of it's subcontrols) does not repaint correctly. What is the reason? Do I need to add some window styles or extended window styles to it? It already has WS_CHILD style. I have tried adding some of "suspected" styles and extended styles but didn't help.

Visual C++ 2008, MFC. The effect is more visible (occures more often for more controls) in XP than in Vista, I think...

Any bit of help would be greatly appreciated !

TX_

Edited by TX_
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...