Sign in to follow this  
Followers 0
PartyPooper

Making Inputbox open on same monitor as GUI

3 posts in this topic

I have a two monitor system and I have a program that displays the GUI on the secondary monitor. When the program opens up an InputBox, it displays it on the primary monitor instead of the secondary monitor where the GUI is located. This is fast becoming a PITA. Is there any way to sticky the InputBox to the GUI? I thought by using the hwnd option of the InputBox and pointing it to the window handle of the parent ($hMainGUI) this would solve the problem but it doesn't. I've tried the following without success:

Local $sInfo = InputBox("Display Information", "Enter Question(case insensitive):", "", "", 250, 110, -1, -1, "", $hMainGUI)
Local $sInfo = InputBox("Display Information", "Enter Question(case insensitive):", "", "", 250, 110, 0, 0, "", $hMainGUI)
Local $sInfo = InputBox("Display Information", "Enter Question(case insensitive):", "", "", 250, 110, "", "", "", $hMainGUI)
Local $sInfo = InputBox("Display Information", "Enter Question(case insensitive):", "", "", 250, 110, Default, Default, "", $hMainGUI)

Any ideas?

Share this post


Link to post
Share on other sites



I should point out the GUI is created in a separate function using:

$hMainGUI = GUICreate($sProgramName, $iGUIWidth, $iGUIHeight, $iGUIXPos, $iGUIDYPos)

Not sure if my lack of Styles and/or exStyles contribute to this problem.

Share this post


Link to post
Share on other sites

What happens if you create a second GUI that is child of the first? If it appears on the right monitor you could use it to make a custom InputBox.

I could but it would mean a significant increase in coding which I want to avoid. If I can't find a solution to this, I may have to end up identifying the main GUIs coordinates and calculating a position from that. Means more coding but less than having to create custom input boxes and input checks.

Thanks for the idea anyway.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0