mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-10 12:35:37 +02:00
#347, show notifications when webpage commander is invoked for the first time
This commit is contained in:
parent
05dec2e6dd
commit
ae75d66172
4 changed files with 20 additions and 7 deletions
|
@ -6,7 +6,6 @@ using System.Data;
|
|||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
@ -632,7 +631,6 @@ namespace PersistentWindows.Common
|
|||
active = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
using PersistentWindows.Common;
|
||||
using PersistentWindows.Common.WinApiBridge;
|
||||
|
@ -10,6 +12,7 @@ namespace PersistentWindows.SystrayShell
|
|||
{
|
||||
public class HotKeyForm : Form
|
||||
{
|
||||
static bool init = true;
|
||||
static HotKeyWindow hkwin = null;
|
||||
static Thread messageLoop;
|
||||
|
||||
|
@ -63,6 +66,18 @@ namespace PersistentWindows.SystrayShell
|
|||
Program.HideRestoreTip(false); //hide icon
|
||||
Program.HideRestoreTip(); //show icon
|
||||
hkwin.HotKeyPressed(from_menu : false);
|
||||
if (init)
|
||||
{
|
||||
init = false;
|
||||
string webpage_commander_notification = Path.Combine(Program.AppdataFolder, "webpage_commander_notification");
|
||||
if (!File.Exists(webpage_commander_notification))
|
||||
{
|
||||
File.Create(webpage_commander_notification);
|
||||
Process.Start(Program.ProjectUrl + "/blob/master/webpage_commander.md");
|
||||
}
|
||||
Program.systrayForm.notifyIconMain.ShowBalloonTip(5000, $"webpage commander is invoked via hotkey", "Press the hotkey (Alt + W) again to revoke", ToolTipIcon.Info);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
else if (m.Msg == 0x0010 || m.Msg == 0x0002)
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace PersistentWindows.SystrayShell
|
|||
private const int MaxSnapshots = 38; // 0-9, a-z, ` and final one for undo
|
||||
|
||||
static PersistentWindowProcessor pwp = null;
|
||||
static SystrayForm systrayForm = null;
|
||||
public static SystrayForm systrayForm = null;
|
||||
static bool silent = false; //suppress all balloon tip & sound prompt
|
||||
static bool notification = false; //pop balloon when auto restore
|
||||
static int delay_manual_capture = 5000; //in millisecond
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
### Webpage commander window is activated via hotkey (Alt + W)
|
||||
* If the activation is unintentional, press the hotkey again to deactivate webpage commander. This feature can be disabled via PW menu or command line.
|
||||
* Webpage commander improves the efficiency of web browsing using single-letter command shortcut
|
||||
* Check out online help for more details
|
||||
### Webpage commander window is invoked via hotkey (Alt + W)
|
||||
* If the invocation is unintentional, press the hotkey again to revoke webpage commander. The hotkey can be disabled via PW menu or command line.
|
||||
* Webpage commander improves the efficiency of web browsing using single-letter command shortcut.
|
||||
* Check out [Online Help](https://www.github.com/kangyu-california/PersistentWindows/blob/master/Help.md) for detailed instructions.
|
Loading…
Add table
Add a link
Reference in a new issue