Click here to Skip to main content
15,867,895 members
Articles / Programming Languages / C#
Article

JotNotes - post-it notes for your computer

Rate me:
Please Sign up or sign in to vote.
3.44/5 (10 votes)
7 Jul 20052 min read 57.6K   1.7K   42   14
Post-it notes for your computer lets you keep your tasks in view. Has global hotkeys, allows transparency setting, including images, changing font etc.

Sample Image - JotNotes.jpg

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:

C#
protected override void WndProc(ref Message m)
{
    base.WndProc(ref m);

    // WM_QUERYENDSESSION
    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.

C#
  ...
  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%.

C#
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

  1. I intend to add networked notes - JotNotes will also be a server that can receive notes from authorized users on other machines.
  2. 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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
France France
~/sathishvj

Comments and Discussions

 
GeneralAnother thank you message to the author [modified] Pin
cwchong18-Jul-09 4:45
cwchong18-Jul-09 4:45 
GeneralJust a thank you Pin
Acid_Jester28-Jun-06 9:32
Acid_Jester28-Jun-06 9:32 
QuestionAny updates? Pin
BryanAsh28-Feb-06 10:04
BryanAsh28-Feb-06 10:04 
AnswerRe: Any updates? Pin
SathishVJ28-Feb-06 23:43
SathishVJ28-Feb-06 23:43 
GeneralRe: Any updates? Pin
DrewBurlingame18-Oct-06 6:31
DrewBurlingame18-Oct-06 6:31 
GeneralShutdown being aborted - fix Pin
SathishVJ28-Jul-05 20:02
SathishVJ28-Jul-05 20:02 
GeneralSource code Pin
SathishVJ8-Jul-05 2:43
SathishVJ8-Jul-05 2:43 
QuestionWant help fixing bugs? Why not let other members help? Pin
fwsouthern7-Jul-05 3:49
fwsouthern7-Jul-05 3:49 
AnswerOkay, I'm impressed by your research -- now for the code ????? Pin
fwsouthern7-Jul-05 8:53
fwsouthern7-Jul-05 8:53 
AnswerRe: Want help fixing bugs? Why not let other members help? Pin
SathishVJ8-Jul-05 2:56
SathishVJ8-Jul-05 2:56 
GeneralOriginal bug still present -- code looks good Pin
fwsouthern8-Jul-05 16:15
fwsouthern8-Jul-05 16:15 
GeneralArticle Submission Guidelines Pin
Daniel Turini7-Jul-05 2:35
Daniel Turini7-Jul-05 2:35 
GeneralException has occurred. Pin
Eduard Gomolyako7-Jul-05 1:56
Eduard Gomolyako7-Jul-05 1:56 
Generalwhere is the source code Pin
rleytens7-Jul-05 1:38
rleytens7-Jul-05 1:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.