Change resoultation back and forth

Posted on 2007-08-02
Last Modified: 2012-06-27
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?
Question by:isnoend2001
    LVL 7

    Expert Comment

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

    Accepted Solution

    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
    LVL 13

    Assisted Solution


    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

    Author Comment

    Thanks guys
    canned that idea

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now