Skip to content
⌘ NSIS Forum Archive

center installer on screen

3 posts

Backland#

center installer on screen

Hello,

I'm moving the position of the installer window with the System plugin and SetWindowPos, but would like to re-center it on the screen at a later time, how can I do that?

Thanks 🙂
kichik#
You can calculate the position or simply save it before you move the window. Call GetWindowRect to get the required values.
dandaman32#
FYI the formula for setting the window position should be:

X = Screen X - (installer_width / 2)
Y = Screen Y - (installer_height / 2)

-dandaman32