Ctrl-PgUp keys

  • Thread starter Thread starter Miky
  • Start date Start date
M

Miky

Hi,

I need to send Ctrl-PgUp (or Ctrl-PgDown) to the active
application but when I use SendKeys.Send("^{PGUP}"), the
program understands it as just PageUp. How may I solve it?

Thanks in advance,
LDV-ME.
 
Hi LDV,

That's the correct syntax for SendKeys, so it should work. Is it getting to the right
Control in the other App, though? If the wrong Control receives the Ctrl-PgUp it will just
ignore it.

Regards,
Fergus
 
* "Miky said:
I need to send Ctrl-PgUp (or Ctrl-PgDown) to the active
application but when I use SendKeys.Send("^{PGUP}"), the
program understands it as just PageUp. How may I solve it?

Should work. Which control are you sending the keys to? Are you sure
it has the input focus?
 
Hi,

thanks to both of you for your answers.

The control that I want to receive the keys has the input
(if I manually type the combination on the keyboard, it
works without any problem).

Thanks,
LDV-ME.
 
Hi LDV,

I was afraid you were going to say that! ;-)

It could be that the SendKeys isn't working or it could be that the receiving program
isn't getting it.

To test the first you could write a simple program which will simply report every
keystroke that it receives.

To test the second (hopefully you wrote it) you can have it send keys to itself when
you click a button or something.

Another way to test it would be to use VbScript to do the SendKeys.

Regards,
Fergus
 
* "Miky said:
The control that I want to receive the keys has the input
(if I manually type the combination on the keyboard, it
works without any problem).

Would be interesting if it works with an other application. If you have
an other application that reacts on the key combination, test it with
this application. If you don't have one, you may want to write your own
application and intercept the keyboard events ('KeyDown', 'KeyUp') and
check if the keys arrive properly.
 
Hi,

I know that is bad :)

To make things worse :)... I don't think that the SendKeys
isn't working because in the program I send other sendkeys
to the same application (normal, such as numbers and
letters or 'Alt' combinations) and they work fine. On the
other side I wrote the program to see if the combination
is correct and it does :(

The application I am sending the sendkeys has been written
in Oracle forms and that combination allows me to move to
the next tab in a tab control.

Thanks.
-----Original Message-----
Hi LDV,

I was afraid you were going to say that! ;-)

It could be that the SendKeys isn't working or it
could be that the receiving program
isn't getting it.

To test the first you could write a simple program which will simply report every
keystroke that it receives.

To test the second (hopefully you wrote it) you can
have it send keys to itself when
 
Hi leonardo,

Based on my understanding, you can send keys to any .NET Winform
application. But you can not send Ctrl+Page Down key to an Oracle Form
application.
If I misunderstand your meaning, please post here.
Have you tried to capture all the Key events of the Oracle Form application
to see if the Ctrl+Page Down key has been sent to the application?
Also, to isolate the problem, can you create a new Oracle Form aplication
as simple as possible, and try to send the keys to see if the problem
persists.
There is tool named Spy++, you may try to use it to capture the message.
If I misunderstand your meaning, please feel free to post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
Content-Class: urn:content-classes:message
From: "Miky" <[email protected]>
Sender: "Miky" <[email protected]>
References: <[email protected]>
<[email protected]>
 
Hi,

Thanks for your reply and sorry for the delay in my answer.

I tried to capture the keys sent to the Oracle application
by Spy and below are the results. Unlucky I cannot create
an Oracle form since I don't have the instruments to do so.

Sorry for the raw data but seems that I cannot insert an
attachment through the newsgroup web interface. It should
be legible on a legal landscape word document.

<00178> 002901C6 P WM_KEYDOWN nVirtKey:VK_F8 cRepeat:1
ScanCode:01 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
[wParam:00000077 lParam:00010001 time:74:06:51.796]
<00179> 002901C6 P WM_KEYUP nVirtKey:VK_F8 cRepeat:1
ScanCode:00 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
[wParam:00000077 lParam:C0000001 time:74:06:51.796]
<00180> 002901C6 P WM_KEYDOWN nVirtKey:VK_CONTROL
cRepeat:1 ScanCode:01 fExtended:0 fAltDown:0 fRepeat:0
fUp:0 [wParam:00000011 lParam:00010001 time:74:06:55.796]
<00181> 002901C6 P WM_KEYDOWN nVirtKey:VK_NEXT cRepeat:1
ScanCode:00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
[wParam:00000022 lParam:00000001 time:74:06:55.796]
<00182> 002901C6 P WM_KEYUP nVirtKey:VK_NEXT cRepeat:1
ScanCode:00 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
[wParam:00000022 lParam:C0000001 time:74:06:55.796]
<00183> 002901C6 P WM_KEYUP nVirtKey:VK_CONTROL cRepeat:1
ScanCode:00 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
[wParam:00000011 lParam:C0000001 time:74:06:55.796]
<00184> 002901C6 P WM_KEYDOWN nVirtKey:VK_CONTROL
cRepeat:1 ScanCode:01 fExtended:0 fAltDown:0 fRepeat:0
fUp:0 [wParam:00000011 lParam:00010001 time:74:07:00.796]
<00185> 002901C6 P WM_KEYDOWN nVirtKey:VK_NEXT cRepeat:1
ScanCode:00 fExtended:0 fAltDown:0 fRepeat:0 fUp:0
[wParam:00000022 lParam:00000001 time:74:07:00.796]
<00186> 002901C6 P WM_KEYUP nVirtKey:VK_NEXT cRepeat:1
ScanCode:00 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
[wParam:00000022 lParam:C0000001 time:74:07:00.796]
<00187> 002901C6 P WM_KEYUP nVirtKey:VK_CONTROL cRepeat:1
ScanCode:00 fExtended:0 fAltDown:0 fRepeat:1 fUp:1
[wParam:00000011 lParam:C0000001 time:74:07:00.796]

As you can see, the Ctrl-PageDown looks that is sent but
the application doesn't receive it. Is there a different
way to send keys to an application other than SendKeys
object?

Thanks in advance,
ME-LDV
 
Hi Miky,

From the log, it seems the SendKeys has sent the keys to the Oracle Form.
Since the Oracle form will work, when you press keys on the keyboard.
You may try to capture the messages again then you press the keys on the
keyboard using Spy++.

Then you may try to compare if there is any difference between the two
methods.(Use sendkeys and Keyboard). I think this is the key point , if
they are the same, then I think you may need to know how the Oracle Form
handle the messages.

If you have any concern on this issue,please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top