I have the same issue. What I want to detect is the actual operating system under the control panel and detect that windows settings so that I can tell the user change the resolution. The screen method does not seem to work well. i have tested my code where I changed the resolution to a lower resolution, and someone made the comment the program looks crappy!
I agree. There's got to be a way to detect under start->Control Panel->Display->Settings-> screen Resolution Slide bar.
The specific question is how to fetch that resolution and evaluate it in your code? The dumb way would be to have a dialog box and tell the user to change it, but more elegant would be a way to detect it.
Does anyone know how to do this? There's got to be an API to acces that in the OS.
Yes, the SysInfo control has an event called DisplayChanged which fires when the screen resolution has been changed. It has many others, including one for SysColorsChanged, several for battery status, power changes and device arrival/removal.
We're both NEWBIES here and as far as VB6 and being a newbie are concerned, I suggest you better opt for simple coding and explanations. You see, advanced coding might give you migraines or ulcers...
Try the suggestions offered to you here (specifically on using the Screen.TwipsPerPixelX and Screen.TwipsPerPixelY techniques, which in my experience, are very simple to integrate and debug).
Now, if you want your program to detect changes in the screen resolution DURING RUN TIME, I suggest you do the coding WITHIN a timer subroutine. This means your program must stay memory-resident and check the screen resolution from time to time, say, every second. As your app checks the resolution, the values should be stored on two variables (say CurrentRes and NewRes, both being arrays to store the values of the screen resolution's height and width). Everytime CurrentRes and NewRes are detected as unequal, you can then trap the inequality and launch an appropriate routine to inform the user.
I can't give you here a thorough coding of this suggestion. Sorry, but you have to discover it by yourself through perseverance and diligence -- just the way I helped myself learn the simple nuances of VB6.
What I am doing currently is designing two forms to open to the left of center under the assumption that user has high screen resolution, but putting a button on right-side form. If the resolution is low, user can't see left form. But, if user clicks button on right-form, both forms become centered. This works. I would, however, like to detect what the screen resolution is, so I will know to programatically to set forms in center when necessary.