Introduction
This tool allows you to keep post-it type notes on your computer desktop.
Demo
.NET 1.1 is required to run the demo. To use the program, execute the JotNotes.exe program. A new icon for JotNotes would then be added to the system tray. Right click on this icon to see all available options.
Code walkthrough
Though the source code is available to everybody, I would like to highlight some interesting code sections that others might want to use.
Only one instance
I am currently allowing only one instance of JotNotes to run at a time. The code to achieve that is available here.
Global Hooks
The program responds to global hot keys. E.g., Pressing Alt+Shift+Ctrl+H hides all notes, Alt+Shift+Ctrl+D displays all notes, and Alt+Shift+Ctrl+N creates a new note. The code for this was borrowed from: Processing Global Mouse and Keyboard Hooks in C#. In order to use the modifier keys, I had to change the original code to include this modification.
Notify icon
Examples of using the notifyicon is available in another article of mine: Yahoo Emoticons, Hidden emoticons (smileys) and Emotes in your system tray.
Exiting application on shutdown
Since we are using a notifyicon, there is no program with a window frame with the close button. Hence the user cannot 'close' the application. This is an issue when the system shuts down. The program handles this by overriding the WndProc
method as shown below:
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == 0x11)
{
this.ExitApplication();
};
}
Splash screen
The fading effect on the splash screen is achieved by reducing the opacity of the form progressively on each tick of a timer.
...
this.splashFadeTimer.Interval = 25;
this.splashFadeTimer.Enabled = true;
this.splashFadeTimer.Tick += new EventHandler(this.FadeSplashScreen);
}
private void FadeSplashScreen(object sender, EventArgs e)
{
this.Opacity -= 0.01;
if (this.Opacity <= 0.01)
{
this.Hide();
this.splashFadeTimer.Enabled = false;
}
}
If the user clicks on the splash screen, I reset the opacity to 100%.
private void StartUpForm_Click(object sender, System.EventArgs e)
{
this.Opacity = 1f;
}
Hiding from Alt+Tab list
I did not want this application to show up in the list of programs that show up when Alt+Tab is pressed. For this I referred to this.
Saving and Loading notes
I chose the easy way out for this - I used RTF files. There is no encryption of files and the notes may be viewed in any editor. However, it eased the process of saving and loading the notes which could contain colored text, images and text in different fonts and font styles. The RichEdit control has methods LoadFile
and SaveFile
to which you can pass the path to the RTF file.
Adding and Removing Font Styles
To add/remove font styles to selected text, I used the code sample here.
Future Developments
- I intend to add networked notes - JotNotes will also be a server that can receive notes from authorized users on other machines.
- Alarm - JotNotes will be able to remind you of appointments and tasks.
Version and history
0.12b First release
- Create/save/modify/delete notes.
- Change opacity of notes.
- Change fonts and colors.
- Global hot keys.
- Auto save notes.
- Include images in notes.