# nsResize NSIS Plugin **Personal modified version** --- ## Original Description **Author:** Stuart 'Afrow UK' Welch **Company:** Afrow Soft Ltd **Date:** 13th April 2013 **Version:** 1.0.0.0 A small NSIS plug-in for moving or resizing windows/controls. See Examples\nsResize\*. ## Macros nsResize.nsh includes macros used by the LargeWindow example script. ## Functions ### nsResize::SetRTL ```nsis nsResize::SetRTL $(^RTL) ``` Sets right-to-left mode on or off. This is only needed when using the nsResize::Set function. ### nsResize::Set ```nsis nsResize::Set control_HWND x y width height ``` Sets a control's new X and Y coordinates and a new width and height. You may use the same unit values as nsDialogs. An empty string for x or y will ensure the control is not moved. An empty string for width or height will ensure the control is not resized. ### nsResize::Add ```nsis nsResize::Add control_HWND x y width height ``` Adds the given X, Y, width and height values. You may use the same unit values as nsDialogs. Note that special treatment must be done for right-to-left languages. ### nsResize::Top ```nsis nsResize::Top control_HWND ``` Moves a control to the top of the Z-order. ### nsResize::GetPos ```nsis nsResize::GetPos control_HWND Pop $X Pop $Y ``` Gets the control position in dialog units relative to its parent window. ### nsResize::GetPosPx ```nsis nsResize::GetPosPx control_HWND Pop $X Pop $Y ``` Gets the control position in pixels relative to its parent window. ### nsResize::GetSize ```nsis nsResize::GetSize control_HWND Pop $Width Pop $Height ``` Gets the control size in dialog units. ### nsResize::GetSizePx ```nsis nsResize::GetSizePx control_HWND Pop $Width Pop $Height ``` Gets the control size in pixels. ## License This plug-in is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this plug-in. Permission is granted to anyone to use this plug-in for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this plug-in must not be misrepresented; you must not claim that you wrote the original plug-in. If you use this plug-in in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered versions must be plainly marked as such, and must not be misrepresented as being the original plug-in. 3. This notice may not be removed or altered from any distribution. --- ## ⚠️ Differences in the Personal Version This version includes the following changes from the original distribution: ### New supported architecture: x64 (amd64-unicode) The original supported only: - x86-ansi - x86-unicode The personal version adds support for: - **amd64-unicode** (x64) ### Visual Studio Project The original included: - `Contrib/nsResize/nsResize.sln` - VS2012 Solution - `Contrib/nsResize/nsResize.vcxproj` - VS2012 Project (x86 only) The personal version updates to VS2022 with x64 support: - `Src/nsResize.sln` - VS2022 Solution - `Src/nsResize.vcxproj` - VS2022 Project (x86-ansi, x86-unicode, amd64-unicode) ### Changed Folder Structure Source files have been moved from `Contrib/nsResize/` to `Src/` for a cleaner structure. ### Added Files - `build_plugin.py` - Python script to compile the plugin for all architectures - `Src/api.h` - NSIS API header - `Src/pluginapi.c` / `Src/pluginapi.h` - NSIS plugin API - `Src/nsis_tchar.h` - Header for TCHAR support - `Src/nsis_unicode/pluginapi_x64.lib` - Plugin API library for x64 - `Src/build_pluginapi_x64.cmd` / `Src/build_pluginapi_x86.cmd` - Scripts to compile plugin API - `Examples/nsResize/*.exe` - Compiled examples ### Build ```powershell python build_plugin.py # Build all architectures python build_plugin.py --config x86-unicode # Single architecture (x86-ansi|x86-unicode|amd64-unicode|all) python build_plugin.py --toolset 2026 # Specific toolset (2022|2026|auto) python build_plugin.py --jobs 4 # Number of parallel MSBuild jobs (default: CPU count) python build_plugin.py --clean # Clean dist/ before build python build_plugin.py --install-dir "C:\NSIS\Plugins" # Copy to additional NSIS directory python build_plugin.py --verbose # Extended MSBuild output python build_plugin.py --version # Print version and exit ``` DLLs are copied to `dist/{platform}/nsResize.dll`. ### Removed Files Pre-compiled DLL files have been removed from the distribution: - `Plugins/nsResize.dll` - `Unicode/Plugins/nsResize.dll` DLLs are generated by the build and copied to `plugins/{platform}/`. --- *See [README_IT.md](README_IT.md) for the Italian version.*