|
|
|
date: Fri, 25 Apr 2008 11:22:47 +0100,
group: microsoft.public.win32.programmer.ui
back
CreateWindow - any chance for additional info?
Hello
I am writing an automated test software that clicks buttons, writes into
editboxes, etc. on our product software that is based on MFC. The tester is
running in a different process. I have declared a COM interface to reliably
get the HWND of a given button etc. It is working nice, but I think this is
an ugly solution.
I wonder, would it be possible to pass additional information in the product
code in CreateWindow(), ideally the resource id, that I could use to
identify the window in the tester. If I could get the resource id of each
control in the tester, I would not need this COM interface anymore.
If you have any suggestions, please let me know.
Thanks,
Jozsi
date: Fri, 25 Apr 2008 11:22:47 +0100
author: Jozsef Bekes
Re: CreateWindow - any chance for additional info?
Jozsef Bekes wrote:
> Hello
>
> I am writing an automated test software that clicks buttons, writes into
> editboxes, etc. on our product software that is based on MFC. The tester is
> running in a different process. I have declared a COM interface to reliably
> get the HWND of a given button etc. It is working nice, but I think this is
> an ugly solution.
>
> I wonder, would it be possible to pass additional information in the product
> code in CreateWindow(), ideally the resource id, that I could use to
> identify the window in the tester. If I could get the resource id of each
> control in the tester, I would not need this COM interface anymore.
>
> If you have any suggestions, please let me know.
>
> Thanks,
> Jozsi
>
>
The resource ID of any child window can be obtained by calling
GetWindowLong() with nIndex set to GWL_ID.
--
Norm
To reply, change domain to an adult feline.
date: Fri, 25 Apr 2008 06:40:49 -0700
author: Norman Bullen
Re: CreateWindow - any chance for additional info?
On Fri, 25 Apr 2008 11:22:47 +0100, "Jozsef Bekes"
wrote:
>Hello
>
>I am writing an automated test software that clicks buttons, writes into
>editboxes, etc. on our product software that is based on MFC. The tester is
>running in a different process. I have declared a COM interface to reliably
>get the HWND of a given button etc. It is working nice, but I think this is
>an ugly solution.
>
>I wonder, would it be possible to pass additional information in the product
>code in CreateWindow(), ideally the resource id, that I could use to
>identify the window in the tester. If I could get the resource id of each
>control in the tester, I would not need this COM interface anymore.
CreateWindowEx takes an extra argument that can be used to pass
information between caller and the created window, perhaps by passing
a pointer to a structure that can be read and/or filled by either
side. Using it does require some care to make sure it and all its
contents point to something valid when used.
-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com
date: Fri, 25 Apr 2008 15:55:49 -0400
author: unknown
Re: CreateWindow - any chance for additional info?
"Norman Bullen" wrote in message
news:UpqdnXNM6o20QYzVnZ2dnUVZ_h-vnZ2d@earthlink.com...
> Jozsef Bekes wrote:
>> Hello
>>
>> I am writing an automated test software that clicks buttons, writes into
>> editboxes, etc. on our product software that is based on MFC. The tester
>> is running in a different process. I have declared a COM interface to
>> reliably get the HWND of a given button etc. It is working nice, but I
>> think this is an ugly solution.
>>
>> I wonder, would it be possible to pass additional information in the
>> product code in CreateWindow(), ideally the resource id, that I could use
>> to identify the window in the tester. If I could get the resource id of
>> each control in the tester, I would not need this COM interface anymore.
>>
>> If you have any suggestions, please let me know.
>>
>> Thanks,
>> Jozsi
> The resource ID of any child window can be obtained by calling
> GetWindowLong() with nIndex set to GWL_ID.
Or by calling GetDlgCtrlID.
The id is actually a control id, not a resource id. A dialog has a resource
id that is not a control id but as far as I can think, controls do not have
a resource id that is not a control id.
date: Sat, 26 Apr 2008 03:18:40 -0700
author: Sam Hobbs _change_social_to_socal
Re: CreateWindow - any chance for additional info?
The GetDlgCtrlID documentation has a little bit of useful information.
"Jozsef Bekes" wrote in message
news:%23NTVQ5rpIHA.4292@TK2MSFTNGP04.phx.gbl...
> Hello
>
> I am writing an automated test software that clicks buttons, writes into
> editboxes, etc. on our product software that is based on MFC. The tester
> is running in a different process. I have declared a COM interface to
> reliably get the HWND of a given button etc. It is working nice, but I
> think this is an ugly solution.
>
> I wonder, would it be possible to pass additional information in the
> product code in CreateWindow(), ideally the resource id, that I could use
> to identify the window in the tester. If I could get the resource id of
> each control in the tester, I would not need this COM interface anymore.
>
> If you have any suggestions, please let me know.
>
> Thanks,
> Jozsi
>
>
date: Sat, 26 Apr 2008 03:19:20 -0700
author: Sam Hobbs _change_social_to_socal
Re: CreateWindow - any chance for additional info?
Can I suggest a different tack? Have you looked at Accessibility tools?
Microsoft has an extensive documentation on driving programs using Active
Accessibility. As one who spent too much time implementing 508 support in our
custom widgets, I appreciate what the OS can do for you. Look at
http://msdn2.microsoft.com/en-us/library/ms697707.aspx
/steveA
Jozsef Bekes wrote:
> Hello
>
> I am writing an automated test software that clicks buttons, writes into
> editboxes, etc. on our product software that is based on MFC. The tester is
> running in a different process. I have declared a COM interface to reliably
> get the HWND of a given button etc. It is working nice, but I think this is
> an ugly solution.
>
> I wonder, would it be possible to pass additional information in the product
> code in CreateWindow(), ideally the resource id, that I could use to
> identify the window in the tester. If I could get the resource id of each
> control in the tester, I would not need this COM interface anymore.
>
> If you have any suggestions, please let me know.
>
> Thanks,
> Jozsi
>
>
--
Steve Alpert
my email fenycreg @ npz.bet is encrypted with ROT13 (www.rot13.org) and spaces
date: Sun, 27 Apr 2008 11:38:01 -0400
author: Steve Alpert am
RE: CreateWindow - any chance for additional info?
"Jozsef Bekes" wrote:
> Hello
>
> I am writing an automated test software that clicks buttons, writes into
> editboxes, etc. on our product software that is based on MFC. The tester is
> running in a different process. I have declared a COM interface to reliably
> get the HWND of a given button etc. It is working nice, but I think this is
> an ugly solution.
>
> I wonder, would it be possible to pass additional information in the product
> code in CreateWindow(), ideally the resource id, that I could use to
> identify the window in the tester. If I could get the resource id of each
> control in the tester, I would not need this COM interface anymore.
>
> If you have any suggestions, please let me know.
>
> Thanks,
> Jozsi
>
>
>
It's possible to pass in a control ID you specify as the HMENU parameter to
CreateWindow/CreateWindowEx.
date: Wed, 7 May 2008 10:17:00 -0700
author: Salman Mughal
Re: CreateWindow - any chance for additional info?
Thank you very much for all answers! It is working great :-))) Thanks!
"Sam Hobbs" <samuel@social.rr.com_change_social_to_socal> wrote in message
news:up8Keb4pIHA.3652@TK2MSFTNGP03.phx.gbl...
> "Norman Bullen" wrote in message
> news:UpqdnXNM6o20QYzVnZ2dnUVZ_h-vnZ2d@earthlink.com...
>> Jozsef Bekes wrote:
>>> Hello
>>>
>>> I am writing an automated test software that clicks buttons, writes into
>>> editboxes, etc. on our product software that is based on MFC. The tester
>>> is running in a different process. I have declared a COM interface to
>>> reliably get the HWND of a given button etc. It is working nice, but I
>>> think this is an ugly solution.
>>>
>>> I wonder, would it be possible to pass additional information in the
>>> product code in CreateWindow(), ideally the resource id, that I could
>>> use to identify the window in the tester. If I could get the resource id
>>> of each control in the tester, I would not need this COM interface
>>> anymore.
>>>
>>> If you have any suggestions, please let me know.
>>>
>>> Thanks,
>>> Jozsi
>> The resource ID of any child window can be obtained by calling
>> GetWindowLong() with nIndex set to GWL_ID.
>
> Or by calling GetDlgCtrlID.
>
> The id is actually a control id, not a resource id. A dialog has a
> resource id that is not a control id but as far as I can think, controls
> do not have a resource id that is not a control id.
>
>
>
date: Mon, 12 May 2008 17:06:36 +0100
author: Jozsef Bekes
|
|