Example #1
0
        public void Initialize()
        {
            // Initialize configuration
            config = new Config();
            if (!config.Load())
                config.Save();

            // Initialize notifyIcon
            notifyIcon = new NotifyIcon();
            notifyIcon.Icon = Properties.Resources.icon;
            notifyIcon.Visible = true;
            notifyIcon.Text = Application.ProductName + " v" + Application.ProductVersion;
            notifyIcon.MouseClick += new MouseEventHandler(notifyIcon_MouseClick);
            //notifyIcon.MouseDoubleClick += new MouseEventHandler(notifyIcon_MouseDoubleClick);

            // Menu
            notifyIcon.ContextMenu = new ContextMenu();
            notifyIcon.ContextMenu.MenuItems.Add("Settings", new EventHandler(notifyIcon_Settings));
            notifyIcon.ContextMenu.MenuItems.Add("Exit", new EventHandler(notifyIcon_Exit));

            // GlobalKeyboardHook
            globalKeyboardHook = new GlobalKeyboardHook();
            globalKeyboardHook.HookedKeys.Add(Keys.PrintScreen);
            globalKeyboardHook.KeyDown += new KeyEventHandler(globalKeyboardHook_KeyDown);

            // ScreenShooter
            screenShooter = new ScreenShooter(config);
        }
Example #2
0
        public SettingsForm(Config config)
        {
            InitializeComponent();
            this.config = config;
            Icon = Properties.Resources.icon;
            Text = Application.ProductName + ": Settings";
            textBoxFull.Text = config.FolderPathFullScreenShot;

            comboBoxImageFormat.Items.Add(ImageFormat.Png);
            comboBoxImageFormat.Items.Add(ImageFormat.Jpeg);
            comboBoxImageFormat.Items.Add(ImageFormat.Gif);
            comboBoxImageFormat.SelectedItem = config.ImageFormat;
        }
Example #3
0
 public ScreenShooter(Config config)
 {
     this.config = config;
 }