views:

50

answers:

1

Hi,

I will try to explain my problem the best i can,

I'm creating a layered window in c++ (using windowsXP), all works fine until i drag my created window near the windows start button, and then when i press the star button of windows taskbar and close it again all the windows beneath of my layered window aren't being painted (only in the area of the start window that pops over my window).

My create window is like this:

CWnd::CreateEx( WS_EX_TOOLWINDOW | WS_EX_LAYERED, AfxRegisterWndClass(0), lpstr_name, WS_POPUP, 0,0,0,0, pc_parent->GetSafeHwnd(), 0);

...

When i create the window with this styles the problem ocurrs, but if i create with the extended style WS_EX_TRANSPARENT and all the others the problem does not occur any more. And if instead of a WS_POPUP window is a WS_CHILD or WS_OVERLAPPED then this also doesn't occur...

Can anyone please explain why when i create a WS_POPUP window with the WS_EX_LAYERED style all the beneath windows aren't updated, and if i add the style WS_EX_TRANSPARENT this works fine.

Note: why i do not use the WS_EX_TRANSPARENT style if it works right? if i use it then my window can not be dragged and i need it to do it :)

Updated: alt text

The image above is to describe better what is happening: The first part of the image you can see my leyered window and beneath is the vs, in the second img i press the start button and then in the last image i already drag my layered window to the right and you can see that the vs window does not updates the affected area. Note that this situation until now only occurs with the start window?! with other windows it does not happen!?...

Thanks

A: 

only in the area of the start window that pops over my window

That's expected. Only that clipping rectangle is obscured by the start menu so only that region will be repainted. What behavior are you expecting? If there are windows covered by more upper level windows, then they won't be repainted either -- why repaint something just to paint over it?

All underneath windows need to get repainted though if you use transparent because GDI can't calculate the final color of the pixel without knowing the area below the window's color.

Billy ONeal
Yes of course, but how i allow this to be done. I want that all underneath windows should be notified of the painting updated, i'm not expecting that my application is the one that will paint the underneath windows, i'm expecting that the system will send some kind of message in order to let it known that the underneath windows must repaint is own contents.I think you do not understand my question, i only want to know witch styles or extend styles allow this to happen.
Nuno
@Nuno: Why should underlying windows repaint? There is a window on top of them! Whatever they paint is going to be blown away when the more topmost window repaints.
Billy ONeal
Right i understand, but what can i do to avoid this? (i update the question and add an image, as you can see, the underlying window need to repaint or not?!) Note that if i add the WS_EX_TRANSPARENT extend style this will not happen...this is what i need, but with this style i can't drag my window because it will be clickthru
Nuno
@Nuno: My question is, why do you want to avoid that? Why have windows underneath yours repaint for no reason?
Billy ONeal
To avoid what you see on the image above
Nuno
@Nuno: So you're trying to to transparency? If that's the case, you need WS_EX_TRANSPARENT for precisely that reason. Normally only one window controls any one pixel on the screen at any one time.
Billy ONeal
Ok ONeal, you win :) i need transparency so i need WS_EX_TRANSPARENT extend style.Only one more question, but even if i don't use the WS_EX_TRANSPARENT style the normal windows don't produce the problem that i describe, only the start menu window produce, can you think on any explanation for this to happen?(only one more note, and not in all pc's :( don't know why, but i got one pc that works fine with or without start menu window)
Nuno
@Nuno: No idea. Think you just got lucky.
Billy ONeal
:) thanks but is not lucky is the opposite, i lost one day looking at this and annoying at least you :)
Nuno