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