Hello,
I want to send keystrokes to the 3rd party application window.
I want to use AppActivate statement.

Question1:
Knowing the window's title but the window is in background, is calling
AppActivate enough or that window must be first brought to the front?

Q2 (related):
Knowing the window's title but the window is minimized, is calling
AppActivate enough or that window must be first brought to normal state?

The sent keystrokes will open another window (of known title) to which one I
need to send another batch of keystrokes.
What will be the answer to Q1 in that case?
Your help appreciated,
Jack

Re: Sending keystrokes to 3rd party window by Kevin

Kevin
Wed Oct 15 20:36:12 CDT 2008

First, let me stress that all of this under Vista will in all seriousness
not work due to privlidges and such. Your process must have the same or
higher privs as the window you want to communicate with.

Useing AppActivate and SendKeys is unreliable at best. You will need focus
of the window (and child window in that window if applicable) and
AppActivate will not do this. That call basically tells VB "yo, this is the
window I want you to look at, and if it isn't there, move on"

My advice, use API (FindWindow, SendMessage, etc). Much more effective.

- Kev

"Jack" <replyto@it> wrote in message
news:uaWXBWyLJHA.4324@TK2MSFTNGP05.phx.gbl...
| Hello,
| I want to send keystrokes to the 3rd party application window.
| I want to use AppActivate statement.
|
| Question1:
| Knowing the window's title but the window is in background, is calling
| AppActivate enough or that window must be first brought to the front?
|
| Q2 (related):
| Knowing the window's title but the window is minimized, is calling
| AppActivate enough or that window must be first brought to normal state?
|
| The sent keystrokes will open another window (of known title) to which one
I
| need to send another batch of keystrokes.
| What will be the answer to Q1 in that case?
| Your help appreciated,
| Jack
|
|



Re: Sending keystrokes to 3rd party window by Jack

Jack
Wed Oct 15 21:58:26 CDT 2008

Thank you.
I like that.
What parameter to use with SendMessage (to send keystrokes)?
Jack

"Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
news:u4RVT%23yLJHA.1500@TK2MSFTNGP06.phx.gbl...
> First, let me stress that all of this under Vista will in all seriousness
> not work due to privlidges and such. Your process must have the same or
> higher privs as the window you want to communicate with.
>
> Useing AppActivate and SendKeys is unreliable at best. You will need
> focus
> of the window (and child window in that window if applicable) and
> AppActivate will not do this. That call basically tells VB "yo, this is
> the
> window I want you to look at, and if it isn't there, move on"
>
> My advice, use API (FindWindow, SendMessage, etc). Much more effective.
>
> - Kev
>
> "Jack" <replyto@it> wrote in message
> news:uaWXBWyLJHA.4324@TK2MSFTNGP05.phx.gbl...
> | Hello,
> | I want to send keystrokes to the 3rd party application window.
> | I want to use AppActivate statement.
> |
> | Question1:
> | Knowing the window's title but the window is in background, is calling
> | AppActivate enough or that window must be first brought to the front?
> |
> | Q2 (related):
> | Knowing the window's title but the window is minimized, is calling
> | AppActivate enough or that window must be first brought to normal state?
> |
> | The sent keystrokes will open another window (of known title) to which
> one
> I
> | need to send another batch of keystrokes.
> | What will be the answer to Q1 in that case?
> | Your help appreciated,
> | Jack
> |
> |
>
>



Re: Sending keystrokes to 3rd party window by Jack

Jack
Wed Oct 15 22:32:15 CDT 2008

Const WM_KEYDOWN = &H100
?
what values to use for wParam and lParam in SendMessage() ?
Jack

"Jack" <replyto@it> wrote in message
news:%23kARRszLJHA.5660@TK2MSFTNGP03.phx.gbl...
> Thank you.
> I like that.
> What parameter to use with SendMessage (to send keystrokes)?
> Jack
>
> "Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
> news:u4RVT%23yLJHA.1500@TK2MSFTNGP06.phx.gbl...
>> First, let me stress that all of this under Vista will in all seriousness
>> not work due to privlidges and such. Your process must have the same or
>> higher privs as the window you want to communicate with.
>>
>> Useing AppActivate and SendKeys is unreliable at best. You will need
>> focus
>> of the window (and child window in that window if applicable) and
>> AppActivate will not do this. That call basically tells VB "yo, this is
>> the
>> window I want you to look at, and if it isn't there, move on"
>>
>> My advice, use API (FindWindow, SendMessage, etc). Much more effective.
>>
>> - Kev
>>
>> "Jack" <replyto@it> wrote in message
>> news:uaWXBWyLJHA.4324@TK2MSFTNGP05.phx.gbl...
>> | Hello,
>> | I want to send keystrokes to the 3rd party application window.
>> | I want to use AppActivate statement.
>> |
>> | Question1:
>> | Knowing the window's title but the window is in background, is calling
>> | AppActivate enough or that window must be first brought to the front?
>> |
>> | Q2 (related):
>> | Knowing the window's title but the window is minimized, is calling
>> | AppActivate enough or that window must be first brought to normal
>> state?
>> |
>> | The sent keystrokes will open another window (of known title) to which
>> one
>> I
>> | need to send another batch of keystrokes.
>> | What will be the answer to Q1 in that case?
>> | Your help appreciated,
>> | Jack
>> |
>> |
>>
>>
>
>



