Note that there are some explanatory texts on larger screens.

plurals
  1. PO.LNK File Shortcut Key no longer works if I press it while my C#, maximized, no border program is running
    text
    copied!<p>For a more general behavior probably caused by this problem please also read:</p> <p><a href="https://stackoverflow.com/questions/2042925/shortcut-keys-defined-in-lnk-files-do-not-work-if-im-running-a-c-winforms-prog">https://stackoverflow.com/questions/2042925/shortcut-keys-defined-in-lnk-files-do-not-work-if-im-running-a-c-winforms-prog</a></p> <p>I'm writing a C# program, using .NET 2.0 and WinForms and Visual C# 2008 Express. I'm using Windows 7 but the problem is also under Windows XP.</p> <p>Important: the FormBorderStyle property of the main form is set to None, and the WindowState to Maximized.</p> <p>I created a shortcut file (.LNK) to my program on the Desktop, and I defined a shortcut key in the Properties dialog box (let's say Ctrl+F11, but the problem is the same with any other shortcut keys I tried). When I press Ctrl+F11 in Windows, my program starts fine.</p> <p>However, if I press Ctrl+F11 while my program is running, nothing happens (and no key down event is generated even if I set the KeyPreview property of the main form to true and assign a KeyDown event handler), but after I close the program, when I try again to press Ctrl+F11, the shortcut no longer works in Windows. I have to change it or wait a longer time until it works again (however it's not very clear how it starts to work again).</p> <p>If I don't press Ctrl+F11 while my program is running, after I close it, the next time I use the shortcut key, it works fine.</p> <p>This problem prevents me for using the .LNK shortcut key feature to define a shortcut key for my C#, WinForms, .NET 2.0 program that has no form border and it is maximized.</p> <p>Is there anything I can do in my C# WinForms program to solve this problem?</p> <p>Thank you</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