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