Re: Sending keystrokes to 3rd party window by Jack

Jack
Wed Oct 15 23:05:55 CDT 2008

Instead of using AppActivate and SendKeys I prefer using SendMessage() API,
but I do not know what parameters to include with it.
Below, is explanations of steps needed to achieve the task:
1.
Send Control + Shift + s
This will open the second window
2.
Send to the 2nd window;
TAB TAB C TAB TAB TAB <some short string here>
Your help appreciated,
Jack

"Jack" <replyto@it> wrote in message
news:uaWXBWyLJHA.4324@TK2MSFTNGP05.phx.gbl...
> Hello,
> I want to send keystrokes to the 3rd party application window.
> I want to use AppActivate statement.
>
> Question1:
> Knowing the window's title but the window is in background, is calling
> AppActivate enough or that window must be first brought to the front?
>
> Q2 (related):
> Knowing the window's title but the window is minimized, is calling
> AppActivate enough or that window must be first brought to normal state?
>
> The sent keystrokes will open another window (of known title) to which one
> I need to send another batch of keystrokes.
> What will be the answer to Q1 in that case?
> Your help appreciated,
> Jack
>



Re: Sending keystrokes to 3rd party window by Kevin

Kevin
Thu Oct 16 00:39:16 CDT 2008

Okay, explain to me what you are trying to do. Describe the steps as if you
were doing these actions normally...then I can tell you what the equivilants
are.

- Kev

"Jack" <replyto@it> wrote in message
news:ut83%23R0LJHA.3080@TK2MSFTNGP06.phx.gbl...
| Instead of using AppActivate and SendKeys I prefer using SendMessage()
API,
| but I do not know what parameters to include with it.
| Below, is explanations of steps needed to achieve the task:
| 1.
| Send Control + Shift + s
| This will open the second window
| 2.
| Send to the 2nd window;
| TAB TAB C TAB TAB TAB <some short string here>
| Your help appreciated,
| Jack
|
| "Jack" <replyto@it> wrote in message
| news:uaWXBWyLJHA.4324@TK2MSFTNGP05.phx.gbl...
| > Hello,
| > I want to send keystrokes to the 3rd party application window.
| > I want to use AppActivate statement.
| >
| > Question1:
| > Knowing the window's title but the window is in background, is calling
| > AppActivate enough or that window must be first brought to the front?
| >
| > Q2 (related):
| > Knowing the window's title but the window is minimized, is calling
| > AppActivate enough or that window must be first brought to normal state?
| >
| > The sent keystrokes will open another window (of known title) to which
one
| > I need to send another batch of keystrokes.
| > What will be the answer to Q1 in that case?
| > Your help appreciated,
| > Jack
| >
|
|



Re: Sending keystrokes to 3rd party window by Jack

Jack
Thu Oct 16 09:30:29 CDT 2008

Below is the full scenario:
=================
1.
Knowing the 3rd party window's title I want to send to it keystrokes:
Ctrl + Shift + s
to open another window titled "Search"
2.
To the window titled "Search" I want to send the following keystrokes:
TAB TAB C TAB TAB TAB
this will navigate that window and it will put cursor at the field I want to
insert
short text (15 characters the most)
3.
After the text is placed in the search field the following keystrokes must
follow:
TAB P AA <ENTER>

Thanks,
Jack

"Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
news:%23Op3HG1LJHA.2760@TK2MSFTNGP06.phx.gbl...
> Okay, explain to me what you are trying to do. Describe the steps as if
> you
> were doing these actions normally...then I can tell you what the
> equivilants
> are.
>
> - Kev
>
> "Jack" <replyto@it> wrote in message
> news:ut83%23R0LJHA.3080@TK2MSFTNGP06.phx.gbl...
> | Instead of using AppActivate and SendKeys I prefer using SendMessage()
> API,
> | but I do not know what parameters to include with it.
> | Below, is explanations of steps needed to achieve the task:
> | 1.
> | Send Control + Shift + s
> | This will open the second window
> | 2.
> | Send to the 2nd window;
> | TAB TAB C TAB TAB TAB <some short string here>
> | Your help appreciated,
> | Jack
> |
> | "Jack" <replyto@it> wrote in message
> | news:uaWXBWyLJHA.4324@TK2MSFTNGP05.phx.gbl...
> | > Hello,
> | > I want to send keystrokes to the 3rd party application window.
> | > I want to use AppActivate statement.
> | >
> | > Question1:
> | > Knowing the window's title but the window is in background, is calling
> | > AppActivate enough or that window must be first brought to the front?
> | >
> | > Q2 (related):
> | > Knowing the window's title but the window is minimized, is calling
> | > AppActivate enough or that window must be first brought to normal
> state?
> | >
> | > The sent keystrokes will open another window (of known title) to which
> one
> | > I need to send another batch of keystrokes.
> | > What will be the answer to Q1 in that case?
> | > Your help appreciated,
> | > Jack
> | >
> |
> |
>
>



Re: Sending keystrokes to 3rd party window by Kevin

Kevin
Thu Oct 16 09:48:31 CDT 2008

