def saveWindowPosition(self):
        """Save the window position in the configuration handler."""
        if DEBUG_WM:
            print "############################ EXITING ############################"
        win = self.displayContext.win
        # The following Windows specific code will not be executed if we're using '--debug-wm' switch.
        if not USE_WM and sys.platform == "win32" and config.settings.setWindowPlacement.get():
            (flags, showCmd, ptMin, ptMax, rect) = mcplatform.win32gui.GetWindowPlacement(
                display.get_wm_info()['window'])
            X, Y, r, b = rect
            if (showCmd == mcplatform.win32con.SW_MINIMIZE or
                        showCmd == mcplatform.win32con.SW_SHOWMINIMIZED):
                showCmd = mcplatform.win32con.SW_SHOWNORMAL

            config.settings.windowX.set(X)
            config.settings.windowY.set(Y)
            config.settings.windowShowCmd.set(showCmd)
        elif win:
            config.settings.windowMaximized.set(self.maximized)
            if not self.maximized:
                x, y = win.get_position()
            else:
                x, y = self.saved_pos
            if DEBUG_WM:
                print "x", x, "y", y
            config.settings.windowX.set(x)
            config.settings.windowY.set(y)
Save the window position in the configuration handler.
mcedit.py