Click here to Skip to main content
16,005,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a dual monitor setup. When I open my application on a primary monitor and drag it to secondary monitor and open the combo box thats in the app, it opens up on a primary monitor even though the application is moved to the secondary monitor.

Please let me know if you know a fix for this.
Thank you in advance.
Posted
Comments
DaveAuld 22-Nov-10 18:05pm    
What happens when you open it on the Secondary monitor?
What happens when you open it on the Secondary monitor, and then move it to the Primary one?
KunalMysterion 22-Nov-10 18:24pm    
If I open the app on a secondary monitor and move it to the Primary one, then the combo box correctly opens up on the primary monitor. This issue arises only when the app is on secondary monitor

1 solution

Found a solution. Just in case if anyone gets stuck at this kind of issue, remember GetSystemMetrics() method returns values specific to the primary screen for all metrics that were supported in versions earlier than Windows CE .NET. So use GetSystemMetrics(SM_CXVIRTUALSCREEN) instead of GetSystemMetrics(SM_CXSCREEN) and this issue will be resolved.
 
Share this answer
 
v2
Comments
DaveAuld 22-Nov-10 18:58pm    
Maybe you should have posted the environment and languages you were working in as part of the original question or using the tags, it might have helped.
KunalMysterion 22-Nov-10 19:32pm    
Working on Windows XP and above, and the application is built in VC++ using MFC and WinAPI. This was my first question on any forum. I will be more precise next time. Thank you for your help.

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