Okay...I'm with you. You're a keyboard type of guy, I'm assuming. But
let's look at this from a mouse/click POV because those actions, IMO are
easier to simulate.

So, can you go through your scenario again, but this time do it as if you
are using a mouse. What would you do/click on/select to accomplish the same
thing. For starters, is there a menu item to open the Search window?

- Kev

"Jack" <replyto@it> wrote in message
news:uZ2y%23u5LJHA.4668@TK2MSFTNGP03.phx.gbl...
| Below is the full scenario:
| =================
| 1.
| Knowing the 3rd party window's title I want to send to it keystrokes:
| Ctrl + Shift + s
| to open another window titled "Search"
| 2.
| To the window titled "Search" I want to send the following keystrokes:
| TAB TAB C TAB TAB TAB
| this will navigate that window and it will put cursor at the field I want
to
| insert
| short text (15 characters the most)
| 3.
| After the text is placed in the search field the following keystrokes must
| follow:
| TAB P AA <ENTER>
|
| Thanks,
| Jack
|
| "Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
| news:%23Op3HG1LJHA.2760@TK2MSFTNGP06.phx.gbl...
| > Okay, explain to me what you are trying to do. Describe the steps as if
| > you
| > were doing these actions normally...then I can tell you what the
| > equivilants
| > are.
| >
| > - Kev
| >
| > "Jack" <replyto@it> wrote in message
| > news:ut83%23R0LJHA.3080@TK2MSFTNGP06.phx.gbl...
| > | Instead of using AppActivate and SendKeys I prefer using SendMessage()
| > API,
| > | but I do not know what parameters to include with it.
| > | Below, is explanations of steps needed to achieve the task:
| > | 1.
| > | Send Control + Shift + s
| > | This will open the second window
| > | 2.
| > | Send to the 2nd window;
| > | TAB TAB C TAB TAB TAB <some short string here>
| > | Your help appreciated,
| > | Jack
| > |
| > | "Jack" <replyto@it> wrote in message
| > | news:uaWXBWyLJHA.4324@TK2MSFTNGP05.phx.gbl...
| > | > Hello,
| > | > I want to send keystrokes to the 3rd party application window.
| > | > I want to use AppActivate statement.
| > | >
| > | > Question1:
| > | > Knowing the window's title but the window is in background, is
calling
| > | > AppActivate enough or that window must be first brought to the
front?
| > | >
| > | > Q2 (related):
| > | > Knowing the window's title but the window is minimized, is calling
| > | > AppActivate enough or that window must be first brought to normal
| > state?
| > | >
| > | > The sent keystrokes will open another window (of known title) to
which
| > one
| > | > I need to send another batch of keystrokes.
| > | > What will be the answer to Q1 in that case?
| > | > Your help appreciated,
| > | > Jack
| > | >
| > |
| > |
| >
| >
|
|



Re: Sending keystrokes to 3rd party window by Jack

Jack
Thu Oct 16 10:21:10 CDT 2008

Kevin, I do not have access to that 3rd party application.
I was only told by the user, what keystrokes and in which sequence must be
pressed.
Thats all, what I know.
I have also a screenshot of Search window.
You can see it in here:
http://www.phonedialerpro.com/search.doc

Thanks,
Jack

"Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
news:OAtSC55LJHA.5692@TK2MSFTNGP04.phx.gbl...
> Okay...I'm with you. You're a keyboard type of guy, I'm assuming. But
> let's look at this from a mouse/click POV because those actions, IMO are
> easier to simulate.
>
> So, can you go through your scenario again, but this time do it as if you
> are using a mouse. What would you do/click on/select to accomplish the
> same
> thing. For starters, is there a menu item to open the Search window?
>
> - Kev
>
> "Jack" <replyto@it> wrote in message
> news:uZ2y%23u5LJHA.4668@TK2MSFTNGP03.phx.gbl...
> | Below is the full scenario:
> | =================
> | 1.
> | Knowing the 3rd party window's title I want to send to it keystrokes:
> | Ctrl + Shift + s
> | to open another window titled "Search"
> | 2.
> | To the window titled "Search" I want to send the following keystrokes:
> | TAB TAB C TAB TAB TAB
> | this will navigate that window and it will put cursor at the field I
> want
> to
> | insert
> | short text (15 characters the most)
> | 3.
> | After the text is placed in the search field the following keystrokes
> must
> | follow:
> | TAB P AA <ENTER>
> |
> | Thanks,
> | Jack
> |
> | "Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
> | news:%23Op3HG1LJHA.2760@TK2MSFTNGP06.phx.gbl...
> | > Okay, explain to me what you are trying to do. Describe the steps as
> if
> | > you
> | > were doing these actions normally...then I can tell you what the
> | > equivilants
> | > are.
> | >
> | > - Kev
> | >
> | > "Jack" <replyto@it> wrote in message
> | > news:ut83%23R0LJHA.3080@TK2MSFTNGP06.phx.gbl...
> | > | Instead of using AppActivate and SendKeys I prefer using
> SendMessage()
> | > API,
> | > | but I do not know what parameters to include with it.
> | > | Below, is explanations of steps needed to achieve the task:
> | > | 1.
> | > | Send Control + Shift + s
> | > | This will open the second window
> | > | 2.
> | > | Send to the 2nd window;
> | > | TAB TAB C TAB TAB TAB <some short string here>
> | > | Your help appreciated,
> | > | Jack
> | > |
> | > | "Jack" <replyto@it> wrote in message
> | > | news:uaWXBWyLJHA.4324@TK2MSFTNGP05.phx.gbl...
> | > | > Hello,
> | > | > I want to send keystrokes to the 3rd party application window.
> | > | > I want to use AppActivate statement.
> | > | >
> | > | > Question1:
> | > | > Knowing the window's title but the window is in background, is
> calling
> | > | > AppActivate enough or that window must be first brought to the
> front?
> | > | >
> | > | > Q2 (related):
> | > | > Knowing the window's title but the window is minimized, is calling
> | > | > AppActivate enough or that window must be first brought to normal
> | > state?
> | > | >
> | > | > The sent keystrokes will open another window (of known title) to
> which
> | > one
> | > | > I need to send another batch of keystrokes.
> | > | > What will be the answer to Q1 in that case?
> | > | > Your help appreciated,
> | > | > Jack
> | > | >
> | > |
> | > |
> | >
> | >
> |
> |
>
>



