how can I have my app ignore the shift key
Printable View
how can I have my app ignore the shift key
In what sense? Like with capital letters?
What exactly are you trying to do by ignoring shift? The easiest way would be to just not make anything in your app that uses shift. Or if you had something look at keys you could do something like making Form.KeyPreview = True and then inside the Form_KeyDown (or KeyUp) event, flip the shift bit of the Shift parameter to 0.
VB Code:
Shift = Shift And (vbCtrlMask Or vbAltMask) 'turns of the shift bit
I cant seem to figure it out and get it working.
what i need is for the use to be able to hold the shift key during the function below and not affect it so I would like to ignore the shift key during the function
Timer1.Enabled = False
Dim strhwindow As String
Dim StrFilename As String
Dim s As String
StrFilename = GetGUID & txtSuffix.Text & ".htm"
strhwindow = FindWindow(vbNullString, "Save As...")
If strhwindow <> 0 Then SendKeys StrFilename, wait
If strhwindow <> 0 Then SendKeys "{Enter}", True
Timer1.Enabled = True
any ideas?
Anyone?
Is holding shift affecting the code you posted? I tried it out myself, and holding shift had no effect. The keys you specify for SendKeys are literal, so "a" is sent as "a", regardless of the shift state. Are you sure that you also have the window specified by strhwindow active? If it's not, SendKeys may not work as you expect. You can force it to be active by using the SetActiveWindow() API once you have the handle.
what it is doing is insted of putting a nine in the filename from the getguid it puts in a ( all of the numbers do this and they are filenames and unix dosn't like that