Added Window position saving between runs

main
Yuriy 6 months ago
parent 845af386c0
commit 64c03c9f65

@ -11,6 +11,7 @@ if(InStr(A_ScriptName, ".ahk")){
} }
ErrorLoggingDirectory = %1% ErrorLoggingDirectory = %1%
PassedInArgument = %1%
; Add menus to the toolbar icon ; Add menus to the toolbar icon
Menu, tray, NoStandard ; remove standard tray Menu, tray, NoStandard ; remove standard tray
@ -124,6 +125,7 @@ ScriptSettingsSection := "SocialMediaPoster"
FileInstall, Version.ini, %A_ScriptDir%\Lib\Version.ini, 1 FileInstall, Version.ini, %A_ScriptDir%\Lib\Version.ini, 1
IniRead, ScriptVersion, %A_ScriptDir%\Lib\Version.ini,Social-Media-Poster, Version, 0.0 IniRead, ScriptVersion, %A_ScriptDir%\Lib\Version.ini,Social-Media-Poster, Version, 0.0
ScriptName = Freedomain Social Media Poster ScriptName = Freedomain Social Media Poster
ScriptAbbreviatedName := "FSMP"
FullScriptName := ScriptName . " " . ScriptVersion FullScriptName := ScriptName . " " . ScriptVersion
@ -340,6 +342,9 @@ if(TestingMode){ ; Easy testing for Yuriy
;---GUI Variables--- ;---GUI Variables---
;------------------------------------------------ ;------------------------------------------------
IniRead, XPosition, %SettingsIniFilepath%, %ScriptSettingsSection%, XPosition, 0
IniRead, YPosition, %SettingsIniFilepath%, %ScriptSettingsSection%, YPosition, 0
TooltipXPosition := Round((A_ScreenWidth / 2) - (A_ScreenWidth / 10)) ; Center Tooltip on the screen and a bit to the left TooltipXPosition := Round((A_ScreenWidth / 2) - (A_ScreenWidth / 10)) ; Center Tooltip on the screen and a bit to the left
GuiWidth := 1366 GuiWidth := 1366
@ -369,6 +374,11 @@ Gui, Margin, %MarginSpace%, %MarginSpace%
GUINormalFontSize := 15 GUINormalFontSize := 15
; Create GUI Elements
; ------------------------------------------------
Gui, Font, s10 Gui, Font, s10
; Gui, Font, s8 ; Gui, Font, s8
if(TestingMode){ if(TestingMode){
@ -520,7 +530,7 @@ gui, font, normal
Gui, Add, StatusBar,, Total Posts Posted: %TotalPostsPosted% | Total Run Time: %TotalRunTime% Seconds | Gui, Add, StatusBar,, Total Posts Posted: %TotalPostsPosted% | Total Run Time: %TotalRunTime% Seconds |
; easier to just let the gui size be as needed instead of trying to recalculate the size each time an element is added ; easier to just let the gui size be as needed instead of trying to recalculate the size each time an element is added
Gui, Show,,%FullScriptName% ; , w%GuiWidth%, %ScriptName% Gui, Show, x%XPosition% y%YPosition% ,%FullScriptName% ; , w%GuiWidth%, %ScriptName%
ControlFocus, Edit1, %FullScriptName% ControlFocus, Edit1, %FullScriptName%
@ -727,7 +737,6 @@ Gui, Submit
Gui, Destroy Gui, Destroy
Gui, Font, Normal Gui, Font, Normal
Gui, Font, s20 Gui, Font, s20
Gui, Add, Text, Center w350 x%marginspace%,Time to Post At Gui, Add, Text, Center w350 x%marginspace%,Time to Post At
@ -742,6 +751,12 @@ Return
PostPost: PostPost:
WinGetPos, XPosition, YPosition, , , A
IniWrite, %XPosition%, %SettingsIniFilepath%, %ScriptSettingsSection%, XPosition
IniWrite, %YPosition%, %SettingsIniFilepath%, %ScriptSettingsSection%, YPosition
Gui, Submit Gui, Submit
; Msgbox % "PostTags: " PostTags ; Msgbox % "PostTags: " PostTags
@ -787,6 +802,10 @@ IniWrite, %SaveTagsBetweenPosts%, %SettingsIniFilepath%, SocialMediaPoster, Save
IniWrite, %PauseBetweenPosts%, %SettingsIniFilepath%, SocialMediaPoster, PauseBetweenPosts IniWrite, %PauseBetweenPosts%, %SettingsIniFilepath%, SocialMediaPoster, PauseBetweenPosts
IniWrite, %ErrorLoggingDirectory%, %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost IniWrite, %ErrorLoggingDirectory%, %SettingsIniFilepath%, %ScriptSettingsSection%, LastPost
IniWrite, %A_ScriptFullPath%, %SettingsIniFilepath%, Filepaths, SocialMediaPosterFilepath
; Combines two variables together so they can be used as needed later ; Combines two variables together so they can be used as needed later
@ -1059,7 +1078,7 @@ Gui, Font, s%GUINormalFontSize%
gui, font, s6 gui, font, s6
Gui, Add, StatusBar,, Total Posts Posted: %TotalPostsPosted% | Run Time: %ScriptRunTime% Seconds Gui, Add, StatusBar,, Total Posts Posted: %TotalPostsPosted% | Run Time: %ScriptRunTime% Seconds
Gui, Show,, %FullScriptName% - Post Results Gui, Show, x%XPosition% y%YPosition%, %FullScriptName% - Post Results
SaveCurrentChromeVersionToIniFile() SaveCurrentChromeVersionToIniFile()

@ -1 +1 @@
Subproject commit e32fe026e952738a1ebda7cf81c626d0528fa660 Subproject commit b8ffb10db187c70219c594ddfe7cdebc6885d552
Loading…
Cancel
Save