Re: Sending keystrokes to 3rd party window by Kevin

Kevin
Thu Oct 16 10:58:55 CDT 2008

Sharpshooting in the dark. :-)

Okay...well. All I can tell you at this point is that to use the API in a
situation such as this, you'll need to have that 3rd party app to determine
class names and such in the event that standard windows controls are not
being used. I couldn't tell you without having that app and something like
Spy++ to reveal this information.

Even if you were to go into this soley with AppActive and SendKeys you still
have the issue of focus and where it starts. Assuming when the search
window is open, the focus starts at the top and works it's way down using
Tab...not to mention debugging is going to be a PITA. :-)

I'm kind of at a loss here. Final verdict: You can use your original plan,
but the window you want will have to be the top most window and not
minimized. Since the screen shot does seem to be an XP OS, the Vista
limitations should not be a problem.

- Kev


"Jack" <replyto@it> wrote in message
news:ORMWTL6LJHA.4536@TK2MSFTNGP03.phx.gbl...
| Kevin, I do not have access to that 3rd party application.
| I was only told by the user, what keystrokes and in which sequence must be
| pressed.
| Thats all, what I know.
| I have also a screenshot of Search window.
| You can see it in here:
| http://www.phonedialerpro.com/search.doc
|
| Thanks,
| Jack
|
| "Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
| news:OAtSC55LJHA.5692@TK2MSFTNGP04.phx.gbl...
| > Okay...I'm with you. You're a keyboard type of guy, I'm assuming. But
| > let's look at this from a mouse/click POV because those actions, IMO are
| > easier to simulate.
| >
| > So, can you go through your scenario again, but this time do it as if
you
| > are using a mouse. What would you do/click on/select to accomplish the
| > same
| > thing. For starters, is there a menu item to open the Search window?
| >
| > - Kev
| >
| > "Jack" <replyto@it> wrote in message
| > news:uZ2y%23u5LJHA.4668@TK2MSFTNGP03.phx.gbl...
| > | Below is the full scenario:
| > | =================
| > | 1.
| > | Knowing the 3rd party window's title I want to send to it keystrokes:
| > | Ctrl + Shift + s
| > | to open another window titled "Search"
| > | 2.
| > | To the window titled "Search" I want to send the following keystrokes:
| > | TAB TAB C TAB TAB TAB
| > | this will navigate that window and it will put cursor at the field I
| > want
| > to
| > | insert
| > | short text (15 characters the most)
| > | 3.
| > | After the text is placed in the search field the following keystrokes
| > must
| > | follow:
| > | TAB P AA <ENTER>
| > |
| > | Thanks,
| > | Jack
| > |
| > | "Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
| > | news:%23Op3HG1LJHA.2760@TK2MSFTNGP06.phx.gbl...
| > | > Okay, explain to me what you are trying to do. Describe the steps
as
| > if
| > | > you
| > | > were doing these actions normally...then I can tell you what the
| > | > equivilants
| > | > are.
| > | >
| > | > - Kev
| > | >
| > | > "Jack" <replyto@it> wrote in message
| > | > news:ut83%23R0LJHA.3080@TK2MSFTNGP06.phx.gbl...
| > | > | Instead of using AppActivate and SendKeys I prefer using
| > SendMessage()
| > | > API,
| > | > | but I do not know what parameters to include with it.
| > | > | Below, is explanations of steps needed to achieve the task:
| > | > | 1.
| > | > | Send Control + Shift + s
| > | > | This will open the second window
| > | > | 2.
| > | > | Send to the 2nd window;
| > | > | TAB TAB C TAB TAB TAB <some short string here>
| > | > | Your help appreciated,
| > | > | Jack
| > | > |
| > | > | "Jack" <replyto@it> wrote in message
| > | > | news:uaWXBWyLJHA.4324@TK2MSFTNGP05.phx.gbl...
| > | > | > Hello,
| > | > | > I want to send keystrokes to the 3rd party application window.
| > | > | > I want to use AppActivate statement.
| > | > | >
| > | > | > Question1:
| > | > | > Knowing the window's title but the window is in background, is
| > calling
| > | > | > AppActivate enough or that window must be first brought to the
| > front?
| > | > | >
| > | > | > Q2 (related):
| > | > | > Knowing the window's title but the window is minimized, is
calling
| > | > | > AppActivate enough or that window must be first brought to
normal
| > | > state?
| > | > | >
| > | > | > The sent keystrokes will open another window (of known title) to
| > which
| > | > one
| > | > | > I need to send another batch of keystrokes.
| > | > | > What will be the answer to Q1 in that case?
| > | > | > Your help appreciated,
| > | > | > Jack
| > | > | >
| > | > |
| > | > |
| > | >
| > | >
| > |
| > |
| >
| >
|
|



