Re: Window transparency dilemma
- From: Marty <net@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 17 Jan 2008 01:37:56 -0800
Rich Walsh wrote:
On Sat, 29 Dec 2007 05:38:32 UTC, Marty <net@xxxxxxxxxxxxxxxxxxx> wrote:
The only other possibility that I see is to somehow map out the windows that are underneath me, find their window handles, and explicitly invalidate them and call their WM_PAINT routines for those affected areas. Sounds like really messy business though.
It really needn't be. After calling WinBeginEnumWindows(HWND_DESKTOP),
you'd cycle through each one, calling WinQueryWindowPos() & WinIntersectRect().
If the latter returns TRUE, it will provide you with a rect you can pass
to WinInvalidateRect(). When done, a call to WinUpdateWindow(HWND_DESKTOP)
should complete the process. If that causes the screen to "blink" because
too much is being repainted, you can make individual calls inside your loop.
Since the updates *will* be handled asynchronously, I'd use DosSleep(1) to
guarantee that the calling thread yields.
This has turned into a personal vendetta for me now. I implemented the enumeration, intersection, and updates as you describe here. Unfortunately, it visibly made no difference from my best pass with my previous method. What's worse is that it's not behaving consistently (in any attempts I made). Sometimes it will clean itself up, but most of the time it won't. Using WinSendMsg to make these windows draw (against your better advice earlier) doesn't make a difference at all either.
My drawing glitch is happening at a time when I can't understand why I'm even getting a message too. My transparent window has the desktop as its parent/owner. When a completely different window from within the same process, with the desktop also as its parent/owner loses the window focus by the user clicking on the desktop, I get a WM_VRNDISABLE/ENABLE pair of messages to my transparent window. When this happens, I hide my transparent window (taking care to avoid the infinite recursion with a window ULONG flag), beg the windows underneath to draw themselves, do the DosSleep, and then capture the bitmap where my window used to be and draw the transparent window again. All windows other than the desktop itself will heed my suggestion and redraw themselves. But I'm left with a shadow of the old transparent window (the part that was on top of the desktop itself) being captured in my bitmap, and incorporated into my new trasparent window.
I just can't convince the desktop window itself to redraw. I even tried a nasty and cheap trick of using CS_SAVEBITS just to put SOMETHING there when my window hides which resembles what the desktop should look like, and it visibly made no difference.
Any ideas on another angle that I can attack this? I refuse to believe that what I'm trying to do is not possible in OS/2. I know that I'll never be able to update based on changes that happen under my window, but I should at least be able to handle other cases without drawing glitches.
--
[Reverse the parts of the e-mail address to reply.]
.
- Follow-Ups:
- Re: Window transparency dilemma
- From: William L. Hartzell
- Re: Window transparency dilemma
- Prev by Date: Re: True Color graphics mode for fullscreen sessions?
- Next by Date: Re: Window transparency dilemma
- Previous by thread: Re: Window transparency dilemma
- Next by thread: Re: Window transparency dilemma
- Index(es):
Relevant Pages
|