• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 294
  • Last Modified:

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?
0
isnoend2001
Asked:
isnoend2001
  • 2
2 Solutions
 
twardCommented:
Activate/Deactivate and GotFocus/LostFocus are only within the application, not when you change focus to another program...
0
 
twardCommented:
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
0
 
Mark_FreeSoftwareCommented:

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
0
 
isnoend2001Author Commented:
Thanks guys
canned that idea
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now