Skip to content

Commit f683e4d

Browse files
committed
First version
1 parent 829ff09 commit f683e4d

13 files changed

Lines changed: 573 additions & 0 deletions

RoundedScreen.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29020.237
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RoundedScreen", "RoundedScreen\RoundedScreen.csproj", "{3CFFC6A7-B746-459B-8B1B-08DD3268DEF5}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{3CFFC6A7-B746-459B-8B1B-08DD3268DEF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{3CFFC6A7-B746-459B-8B1B-08DD3268DEF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{3CFFC6A7-B746-459B-8B1B-08DD3268DEF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{3CFFC6A7-B746-459B-8B1B-08DD3268DEF5}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {115C8384-1406-4D88-800D-FF2026405C22}
24+
EndGlobalSection
25+
EndGlobal

RoundedScreen/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
5+
</startup>
6+
</configuration>

RoundedScreen/App.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="RoundedScreen.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:RoundedScreen"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>

RoundedScreen/App.xaml.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
9+
namespace RoundedScreen
10+
{
11+
/// <summary>
12+
/// Logique d'interaction pour App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}

RoundedScreen/MainWindow.xaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<Window x:Name="wndRoundedScreen" x:Class="RoundedScreen.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:RoundedScreen"
7+
mc:Ignorable="d"
8+
Title="RoundedScreen" Height="450" Width="800" Topmost="True" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" WindowState="Maximized" ShowInTaskbar="False" Focusable="False" IsTabStop="False" Closing="WndRoundedScreen_Closing" WindowStyle="None" AllowsTransparency="True">
9+
<Window.Resources>
10+
<Storyboard x:Key="Opening">
11+
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="grid">
12+
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
13+
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
14+
</DoubleAnimationUsingKeyFrames>
15+
</Storyboard>
16+
</Window.Resources>
17+
<Window.Triggers>
18+
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
19+
<BeginStoryboard Storyboard="{StaticResource Opening}"/>
20+
</EventTrigger>
21+
</Window.Triggers>
22+
<Window.Background>
23+
<SolidColorBrush Color="#FFB0B0B0"
24+
Opacity="0.0" />
25+
</Window.Background>
26+
<Grid x:Name="grid">
27+
<Image x:Name="imgCornerTL" HorizontalAlignment="Left" Margin="0" VerticalAlignment="Top" Width="12" Source="pack://siteoforigin:,,,/Resources/Corner.png"/>
28+
<Image x:Name="imgCornerTR" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Top" Width="12" Source="pack://siteoforigin:,,,/Resources/Corner.png" RenderTransformOrigin="0.5,0.5">
29+
<Image.RenderTransform>
30+
<TransformGroup>
31+
<ScaleTransform/>
32+
<SkewTransform/>
33+
<RotateTransform Angle="90"/>
34+
<TranslateTransform/>
35+
</TransformGroup>
36+
</Image.RenderTransform>
37+
</Image>
38+
<Image x:Name="imgCornerBR" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Bottom" Width="12" Source="pack://siteoforigin:,,,/Resources/Corner.png" RenderTransformOrigin="0.5,0.5">
39+
<Image.RenderTransform>
40+
<TransformGroup>
41+
<ScaleTransform/>
42+
<SkewTransform/>
43+
<RotateTransform Angle="180"/>
44+
<TranslateTransform/>
45+
</TransformGroup>
46+
</Image.RenderTransform>
47+
</Image>
48+
<Image x:Name="imgCornerBL" HorizontalAlignment="Left" Margin="0" VerticalAlignment="Bottom" Width="12" Source="pack://siteoforigin:,,,/Resources/Corner.png" RenderTransformOrigin="0.5,0.5">
49+
<Image.RenderTransform>
50+
<TransformGroup>
51+
<ScaleTransform/>
52+
<SkewTransform/>
53+
<RotateTransform Angle="270"/>
54+
<TranslateTransform/>
55+
</TransformGroup>
56+
</Image.RenderTransform>
57+
</Image>
58+
59+
</Grid>
60+
</Window>

RoundedScreen/MainWindow.xaml.cs

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
using Microsoft.Win32;
2+
using System;
3+
using System.Diagnostics;
4+
using System.Runtime.InteropServices;
5+
using System.Windows;
6+
using System.Windows.Input;
7+
using System.Windows.Interop;
8+
9+
namespace RoundedScreen
10+
{
11+
public static class PreventTouchToMousePromotion
12+
{
13+
public static void Register(FrameworkElement root)
14+
{
15+
root.PreviewMouseDown += Evaluate;
16+
root.PreviewMouseMove += Evaluate;
17+
root.PreviewMouseUp += Evaluate;
18+
}
19+
20+
private static void Evaluate(object sender, MouseEventArgs e)
21+
{
22+
if (e.StylusDevice != null)
23+
{
24+
e.Handled = true;
25+
}
26+
}
27+
}
28+
29+
public partial class MainWindow : Window
30+
{
31+
public const int WS_EX_TRANSPARENT = 0x00000020;
32+
public const int GWL_EXSTYLE = (-20);
33+
34+
[DllImport("user32.dll")]
35+
public static extern int GetWindowLong(IntPtr hwnd, int index);
36+
37+
[DllImport("user32.dll")]
38+
public static extern int SetWindowLong(IntPtr hwnd, int index, int newStyle);
39+
40+
public MainWindow()
41+
{
42+
InitializeComponent();
43+
SetStartup();
44+
}
45+
46+
private void SetStartup()
47+
{
48+
RegistryKey rk = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
49+
rk.SetValue("RoundedScreen", Process.GetCurrentProcess().MainModule.FileName);
50+
Debug.WriteLine(Process.GetCurrentProcess().MainModule.FileName);
51+
}
52+
53+
protected override void OnSourceInitialized(EventArgs e)
54+
{
55+
base.OnSourceInitialized(e);
56+
IntPtr hwnd = new WindowInteropHelper(this).Handle;
57+
int extendedStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
58+
SetWindowLong(hwnd, GWL_EXSTYLE, extendedStyle | WS_EX_TRANSPARENT);
59+
}
60+
61+
private void WndRoundedScreen_Closing(object sender, System.ComponentModel.CancelEventArgs e) { e.Cancel = true; }
62+
}
63+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using System.Reflection;
2+
using System.Resources;
3+
using System.Runtime.CompilerServices;
4+
using System.Runtime.InteropServices;
5+
using System.Windows;
6+
7+
// Les informations générales relatives à un assembly dépendent de
8+
// l'ensemble d'attributs suivant. Pour modifier les informations
9+
// associées à un assembly.
10+
[assembly: AssemblyTitle("RoundedScreen")]
11+
[assembly: AssemblyDescription("")]
12+
[assembly: AssemblyConfiguration("")]
13+
[assembly: AssemblyCompany("")]
14+
[assembly: AssemblyProduct("RoundedScreen")]
15+
[assembly: AssemblyCopyright("Copyright © 2020")]
16+
[assembly: AssemblyTrademark("")]
17+
[assembly: AssemblyCulture("")]
18+
19+
// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
20+
// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
21+
// COM, affectez la valeur True à l'attribut ComVisible sur ce type.
22+
[assembly: ComVisible(false)]
23+
24+
//Pour commencer à générer des applications localisables, définissez
25+
//<UICulture>CultureUtiliséePourCoder</UICulture> dans votre fichier .csproj
26+
//dans <PropertyGroup>. Par exemple, si vous utilisez le français
27+
//dans vos fichiers sources, définissez <UICulture> à fr-FR. Puis, supprimez les marques de commentaire de
28+
//l'attribut NeutralResourceLanguage ci-dessous. Mettez à jour "fr-FR" dans
29+
//la ligne ci-après pour qu'elle corresponde au paramètre UICulture du fichier projet.
30+
31+
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32+
33+
34+
[assembly: ThemeInfo(
35+
ResourceDictionaryLocation.None, //où se trouvent les dictionnaires de ressources spécifiques à un thème
36+
//(utilisé si une ressource est introuvable dans la page,
37+
// ou dictionnaires de ressources de l'application)
38+
ResourceDictionaryLocation.SourceAssembly //où se trouve le dictionnaire de ressources générique
39+
//(utilisé si une ressource est introuvable dans la page,
40+
// dans l'application ou dans l'un des dictionnaires de ressources spécifiques à un thème)
41+
)]
42+
43+
44+
// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
45+
//
46+
// Version principale
47+
// Version secondaire
48+
// Numéro de build
49+
// Révision
50+
//
51+
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
52+
// en utilisant '*', comme indiqué ci-dessous :
53+
// [assembly: AssemblyVersion("1.0.*")]
54+
[assembly: AssemblyVersion("1.0.0.0")]
55+
[assembly: AssemblyFileVersion("1.0.0.0")]

RoundedScreen/Properties/Resources.Designer.cs

Lines changed: 73 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)