Re: Sending keystrokes to 3rd party window by Jack

Jack
Thu Oct 16 11:12:37 CDT 2008

OK.
I think I will split that into 2 parts:
1.
Navigate and open Search window using FindWindow() and SendMessage()
2.
Navigate 'Search' window using AppActivate and SendKeys

Please help me the to navigate to the Search window only, using
SendMessage API
I am not sure how to send this:
Ctrl + Shift + s
using SendMessage()
Thanks,
Jack

"Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
news:upgJYg6LJHA.5060@TK2MSFTNGP02.phx.gbl...
> Sharpshooting in the dark. :-)
>
> Okay...well. All I can tell you at this point is that to use the API in a
> situation such as this, you'll need to have that 3rd party app to
> determine
> class names and such in the event that standard windows controls are not
> being used. I couldn't tell you without having that app and something
> like
> Spy++ to reveal this information.
>
> Even if you were to go into this soley with AppActive and SendKeys you
> still
> have the issue of focus and where it starts. Assuming when the search
> window is open, the focus starts at the top and works it's way down using
> Tab...not to mention debugging is going to be a PITA. :-)
>
> I'm kind of at a loss here. Final verdict: You can use your original
> plan,
> but the window you want will have to be the top most window and not
> minimized. Since the screen shot does seem to be an XP OS, the Vista
> limitations should not be a problem.
>
> - Kev
>
>
> "Jack" <replyto@it> wrote in message
> news:ORMWTL6LJHA.4536@TK2MSFTNGP03.phx.gbl...
> | Kevin, I do not have access to that 3rd party application.
> | I was only told by the user, what keystrokes and in which sequence must
> be
> | pressed.
> | Thats all, what I know.
> | I have also a screenshot of Search window.
> | You can see it in here:
> | http://www.phonedialerpro.com/search.doc
> |
> | Thanks,
> | Jack
> |
> | "Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
> | news:OAtSC55LJHA.5692@TK2MSFTNGP04.phx.gbl...
> | > Okay...I'm with you. You're a keyboard type of guy, I'm assuming.
> But
> | > let's look at this from a mouse/click POV because those actions, IMO
> are
> | > easier to simulate.
> | >
> | > So, can you go through your scenario again, but this time do it as if
> you
> | > are using a mouse. What would you do/click on/select to accomplish
> the
> | > same
> | > thing. For starters, is there a menu item to open the Search window?
> | >
> | > - Kev
> | >
> | > "Jack" <replyto@it> wrote in message
> | > news:uZ2y%23u5LJHA.4668@TK2MSFTNGP03.phx.gbl...
> | > | Below is the full scenario:
> | > | =================
> | > | 1.
> | > | Knowing the 3rd party window's title I want to send to it
> keystrokes:
> | > | Ctrl + Shift + s
> | > | to open another window titled "Search"
> | > | 2.
> | > | To the window titled "Search" I want to send the following
> keystrokes:
> | > | TAB TAB C TAB TAB TAB
> | > | this will navigate that window and it will put cursor at the field I
> | > want
> | > to
> | > | insert
> | > | short text (15 characters the most)
> | > | 3.
> | > | After the text is placed in the search field the following
> keystrokes
> | > must
> | > | follow:
> | > | TAB P AA <ENTER>
> | > |
> | > | Thanks,
> | > | Jack
> | > |
> | > | "Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
> | > | news:%23Op3HG1LJHA.2760@TK2MSFTNGP06.phx.gbl...
> | > | > Okay, explain to me what you are trying to do. Describe the steps
> as
> | > if
> | > | > you
> | > | > were doing these actions normally...then I can tell you what the
> | > | > equivilants
> | > | > are.
> | > | >
> | > | > - Kev
> | > | >
> | > | > "Jack" <replyto@it> wrote in message
> | > | > news:ut83%23R0LJHA.3080@TK2MSFTNGP06.phx.gbl...
> | > | > | Instead of using AppActivate and SendKeys I prefer using
> | > SendMessage()
> | > | > API,
> | > | > | but I do not know what parameters to include with it.
> | > | > | Below, is explanations of steps needed to achieve the task:
> | > | > | 1.
> | > | > | Send Control + Shift + s
> | > | > | This will open the second window
> | > | > | 2.
> | > | > | Send to the 2nd window;
> | > | > | TAB TAB C TAB TAB TAB <some short string here>
> | > | > | Your help appreciated,
> | > | > | Jack
> | > | > |
> | > | > | "Jack" <replyto@it> wrote in message
> | > | > | news:uaWXBWyLJHA.4324@TK2MSFTNGP05.phx.gbl...
> | > | > | > Hello,
> | > | > | > I want to send keystrokes to the 3rd party application window.
> | > | > | > I want to use AppActivate statement.
> | > | > | >
> | > | > | > Question1:
> | > | > | > Knowing the window's title but the window is in background, is
> | > calling
> | > | > | > AppActivate enough or that window must be first brought to the
> | > front?
> | > | > | >
> | > | > | > Q2 (related):
> | > | > | > Knowing the window's title but the window is minimized, is
> calling
> | > | > | > AppActivate enough or that window must be first brought to
> normal
> | > | > state?
> | > | > | >
> | > | > | > The sent keystrokes will open another window (of known title)
> to
> | > which
> | > | > one
> | > | > | > I need to send another batch of keystrokes.
> | > | > | > What will be the answer to Q1 in that case?
> | > | > | > Your help appreciated,
> | > | > | > Jack
> | > | > | >
> | > | > |
> | > | > |
> | > | >
> | > | >
> | > |
> | > |
> | >
> | >
> |
> |
>
>



