Click here to Skip to main content
15,867,835 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
32-bit depth Icons become invisible while connecting second display and choosing "Control Panel\Display\Change Display Settings\Multiple displays: extend these displays" setting.

I draw icons in my MFC\C++\ATL Windows application using

::DrawIconEx( hDC, x, y, hIcon,W,H,NULL,NULL, DI_NORMAL) API function.

Handle of ICON in memory is passed from outside.
Handle of DeviceContext I take from DirectDraw surface ( we draw complex scene using DirectX 9.0 DirectDraw ).

The icon is drawn alright while it has less than 32-bit depth.

I use defaults when create primary/back surfaces. Probably I need to configure some "bit depth" fields for it...

Any ideas? Thanks in advance!
Tatyana

What I have tried:

My custom 4-8-16-24 bit icons are OK.
I've tested on Win10 and encountered with the same problem .
Posted
Updated 28-Jan-20 10:02am
v4
Comments
Stefan_Lang 20-Jan-20 9:53am    
Please be a little more verbose on your problem, and keep in mind that we have no idea about your project, your development environment, the libraries and functions you are using, whatever you wish to achieve, and the code you've written to try achieve your goal(s).

The only advice I can offer is: do not use one-letter names (referring to "f.i." in the only code fragment you've offered so far). The name of a variable or type should give you a hunch of what it is, or what it's used for, without having to look up it's definition.

But that will hardly solve your problem...
Tatyana Entin 21-Jan-20 6:20am    
Thanks a lot. I've updated my question. Is it understandable now?
Best regards
Stefan_Lang 21-Jan-20 7:34am    
Yep, that makes a lot more sense now. I'm afraid that I have no idea how to resolve this, but maybe someone else does.
Rick York 20-Jan-20 11:11am    
I agree with Stefan and would add to that, what are "extended" and "non-extended" display modes in windows? I have been programming in windows since Windows NT was in beta and I have never seen anything about those display modes.
[no name] 21-Jan-20 14:26pm    
Try another OS. The "extending" implies an OS refresh issue; nothing to do with your code in particular. I have an extended desktop over 3 different monitors in Windows 10 without any issues running all kinds of stuff.

1 solution

This is a real shot in the dark here but check the icons and see what their alpha channel looks like. If it is completely black they might be interpreted as being fully transparent.
 
Share this answer
 
Comments
Tatyana Entin 29-Jan-20 7:55am    
The icon is drawn alright while not in "extended multi-display" mode.

Handle of DeviceContext I take from DirectDraw surface (DirectX9).
I use defaults when create primary/back surfaces. Probably I need to configure some "bit depth" fields for it?

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