Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
# Windows-RoundedScreen
**this is a fork for development purposes, please use the [main project](https://github.com/BeezBeez/Windows-RoundedScreen) instead**

[BeezBeez/Windows-RoundedScreen](https://github.com/BeezBeez/Windows-RoundedScreen)

# RoundedScreen
A simple workaround to get rounded screen corners on Windows.

LATEST CHANGES (09/03/2025) :
- HWND_TOPMOST
- remove austostart with uninstall
- bumped the version number to 4.0

LATEST CHANGES (08/03/2025) :
- added auto-reload on detected changes of displaysettings
- added nsi installer script
- bumped the version number to 3.0

LATEST CHANGES (26/01/2023) :
- hidden from alt+tab list
- made corners a bit smaller
- added an AppIcon
- upped the version number
- added a command to quit the program

**THIS PROJECT IS NOT MAINTAINED BUT I FREQUENTLY CHECK THE PULL REQUESTS**
- bumped the version number to 2.0
161 changes: 161 additions & 0 deletions RoundedScreen.nsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
!define APP_NAME "RoundedScreen"
!define COMP_NAME "RoundedScreen"
!define WEB_SITE "https://github.com/BeezBeez/Windows-RoundedScreen"
!define VERSION "04.00.00.00"
!define COPYRIGHT "Copyright © 2025"
!define SHORTVERSIONNUM "4.0"
!define DESCRIPTION "RoundedScreen"
!define INSTALLER_NAME "C:\Users\user\Desktop\Windows-RoundedScreen-master\RoundedScreen\bin\Release\${APP_NAME}.${SHORTVERSIONNUM}.Installer.exe"
!define MAIN_APP_EXE "RoundedScreen.exe"
!define INSTALL_TYPE "SetShellVarContext all"
!define REG_ROOT "HKLM"
!define REG_APP_PATH "Software\Microsoft\Windows\CurrentVersion\App Paths\${MAIN_APP_EXE}"
!define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"

######################################################################

VIProductVersion "${VERSION}"
VIAddVersionKey "ProductName" "${APP_NAME}"
VIAddVersionKey "CompanyName" "${COMP_NAME}"
VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
VIAddVersionKey "FileDescription" "${DESCRIPTION}"
VIAddVersionKey "FileVersion" "${VERSION}"

######################################################################

SetCompressor ZLIB
Name "${APP_NAME}"
Caption "${APP_NAME}"
OutFile "${INSTALLER_NAME}"
BrandingText "${APP_NAME}"
XPStyle on
InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" ""
InstallDir "$PROGRAMFILES\RoundedScreen"

######################################################################

!include "MUI.nsh"

!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING

!insertmacro MUI_PAGE_WELCOME

!ifdef LICENSE_TXT
!insertmacro MUI_PAGE_LICENSE "${LICENSE_TXT}"
!endif

!ifdef REG_START_MENU
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "RoundedScreen"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${REG_ROOT}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${UNINSTALL_PATH}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${REG_START_MENU}"
!insertmacro MUI_PAGE_STARTMENU Application $SM_Folder
!endif

!insertmacro MUI_PAGE_INSTFILES

!define MUI_FINISHPAGE_RUN "$INSTDIR\${MAIN_APP_EXE}"
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_UNPAGE_CONFIRM

!insertmacro MUI_UNPAGE_INSTFILES

!insertmacro MUI_UNPAGE_FINISH

!insertmacro MUI_LANGUAGE "English"

######################################################################

Section -MainProgram
${INSTALL_TYPE}
SetOverwrite ifnewer
SetOutPath "$INSTDIR"
File "C:\Users\user\Desktop\Windows-RoundedScreen-master\RoundedScreen\bin\Release\RoundedScreen.exe"
File "C:\Users\user\Desktop\Windows-RoundedScreen-master\RoundedScreen\bin\Release\RoundedScreen.exe.config"
File "C:\Users\user\Desktop\Windows-RoundedScreen-master\RoundedScreen\bin\Release\RoundedScreen.pdb"
SectionEnd

######################################################################

Section -Icons_Reg
SetOutPath "$INSTDIR"
WriteUninstaller "$INSTDIR\uninstall.exe"

!ifdef REG_START_MENU
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$SM_Folder"
CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
CreateShortCut "$SMPROGRAMS\$SM_Folder\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe"

!ifdef WEB_SITE
WriteIniStr "$INSTDIR\${APP_NAME} website.url" "InternetShortcut" "URL" "${WEB_SITE}"
CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME} Website.lnk" "$INSTDIR\${APP_NAME} website.url"
!endif
!insertmacro MUI_STARTMENU_WRITE_END
!endif

!ifndef REG_START_MENU
CreateDirectory "$SMPROGRAMS\RoundedScreen"
CreateShortCut "$SMPROGRAMS\RoundedScreen\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
CreateShortCut "$SMPROGRAMS\RoundedScreen\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe"

!ifdef WEB_SITE
WriteIniStr "$INSTDIR\${APP_NAME} website.url" "InternetShortcut" "URL" "${WEB_SITE}"
CreateShortCut "$SMPROGRAMS\RoundedScreen\${APP_NAME} Website.lnk" "$INSTDIR\${APP_NAME} website.url"
!endif
!endif

WriteRegStr ${REG_ROOT} "${REG_APP_PATH}" "" "$INSTDIR\${MAIN_APP_EXE}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayName" "${APP_NAME}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "UninstallString" "$INSTDIR\uninstall.exe"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayIcon" "$INSTDIR\${MAIN_APP_EXE}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayVersion" "${VERSION}"
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "Publisher" "${COMP_NAME}"

!ifdef WEB_SITE
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "URLInfoAbout" "${WEB_SITE}"
!endif
SectionEnd

######################################################################

Section Uninstall
${INSTALL_TYPE}
Delete "$INSTDIR\RoundedScreen.exe"
Delete "$INSTDIR\RoundedScreen.exe.config"
Delete "$INSTDIR\RoundedScreen.pdb"
Delete "$INSTDIR\uninstall.exe"
!ifdef WEB_SITE
Delete "$INSTDIR\${APP_NAME} website.url"
!endif

RmDir "$INSTDIR"

!ifdef REG_START_MENU
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $SM_Folder
Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk"
Delete "$SMPROGRAMS\$SM_Folder\Uninstall ${APP_NAME}.lnk"
!ifdef WEB_SITE
Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME} Website.lnk"
!endif
RmDir "$SMPROGRAMS\$SM_Folder"
!endif