Re: Sending keystrokes to 3rd party window by Eduardo

Eduardo
Thu Oct 16 11:34:31 CDT 2008

Hi,

to restore and activate the window (main window of the program):

Private Declare Function OpenIcon Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As
Long) As Long


Dim ih As Long

ih = FindWindow(vbNullString, "Title main window")
OpenIcon ih
SetForegroundWindow ih

And for sending keystrokes, you can use the API keyb_event:
http://allapi.mentalis.org/apilist/keyb_event.shtml

If you cannot have the program you need to manage, make a VB program that
works in the same way (with the same keystrokes) to test your other program
(and good luck, because as you have been told, to do that in a blind way is
a lottery).


"Jack" <replyto@it> escribió en el mensaje
news:e1puDo6LJHA.3080@TK2MSFTNGP06.phx.gbl...
> OK.
> I think I will split that into 2 parts:
> 1.
> Navigate and open Search window using FindWindow() and SendMessage()
> 2.
> Navigate 'Search' window using AppActivate and SendKeys
>
> Please help me the to navigate to the Search window only, using
> SendMessage API
> I am not sure how to send this:
> Ctrl + Shift + s
> using SendMessage()
> Thanks,
> Jack
>
> "Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
> news:upgJYg6LJHA.5060@TK2MSFTNGP02.phx.gbl...
>> Sharpshooting in the dark. :-)
>>
>> Okay...well. All I can tell you at this point is that to use the API in
>> a
>> situation such as this, you'll need to have that 3rd party app to
>> determine
>> class names and such in the event that standard windows controls are not
>> being used. I couldn't tell you without having that app and something
>> like
>> Spy++ to reveal this information.
>>
>> Even if you were to go into this soley with AppActive and SendKeys you
>> still
>> have the issue of focus and where it starts. Assuming when the search
>> window is open, the focus starts at the top and works it's way down using
>> Tab...not to mention debugging is going to be a PITA. :-)
>>
>> I'm kind of at a loss here. Final verdict: You can use your original
>> plan,
>> but the window you want will have to be the top most window and not
>> minimized. Since the screen shot does seem to be an XP OS, the Vista
>> limitations should not be a problem.
>>
>> - Kev
>>
>>
>> "Jack" <replyto@it> wrote in message
>> news:ORMWTL6LJHA.4536@TK2MSFTNGP03.phx.gbl...
>> | Kevin, I do not have access to that 3rd party application.
>> | I was only told by the user, what keystrokes and in which sequence must
>> be
>> | pressed.
>> | Thats all, what I know.
>> | I have also a screenshot of Search window.
>> | You can see it in here:
>> | http://www.phonedialerpro.com/search.doc
>> |
>> | Thanks,
>> | Jack
>> |
>> | "Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
>> | news:OAtSC55LJHA.5692@TK2MSFTNGP04.phx.gbl...
>> | > Okay...I'm with you. You're a keyboard type of guy, I'm assuming.
>> But
>> | > let's look at this from a mouse/click POV because those actions, IMO
>> are
>> | > easier to simulate.
>> | >
>> | > So, can you go through your scenario again, but this time do it as if
>> you
>> | > are using a mouse. What would you do/click on/select to accomplish
>> the
>> | > same
>> | > thing. For starters, is there a menu item to open the Search window?
>> | >
>> | > - Kev
>> | >
>> | > "Jack" <replyto@it> wrote in message
>> | > news:uZ2y%23u5LJHA.4668@TK2MSFTNGP03.phx.gbl...
>> | > | Below is the full scenario:
>> | > | =================
>> | > | 1.
>> | > | Knowing the 3rd party window's title I want to send to it
>> keystrokes:
>> | > | Ctrl + Shift + s
>> | > | to open another window titled "Search"
>> | > | 2.
>> | > | To the window titled "Search" I want to send the following
>> keystrokes:
>> | > | TAB TAB C TAB TAB TAB
>> | > | this will navigate that window and it will put cursor at the field
>> I
>> | > want
>> | > to
>> | > | insert
>> | > | short text (15 characters the most)
>> | > | 3.
>> | > | After the text is placed in the search field the following
>> keystrokes
>> | > must
>> | > | follow:
>> | > | TAB P AA <ENTER>
>> | > |
>> | > | Thanks,
>> | > | Jack
>> | > |
>> | > | "Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
>> | > | news:%23Op3HG1LJHA.2760@TK2MSFTNGP06.phx.gbl...
>> | > | > Okay, explain to me what you are trying to do. Describe the
>> steps
>> as
>> | > if
>> | > | > you
>> | > | > were doing these actions normally...then I can tell you what the
>> | > | > equivilants
>> | > | > are.
>> | > | >
>> | > | > - Kev
>> | > | >
>> | > | > "Jack" <replyto@it> wrote in message
>> | > | > news:ut83%23R0LJHA.3080@TK2MSFTNGP06.phx.gbl...
>> | > | > | Instead of using AppActivate and SendKeys I prefer using
>> | > SendMessage()
>> | > | > API,
>> | > | > | but I do not know what parameters to include with it.
>> | > | > | Below, is explanations of steps needed to achieve the task:
>> | > | > | 1.
>> | > | > | Send Control + Shift + s
>> | > | > | This will open the second window
>> | > | > | 2.
>> | > | > | Send to the 2nd window;
>> | > | > | TAB TAB C TAB TAB TAB <some short string here>
>> | > | > | Your help appreciated,
>> | > | > | Jack
>> | > | > |
>> | > | > | "Jack" <replyto@it> wrote in message
>> | > | > | news:uaWXBWyLJHA.4324@TK2MSFTNGP05.phx.gbl...
>> | > | > | > Hello,
>> | > | > | > I want to send keystrokes to the 3rd party application
>> window.
>> | > | > | > I want to use AppActivate statement.
>> | > | > | >
>> | > | > | > Question1:
>> | > | > | > Knowing the window's title but the window is in background,
>> is
>> | > calling
>> | > | > | > AppActivate enough or that window must be first brought to
>> the
>> | > front?
>> | > | > | >
>> | > | > | > Q2 (related):
>> | > | > | > Knowing the window's title but the window is minimized, is
>> calling
>> | > | > | > AppActivate enough or that window must be first brought to
>> normal
>> | > | > state?
>> | > | > | >
>> | > | > | > The sent keystrokes will open another window (of known title)
>> to
>> | > which
>> | > | > one
>> | > | > | > I need to send another batch of keystrokes.
>> | > | > | > What will be the answer to Q1 in that case?
>> | > | > | > Your help appreciated,
>> | > | > | > Jack
>> | > | > | >
>> | > | > |
>> | > | > |
>> | > | >
>> | > | >
>> | > |
>> | > |
>> | >
>> | >
>> |
>> |
>>
>>
>
>



