Radsam Posted January 27, 2005 Posted January 27, 2005 Hi, I am developing an application for our organization however it seems as if the window is hidden when users run it using Windows 2000. I know it is running as the hotkeys I defined work and it is in the sys tray. Here are a few lines of my gui create function. Is there any reasons why this is happening? I've tested on other XP machines and everything is a-ok... $IMSC = GUICreate("IMSC", 200, 36, $winpos[0], $winpos[1], -1, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW) $statuslabel = GUICtrlCreateLabel($status, 0, 0, 200, 16, $SS_SIMPLE + $SS_SUNKEN) ;menu items are here GUISetState(@SW_SHOW) Radsam
Radsam Posted January 27, 2005 Author Posted January 27, 2005 $winpos[0] = IniRead("C:\Program Files\IBM\IMS Console\Config.ini", "IMSC Settings", "WinPosX", -1) $winpos[1] = IniRead("C:\Program Files\IBM\IMS Console\Config.ini", "IMSC Settings", "WinPosY", -1) It reads the values in the ini file and displays the Gui in that location. I use a correspnding code to write to the ini file the window's lcation when closing. I do all of this so that the App will open in the same spot that it was last in. Case $msg = $GUI_EVENT_CLOSE;Case the "X" Button is pressed $confirm = MsgBox(262144 + 36, "Confirm Close", "Are you sure you want to close IMSC?") If $confirm = 6 Then $winpos = WinGetPos("") IniWrite("C:\Program Files\IBM\IMS Console\Config.ini", "IMSC Settings", "WinPosX", $winpos[0]) IniWrite("C:\Program Files\IBM\IMS Console\Config.ini", "IMSC Settings", "WinPosY", $winpos[1]) Exit
Valik Posted January 27, 2005 Posted January 27, 2005 IniRead() returns a string, not a number. Try casting the return from IniRead() to a number: Number(IniRead(...)) I would guess that you are also storing the size? If so, when you restore it, you are basically creating a window at coordinate 0, 0 wit the size 0, 0.
Radsam Posted January 27, 2005 Author Posted January 27, 2005 The doc is a bit confusing regarding the GuiSetState. Should I use GUISetState(@SW_SHOW) or GUISetState(@SW_SHOWNORMAL)
Radsam Posted January 27, 2005 Author Posted January 27, 2005 (edited) I don't see a diference when I run the app if the parameters are either strings ("123456") or numbers (123456). I mean it runs on mine and another users pc no problem using either-or. I don't see how using "numbers" in the GUIcreate function parameters will make it display on a Windows 2000 pc. I'm going to test right now anyway, but does what I say make sense? The following code shows that if there is no value in the ini file, a NUMBER -1 is used for the X and Y positions. THis should display window in the center. This does even work on the Win2000 PC, but on mine and another users XP machine, it does. $winpos[0] = IniRead("C:\Program Files\IBM\IMS Console\Config.ini", "IMSC Settings", "WinPosX", -1) $winpos[1] = IniRead("C:\Program Files\IBM\IMS Console\Config.ini", "IMSC Settings", "WinPosY", -1) Edited January 27, 2005 by Radsam
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now