Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Posts
    2,466

    Any thoughts where -32000 comes from?

    I have an app that colleagues use which looks after distribution, updating and opening of Access front ends to our SQL Server database. It's pretty much self-maintaining and amongst other things it 'remembers' screen position by setting the X&Y in an ini file in the user AppData folder when it closes.

    We have recently been upgraded to Win7 and Office2010 and our IT dept. have implemented Applocker through Group Policies (total nightmare for me!!). To accomodate Applocker I have had to do a "build to folder" in a shared network folder which is 'whitelisted' in Applocker.

    Since the upgrade I've had two instances of users complaining that my app had stopped working. When I checked I found that the app position ini file was showing X=-32000 and Y=-32000.

    It's impossible that the window has actually been moved to that position so the value of minus 32000 is coming from somewhere.

    I set global variables with the location of various folders at startup and then on shutdown do:-

    Code:
    tblcurrpos = Window.GetPos(Application.GetWndHandle());
    INIFile.SetValue(posfile, "Position", "xpos", tblcurrpos.X);
    INIFile.SetValue(posfile, "Position", "ypos", tblcurrpos.Y);
    Where does -3200 come from?

  2. #2
    Join Date
    Aug 2003
    Posts
    2,466
    After a bit of detective work I've solved the mystery.

    Minimising a window simply moves it off screen to a position -32000x-32000.

    My users had closed the app whilst it was minimised and that's the window position that was being saved. A bit of extra code has resolved it.

  3. #3
    Join Date
    May 2006
    Posts
    5,557
    when saving window position i never save the window position if the window is minimized or maximized so when the app is next run it will open in the same state it was closed in (in exception of minimized) and when the user restores the window it will take the same position and size is was on the last run before is was maximized

  4. #4
    Join Date
    Aug 2003
    Posts
    2,466
    Now I've sussed it, it's fine. Just needed an extra "if" statement to correct the unwanted behaviour. Live and learn!!

Posting Permissions

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