Re: Sending keystrokes to 3rd party window by Jack

Jack
Thu Oct 16 11:58:05 CDT 2008

That is the point.
I do not want to
"to restore and activate the window (main window of the program):
"
I want to open the second (child) window without changing the state of the
main window.
Jack

"Eduardo" <mm@mm.com> wrote in message news:gd7qhu$7on$1@aioe.org...
> Hi,
>
> to restore and activate the window (main window of the program):
>
> Private Declare Function OpenIcon Lib "user32" (ByVal hWnd As Long) As
> Long
> Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"
> (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
> Private Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As
> Long) As Long
>
>
> Dim ih As Long
>
> ih = FindWindow(vbNullString, "Title main window")
> OpenIcon ih
> SetForegroundWindow ih
>
> And for sending keystrokes, you can use the API keyb_event:
> http://allapi.mentalis.org/apilist/keyb_event.shtml
>
> If you cannot have the program you need to manage, make a VB program that
> works in the same way (with the same keystrokes) to test your other
> program (and good luck, because as you have been told, to do that in a
> blind way is a lottery).
>
>
> "Jack" <replyto@it> escribió en el mensaje
> news:e1puDo6LJHA.3080@TK2MSFTNGP06.phx.gbl...
>> OK.
>> I think I will split that into 2 parts:
>> 1.
>> Navigate and open Search window using FindWindow() and SendMessage()
>> 2.
>> Navigate 'Search' window using AppActivate and SendKeys
>>
>> Please help me the to navigate to the Search window only, using
>> SendMessage API
>> I am not sure how to send this:
>> Ctrl + Shift + s
>> using SendMessage()
>> Thanks,
>> Jack
>>
>> "Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
>> news:upgJYg6LJHA.5060@TK2MSFTNGP02.phx.gbl...
>>> Sharpshooting in the dark. :-)
>>>
>>> Okay...well. All I can tell you at this point is that to use the API in
>>> a
>>> situation such as this, you'll need to have that 3rd party app to
>>> determine
>>> class names and such in the event that standard windows controls are not
>>> being used. I couldn't tell you without having that app and something
>>> like
>>> Spy++ to reveal this information.
>>>
>>> Even if you were to go into this soley with AppActive and SendKeys you
>>> still
>>> have the issue of focus and where it starts. Assuming when the search
>>> window is open, the focus starts at the top and works it's way down
>>> using
>>> Tab...not to mention debugging is going to be a PITA. :-)
>>>
>>> I'm kind of at a loss here. Final verdict: You can use your original
>>> plan,
>>> but the window you want will have to be the top most window and not
>>> minimized. Since the screen shot does seem to be an XP OS, the Vista
>>> limitations should not be a problem.
>>>
>>> - Kev
>>>
>>>
>>> "Jack" <replyto@it> wrote in message
>>> news:ORMWTL6LJHA.4536@TK2MSFTNGP03.phx.gbl...
>>> | Kevin, I do not have access to that 3rd party application.
>>> | I was only told by the user, what keystrokes and in which sequence
>>> must be
>>> | pressed.
>>> | Thats all, what I know.
>>> | I have also a screenshot of Search window.
>>> | You can see it in here:
>>> | http://www.phonedialerpro.com/search.doc
>>> |
>>> | Thanks,
>>> | Jack
>>> |
>>> | "Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in message
>>> | news:OAtSC55LJHA.5692@TK2MSFTNGP04.phx.gbl...
>>> | > Okay...I'm with you. You're a keyboard type of guy, I'm assuming.
>>> But
>>> | > let's look at this from a mouse/click POV because those actions, IMO
>>> are
>>> | > easier to simulate.
>>> | >
>>> | > So, can you go through your scenario again, but this time do it as
>>> if
>>> you
>>> | > are using a mouse. What would you do/click on/select to accomplish
>>> the
>>> | > same
>>> | > thing. For starters, is there a menu item to open the Search
>>> window?
>>> | >
>>> | > - Kev
>>> | >
>>> | > "Jack" <replyto@it> wrote in message
>>> | > news:uZ2y%23u5LJHA.4668@TK2MSFTNGP03.phx.gbl...
>>> | > | Below is the full scenario:
>>> | > | =================
>>> | > | 1.
>>> | > | Knowing the 3rd party window's title I want to send to it
>>> keystrokes:
>>> | > | Ctrl + Shift + s
>>> | > | to open another window titled "Search"
>>> | > | 2.
>>> | > | To the window titled "Search" I want to send the following
>>> keystrokes:
>>> | > | TAB TAB C TAB TAB TAB
>>> | > | this will navigate that window and it will put cursor at the field
>>> I
>>> | > want
>>> | > to
>>> | > | insert
>>> | > | short text (15 characters the most)
>>> | > | 3.
>>> | > | After the text is placed in the search field the following
>>> keystrokes
>>> | > must
>>> | > | follow:
>>> | > | TAB P AA <ENTER>
>>> | > |
>>> | > | Thanks,
>>> | > | Jack
>>> | > |
>>> | > | "Kevin Provance" <kevin@remove_tpasoft_remove.com> wrote in
>>> message
>>> | > | news:%23Op3HG1LJHA.2760@TK2MSFTNGP06.phx.gbl...
>>> | > | > Okay, explain to me what you are trying to do. Describe the
>>> steps
>>> as
>>> | > if
>>> | > | > you
>>> | > | > were doing these actions normally...then I can tell you what the
>>> | > | > equivilants
>>> | > | > are.
>>> | > | >
>>> | > | > - Kev
>>> | > | >
>>> | > | > "Jack" <replyto@it> wrote in message
>>> | > | > news:ut83%23R0LJHA.3080@TK2MSFTNGP06.phx.gbl...
>>> | > | > | Instead of using AppActivate and SendKeys I prefer using
>>> | > SendMessage()
>>> | > | > API,
>>> | > | > | but I do not know what parameters to include with it.
>>> | > | > | Below, is explanations of steps needed to achieve the task:
>>> | > | > | 1.
>>> | > | > | Send Control + Shift + s
>>> | > | > | This will open the second window
>>> | > | > | 2.
>>> | > | > | Send to the 2nd window;
>>> | > | > | TAB TAB C TAB TAB TAB <some short string here>
>>> | > | > | Your help appreciated,
>>> | > | > | Jack
>>> | > | > |
>>> | > | > | "Jack" <replyto@it> wrote in message
>>> | > | > | news:uaWXBWyLJHA.4324@TK2MSFTNGP05.phx.gbl...
>>> | > | > | > Hello,
>>> | > | > | > I want to send keystrokes to the 3rd party application
>>> window.
>>> | > | > | > I want to use AppActivate statement.
>>> | > | > | >
>>> | > | > | > Question1:
>>> | > | > | > Knowing the window's title but the window is in background,
>>> is
>>> | > calling
>>> | > | > | > AppActivate enough or that window must be first brought to
>>> the
>>> | > front?
>>> | > | > | >
>>> | > | > | > Q2 (related):
>>> | > | > | > Knowing the window's title but the window is minimized, is
>>> calling
>>> | > | > | > AppActivate enough or that window must be first brought to
>>> normal
>>> | > | > state?
>>> | > | > | >
>>> | > | > | > The sent keystrokes will open another window (of known
>>> title) to
>>> | > which
>>> | > | > one
>>> | > | > | > I need to send another batch of keystrokes.
>>> | > | > | > What will be the answer to Q1 in that case?
>>> | > | > | > Your help appreciated,
>>> | > | > | > Jack
>>> | > | > | >
>>> | > | > |
>>> | > | > |
>>> | > | >
>>> | > | >
>>> | > |
>>> | > |
>>> | >
>>> | >
>>> |
>>> |
>>>
>>>
>>
>>
>
>