A Windows systray application that displays the current lunar phase.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Claire 07d9979d75 Updated manifest info 11 months ago
LunaWin Updated manifest info 11 months ago
.gitignore Initial commit 11 months ago
LICENSE Initial commit 11 months ago
README.md Updated readme 11 months ago

README.md

LunaWin

LunaWin is a small systray utility displaying the current moon phase. It's written in .NET C# using WinForms.

The actual lunar phase calculation credit goes to this blog post (archive), which details the rationale behind the calculations and presents a PHP implementation.

This project demonstrates a number of concepts, some more advanced than others.

Introductory

  • Programmatically creating and updating a system tray icon using NotifyIcon
  • Programmatically creating and updating the icon's context menu using ContextMenuStrip and ToolStripMenuItem
  • Setting a program to run at user login (startup)

Advanced

  • Using Mutex to find existing instance of application
  • Using DllImport to access the current Windows 10+ theme (light or dark) natively
  • Overloading WndProc to handle system-wide messaging, to detect Windows 10+ theme changes
  • Accessing memory directly through pointers and unsafe code handling