├── .gitattributes
├── .gitignore
├── FloatingClock.sln
├── FloatingClock
├── App.config
├── App.xaml
├── App.xaml.cs
├── FloatingClock.csproj
├── HotKey.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── MouseHook.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
└── clock.ico
├── LICENSE
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | build/
21 | bld/
22 | [Bb]in/
23 | [Oo]bj/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 |
28 | # MSTest test Results
29 | [Tt]est[Rr]esult*/
30 | [Bb]uild[Ll]og.*
31 |
32 | # NUNIT
33 | *.VisualState.xml
34 | TestResult.xml
35 |
36 | # Build Results of an ATL Project
37 | [Dd]ebugPS/
38 | [Rr]eleasePS/
39 | dlldata.c
40 |
41 | # DNX
42 | project.lock.json
43 | artifacts/
44 |
45 | *_i.c
46 | *_p.c
47 | *_i.h
48 | *.ilk
49 | *.meta
50 | *.obj
51 | *.pch
52 | *.pdb
53 | *.pgc
54 | *.pgd
55 | *.rsp
56 | *.sbr
57 | *.tlb
58 | *.tli
59 | *.tlh
60 | *.tmp
61 | *.tmp_proj
62 | *.log
63 | *.vspscc
64 | *.vssscc
65 | .builds
66 | *.pidb
67 | *.svclog
68 | *.scc
69 |
70 | # Chutzpah Test files
71 | _Chutzpah*
72 |
73 | # Visual C++ cache files
74 | ipch/
75 | *.aps
76 | *.ncb
77 | *.opensdf
78 | *.sdf
79 | *.cachefile
80 |
81 | # Visual Studio profiler
82 | *.psess
83 | *.vsp
84 | *.vspx
85 |
86 | # TFS 2012 Local Workspace
87 | $tf/
88 |
89 | # Guidance Automation Toolkit
90 | *.gpState
91 |
92 | # ReSharper is a .NET coding add-in
93 | _ReSharper*/
94 | *.[Rr]e[Ss]harper
95 | *.DotSettings.user
96 |
97 | # JustCode is a .NET coding add-in
98 | .JustCode
99 |
100 | # TeamCity is a build add-in
101 | _TeamCity*
102 |
103 | # DotCover is a Code Coverage Tool
104 | *.dotCover
105 |
106 | # NCrunch
107 | _NCrunch_*
108 | .*crunch*.local.xml
109 |
110 | # MightyMoose
111 | *.mm.*
112 | AutoTest.Net/
113 |
114 | # Web workbench (sass)
115 | .sass-cache/
116 |
117 | # Installshield output folder
118 | [Ee]xpress/
119 |
120 | # DocProject is a documentation generator add-in
121 | DocProject/buildhelp/
122 | DocProject/Help/*.HxT
123 | DocProject/Help/*.HxC
124 | DocProject/Help/*.hhc
125 | DocProject/Help/*.hhk
126 | DocProject/Help/*.hhp
127 | DocProject/Help/Html2
128 | DocProject/Help/html
129 |
130 | # Click-Once directory
131 | publish/
132 |
133 | # Publish Web Output
134 | *.[Pp]ublish.xml
135 | *.azurePubxml
136 | ## TODO: Comment the next line if you want to checkin your
137 | ## web deploy settings but do note that will include unencrypted
138 | ## passwords
139 | #*.pubxml
140 |
141 | *.publishproj
142 |
143 | # NuGet Packages
144 | *.nupkg
145 | # The packages folder can be ignored because of Package Restore
146 | **/packages/*
147 | # except build/, which is used as an MSBuild target.
148 | !**/packages/build/
149 | # Uncomment if necessary however generally it will be regenerated when needed
150 | #!**/packages/repositories.config
151 |
152 | # Windows Azure Build Output
153 | csx/
154 | *.build.csdef
155 |
156 | # Windows Store app package directory
157 | AppPackages/
158 |
159 | # Visual Studio cache files
160 | # files ending in .cache can be ignored
161 | *.[Cc]ache
162 | # but keep track of directories ending in .cache
163 | !*.[Cc]ache/
164 |
165 | # Others
166 | ClientBin/
167 | [Ss]tyle[Cc]op.*
168 | ~$*
169 | *~
170 | *.dbmdl
171 | *.dbproj.schemaview
172 | *.pfx
173 | *.publishsettings
174 | node_modules/
175 | orleans.codegen.cs
176 |
177 | # RIA/Silverlight projects
178 | Generated_Code/
179 |
180 | # Backup & report files from converting an old project file
181 | # to a newer Visual Studio version. Backup files are not needed,
182 | # because we have git ;-)
183 | _UpgradeReport_Files/
184 | Backup*/
185 | UpgradeLog*.XML
186 | UpgradeLog*.htm
187 |
188 | # SQL Server files
189 | *.mdf
190 | *.ldf
191 |
192 | # Business Intelligence projects
193 | *.rdl.data
194 | *.bim.layout
195 | *.bim_*.settings
196 |
197 | # Microsoft Fakes
198 | FakesAssemblies/
199 |
200 | # Node.js Tools for Visual Studio
201 | .ntvs_analysis.dat
202 |
203 | # Visual Studio 6 build log
204 | *.plg
205 |
206 | # Visual Studio 6 workspace options file
207 | *.opt
208 |
209 | # LightSwitch generated files
210 | GeneratedArtifacts/
211 | _Pvt_Extensions/
212 | ModelManifest.xml
213 |
--------------------------------------------------------------------------------
/FloatingClock.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FloatingClock", "FloatingClock\FloatingClock.csproj", "{D2E6E615-8CA6-4F39-8245-5CAE735BC199}"
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 | {D2E6E615-8CA6-4F39-8245-5CAE735BC199}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {D2E6E615-8CA6-4F39-8245-5CAE735BC199}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {D2E6E615-8CA6-4F39-8245-5CAE735BC199}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {D2E6E615-8CA6-4F39-8245-5CAE735BC199}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/FloatingClock/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/FloatingClock/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/FloatingClock/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace FloatingClock
4 | {
5 | ///
6 | /// Interaction logic for App.xaml
7 | ///
8 | public partial class App : Application
9 | {
10 | ///
11 | /// Unhook Mouse On Application Exit
12 | ///
13 | private void App_OnExit(object sender, ExitEventArgs e)
14 | {
15 | MouseHook.UnhookWindowsHookEx(MouseHook._hookID);
16 |
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/FloatingClock/FloatingClock.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {D2E6E615-8CA6-4F39-8245-5CAE735BC199}
8 | WinExe
9 | Properties
10 | FloatingClock
11 | FloatingClock
12 | v4.7.2
13 | 512
14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
15 | 4
16 | true
17 |
18 |
19 |
20 | AnyCPU
21 | true
22 | full
23 | false
24 | bin\Debug\
25 | DEBUG;TRACE
26 | prompt
27 | 4
28 | false
29 |
30 |
31 | AnyCPU
32 | pdbonly
33 | true
34 | bin\Release\
35 | TRACE
36 | prompt
37 | 4
38 | false
39 |
40 |
41 | clock.ico
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | 4.0
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | MSBuild:Compile
63 | Designer
64 |
65 |
66 | MSBuild:Compile
67 | Designer
68 |
69 |
70 | App.xaml
71 | Code
72 |
73 |
74 |
75 | MainWindow.xaml
76 | Code
77 |
78 |
79 |
80 |
81 |
82 | Code
83 |
84 |
85 | True
86 | True
87 | Resources.resx
88 |
89 |
90 | True
91 | Settings.settings
92 | True
93 |
94 |
95 | ResXFileCodeGenerator
96 | Resources.Designer.cs
97 |
98 |
99 | SettingsSingleFileGenerator
100 | Settings.Designer.cs
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | Always
110 |
111 |
112 |
113 |
120 |
--------------------------------------------------------------------------------
/FloatingClock/HotKey.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Runtime.InteropServices;
4 | using System.Windows.Input;
5 | using System.Windows.Interop;
6 |
7 | namespace FloatingClock
8 | {
9 | public class HotKey : IDisposable
10 | {
11 | private const int WmHotKey = 0x0312;
12 | private static Dictionary DictHotKeyToCalBackProc;
13 | private bool _disposed;
14 |
15 | public HotKey(Key k, KeyModifier keyModifiers, Action action, bool register = true)
16 | {
17 | Key = k;
18 | KeyModifiers = keyModifiers;
19 | Action = action;
20 | if (register)
21 | {
22 | Register();
23 | }
24 | }
25 |
26 | private Key Key { get; }
27 | private KeyModifier KeyModifiers { get; }
28 | private Action Action { get; }
29 | private int Id { get; set; }
30 |
31 | public void Dispose()
32 | {
33 | Dispose(true);
34 |
35 | GC.SuppressFinalize(this);
36 | }
37 |
38 | [DllImport("user32.dll")]
39 | private static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vlc);
40 |
41 | [DllImport("user32.dll")]
42 | private static extern bool UnregisterHotKey(IntPtr hWnd, int id);
43 |
44 | private bool Register()
45 | {
46 | var virtualKeyCode = KeyInterop.VirtualKeyFromKey(Key);
47 | Id = virtualKeyCode + ((int)KeyModifiers * 0x10000);
48 | var result = RegisterHotKey(IntPtr.Zero, Id, (uint)KeyModifiers, (uint)virtualKeyCode);
49 |
50 | if (DictHotKeyToCalBackProc == null)
51 | {
52 | DictHotKeyToCalBackProc = new Dictionary();
53 | ComponentDispatcher.ThreadFilterMessage += ComponentDispatcherThreadFilterMessage;
54 | }
55 |
56 | DictHotKeyToCalBackProc.Add(Id, this);
57 |
58 | return result;
59 | }
60 |
61 | private void Unregister()
62 | {
63 | HotKey hotKey;
64 | if (DictHotKeyToCalBackProc.TryGetValue(Id, out hotKey))
65 | {
66 | UnregisterHotKey(IntPtr.Zero, Id);
67 | }
68 | }
69 |
70 | private static void ComponentDispatcherThreadFilterMessage(ref MSG msg, ref bool handled)
71 | {
72 | if (handled) return;
73 | if (msg.message != WmHotKey) return;
74 | HotKey hotKey;
75 |
76 | if (!DictHotKeyToCalBackProc.TryGetValue((int)msg.wParam, out hotKey)) return;
77 | hotKey.Action?.Invoke(hotKey);
78 | handled = true;
79 | }
80 |
81 | private void Dispose(bool disposing)
82 | {
83 | if (_disposed) return;
84 | if (disposing)
85 | {
86 | Unregister();
87 | }
88 | _disposed = true;
89 | }
90 | }
91 |
92 |
93 | [Flags]
94 | public enum KeyModifier
95 | {
96 | None = 0x0000,
97 | Alt = 0x0001,
98 | Ctrl = 0x0002,
99 | NoRepeat = 0x4000,
100 | Shift = 0x0004,
101 | Win = 0x0008
102 | }
103 |
104 |
105 | }
--------------------------------------------------------------------------------
/FloatingClock/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
25 |
29 |
33 |
34 |
37 |
41 |
42 |
43 |
46 |
49 |
50 |
51 |
52 |
53 |
55 |
57 |
58 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/FloatingClock/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using System.Threading.Tasks;
4 | using System.Windows;
5 | using System.Windows.Forms;
6 | using System.Windows.Input;
7 | using System.Windows.Threading;
8 | using Application = System.Windows.Application;
9 | using MouseEventArgs = System.Windows.Forms.MouseEventArgs;
10 |
11 | namespace FloatingClock
12 | {
13 | using System.Windows.Media;
14 | using Microsoft.Win32;
15 |
16 | ///
17 | /// Interaction logic for MainWindow.xaml
18 | ///
19 | public partial class MainWindow
20 | {
21 | public static MainWindow Current;
22 | public static bool WindowIsVisible;
23 | public static bool HotCornerEnabled;
24 | public static bool SecondsEnabled;
25 | public static bool HideIfFocusLost = true;
26 | public static bool DisableGlass = false;
27 |
28 | private NotifyIcon notifyIcon;
29 | private DispatcherTimer refreshDispatcher;
30 | ///
31 | /// Initialize Application and Main Window
32 | ///
33 | public MainWindow()
34 | {
35 | InitializeComponent();
36 | Current = this;
37 |
38 | RegistryKey registryKey = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\BaalTech\FloatingClock");
39 | HotCornerEnabled = Convert.ToBoolean(registryKey.GetValue(nameof(HotCornerEnabled), Convert.ToInt32(HotCornerEnabled)));
40 | SecondsEnabled = Convert.ToBoolean(registryKey.GetValue(nameof(SecondsEnabled), Convert.ToInt32(SecondsEnabled)));
41 | HideIfFocusLost = Convert.ToBoolean(registryKey.GetValue(nameof(HideIfFocusLost), Convert.ToInt32(HideIfFocusLost)));
42 | DisableGlass = Convert.ToBoolean(registryKey.GetValue(nameof(DisableGlass), Convert.ToInt32(DisableGlass)));
43 | registryKey.Close();
44 |
45 | Refresh();
46 |
47 | if(SystemParameters.IsGlassEnabled && !DisableGlass)
48 | ClockWindow.Background = SystemParameters.WindowGlassBrush;
49 |
50 | ShowClock();
51 | InitializeRefreshDispatcher();
52 |
53 | EnableSeconds(SecondsEnabled);
54 |
55 | new HotKey(Key.C, KeyModifier.Alt, key => ShowClock());
56 | EnableHotCorner(HotCornerEnabled);
57 |
58 | TrayIcon();
59 | }
60 |
61 | private void EnableHotCorner(bool enable)
62 | {
63 | if (enable)
64 | MouseHook._hookID = MouseHook.SetHook(MouseHook._proc);
65 | else MouseHook.UnhookWindowsHookEx(MouseHook._hookID);
66 | HotCornerEnabled = enable;
67 | }
68 |
69 | private void EnableSeconds(bool enable)
70 | {
71 | SecondsEnabled = enable;
72 | OptionalSeconds.Visibility = enable ? Visibility.Visible : Visibility.Hidden;
73 | Refresh();
74 | InitializeRefreshDispatcher();
75 |
76 | if (enable)
77 | {
78 | refreshDispatcher.Start();
79 | }
80 | else
81 | {
82 | WaitToFullMinuteAndRefresh();
83 |
84 | }
85 | }
86 |
87 | ///
88 | /// Prepare Clock to Show
89 | ///
90 | public void ShowClock()
91 | {
92 | if (!WindowIsVisible)
93 | {
94 | SetPositionOnCurrentDisplay();
95 | Refresh();
96 | InitializeAnimationIn();
97 | WaitToFullMinuteAndRefresh();
98 | }
99 | else
100 | {
101 | HideWindow();
102 | }
103 | }
104 |
105 | ///
106 | /// Load Current Data to Controls
107 | ///
108 | private void LoadCurrentClockData()
109 | {
110 | var timeNow = DateTime.Now;
111 | Hours.Text = timeNow.ToString("HH");
112 | Minutes.Text = timeNow.ToString("mm");
113 | Seconds.Text = timeNow.ToString("ss");
114 | DayOfTheWeek.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase( timeNow.ToString("dddd"));
115 | DayOfTheMonth.Text = timeNow.ToString("dd") + " " + System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(timeNow.ToString("MMMM"));
116 | }
117 |
118 | ///
119 | /// Initialize Refresh Dispatcher
120 | ///
121 | private void InitializeRefreshDispatcher()
122 | {
123 | refreshDispatcher = new DispatcherTimer();
124 | refreshDispatcher.Tick += Refresh;
125 | if(SecondsEnabled)
126 | refreshDispatcher.Interval = new TimeSpan(0,0,1);
127 | else
128 | refreshDispatcher.Interval = new TimeSpan(0, 1, 0);
129 | }
130 |
131 | ///
132 | /// Wait to full minute refresh data and start refresh Dispatcher
133 | ///
134 | private async void WaitToFullMinuteAndRefresh()
135 | {
136 | await Task.Delay((60 - DateTime.Now.Second) * 1000);
137 | Refresh();
138 | refreshDispatcher.Start();
139 | }
140 |
141 | ///
142 | /// DispatcherTimer Refresh Event
143 | ///
144 | /// Dispatcher
145 | /// Dispatcher Arg
146 | private void Refresh(object sender = null, EventArgs e = null)
147 | {
148 | LoadCurrentClockData();
149 | }
150 |
151 | ///
152 | /// Set position on current Display
153 | ///
154 | private void SetPositionOnCurrentDisplay()
155 | {
156 | var activeScreen = Screen.FromPoint(Control.MousePosition);
157 | int resHeight = Screen.PrimaryScreen.Bounds.Height;
158 | double actualHeight = SystemParameters.PrimaryScreenHeight;
159 | double dpi = resHeight / actualHeight;
160 |
161 | Application.Current.MainWindow.Top = (activeScreen.WorkingArea.Height/dpi + activeScreen.WorkingArea.Y) - 140 - 48;
162 | Application.Current.MainWindow.Left = activeScreen.WorkingArea.X + 50;
163 | }
164 |
165 | ///
166 | /// Initialize Tray Icon and BaloonTip
167 | ///
168 | private void TrayIcon()
169 | {
170 | notifyIcon = new NotifyIcon();
171 | // notifyIcon.Click += NotifyIcon_Click;
172 | ContextMenu m_menu;
173 |
174 | m_menu = new ContextMenu();
175 | var activeHotCornerItem = new MenuItem("Activate HotCorner", ChangeHotCornerActiveState);
176 | activeHotCornerItem.Checked = HotCornerEnabled;
177 | var activeSecondsItem = new MenuItem("Enable Seconds", ChangeSecondsState);
178 | activeSecondsItem.Checked = SecondsEnabled;
179 | var hideIfFocusLostItem = new MenuItem("Enable Hiding if focus lost", ChangeHideIfFocusLostState);
180 | hideIfFocusLostItem.Checked = MainWindow.HideIfFocusLost;
181 | var disableGlassItem = new MenuItem("DisableGlass", ChangeDisableGlassState);
182 | disableGlassItem.Checked = MainWindow.HideIfFocusLost;
183 | var optionsItem = new MenuItem("Options", OpenOptionWindow);
184 | optionsItem.Enabled = false;
185 | var exitItem = new MenuItem("Exit", CloseWindow);
186 | m_menu.MenuItems.Add(0, (activeHotCornerItem));
187 | m_menu.MenuItems.Add(1, (activeSecondsItem));
188 | m_menu.MenuItems.Add(2, (hideIfFocusLostItem));
189 | m_menu.MenuItems.Add(3, (optionsItem));
190 | m_menu.MenuItems.Add(4, (exitItem));
191 | notifyIcon.ContextMenu = m_menu;
192 |
193 | var streamResourceInfo = Application.GetResourceStream(new Uri("pack://application:,,,/clock.ico"));
194 | if (streamResourceInfo != null)
195 | notifyIcon.Icon = new Icon(streamResourceInfo.Stream);
196 |
197 | notifyIcon.Visible = true;
198 |
199 | notifyIcon.ShowBalloonTip(5, "Hello " + Environment.UserName,
200 | "Press Alt+C to show Clock\nRight Click on Tray to Close", ToolTipIcon.Info);
201 | }
202 |
203 | private void ChangeDisableGlassState(object sender, EventArgs e)
204 | {
205 | DisableGlass = !DisableGlass;
206 |
207 | if (SystemParameters.IsGlassEnabled && !DisableGlass)
208 | ClockWindow.Background = SystemParameters.WindowGlassBrush;
209 | else
210 | ClockWindow.Background =new SolidColorBrush(Color.FromArgb(255,17,17,17));
211 |
212 |
213 | (sender as MenuItem).Checked = DisableGlass;
214 | RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\BaalTech\FloatingClock", true);
215 | registryKey.SetValue(nameof(DisableGlass), Convert.ToInt32(DisableGlass));
216 | registryKey.Close();
217 | }
218 |
219 | private void ChangeSecondsState(object sender, EventArgs e)
220 | {
221 | EnableSeconds(!SecondsEnabled);
222 | (sender as MenuItem).Checked = SecondsEnabled;
223 | RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\BaalTech\FloatingClock", true);
224 | registryKey.SetValue(nameof(SecondsEnabled), Convert.ToInt32(SecondsEnabled));
225 | registryKey.Close();
226 | }
227 |
228 |
229 | private void ChangeHideIfFocusLostState(object sender, EventArgs e)
230 | {
231 | HideIfFocusLost = !HideIfFocusLost;
232 | (sender as MenuItem).Checked = HideIfFocusLost;
233 | RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\BaalTech\FloatingClock", true);
234 | registryKey.SetValue(nameof(HideIfFocusLost), Convert.ToInt32(HideIfFocusLost));
235 | registryKey.Close();
236 | }
237 |
238 | private void OpenOptionWindow(object sender, EventArgs e)
239 | {
240 |
241 | }
242 |
243 | private void ChangeHotCornerActiveState(object sender, EventArgs e)
244 | {
245 | EnableHotCorner(!HotCornerEnabled);
246 | (sender as MenuItem).Checked =HotCornerEnabled;
247 | RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\BaalTech\FloatingClock",true);
248 | registryKey.SetValue(nameof(HotCornerEnabled), Convert.ToInt32(HotCornerEnabled));
249 | registryKey.Close();
250 |
251 | }
252 |
253 | private void CloseWindow(object sender, EventArgs e)
254 | {
255 | Close();
256 | }
257 |
258 | ///
259 | /// Closing app after Right Click
260 | ///
261 | /// NotifyIcon Click Event
262 | /// MouseEventArg (Left Right Mouse button)
263 | private void NotifyIcon_Click(object sender, EventArgs e)
264 | {
265 | var mouseEventArgs = e as MouseEventArgs;
266 | if (mouseEventArgs != null && mouseEventArgs.Button == MouseButtons.Right)
267 | Close();
268 | }
269 |
270 | ///
271 | /// Start Animation FadeIN
272 | ///
273 | private void InitializeAnimationIn()
274 | {
275 | Application.Current.MainWindow.Activate();
276 | var dispatcherTimer = new DispatcherTimer();
277 | dispatcherTimer.Tick += OpacityFadeIn;
278 | dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 5);
279 | Application.Current.MainWindow.Visibility = Visibility.Visible;
280 |
281 | WindowIsVisible = true;
282 | dispatcherTimer.Start();
283 |
284 | }
285 |
286 | ///
287 | /// Animation Fade In Event
288 | ///
289 | ///
290 | ///
291 | private static void OpacityFadeIn(object sender, EventArgs e)
292 | {
293 | if (Application.Current.MainWindow.Opacity < 0.95)
294 | Application.Current.MainWindow.Opacity += 0.05;
295 | else
296 | ((DispatcherTimer)sender).Stop();
297 | }
298 |
299 | ///
300 | /// Call HideWindow if Window Deactivated
301 | ///
302 | private void Window_Deactivated(object sender, EventArgs e)
303 | {
304 | if(HideIfFocusLost)
305 | HideWindow();
306 | }
307 | ///
308 | /// Start Fade out Animation and stop time Dispatchers
309 | ///
310 | private void HideWindow()
311 | {
312 | var dispatcherTimer = new DispatcherTimer();
313 | dispatcherTimer.Tick += OpacityFadeOut;
314 | dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 15);
315 |
316 | dispatcherTimer.Start();
317 | WindowIsVisible = false;
318 | refreshDispatcher.Stop();
319 |
320 | }
321 |
322 | ///
323 | /// Animation Fade Out Event
324 | ///
325 | ///
326 | ///
327 | private static void OpacityFadeOut(object sender, EventArgs e)
328 | {
329 | if (Application.Current.MainWindow.Opacity > 0)
330 | Application.Current.MainWindow.Opacity -= 0.1;
331 | else
332 | {
333 | ((DispatcherTimer)sender).Stop();
334 | Application.Current.MainWindow.Visibility = Visibility.Collapsed;
335 | }
336 | }
337 |
338 | }
339 | }
--------------------------------------------------------------------------------
/FloatingClock/MouseHook.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Runtime.InteropServices;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows.Forms;
9 |
10 | namespace FloatingClock
11 | {
12 | public static class MouseHook
13 | {
14 |
15 |
16 | ///
17 | /// The _proc type defines a pointer to this callback function.
18 | ///
19 | public static readonly LowLevelMouseProc _proc = HookCallback;
20 |
21 | ///
22 | /// Pointer Hook ID
23 | ///
24 | public static IntPtr _hookID = IntPtr.Zero;
25 |
26 | ///
27 | /// Bool with information about state of corner
28 | ///
29 | private static bool cornerIsActive;
30 |
31 | ///
32 | /// If Corner is Active Wait for 2 sec and Disable it
33 | ///
34 | private static async void DisableCorner()
35 | {
36 | if (!cornerIsActive) return;
37 | await Task.Delay(2 * 1000);
38 | cornerIsActive = false;
39 | }
40 |
41 | ///
42 | /// Get Current Process and Module and Installs an application-defined hook procedure into a hook chain. You would install a hook procedure to monitor the system for certain types of events. These events are associated either with a specific thread or with all threads in the same desktop as the calling thread
43 | ///
44 | /// HookCallback
45 | ///
46 | public static IntPtr SetHook(LowLevelMouseProc proc)
47 | {
48 | using (var curProcess = Process.GetCurrentProcess())
49 | using (var curModule = curProcess.MainModule)
50 | {
51 | return SetWindowsHookEx(WH_MOUSE_LL, proc, GetModuleHandle(curModule.ModuleName), 0);
52 | }
53 | }
54 |
55 | public delegate IntPtr LowLevelMouseProc(int nCode, IntPtr wParam, IntPtr lParam);
56 |
57 |
58 |
59 | ///
60 | /// Low Level Mouse Proc - callback function used with the SetWindowsHookEx function. The system calls this function every time a new mouse input event is about to be posted into a thread input queue.
61 | ///
62 | /// A code the hook procedure uses to determine how to process the message. If nCode is less than zero, the hook procedure must pass the message to the CallNextHookEx function without further processing and should return the value returned by CallNextHookEx. This parameter can be one of the following values.
63 | /// The identifier of the mouse message. This parameter can be one of the following messages: WM_LBUTTONDOWN, WM_LBUTTONUP, WM_MOUSEMOVE, WM_MOUSEWHEEL, WM_MOUSEHWHEEL, WM_RBUTTONDOWN, or WM_RBUTTONUP.
64 | /// A pointer to an MSLLHOOKSTRUCT structure.
65 | ///
66 | private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
67 | {
68 | if (MainWindow.WindowIsVisible || nCode < 0) return CallNextHookEx(_hookID, nCode, wParam, lParam);
69 | var hookStruct = (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT));
70 | var activeScreen = Screen.FromPoint(Control.MousePosition);
71 | if (hookStruct.pt.x >= activeScreen.Bounds.X + activeScreen.Bounds.Width - 25)
72 | {
73 | if (
74 | (hookStruct.pt.y <= activeScreen.Bounds.Y + 25)
75 | ||
76 | (hookStruct.pt.y >= activeScreen.Bounds.Y + activeScreen.Bounds.Height - 25)
77 | )
78 | {
79 | cornerIsActive = true;
80 | }
81 | else
82 | {
83 | DisableCorner();
84 | }
85 | if (!cornerIsActive || (hookStruct.pt.y < activeScreen.Bounds.Y + (activeScreen.Bounds.Height / 5)) ||
86 | (hookStruct.pt.y >
87 | activeScreen.Bounds.Y + activeScreen.Bounds.Height - (activeScreen.Bounds.Height / 5)))
88 | return CallNextHookEx(_hookID, nCode, wParam, lParam);
89 | MainWindow.Current.ShowClock();
90 | cornerIsActive = false;
91 | }
92 | else
93 | {
94 | DisableCorner();
95 | }
96 | return CallNextHookEx(_hookID, nCode, wParam, lParam);
97 | }
98 |
99 |
100 | ///
101 | /// The WH_MOUSE_LL (id 14) hook enables you to monitor mouse input events about to be posted in a thread input queue.
102 | ///
103 | private const int WH_MOUSE_LL = 14;
104 |
105 | ///
106 | /// Type of MouseEvent
107 | ///
108 | public enum MouseMessages
109 | {
110 | WM_LBUTTONDOWN = 0x0201,
111 | WM_LBUTTONUP = 0x0202,
112 | WM_MOUSEMOVE = 0x0200,
113 | WM_MOUSEWHEEL = 0x020A,
114 | WM_RBUTTONDOWN = 0x0204,
115 | WM_RBUTTONUP = 0x0205
116 | }
117 |
118 |
119 | ///
120 | /// The POINT structure defines the x- and y- coordinates of a point.
121 | ///
122 | [StructLayout(LayoutKind.Sequential)]
123 | private struct POINT
124 | {
125 | public int x;
126 | public int y;
127 | }
128 |
129 |
130 | ///
131 | /// Contains information about a low-level mouse input event.
132 | ///
133 | [StructLayout(LayoutKind.Sequential)]
134 | private struct MSLLHOOKSTRUCT
135 | {
136 | public POINT pt;
137 | private uint mouseData;
138 | private uint flags;
139 | private uint time;
140 | private IntPtr dwExtraInfo;
141 | }
142 |
143 |
144 | ///
145 | /// Installs an application-defined hook procedure into a hook chain. You would install a hook procedure to monitor the system for certain types of events. These events are associated either with a specific thread or with all threads in the same desktop as the calling thread.
146 | ///
147 | /// The type of hook procedure to be installed. This parameter can be one of the following values.
148 | /// A pointer to the hook procedure. If the dwThreadId parameter is zero or specifies the identifier of a thread created by a different process, the lpfn parameter must point to a hook procedure in a DLL. Otherwise, lpfn can point to a hook procedure in the code associated with the current process.
149 | /// A handle to the DLL containing the hook procedure pointed to by the lpfn parameter. The hMod parameter must be set to NULL if the dwThreadId parameter specifies a thread created by the current process and if the hook procedure is within the code associated with the current process.
150 | /// The identifier of the thread with which the hook procedure is to be associated. For desktop apps, if this parameter is zero, the hook procedure is associated with all existing threads running in the same desktop as the calling thread. For Windows Store apps, see the Remarks section.
151 | /// If the function succeeds, the return value is the handle to the hook procedure. If the function fails, the return value is NULL.To get extended error information, call GetLastError.
152 | [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
153 | private static extern IntPtr SetWindowsHookEx(int idHook,
154 | LowLevelMouseProc lpfn, IntPtr hMod, uint dwThreadId);
155 |
156 |
157 |
158 | ///
159 | /// Removes a hook procedure installed in a hook chain by the SetWindowsHookEx function.
160 | ///
161 | /// A handle to the hook to be removed. This parameter is a hook handle obtained by a previous call to SetWindowsHookEx.
162 | ///
163 | [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
164 | [return: MarshalAs(UnmanagedType.Bool)]
165 | public static extern bool UnhookWindowsHookEx(IntPtr hhk);
166 |
167 |
168 |
169 | ///
170 | /// Passes the hook information to the next hook procedure in the current hook chain. A hook procedure can call this function either before or after processing the hook information.
171 | ///
172 | /// This parameter is ignored.
173 | /// The hook code passed to the current hook procedure. The next hook procedure uses this code to determine how to process the hook information.
174 | /// The wParam value passed to the current hook procedure. The meaning of this parameter depends on the type of hook associated with the current hook chain.
175 | /// The lParam value passed to the current hook procedure. The meaning of this parameter depends on the type of hook associated with the current hook chain.
176 | /// This value is returned by the next hook procedure in the chain. The current hook procedure must also return this value. The meaning of the return value depends on the hook type. For more information, see the descriptions of the individual hook procedures.
177 | [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
178 | private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode,
179 | IntPtr wParam, IntPtr lParam);
180 |
181 |
182 | ///
183 | /// Retrieves a module handle for the specified module. The module must have been loaded by the calling process.
184 | ///
185 | /// The name of the loaded module (either a .dll or .exe file). If the file name extension is omitted, the default library extension .dll is appended. The file name string can include a trailing point character (.) to indicate that the module name has no extension. The string does not have to specify a path. When specifying a path, be sure to use backslashes (\), not forward slashes (/). The name is compared (case independently) to the names of modules currently mapped into the address space of the calling process.
186 | /// If the function succeeds, the return value is a handle to the specified module. If the function fails, the return value is NULL.To get extended error information, call GetLastError.
187 | [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
188 | private static extern IntPtr GetModuleHandle(string lpModuleName);
189 | }
190 |
191 |
192 | }
193 |
--------------------------------------------------------------------------------
/FloatingClock/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 | using System.Windows;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 |
9 | [assembly: AssemblyTitle("Floating Clock")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("BaalTech")]
13 | [assembly: AssemblyProduct("Floating Clock")]
14 | [assembly: AssemblyCopyright("Copyright © BaalTech 2015")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | // Setting ComVisible to false makes the types in this assembly not visible
19 | // to COM components. If you need to access a type in this assembly from
20 | // COM, set the ComVisible attribute to true on that type.
21 |
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 |
55 | [assembly: AssemblyVersion("1.0.0.1")]
56 | [assembly: AssemblyFileVersion("1.0.0.1")]
--------------------------------------------------------------------------------
/FloatingClock/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FloatingClock.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FloatingClock.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/FloatingClock/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/FloatingClock/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FloatingClock.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/FloatingClock/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/FloatingClock/clock.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BaalTech/Floating-Clock/45b4962de445731f898a1a5daf08867cec3aac7c/FloatingClock/clock.ico
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License
2 |
3 | By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
4 |
5 | Section 1 – Definitions.
6 |
7 | Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
8 | Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
9 | Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
10 | Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
11 | Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
12 | Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
13 | Licensor means the individual(s) or entity(ies) granting rights under this Public License.
14 | NonCommercial means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.
15 | Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
16 | Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
17 | You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
18 |
19 | Section 2 – Scope.
20 |
21 | License grant.
22 | Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
23 | reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and
24 | produce and reproduce, but not Share, Adapted Material for NonCommercial purposes only.
25 | Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
26 | Term. The term of this Public License is specified in Section 6(a).
27 | Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
28 | Downstream recipients.
29 | Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
30 | No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
31 | No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
32 |
33 | Other rights.
34 | Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
35 | Patent and trademark rights are not licensed under this Public License.
36 | To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes.
37 |
38 | Section 3 – License Conditions.
39 |
40 | Your exercise of the Licensed Rights is expressly made subject to the following conditions.
41 |
42 | Attribution.
43 |
44 | If You Share the Licensed Material, You must:
45 | retain the following if it is supplied by the Licensor with the Licensed Material:
46 | identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
47 | a copyright notice;
48 | a notice that refers to this Public License;
49 | a notice that refers to the disclaimer of warranties;
50 | a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
51 | indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
52 | indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
53 | For the avoidance of doubt, You do not have permission under this Public License to Share Adapted Material.
54 | You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
55 | If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
56 |
57 | Section 4 – Sui Generis Database Rights.
58 |
59 | Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
60 |
61 | for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only and provided You do not Share Adapted Material;
62 | if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
63 | You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
64 |
65 | For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
66 |
67 | Section 5 – Disclaimer of Warranties and Limitation of Liability.
68 |
69 | Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
70 | To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
71 |
72 | The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
73 |
74 | Section 6 – Term and Termination.
75 |
76 | This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
77 |
78 | Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
79 | automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
80 | upon express reinstatement by the Licensor.
81 | For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
82 | For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
83 | Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
84 |
85 | Section 7 – Other Terms and Conditions.
86 |
87 | The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
88 | Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
89 |
90 | Section 8 – Interpretation.
91 |
92 | For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
93 | To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
94 | No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
95 | Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
96 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Floating (Charms) Clock for Windows 10
2 |
3 | ## Description
4 | If someone, besides me, miss the charm clock after updating to #Windows10 I'm happy to report that I have restored it as a separate application. The whole thing weighs only 48KB.
5 |
6 | From the technical point of view, the app **supports multiple screens**, so if you use several of them and you want to have access to the clock on current one, you will not be disappointed.
7 |
8 | Even if you decide to leave your computer, with the clock opened, it will be **updated in real time**, no need to open it again, or manual refresh.
9 |
10 | Is **MultiLingual** (Uses System default Language).
11 |
12 | To show Clock Press **Alt+C**
13 |
14 | If someone would have some ideas regarding the development, or found some errors. Please contact me ;)
15 |
16 | ## 2020 Update
17 | * Updated to .Net 4.7.2
18 | * Added storing settings in registry
19 | * Added GlassBrush for windows 10 (if enabled in system)
20 | * Added Seconds
21 | * Added Ability to disable AutoHide if lost focus
22 | * Month and Name of the Day is now Capitalized
23 |
24 | ## Next Release Todo
25 | * [x] Add HotCorner Mode
26 | * [x] Add Menu in Tray
27 | * [ ] Add Color Options (Text, Background,Opacity)
28 | * [ ] Config window
29 |
30 | ## Todo in future
31 | * [ ] Change Shortcut (Maybe Win+C for Win7 and Earlier in newer is assigned to Cortana or Win8 Clock) and Custom
32 | * [ ] Change Position (Top-Left,Top-Right,Bottom-Left,Bottom-Right)
33 | * [ ] Disable in GameMode or just disable option in tray Menu
34 |
35 |
36 | ## Download
37 | [=== Download: Floating Clock===](https://github.com/BaalTech/Floating-Clock/releases/latest)
38 | ## ScreenShot
39 | 
40 | ## Licence:
41 | 
Floating Clock by BaalTech is licensed under a Creative Commons Uznanie autorstwa - Użycie niekomercyjne - Bez utworów zależnych 4.0 Międzynarodowe License.
W oparciu o utwór dostępny pod adresem https://github.com/BaalTech/Floating-Clock
42 |
--------------------------------------------------------------------------------