add resource, and save window position