Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Two (dual) Monitors - Two Applications - Please Help

  1. #1
    Join Date
    Aug 2007
    Location
    MO USA
    Posts
    106
    Thanks
    37
    Thanked 0 Times in 0 Posts

    Exclamation Two (dual) Monitors - Two Applications - Please Help

    We have our older version of the client-server software running on my pc - the older version needs 800x600 (cannot run in higher resolutions). Now we have a new version of the software - web based - which needs 1024x768 (will not run in lower resolutions). For this reason, i have two monitors and planned on using dual/extended screens.

    The problem i am facing with the above is the script i am using for the 1024x768 application takes the default screen resolution (800x600) and not its monitor resolution (1024x768) - how do i make it so that the application checks for its current monitor resolution and display.

    Thanks.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If it is running on two monitors at once, it must adapt to the lower resolution monitor.

    Now, that said, I really cannot tell form your post what you are doing exactly. If all you need to know is how to test in javascript for screen resolution, the javascript properties that will tell you this are:

    screen.width

    and:

    screen.height
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    me_myself (06-17-2008)

  4. #3
    Join Date
    Aug 2007
    Location
    MO USA
    Posts
    106
    Thanks
    37
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    If it is running on two monitors at once, it must adapt to the lower resolution monitor.

    Now, that said, I really cannot tell form your post what you are doing exactly. If all you need to know is how to test in javascript for screen resolution, the javascript properties that will tell you this are:

    screen.width

    and:

    screen.height
    Here is what i am doing - i have a monitor connected to my laptop. I have set my laptop screen resolution to be 800x600 and the external monitor to be 1024x768. Now i launch IE in the external monitor. When i open the application in IE, i get a message saying the browser needs a minimum of 1024x768 to run the application - the application is taking the screen resolution of my laptop screen and not the external screen in which the IE is opened.

    Thanks.

  5. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Because - as far as I know - additional monitors may only extend, or show a copy of the existing desktop, you would need to disable the lower res monitor.

    If you are using the other monitor to extend the desktop, rather than as a copy of it, you might be OK as long as the program that needs the higher resolution launches only in the extended portion of the desktop. Getting this to happen is beyond me though. I've only ever been able to get things over to the extended monitor by dragging them. Unless, if your were able to make the external monitor the primary monitor with the one on the lap top being the extension - that might work.

    If all you want is to run the program, disable the lap top's monitor and hope that the program will now take the dimensions and resolution from the active monitor.

    I don't think this is anything to do with javascript though. You could at least test the browser in the extended monitor by pasting:

    javascript:alert(screen.width + ' x ' + screen.height)

    into the browser's address bar to see what res the browser thinks it has.
    Last edited by jscheuer1; 06-17-2008 at 06:08 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #5
    Join Date
    Aug 2007
    Location
    MO USA
    Posts
    106
    Thanks
    37
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the script. When i used it, it shows the correct browser resolution (primary as 800x600 and the secondary as 1024x768) but the javascript which i use some how always takes the primary screens resolution

  7. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I just edited my last post while you were replying. First you would need to know what the browser thinks the res is (I just explained it but you missed it as you were already replying, go back and do that part). If the browser is seeing the lower res, you cannot force it to tell the web based code anything different. If the web based code relies solely on javascript, HTML and server - side code, it is simply getting the wrong information - probably from the browser, and could be coded to give the user the option of overriding that and running it anyway. But if it uses active x or java, it might be getting the wrong idea from the computer itself, and I would be unsure how to make it do anything different without disabling the low res monitor.

    None of this matters much either way unless you have access to the code of the web based application, and can change it
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by me_myself View Post
    Thanks for the script. When i used it, it shows the correct browser resolution (primary as 800x600 and the secondary as 1024x768) but the javascript which i use some how always takes the primary screens resolution
    OK, well we need to know how the web based application is determining the resolution. It obviously either doesn't use javascript, or if it does, it's using it wrong.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #8
    Join Date
    Aug 2007
    Location
    MO USA
    Posts
    106
    Thanks
    37
    Thanked 0 Times in 0 Posts

    Default

    Here is the script which determines the browser resolution -

    Code:
    <script>
    function CheckResolution()
    {
        if(window.screen.width >= 1024 && window.screen.height >= 768)
        {
            document.getElementById("imgLaunch").style.display = 'block';
            document.getElementById("imgMessage").style.display = 'none';        
        }
        else
        {
            document.getElementById("imgLaunch").style.display = 'none';
            document.getElementById("imgMessage").style.display = 'block';
        }
    }
        </script>
    
    <!-- below code within the body -->
    
    <td>
    <img id="imgLaunch" style="display:none;" src="images/icon_success.jpg" width="156" height="123" border="0">
    <img id="imgMessage" style="display:none;" src="images/icon_failure.jpg" width="156" height="123" border="0">
    </td>
    the purpose of the above code is to Check if the browser resolution is above 1024, if it is equal or above 1024, it should display an image and if it is below, it should display a different image

    Please help me change the script to successfully capture the "current" browser resolution and display the application.

    Thanks
    Last edited by me_myself; 06-17-2008 at 08:36 PM.

  10. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This almost seems too simple, but I don't see anywhere that the code gets executed. The way you have it, with the script in the head (I'm assuming) and the markup in the body, it would have to be onload, and you haven't shown and/or mentioned that happening.

    Generally, this would be a better strategy (all in the body, all in the td in fact):

    Code:
    <td>
    <img id="imgLaunch" style="display:none;" src="images/icon_launch.jpg" width="156" height="123" border="0">
    <img id="imgMessage" style="display:none;" src="images/icon_launch_disabled.jpg" width="156" height="123" border="0">
    <script type="text/javascript" defer="defer">
    function CheckResolution()
    {
        if(screen.width >= 1024 && screen.height >= 768)
        {
            document.getElementById("imgLaunch").style.display = 'block';
            document.getElementById("imgMessage").style.display = 'none';        
        }
        else
        {
            document.getElementById("imgLaunch").style.display = 'none';
            document.getElementById("imgMessage").style.display = 'block';
        }
    }
    CheckResolution();
    </script>
    </td>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  11. #10
    Join Date
    Aug 2007
    Location
    MO USA
    Posts
    106
    Thanks
    37
    Thanked 0 Times in 0 Posts

    Default

    Sorry for not mentioning it, the function was getting called in the body onload.

    I copied your code to TD as you said (removed the one in the head and removed body onload), but still no luck

    It always takes my laptops primary resolution which is 800x600, even though the monitor where the IE resides has 1024x768

    Any ideas? Thanks.
    Last edited by me_myself; 06-17-2008 at 09:09 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •