Jump to content

Recommended Posts

Help!

I wrote an AU3 script to be used by a bunch of people but for some reason, on some of the computers, the GUI disappeared and never came back. I created a GUI file to record/set the position of the window (initially 20,20) and it does not make any difference on the visibility of the GUI.

The only difference that I can find is that the GUI was created on a machine with Windows 2000 and the only computers that it seems to be happening on have WinXP. However, some of the WinXP computers seem to have it visible. I tried changing the resolution and that didn't make any difference either.

Any ideas?

Link to post
Share on other sites

Maybe this can help. Each of the menu items triggers a function from another file

Global $status = "Ready"
Global $ABORT_ACTION = 0
$helpdoc = FileGetShortName("<path>")
$nowDate = @MON & "/" & @MDAY & "/" & @YEAR
$nowTime = @HOUR & ":" & @MIN & ":" & @SEC
$winpos[0] = IniRead("<ini path>", "IMSC Settings", "WinPosX", -1)
$winpos[1] = IniRead("<ini path>", "IMSC Settings", "WinPosY", -1)
#EndRegion ~Variables
#Region ~Main Gui Design
$IMSC = GUICreate("IMSC", 200, 36, $winpos[0], $winpos[1], -1, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW);819 and 90
$statuslabel = GUICtrlCreateLabel($status, 0, 0, 200, 16, $SS_SIMPLE + $SS_SUNKEN)
GUISetIcon("<path for icon>")
#Region ~Asset Menu Item

$assetmenu = GUICtrlCreateMenu("<menu name>")

$assetitem1 = GUICtrlCreateMenuitem("<menu item name>" & @TAB & "Ctrl-Alt-O", $assetmenu)
$assetitem3 = GUICtrlCreateMenuitem("<menu item name>" & @TAB & "Ctrl-Alt-A", $assetmenu)
$assetitem4 = GUICtrlCreateMenuitem("<menu item name>" & @TAB & "Ctrl-Alt-L", $assetmenu)


GUICtrlCreateMenuitem("", $assetmenu)

$termmenu = GUICtrlCreateMenu("&Termination", $assetmenu)

$termitem1 = GUICtrlCreateMenuitem("<menu item name>", $termmenu, 1)
$termitem2 = GUICtrlCreateMenuitem("<menu item name>", $termmenu, 2)
$termitem3 = GUICtrlCreateMenuitem("<menu item name>", $termmenu, 3)
$termitem4 = GUICtrlCreateMenuitem("<menu item name>", $termmenu, 4)
$termitem5 = GUICtrlCreateMenuitem("<menu item name>", $termmenu, 5)
$termitem6 = GUICtrlCreateMenuitem("<menu item name>", $termmenu, 6)

GUICtrlCreateMenuitem("", $assetmenu)

$ordermenu = GUICtrlCreateMenu("<menu name>", $assetmenu)

GUICtrlCreateMenuitem("", $assetmenu)

$chnotesmenu = GUICtrlCreateMenu("<menu name>", $assetmenu)

$dismenu = GUICtrlCreateMenu("<menu name>", $chnotesmenu)
$disitem1 = GUICtrlCreateMenuitem("<menu item name>", $dismenu)
$disitem2 = GUICtrlCreateMenuitem("<menu item name>", $dismenu)
$disitem3 = GUICtrlCreateMenuitem("<menu item name>", $dismenu)

$tammenu = GUICtrlCreateMenu("<menu name>", $assetmenu)
$tamitem1 = GUICtrlCreateMenuitem("<menu item name>", $tammenu)
$tamitem2 = GUICtrlCreateMenuitem("<menu item name>", $tammenu)
$tamitem3 = GUICtrlCreateMenuitem("<menu item name>", $tammenu)
$tamitem4 = GUICtrlCreateMenuitem("<menu item name>", $tammenu)
$tamitem5 = GUICtrlCreateMenuitem("<menu item name>", $tammenu)
$tamitem6 = GUICtrlCreateMenuitem("<menu item name>", $tammenu)
$tamitem7 = GUICtrlCreateMenuitem("<menu item name>", $tammenu)

GUICtrlCreateMenuitem("", $assetmenu)

$assetitem11 = GUICtrlCreateMenuitem("<menu item name>" & @TAB & "Ctrl-Alt-T", $assetmenu)
$assetitem14 = GUICtrlCreateMenuitem("<menu item name>", $assetmenu)
$assetitem15 = GUICtrlCreateMenuitem("<menu item name>", $assetmenu)
$assetitem12 = GUICtrlCreateMenuitem("<menu item name>", $assetmenu)
$assetitem13 = GUICtrlCreateMenuitem("<menu item name>", $assetmenu)

#EndRegion ~Asset Menu Item
#Region ~IMAC Menu

$mnuImac = GUICtrlCreateMenu("&Imac")
$mnuImacQueue = GUICtrlCreateMenuitem("<menu item name>", $mnuImac)

$mnuImacOrder = GUICtrlCreateMenuitem("<menu item name>", $mnuImac)

#EndRegion ~IMAC Menu
#Region ~Global Menu Item

$globalmenu = GUICtrlCreateMenu("&Global")
$globalitem1 = GUICtrlCreateMenuitem("<menu item name>", $globalmenu)
$globalitem2 = GUICtrlCreateMenuitem("<menu item name>", $globalmenu)
$globalitem3 = GUICtrlCreateMenuitem("<menu item name>", $globalmenu)

#EndRegion ~Global Menu Item
#Region ~Login Menu Item

$loginmenu = GUICtrlCreateMenu("&Login")

$loginitem1 = GUICtrlCreateMenuitem("<menu item name>", $loginmenu)
$loginitem1 = GUICtrlCreateMenuitem("<menu item name>", $loginmenu)
$loginitem2 = GUICtrlCreateMenuitem("<menu item name>", $loginmenu)
$loginitem8 = GUICtrlCreateMenuitem("<menu item name>", $loginmenu)$loginitem3 = GUICtrlCreateMenuitem("<menu item name>", $loginmenu)$loginitem4 = GUICtrlCreateMenuitem("<menu item name>", $loginmenu)$loginitem5 = GUICtrlCreateMenuitem("<menu item name>", $loginmenu)$separator5 = GUICtrlCreateMenuitem("<menu item name>", $loginmenu)$loginitem7 = GUICtrlCreateMenuitem("<menu item name>", $loginmenu)

#EndRegion ~Login Menu Item
#Region ~Help Menu Item

$helpmenu = GUICtrlCreateMenu("&Help")
$helpitem1 = GUICtrlCreateMenuitem("<menu item name>", $helpmenu)
$separator6 = GUICtrlCreateMenuitem("", $helpmenu)
$helpitem2 = GUICtrlCreateMenuitem("<menu item name>", $helpmenu)
$separator7 = GUICtrlCreateMenuitem("", $helpmenu)
$helpitem3 = GUICtrlCreateMenuitem("<menu item name>", $helpmenu)

#EndRegion ~Help Menu Item

GUISetState();Run the GUI until the dialog is closed
Link to post
Share on other sites

You've encountered a bug that has gotten me a few times. Maybe we should remind jpm and the guys:

Your window HEIGHT is too small. If the height is less than the height of a titlebar, then the GUI never appears....

Under the default Windows XP style, the titlebar height is bigger than it used to be. Try a height of 100

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to post
Share on other sites

You've encountered a bug that has gotten me a few times.  Maybe we should remind jpm and the guys:

Your window HEIGHT is too small.  If the height is less than the height of a titlebar, then the GUI never appears....

Under the default Windows XP style, the titlebar height is bigger than it used to be.  Try a height of 100

<{POST_SNAPBACK}>

I am not sure to understand what too small mean. It is the user responsability to define the HEIGHT in agreement with the windows/Style it is running with.

Where do you suggest I put this warning in the doc? :)

Link to post
Share on other sites

I might be wrong.... Hmm, I can't track down the problem....:)

modernes's code only works for me if I increase the height....

HOWEVER, the following works for me:

$height = 1
#include <GuiConstants.au3>
GuiCreate("This works for me", 200, $height)
GuiSetState()
While GuiGetMsg() <> $GUI_EVENT_CLOSE
Wend

:D confused

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to post
Share on other sites

I might be wrong....  Hmm, I can't track down the problem....:)

modernes's code only works for me if I increase the height....

HOWEVER, the following works for me:

$height = 1
#include <GuiConstants.au3>
GuiCreate("This works for me", 200, $height)
GuiSetState()
While GuiGetMsg() <> $GUI_EVENT_CLOSE
Wend

:D confused

<{POST_SNAPBACK}>

that's work for me too.

@modernes

can you post a fully (non)working script with associated data so I can reproduce?

Thanks :D

Edited by jpm
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...