Note that there are some explanatory texts on larger screens.

plurals
  1. PONotifyIcon Context Menu Slows Down
    text
    copied!<p>So, I have a [.NET] program that implements a NotifyIcon that persists in the Notification Tray in Windows for the entire time that the program runs. When I first execute the program, and for a small time afterwards, the NotifyIcon and associated ContextMenuStrip work an absolute charm. </p> <p>However, after some time of the machine being in a lower power state or just idle for a few hours, when trying to access the Context Menu, it can take up to 2 seconds for the object to draw.</p> <p>Is there some persistence need to define to get the menu to respond faster? Have I enabled an incorrect event that is firing a cleanup of resources?</p> <p><strong><em>Edit</em></strong></p> <p>It would seem that I have 3 options to see if I can get this to work:<br> 1. Insert a <code>SecureString</code> object into the <code>ContextMenuStrip</code> object; this assumes that by having the <code>SecureString</code> inside the <code>ContextMenuStrip</code>, the whole object will be treated the same and will not be page swapped<br> 2. Create a <code>Timer</code> that touches the <code>ContextMenuStrip</code> on interval in some manner to keep it in memory<br> 3. Alter <code>Process.MinWorkingSet</code> when the app has completed initial launch to try (read: hope) that the <code>ContextMenuStrip</code> object is kept alive and not something else</p> <p>I really am not a fan of items 2 or 3; 3 especially. I am going to try item 1 and see if it works.</p> <p>Thanks for the responses so far!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload