EnterDbEntryName() may return null, indicating user cancelled the dialog

This commit is contained in:
Kang Yu 2023-07-30 18:36:24 -07:00
parent b26c92a6ed
commit f2c9dda7ee

View file

@ -488,7 +488,10 @@ namespace PersistentWindows.SystrayShell
pwp.dbDisplayKey = pwp.GetDisplayKey(); pwp.dbDisplayKey = pwp.GetDisplayKey();
if ((User32.GetKeyState(0x11) & 0x8000) != 0) //ctrl key pressed if ((User32.GetKeyState(0x11) & 0x8000) != 0) //ctrl key pressed
{ {
pwp.dbDisplayKey += EnterDbEntryName(); var name = EnterDbEntryName();
if (String.IsNullOrEmpty(name))
return;
pwp.dbDisplayKey += name;
} }
capture_to_hdd_timer.Change(delay_capture ? delay_manual_capture : 0, Timeout.Infinite); capture_to_hdd_timer.Change(delay_capture ? delay_manual_capture : 0, Timeout.Infinite);
@ -519,7 +522,10 @@ namespace PersistentWindows.SystrayShell
pwp.dbDisplayKey = pwp.GetDisplayKey(); pwp.dbDisplayKey = pwp.GetDisplayKey();
if ((User32.GetKeyState(0x11) & 0x8000) != 0) //ctrl key pressed if ((User32.GetKeyState(0x11) & 0x8000) != 0) //ctrl key pressed
{ {
pwp.dbDisplayKey += EnterDbEntryName(); var name = EnterDbEntryName();
if (String.IsNullOrEmpty(name))
return;
pwp.dbDisplayKey += name;
} }
} }
pwp.StartRestoreTimer(milliSecond : 2000 /*wait mouse settle still for taskbar restore*/); pwp.StartRestoreTimer(milliSecond : 2000 /*wait mouse settle still for taskbar restore*/);