EXCELLENT WORK!!! Great code!!!! Many thanks!
Main Topics
Browse All TopicsHello.
We are looking for functional code that:
1. Checks if the computer is capable of dual monitor support.
2. If dual monitor support is available, code checks if the secondary monitor is enabled.
3. If is not enabled, code enables (attaches) it.
4. Checks resolution. If already enabled, or code enabled it, sets the resolution to 1024 x 768, if it is anything other than 1024x768.
5. If secondary monitor is already enabled, only check resolution and adjust if needed.
6. If secondary monitor is already enabled, and the resolution is correct, do nothing.
Functional VB6 code needed that works on XP and Vista.
thank you!!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: sedgwickPosted on 2009-11-09 at 01:06:46ID: 25774340
Use the EnumDisplayDevices() API call to enumerate the display devices on the system and look for those that don't have the DISPLAY_DEVICE_ATTACHED_TO _DESKTOP flag set (this will include any mirroring devices so not all will be physical displays.) Once you've found the display device you'll need to get a valid display mode to change it to, you can find this by calling the EnumDisplaySettingsEx() API call - Generally you'd display all the available modes and allow the user to choose however in your case it sounds like this may be possible to hard-code and save you an additional step. For the sake of future-proofing your application though I'd suggest having this easily changeable without having to dig through the source every time, a registry key would be the obvious choice. Once you've got that sorted out populate a DevMode display structure with the information about the display positioning (set the PelsWidth/Height, Position, DisplayFrequency and BitsPerPel properties) then set these flags in the fields member. Finally call ChangeDisplaySettingsEx() with this settings structure and be sure to send the reset and update registry flags. That should be all you need, hope this helps,
/KB/dotnet /changing- display- se ttings.asp x?display= Print
DISPLAY_DEVICE structure import using PInvoke
EnumDisplayDevices function import
EnumDisplaySettingsEx function import
etc. the rest of them functions can be found with a simple search by name.
alos, check http://www.codeproject.com
i'm not sure if it applicable to VB6 but i would give it a try.
Select allOpen in new window