Change resoultation back and forth

Hi experts
Been fighting screen resoulations . My setup now checks the screen res and adjusts the form accordingly foir each res. Never had got this to perfection. My form on a pc running 1600x1200  my form is tiny and it is way too big too fit on 680x400. I do not like changing a users resolutation.Has anyone tried this:
Detect and change a users resolutation on form load and change it back if they click out of my program.
and change it back when my program gets the focus again.
I kinda got started and found i could not detect when a user clicks out of my form. The form lost focus seems worthless. How could i detect this?
Who is Participating?
This function might help you:

Private Declare Function GetActiveWindow Lib "user32" () As Long

Then in a Timer Event:

If GetActiveWindow <> Me.hWnd Then
  ' Your form has lost focus '

End If
Activate/Deactivate and GotFocus/LostFocus are only within the application, not when you change focus to another program...

as long as your app is not a game, users are not prepared to have it changing resolution.

take a look at this example:

joe average has a rather old monitor.
His screen settings are 1024*768, and his refresh rate is 90 Hz

now when your app changes the resolution to 1600*1200, and doesnt change the resolution, joe average gets a warning message on his screen, that the refresh rate is too high.
And because the refresh rate is too high, the monitor cant display whats on screen and will turn to black.

a better solution would be to have your form dynamically resize, and resize all controls in it.
sure thats a lot of work, but imo its a better solution for the end user
isnoend2001Author Commented:
Thanks guys
canned that idea
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.