473,394 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Capture Shift Held Down When Application Starts?

Hi All,

I'm writing a launcher program which checks for updates and copies them down
to the client.
However, I would like the user to be able to modify the settings for the
launcher. As this runs automatically, I would like it to be configurable by
the user holding down the shift key when double-clicking my exe, to bypass
the usual update routine and start the config form.

Access does something similar, by holding down the shift to bypass the
autoexec macros with automatically starts on startup.

I'm already checking for command parameters to start the config, but that
isn't acceptable, and the user would have to modify the shortcut etc.

Any ideas?

Thanks

Alex
Nov 21 '05 #1
6 2323
Alex,
Have you looked at using System.Windows.Forms.Control.ModifierKeys to see if
one of the modifier keys (SHIFT, CTRL, & ALT) is in a pressed state or not?

http://msdn.microsoft.com/library/de...rkeystopic.asp

Hope this helps
Jay

"Alex Stevens" <Al**********************@gcc.co.uk> wrote in message
news:e3**************@TK2MSFTNGP09.phx.gbl...
Hi All,

I'm writing a launcher program which checks for updates and copies them
down
to the client.
However, I would like the user to be able to modify the settings for the
launcher. As this runs automatically, I would like it to be configurable
by
the user holding down the shift key when double-clicking my exe, to bypass
the usual update routine and start the config form.

Access does something similar, by holding down the shift to bypass the
autoexec macros with automatically starts on startup.

I'm already checking for command parameters to start the config, but that
isn't acceptable, and the user would have to modify the shortcut etc.

Any ideas?

Thanks

Alex

Nov 21 '05 #3
Alex,
Have you looked at using System.Windows.Forms.Control.ModifierKeys to see if
one of the modifier keys (SHIFT, CTRL, & ALT) is in a pressed state or not?

http://msdn.microsoft.com/library/de...rkeystopic.asp

Hope this helps
Jay

"Alex Stevens" <Al**********************@gcc.co.uk> wrote in message
news:e3**************@TK2MSFTNGP09.phx.gbl...
Hi All,

I'm writing a launcher program which checks for updates and copies them
down
to the client.
However, I would like the user to be able to modify the settings for the
launcher. As this runs automatically, I would like it to be configurable
by
the user holding down the shift key when double-clicking my exe, to bypass
the usual update routine and start the config form.

Access does something similar, by holding down the shift to bypass the
autoexec macros with automatically starts on startup.

I'm already checking for command parameters to start the config, but that
isn't acceptable, and the user would have to modify the shortcut etc.

Any ideas?

Thanks

Alex

Nov 21 '05 #4


"Alex Stevens" wrote:
Hi All,

I'm writing a launcher program which checks for updates and copies them down
to the client.
However, I would like the user to be able to modify the settings for the
launcher. As this runs automatically, I would like it to be configurable by
the user holding down the shift key when double-clicking my exe, to bypass
the usual update routine and start the config form.

Access does something similar, by holding down the shift to bypass the
autoexec macros with automatically starts on startup.

I'm already checking for command parameters to start the config, but that
isn't acceptable, and the user would have to modify the shortcut etc.

Any ideas?

Thanks

Alex

Nov 21 '05 #5
Othman,

"Othman Kinani" <Ot**********@discussions.microsoft.com> schrieb:
[Nothing]


It seems that there is something wrong because your replies don't contain
any text...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #6

If Control.ModifierKeys = Keys.Shift Then
' Shift is being held down.. special processing...
End If

This checks if Shift is the only modifier key being pressed. If you
want to check if shift or any other key is pressed, then use

If (Control.ModifierKeys And Keys.Shift) = Keys.Shift Then
' Shift is being held down.. special processing...
End If

HTH,

Sam

Hi All,

I'm writing a launcher program which checks for updates and copies them down
to the client.
However, I would like the user to be able to modify the settings for the
launcher. As this runs automatically, I would like it to be configurable by
the user holding down the shift key when double-clicking my exe, to bypass
the usual update routine and start the config form.

Access does something similar, by holding down the shift to bypass the
autoexec macros with automatically starts on startup.

I'm already checking for command parameters to start the config, but that
isn't acceptable, and the user would have to modify the shortcut etc.

Any ideas?

Thanks

Alex


B-Line is now hiring one VB.NET developer for
WinForms + WebServices position with ASPX in future.
Seaking mid to senior level developer. For
information or to apply e-mail sam_blinex_com.
Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Alex Stevens | last post by:
Hi All, I'm writing a launcher program which checks for updates and copies them down to the client. However, I would like the user to be able to modify the settings for the launcher. As this...
6
by: PerryC | last post by:
I have search googles and there are hundreds of tips about AllowByPassKey... however, none works for me... well, perhaps I am too new to such high level functionality that it just does not make...
4
by: Tom van Stiphout | last post by:
Hi All, Here is my code: Dim appData As New Access.Application appData.Visible = True appData.OpenCurrentDatabase "c:\test\test.mdb", False ' Do my thing with the appData automation...
2
by: orekinbck | last post by:
Hi There In a C# windows app in .NET 2003, I would like to capture when the user is within a certain text box and holds down shift then presses tab. Atm, my code is: protected override bool...
1
by: Mike Hutton | last post by:
I need some help. I am trying to set up our development environment so as to make life easy for my fellow developers (none of whom have used ASP.NET or VS.NET before). We are developing our...
10
by: Tim Frawley | last post by:
I am attempting to detect a Shift+Tab in the KeyPress event for back navigation on a control that doesn't support this method. Does anyone have any ideas how to compare e.KeyChar to a ShiftTab? ...
2
by: Don | last post by:
It took me a while to find this code, so I decided to post it here for others who might also be looking for a way to trap tab key presses. You can extend a control and place this code in it to...
0
by: Martijn Mulder | last post by:
/* I override IsInputKey() to direct the Arrow Keys (Cursor Keys) to my custom System.Windows.Forms.Control. But, holding down the Shift-Key prevents the Arrow Keys from coming through. How can...
0
by: amyl | last post by:
I have a 32 bit number "3515261219" that really contains four 8 bit numbers. 11010001 10000110 10100001 00100011 Is there a way to capture the bits that are shifted out of the number when you...
4
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
I know how to capture a keypress for a windows application, but how would I go about doing it for a windows service? Rather than having a form in focus all the time, I would prefer to have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.