!ifndef REG_START_MENU
Delete "$SMPROGRAMS\RoundedScreen\${APP_NAME}.lnk"
Delete "$SMPROGRAMS\RoundedScreen\Uninstall ${APP_NAME}.lnk"
!ifdef WEB_SITE
Delete "$SMPROGRAMS\RoundedScreen\${APP_NAME} Website.lnk"
!endif
RmDir "$SMPROGRAMS\RoundedScreen"
!endif

DeleteRegKey ${REG_ROOT} "${REG_APP_PATH}"
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "RoundedScreen"
DeleteRegKey ${REG_ROOT} "${UNINSTALL_PATH}"
SectionEnd

######################################################################
45 changes: 37 additions & 8 deletions RoundedScreen/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using Microsoft.Win32;
using Microsoft.Win32;
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interop;

namespace RoundedScreen
Expand All @@ -14,16 +13,25 @@ public partial class MainWindow : Window
public const int GWL_EXSTYLE = (-20);
public const int WS_EX_TOOLWINDOW = 0x00000080;

public const int HWND_TOPMOST = -1;
public const int SWP_NOSIZE = 0x0001;
public const int SWP_NOMOVE = 0x0002;
public const int SWP_NOACTIVATE = 0x0010;

[DllImport("user32.dll")]
public static extern int GetWindowLong(IntPtr hwnd, int index);

[DllImport("user32.dll")]
public static extern int SetWindowLong(IntPtr hwnd, int index, int newStyle);

[DllImport("user32.dll", SetLastError = true)]
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);

public MainWindow()
{
InitializeComponent();
this.SetStartup();
SystemEvents.DisplaySettingsChanged += OnDisplaySettingsChanged;
}

private void SetStartup()
Expand All @@ -37,27 +45,48 @@ protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
IntPtr hwnd = new WindowInteropHelper(this).Handle;

int extendedStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW);

SetWindowPos(hwnd, new IntPtr(HWND_TOPMOST), 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
}

private void WndRoundedScreen_Closing(object sender, System.ComponentModel.CancelEventArgs e) { e.Cancel = true; }
private void WndRoundedScreen_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
e.Cancel = true;
}

private void WndRoundedScreen_LostFocus(object sender, RoutedEventArgs e)
{
this.Activate();
this.Topmost = true;
this.Topmost = false;
this.Focus();
this.Topmost = true;
this.Topmost = false;
this.Focus();
}

private void WndRoundedScreen_Loaded(object sender, RoutedEventArgs e)
{
AdjustWindowSizeAndPosition();
}

private void AdjustWindowSizeAndPosition()
{
Point location = this.PointToScreen(new Point(0, 0));
this.WindowStartupLocation = WindowStartupLocation.Manual;
this.Width = SystemParameters.PrimaryScreenWidth;
this.Height = SystemParameters.PrimaryScreenHeight;
}

this.Width = System.Windows.SystemParameters.PrimaryScreenWidth;
this.Height = System.Windows.SystemParameters.PrimaryScreenHeight;
private void OnDisplaySettingsChanged(object sender, EventArgs e)
{
Application.Current.Shutdown();
System.Diagnostics.Process.Start(Application.ResourceAssembly.Location);
}

~MainWindow()
{
SystemEvents.DisplaySettingsChanged -= OnDisplaySettingsChanged;
}
}
}
11 changes: 6 additions & 5 deletions RoundedScreen/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
// l'ensemble d'attributs suivant. Pour modifier les informations
// associées à un assembly.
[assembly: AssemblyTitle("RoundedScreen")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyDescription("Round Your Screen Corners")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("RoundedScreen")]
[assembly: AssemblyProduct("RoundedScreen")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down Expand Up @@ -51,5 +51,6 @@
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
// en utilisant '*', comme indiqué ci-dessous :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: Guid("6a1c4e0a-4028-4697-891b-7bc03282cb7a")]