Jump to content

Recommended Posts

Posted

Hi Guys,

I've set the vertical height of my InputBox to the screen resolution height minus the taskbar.  The height bit works great, but consequentially the window is no longer centered.  The first 0 in the InputBox parameters below is the Left property.  I can't set it to -1 nor just omit it leaving a comma as in ".. $Usable_Screen_Area[3],, 0".  Is there any easy way to get my Window centered shy of a separate program that launches just before, waits for my InputBox, an then centers it.  I would think -1 would just equate to centered, but it isn't valid input according to SciTe

;Needed to get usable screen area
#include <WinAPI.au3>

;$Usable_Screen_Area[3] = screen height minus the taskbar on the current screen which may or may not have a taskbar
Local $Usable_Screen_Area = _GetDesktopArea()
        
;The M2 means a 1-2 character value is required, $Usable_Screen_Area[3] is the screen's height minus the taskbar if there's a taskbar on the current screen
$Response = InputBox("Simulator", "Please enter the index you'd like to simulate?" & @CR & $Options, "", " M2", -1, $Usable_Screen_Area[3],0, 0)

Thanks for your help,

Christian

Christian Blackburn, A+, Network+
 

Posted (edited)
;Needed to get usable screen area
#include <WinAPI.au3>

;$Usable_Screen_Area[3] = screen height minus the taskbar on the current screen which may or may not have a taskbar
Local $Usable_Screen_Area = _GetDesktopArea()
        
;The M2 means a 1-2 character value is required, $Usable_Screen_Area[3] is the screen's height minus the taskbar if there's a taskbar on the current screen
$Response = InputBox("Simulator", "Please enter the index you'd like to simulate?" & @CR & $Options, "", " M2", -1, $Usable_Screen_Area[3],Default, 0)

Have you tried this? I can't really test it because I don't have the desktop area part of your code.

EDIT: I tested it, seems to work.

Edited by anthonyjr2

UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

  • 2 weeks later...
Posted

Hi Malkey and AnthonyJr2,

Thank you both very much for your tips.  Anthony's code worked great.  Sorry I failed to give credit where it was plainly due. 

Thanks,
Christian Blackburn

 

Christian Blackburn, A+, Network+
 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...