How to make an app - Andromo App Maker


No announcement yet.

Any thoughts where -32000 comes from?

  • Filter
  • Time
  • Show
Clear All
new posts

  • 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:-

    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
    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
      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
      Embrace change in your life, you never know, it could all work out for the best


      • #4
        Now I've sussed it, it's fine. Just needed an extra "if" statement to correct the unwanted behaviour. Live and learn!!