views:

211

answers:

0

To test this problem I wrote a simple 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.

Important: the FormBorderStyle property of the main form is set to None, and the WindowState to Maximized. The program does nothing special.

When this program is running, all shortcut keys defined in any .LNK (shortcut) file from Desktop or Start Menu stop working.

For example, let's say I create a shortcut to Windows Calc on the desktop and I assign Ctrl+F3 to it as the shortcut key in the Shortcut Properties dialog box. If I press Ctrl+F3 anywhere in Windows, Calculator will start. However, if I press Ctrl+F3 while my program is running, Calculator does not start, and more, even after I close the program, the shortcut will no longer work.

Also, pressing Ctrl+F3 or any other shortcut does not generate a key down event if I set the KeyPreview property of the main form to true and assign a KeyDown event handler.

Did you stumble upon this behavior before?

More important, I think it's the cause of the problem asked at

http://stackoverflow.com/questions/2029987/lnk-file-shortcut-key-no-longer-works-if-i-press-it-while-my-program-is-running

that 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.