Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clear Form Window Positions
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00684047
Message ID:
00684076
Views:
24
>Here is some code that I thought most MM developers could use. If you have your forms set to save position (lsaveposition = .t.) then you change the size of the form in the development environment the forms are sized incorrectly when you run the application. It just removes the entire "Window Positions" section either in your registry or INI file based on the setting of luseinifile setting of your application object.
>
>
>#INCLUDE 'INCLUDE\APPINCL.H'
>DECLARE INTEGER WritePrivateProfileString IN Win32API ;
>  String cSection, String cKey, String cValue, String cINIFile
>LOCAL goApp, lcIniFile, lnResult
>
>DO setx
>goApp = CREATEOBJECT(APPCLASS)
>IF goapp.luseinifile
>	lcIniFile = goApp.GetIniFile()
>	lnResult = WritePrivateProfileString("Window Positions", NULL, NULL, lcIniFile)
>ELSE
>	goApp.osystemsetting.delete(goapp.osystemsetting.cregistrykey + "Window Positions")
>ENDIF
>
>
>Dan

I'd suggest just adding this to the menu somewhere (eg. added to the framework). This was actually on my list of things to do for my current app. I think I'll grab your code right now and paste it into my app. People tend to mess things like this up and this is a nice easy way to fix it.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform