Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
MBUE - Thanks. I gave it a try and it does identify some "Layered" / "Transparent" windows, but not all. I've got a Sony Vaio and when I have the Vaio Gate utility (seemingly transparent) running, it never gets tagged. Any thoughts???

*************************************************************************************************************************

Is there a way to detect if Transparent and Layered Windows are visible on the desktop. If you could do this, you could conditionally BitBlt (with or without CAPTUREBLT). It wouldn't remove, but would minimize, the flicker.

*************************************************************************************************************************


Has anyone come up with a solution to the BitBlt CAPTUREBLT / Mouse Cursor Flicker issue?

Through research, I’ve determined why the mouse cursor flickers (BitBlt HIDE/SHOW cursor), but this is a real MS hack. Why didn’t they, at least, provide a BitBlt CAPTUREBLT<With Mouse> flag and a CAPTUREBLT<Without Mouse> flag – not rocket science???

If you have a solution please reply to [removed_email]@gmail.com (I travel and this is the easiest contact)

Thank you, in advance.
Posted
Updated 9-Aug-11 11:27am
v4
Comments
walterhevedeich 21-Jul-11 22:53pm    
Please don't post your email address. If someone has a solution to your problem, they will reply here.
Tim Simonetti 22-Jul-11 10:43am    
I'm not here to slap leather - just to get a solution.
mbue 9-Aug-11 21:52pm    
It woult be better to post a reply on my post so i will be notified about that.
There is indeed a possibility to create transparent windows by using non rectangular regions. that came up from win95. these windows are transparent an the part that is outside the region (for example the round corners of win-xp frames). to find such windows you should enumerate all windows (EnumWindows) and examine the windows region.
regards.
Tim Simonetti 10-Aug-11 12:00pm    
MBUE - You're the best. Many thanks - I'll take a run at it.

Cheers!

How does MS wrote his code is something you shold ask to MS, not here.
My guess is that the "mouse" (that is an hardware device) has nothing to do with it.
The "cursor" (that represents the mouse position, and is what you should more properly speak about) is noting more than an icon blit-ted on the screen. If you blit something else over, it will be covered. It will reappear as the system is forced (by a mouse move or by a hide/show) to reblit it.
It not a matter of rockets, but of physics.

Of course MS can do an api that does the mouse rewrite automatically after a blit, but blit does not necessarilly write on screen. The cursor is just another thing not related to image processing. Writing such an API breaks the encapsulation of the two concepts.
 
Share this answer
 
Comments
Tim Simonetti 22-Jul-11 10:42am    
The MS comment was just rhetorical. If you Google this issue it is a very real programming problem. The problem is that internally MS does a ShowCursor (FALSE) / ShowCursor (TRUE) every time you BitBlt – this creates a Blinking Cursor. My question is basically has anyone found a programming solution/work-around to this issue.
Emilio Garavaglia 22-Jul-11 12:06pm    
I got your point (my answer is equally rhetorical ...)but for the problem you pose there cannot be any "programming workaround", since it relates on the fact that the hardware doesn't have the concept of "mouse cursor": it is just a picture the software draws on it. And that conflict with any other software drawing on it!
Tim Simonetti 22-Jul-11 12:24pm    
I hear what you're saying. I had created a sprite-cursor that followed the cursor and dynamically took on the appearance of the cursor. It works pretty well, but not perfectly. I know that the MS BitBlt issue can’t be fixed (outside of MS) – just curious if anyone has worked around it.
if(WS_EX_LAYERED & GetWindowLong(hwnd,GWL_EXSTYLE))
{
  // <- layered window
}

if(WS_EX_TRANSPARENT & GetWindowLong(hwnd,GWL_EXSTYLE))
{
  // <- transparent window
}

CAPTUREBLT is always without mouse cursor shape. since windows 3.1 and grapic cards with hardware overlay capablities you must not hide the cursor as you should do on windows 3.0 before painting. this is the reason why there was no flicker of the mouse cursor anyway. except the cursor is hidden and shown by the program, perhaps on WM_SETCURSOR message. the print screen function does it from traditional reasons. if you want the cursor shape you have to paint it yourself.
Regards.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900