In a Win32 project Is there a way to get infos/styles/properties
for .Net GUI controls ? When using Spy++ and pointing to a .Net
Checkbox (WindowsForms10.BUTTON.app.0.378734a) it return no styles
like BS_CHECKED, BS_RADIOBUTTON, BS_CHECKBOX,BS_GROUPBOX.

My application is similar to Spy++ ...how can I know if the window
WindowsForms10.BUTTON.app.0.378734a is a button, a checkbox or
something else?? How can I know the button state (Checked or not
checked) since there is no BS_CHECKED for a .NET control ???

When looking under the style tab of Spy++ for a .Net checkbox we can
see a 0000000B style (unknown style)....Maybe this will point to a
solution?

Is Win32 is appropriate appropriate to do a ".Net" spy++ ?? Is a
managed application will offers more information on .net controls?

Thanks, i really need help on this.

Re: recognize .Net controls properly and get infos/styles/properties by Igor

Igor
Wed Oct 17 14:18:46 PDT 2007

SQACPP <lsdisciples@hotmail.com> wrote:
> In a Win32 project Is there a way to get infos/styles/properties
> for .Net GUI controls ? When using Spy++ and pointing to a .Net
> Checkbox (WindowsForms10.BUTTON.app.0.378734a) it return no styles
> like BS_CHECKED, BS_RADIOBUTTON, BS_CHECKBOX,BS_GROUPBOX.
>
> My application is similar to Spy++ ...how can I know if the window
> WindowsForms10.BUTTON.app.0.378734a is a button, a checkbox or
> something else?? How can I know the button state (Checked or not
> checked) since there is no BS_CHECKED for a .NET control ???
>
> When looking under the style tab of Spy++ for a .Net checkbox we can
> see a 0000000B style (unknown style)....Maybe this will point to a
> solution?

That's actually BS_OWNERDRAW (which happens to have a numberic value of
0xB). Not that this information helps you very much.

Basically, in my humble opinion, your quest is hopeless. Spy++ doesn't
show the information you want not because its authors were lazy, but
because this information is unavailable. Anybody can write a control
that looks like anything, and give it any class name and any style.
Without a priori knowledge of the window class in question, there's no
way to meaningfully interpret the styles.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925



Re: recognize .Net controls properly and get infos/styles/properties by SQACPP

SQACPP
Wed Oct 17 18:12:32 PDT 2007

> That's actually BS_OWNERDRAW (which happens to have a numberic value of
> 0xB). Not that this information helps you very much.

How the BS_OWNERDRAW can help me to find if the button is a
button,checkbox,radiobutton, groupbox or something else ? HOW?????

> Basically, in my humble opinion, your quest is hopeless. Spy++ doesn't
> show the information you want not because its authors were lazy, but
> because this information is unavailable. Anybody can write a control
> that looks like anything, and give it any class name and any style.
> Without a priori knowledge of the window class in question, there's no
> way to meaningfully interpret the styles.

Ok so I understand now that there is no way to get more informations/
styles/properties on .Net control. Sounds really weird but just
because it's a .net control checkbox I cant even know if the checkbox
is checked or not with BS_CHECKED because there is no BS_CHECKED or
BM_GETCHECK for .net control... So you confirm that there is no way to
know if a .net checkbox control is checked or not and there i no
workaround??? Im a little bit surprised



Re: recognize .Net controls properly and get infos/styles/properties by SQACPP

SQACPP
Wed Oct 17 19:31:26 PDT 2007

> That's actually BS_OWNERDRAW (which happens to have a numberic value of
> 0xB). Not that this information helps you very much.

How the BS_OWNERDRAW can help me to find if the button is a
button,checkbox,radiobutton, groupbox or something else ? HOW?????

> Basically, in my humble opinion, your quest is hopeless. Spy++ doesn't
> show the information you want not because its authors were lazy, but
> because this information is unavailable. Anybody can write a control
> that looks like anything, and give it any class name and any style.
> Without a priori knowledge of the window class in question, there's no
> way to meaningfully interpret the styles.

Ok so I understand now that there is no way to get more informations/
styles/properties on .Net control. Sounds really weird but just
because it's a .net control checkbox I cant even know if the checkbox
is checked or not with BS_CHECKED because there is no BS_CHECKED or
BM_GETCHECK for .net control... So you confirm that there is no way to
know if a .net checkbox control is checked or not and there i no
workaround??? Im a little bit surprised


Re: recognize .Net controls properly and get infos/styles/properties by Igor

Igor
Wed Oct 17 20:06:53 PDT 2007

"SQACPP" <lsdisciples@hotmail.com> wrote in message
news:1192669952.552338.262540@z24g2000prh.googlegroups.com
>> That's actually BS_OWNERDRAW (which happens to have a numberic value
>> of 0xB). Not that this information helps you very much.
>
> How the BS_OWNERDRAW can help me to find if the button is a
> button,checkbox,radiobutton, groupbox or something else ? HOW?????

It can't. That's why I said it isn't helpful. BS_OWNERDRAW means the
application's code took responsibility over drawing the button. It can
do so in any way it sees fit: like a push button, like a checkbox, like
a radiobutton, or even unlike any button type at all.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925



Re: recognize .Net controls properly and get infos/styles/properties by SQACPP

SQACPP
Wed Oct 17 23:14:44 PDT 2007

On Oct 17, 11:06 pm, "Igor Tandetnik" <itandet...@mvps.org> wrote:
> "SQACPP" <lsdiscip...@hotmail.com> wrote in message
>
> news:1192669952.552338.262540@z24g2000prh.googlegroups.com
>
> >> That's actually BS_OWNERDRAW (which happens to have a numberic value
> >> of 0xB). Not that this information helps you very much.
>
> > How the BS_OWNERDRAW can help me to find if the button is a
> > button,checkbox,radiobutton, groupbox or something else ? HOW?????
>
> It can't. That's why I said it isn't helpful. BS_OWNERDRAW means the
> application's code took responsibility over drawing the button. It can
> do so in any way it sees fit: like a push button, like a checkbox, like
> a radiobutton, or even unlike any button type at all.

Ranorex Spy from http://www.ranorex.com/fileadmin/downloads/RanorexSpy.exe
is able to tell is my .net checkbox is checked or Not.... How it's
done ? (without using BM_GETCHECK or BS_CHECKED ??) This application
is at least able to know that the control ""WindowsForms10.BUTTON.app.
0.378734a"" is a checkbox and get the state of the checkbox!?!?? any
ideas?







Re: recognize .Net controls properly and get infos/styles/properties by SQACPP

SQACPP
Thu Oct 18 00:07:29 PDT 2007

I also realise that Ranorex **Recorder*** from www.ranorex.com when
you install the ranorex free tool can do exactly what i'm trying to
do:

- Get the control name. :ex CheckBox1, or Form1, MyRadioButton (By
Control name i mean the name of the control when you create it
in .net) Note that the name is not a simple WM_GETTEXT (WM_GETTEXT
work to get the control name when the control have no text) it's the
real control ID

- Identify object EXACTLY. The control is a RadioButton, or
PictureBox, menu strip, tool stip, etc..etc.. How this application
can know exactly the type of control?????????

I badly need to understand how to get the control name properties and
being able to indentify any object in a form in another application
like this...

I'm desesperate after days of reading books, google and trying
different thing without being sure it can be done... At least now I
can hope findind a solution since i can see it's possible :)

Thanks for any ideas...


Re: recognize .Net controls properly and get infos/styles/properties by Ben

Ben
Thu Oct 18 08:33:24 PDT 2007


"SQACPP" <lsdisciples@hotmail.com> wrote in message
news:1192674686.715677.216450@i38g2000prf.googlegroups.com...
>> That's actually BS_OWNERDRAW (which happens to have a numberic value of
>> 0xB). Not that this information helps you very much.
>
> How the BS_OWNERDRAW can help me to find if the button is a
> button,checkbox,radiobutton, groupbox or something else ? HOW?????
>
>> Basically, in my humble opinion, your quest is hopeless. Spy++ doesn't
>> show the information you want not because its authors were lazy, but
>> because this information is unavailable. Anybody can write a control
>> that looks like anything, and give it any class name and any style.
>> Without a priori knowledge of the window class in question, there's no
>> way to meaningfully interpret the styles.
>
> Ok so I understand now that there is no way to get more informations/
> styles/properties on .Net control. Sounds really weird but just
> because it's a .net control checkbox I cant even know if the checkbox
> is checked or not with BS_CHECKED because there is no BS_CHECKED or
> BM_GETCHECK for .net control... So you confirm that there is no way to
> know if a .net checkbox control is checked or not and there i no
> workaround??? Im a little bit surprised

It isn't that there's no way, it's that there's no generic way. You have to
account for the exact library and version the widget belongs to.

For .NET apps, you could almost certainly write a C++/CLI dll, use thread
injection to start it in the process you're spying on, access the
Windows.Forms.Application static members such as OpenForms, and do
hit-testing to find out what Control is at that particular location, then
test against known control classes or use reflection to read its properties.



Re: recognize .Net controls properly and get infos/styles/properties by Sheng

Sheng
Fri Oct 19 15:43:38 PDT 2007

How .net wrap windows apis is the implementation detail that can subject to
change between versions. If you know target process is running on clr 2.0,
you can try the managedspy sample
(msdn.microsoft.com/msdnmag/issues/06/04/ManagedSpy/)

--
Sheng Jiang
Microsoft MVP in VC++
"SQACPP" <lsdisciples@hotmail.com> wrote in message
news:1192674686.715677.216450@i38g2000prf.googlegroups.com...
> > That's actually BS_OWNERDRAW (which happens to have a numberic value of
> > 0xB). Not that this information helps you very much.
>
> How the BS_OWNERDRAW can help me to find if the button is a
> button,checkbox,radiobutton, groupbox or something else ? HOW?????
>
> > Basically, in my humble opinion, your quest is hopeless. Spy++ doesn't
> > show the information you want not because its authors were lazy, but
> > because this information is unavailable. Anybody can write a control
> > that looks like anything, and give it any class name and any style.
> > Without a priori knowledge of the window class in question, there's no
> > way to meaningfully interpret the styles.
>
> Ok so I understand now that there is no way to get more informations/
> styles/properties on .Net control. Sounds really weird but just
> because it's a .net control checkbox I cant even know if the checkbox
> is checked or not with BS_CHECKED because there is no BS_CHECKED or
> BM_GETCHECK for .net control... So you confirm that there is no way to
> know if a .net checkbox control is checked or not and there i no
> workaround??? Im a little bit surprised
>



Re: recognize .Net controls properly and get infos/styles/properties by SQACPP

SQACPP
Sun Oct 28 13:22:18 PDT 2007

On Oct 19, 6:43 pm, "Sheng Jiang[MVP]"
<sheng_ji...@hotmail.com.discuss> wrote:
> How .net wrap windows apis is the implementation detail that can subject to
> change between versions. If you know target process is running on clr 2.0,
> you can try the managedspy sample
> (msdn.microsoft.com/msdnmag/issues/06/04/ManagedSpy/)
>
> --
> Sheng Jiang
> Microsoft MVP in VC++"SQACPP" <lsdiscip...@hotmail.com> wrote in message

The target process must be 1.0 or 2.0 :(

I'm playing with different .net spy examples since last week...

I want to target clr 1.X and 2.0 processes also.

I'm wondering how list 1.0 process in ManagedSpy (msdn.microsoft.com/
msdnmag/issues/06/04/ManagedSpy/)

Did my application must be coded in 1.0 to support 1.0 and 2.0 ??

When looking at the ManagedSpy code, an application is identified as a
2.0 managed process when :
- mscorlib.dll is linked to the process or
- mscorlib.ni.dll is linked to the process or
- System::Reflection::AssemblyName::GetAssemblyName(..) return name-
>version->Major==2

How the clr version affect the way to get a pointer to the .net
control when using something like this :

Control^ w = System::Windows::Forms::Control::FromHandle(...)

The returned control is supported by all .Dot net version... I can
understand that some control can be added,changed or removed between
versions but what is the main reasons why ManagedSpy CAN'T list 1.0
process and properties ??

So my questions are :

- How can I list 1.0 and 2.0 managed process????
- Did i need a 1.0 application to be able to list 1.0 control
properties???

Any help or suggestion???? Not sure about how to "adapt" managed spy
to list also clr 1.0 process and properties?


Re: recognize .Net controls properly and get infos/styles/properties by Alexander

Alexander
Mon Oct 29 08:56:56 PDT 2007

My understanding is you'll need three versions, one for each
version of the framework. BTW, note you might want to start
targeting .NET 3.0 as well. It's available for both Vista and
Windows XP and the development support is coming out soon
via Visual Studio 2008... (not to mention there's a standalone
SDK out right now)

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================

"SQACPP" <lsdisciples@hotmail.com> wrote in message
news:1193602938.800375.262530@v3g2000hsg.googlegroups.com...
> On Oct 19, 6:43 pm, "Sheng Jiang[MVP]"
> <sheng_ji...@hotmail.com.discuss> wrote:
>> How .net wrap windows apis is the implementation detail that can subject
>> to
>> change between versions. If you know target process is running on clr
>> 2.0,
>> you can try the managedspy sample
>> (msdn.microsoft.com/msdnmag/issues/06/04/ManagedSpy/)
>>
>> --
>> Sheng Jiang
>> Microsoft MVP in VC++"SQACPP" <lsdiscip...@hotmail.com> wrote in message
>
> The target process must be 1.0 or 2.0 :(
>
> I'm playing with different .net spy examples since last week...
>
> I want to target clr 1.X and 2.0 processes also.
>
> I'm wondering how list 1.0 process in ManagedSpy (msdn.microsoft.com/
> msdnmag/issues/06/04/ManagedSpy/)
>
> Did my application must be coded in 1.0 to support 1.0 and 2.0 ??
>
> When looking at the ManagedSpy code, an application is identified as a
> 2.0 managed process when :
> - mscorlib.dll is linked to the process or
> - mscorlib.ni.dll is linked to the process or
> - System::Reflection::AssemblyName::GetAssemblyName(..) return name-
>>version->Major==2
>
> How the clr version affect the way to get a pointer to the .net
> control when using something like this :
>
> Control^ w = System::Windows::Forms::Control::FromHandle(...)
>
> The returned control is supported by all .Dot net version... I can
> understand that some control can be added,changed or removed between
> versions but what is the main reasons why ManagedSpy CAN'T list 1.0
> process and properties ??
>
> So my questions are :
>
> - How can I list 1.0 and 2.0 managed process????
> - Did i need a 1.0 application to be able to list 1.0 control
> properties???
>
> Any help or suggestion???? Not sure about how to "adapt" managed spy
> to list also clr 1.0 process and properties?
>



Re: recognize .Net controls properly and get infos/styles/properties by Ben

Ben
Mon Oct 29 10:36:36 PDT 2007


"Alexander Nickolov" <agnickolov@mvps.org> wrote in message
news:%23Dg64QkGIHA.2100@TK2MSFTNGP03.phx.gbl...
> My understanding is you'll need three versions, one for each
> version of the framework. BTW, note you might want to start
> targeting .NET 3.0 as well. It's available for both Vista and
> Windows XP and the development support is coming out soon
> via Visual Studio 2008... (not to mention there's a standalone
> SDK out right now)

That's .NET 3.5, the next major release after 2.0. .NET 3.0 was a feature
release, binary compatible with 2.0 and not changing any of the core bits,
but adding WPF and WCF (and something else?).

>
> --
> =====================================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD
> email: agnickolov@mvps.org
> MVP VC FAQ: http://vcfaq.mvps.org
> =====================================
>
> "SQACPP" <lsdisciples@hotmail.com> wrote in message
> news:1193602938.800375.262530@v3g2000hsg.googlegroups.com...
>> On Oct 19, 6:43 pm, "Sheng Jiang[MVP]"
>> <sheng_ji...@hotmail.com.discuss> wrote:
>>> How .net wrap windows apis is the implementation detail that can subject
>>> to
>>> change between versions. If you know target process is running on clr
>>> 2.0,
>>> you can try the managedspy sample
>>> (msdn.microsoft.com/msdnmag/issues/06/04/ManagedSpy/)
>>>
>>> --
>>> Sheng Jiang
>>> Microsoft MVP in VC++"SQACPP" <lsdiscip...@hotmail.com> wrote in message
>>
>> The target process must be 1.0 or 2.0 :(
>>
>> I'm playing with different .net spy examples since last week...
>>
>> I want to target clr 1.X and 2.0 processes also.
>>
>> I'm wondering how list 1.0 process in ManagedSpy (msdn.microsoft.com/
>> msdnmag/issues/06/04/ManagedSpy/)
>>
>> Did my application must be coded in 1.0 to support 1.0 and 2.0 ??
>>
>> When looking at the ManagedSpy code, an application is identified as a
>> 2.0 managed process when :
>> - mscorlib.dll is linked to the process or
>> - mscorlib.ni.dll is linked to the process or
>> - System::Reflection::AssemblyName::GetAssemblyName(..) return name-
>>>version->Major==2
>>
>> How the clr version affect the way to get a pointer to the .net
>> control when using something like this :
>>
>> Control^ w = System::Windows::Forms::Control::FromHandle(...)
>>
>> The returned control is supported by all .Dot net version... I can
>> understand that some control can be added,changed or removed between
>> versions but what is the main reasons why ManagedSpy CAN'T list 1.0
>> process and properties ??
>>
>> So my questions are :
>>
>> - How can I list 1.0 and 2.0 managed process????
>> - Did i need a 1.0 application to be able to list 1.0 control
>> properties???
>>
>> Any help or suggestion???? Not sure about how to "adapt" managed spy
>> to list also clr 1.0 process and properties?
>>
>
>



Re: recognize .Net controls properly and get infos/styles/properties by SQACPP

SQACPP
Mon Oct 29 16:11:26 PDT 2007

Thanks Ben and Alexander!...

So with a single .exe it's IMPOSSIBLE to target 1.0 and 2.x (including
3.0 ;o))...I absolutely need different .exe depending on the
targeted .net version??????????

based on your comment I'm loosing my time trying to add the feature
(support of net 1.0) of http://www.codeproject.com/dotnet/wfspy.asp in
a modified version of ManagedSpy http://msdn.microsoft.com/msdnmag/issues/06/04/ManagedSpy/
.....right ????????????

The following comment http://www.codeproject.com/dotnet/wfspy.asp?df=100&forumid=16563&select=1540831#xx1540831xx
suggest modifying wfspy to also support 2.0 controls is it the way to
go???????????????. By looking at the code the two applications access
to the controls on the form almost in the same way...
System::Windows::Forms::Control::FromHandle(...) Still trying to
figure out how to modifiy wfspy example to show 2.0 application in the
treeview and it's properties... any idea or something to start with ?

just want to make sure i'm going to the right direction.

Thanks again...


Re: recognize .Net controls properly and get infos/styles/properties by Alexander

Alexander
Tue Oct 30 09:14:54 PDT 2007

I've predicted this maintenace nightmare of the .NET framework
since when version 1.0 was released... Welcome to maintenance
hell to replace DLL hell!

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================

"SQACPP" <lsdisciples@hotmail.com> wrote in message
news:1193699486.875764.132270@o38g2000hse.googlegroups.com...
> Thanks Ben and Alexander!...
>
> So with a single .exe it's IMPOSSIBLE to target 1.0 and 2.x (including
> 3.0 ;o))...I absolutely need different .exe depending on the
> targeted .net version??????????
>
> based on your comment I'm loosing my time trying to add the feature
> (support of net 1.0) of http://www.codeproject.com/dotnet/wfspy.asp in
> a modified version of ManagedSpy
> http://msdn.microsoft.com/msdnmag/issues/06/04/ManagedSpy/
> .....right ????????????
>
> The following comment
> http://www.codeproject.com/dotnet/wfspy.asp?df=100&forumid=16563&select=1540831#xx1540831xx
> suggest modifying wfspy to also support 2.0 controls is it the way to
> go???????????????. By looking at the code the two applications access
> to the controls on the form almost in the same way...
> System::Windows::Forms::Control::FromHandle(...) Still trying to
> figure out how to modifiy wfspy example to show 2.0 application in the
> treeview and it's properties... any idea or something to start with ?
>
> just want to make sure i'm going to the right direction.
>
> Thanks again...
>



Re: recognize .Net controls properly and get infos/styles/properties by SQACPP

SQACPP
Wed Oct 31 22:15:15 PDT 2007

I download wfspy src from http://www.codeproject.com/dotnet/wfspy.asp
and convert and compile the source in VS 2005

I can generate the .exe and .dll but the compiler return the error :
"Error spawning 'cmd.exe'

Since the error is not stopping the generation of the .exe and .dll I
have modified the code to show .Net 2.0 window also. Cool!! now I can
have both .net 1.0 and 2.0 window listed in the treeview.

Questions
=========
1- What is that Error spawning CMD.EXE ??? How to fix this ???
2- Now I can list 1.0 and 2.0 window in the same treeview (the list of
window) but i can only get the properties for 2.0 window/controls ????
Why??? Just because I load the source in VS2005 instead of VS2003
like the author I get an exception for 1.0 controls and 2.0 control
are now working??? This make no sense? The demo .exe/.dll posted in
codeproject do the opposite...it correctly list properties of 1.0
controls??? Is it suppose to be like this????

If I can fix the cmd.exe error maybe I will be able to debug to
understand why it fail.

BTW sorry for this thread.. it start unmanaged C++ and it continue
with managed C# ;o)

Thanks again..


Re: recognize .Net controls properly and get infos/styles/properties by Alexander

Alexander
Thu Nov 01 09:15:28 PDT 2007

You probably need to start asking in .NET groups as the experts
here are not necessarily also .NET experts. I for one know very
little about .NET...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================

"SQACPP" <lsdisciples@hotmail.com> wrote in message
news:1193894115.259159.168860@o80g2000hse.googlegroups.com...
>I download wfspy src from http://www.codeproject.com/dotnet/wfspy.asp
> and convert and compile the source in VS 2005
>
> I can generate the .exe and .dll but the compiler return the error :
> "Error spawning 'cmd.exe'
>
> Since the error is not stopping the generation of the .exe and .dll I
> have modified the code to show .Net 2.0 window also. Cool!! now I can
> have both .net 1.0 and 2.0 window listed in the treeview.
>
> Questions
> =========
> 1- What is that Error spawning CMD.EXE ??? How to fix this ???
> 2- Now I can list 1.0 and 2.0 window in the same treeview (the list of
> window) but i can only get the properties for 2.0 window/controls ????
> Why??? Just because I load the source in VS2005 instead of VS2003
> like the author I get an exception for 1.0 controls and 2.0 control
> are now working??? This make no sense? The demo .exe/.dll posted in
> codeproject do the opposite...it correctly list properties of 1.0
> controls??? Is it suppose to be like this????
>
> If I can fix the cmd.exe error maybe I will be able to debug to
> understand why it fail.
>
> BTW sorry for this thread.. it start unmanaged C++ and it continue
> with managed C# ;o)
>
> Thanks again..
>



Re: recognize .Net controls properly and get infos/styles/properties by Ben

Ben
Tue Nov 13 06:54:37 PST 2007


"SQACPP" <lsdisciples@hotmail.com> wrote in message
news:1193699486.875764.132270@o38g2000hse.googlegroups.com...
> Thanks Ben and Alexander!...
>
> So with a single .exe it's IMPOSSIBLE to target 1.0 and 2.x (including
> 3.0 ;o))...I absolutely need different .exe depending on the
> targeted .net version??????????

.NET 2.0/3.x can load your .exe compiled for 1.x, but... an executable
running under .NET 1.x and running under .NET 2.0/3.x (regardless of
original compiler used) cannot interact in a .NET way, only via standard
interface layers such as sockets, pipes, web services.

So the same .exe could perhaps work with either version of .NET, if compiled
for 1.x and using an external manifest.

But for your specific case, no I don't think that one process can see both
.NET 1.x and 2.0/3.x processes as .NET programs.

>
> based on your comment I'm loosing my time trying to add the feature
> (support of net 1.0) of http://www.codeproject.com/dotnet/wfspy.asp in
> a modified version of ManagedSpy
> http://msdn.microsoft.com/msdnmag/issues/06/04/ManagedSpy/
> .....right ????????????
>
> The following comment
> http://www.codeproject.com/dotnet/wfspy.asp?df=100&forumid=16563&select=1540831#xx1540831xx
> suggest modifying wfspy to also support 2.0 controls is it the way to
> go???????????????. By looking at the code the two applications access
> to the controls on the form almost in the same way...
> System::Windows::Forms::Control::FromHandle(...) Still trying to
> figure out how to modifiy wfspy example to show 2.0 application in the
> treeview and it's properties... any idea or something to start with ?
>
> just want to make sure i'm going to the right direction.
>
> Thanks again...
>



Re: recognize .Net controls properly and get infos/styles/properties by SQACPP

SQACPP
Sun Dec 09 00:34:21 PST 2007

On Nov 13, 9:54 am, "Ben Voigt [C++ MVP]" <r...@nospam.nospam> wrote:
> "SQACPP" <lsdiscip...@hotmail.com> wrote in message
>
> news:1193699486.875764.132270@o38g2000hse.googlegroups.com...
>
> > Thanks Ben and Alexander!...
>
> > So with a single .exe it's IMPOSSIBLE to target 1.0 and 2.x (including
> > 3.0 ;o))...I absolutely need different .exe depending on the
> > targeted .net version??????????
>
> .NET 2.0/3.x can load your .exe compiled for 1.x, but... an executable
> running under .NET 1.x and running under .NET 2.0/3.x (regardless of
> original compiler used) cannot interact in a .NET way, only via standard
> interface layers such as sockets, pipes, web services.
>
> So the same .exe could perhaps work with either version of .NET, if compiled
> for 1.x and using an external manifest.
>
> But for your specific case, no I don't think that one process can see both
> .NET 1.x and 2.0/3.x processes as .NET programs.
>
>
>
>
>
> > based on your comment I'm loosing my time trying to add the feature
> > (support of net 1.0) ofhttp://www.codeproject.com/dotnet/wfspy.aspin
> > a modified version of ManagedSpy
> >http://msdn.microsoft.com/msdnmag/issues/06/04/ManagedSpy/
> > .....right ????????????
>
> > The following comment
> >http://www.codeproject.com/dotnet/wfspy.asp?df=100&forumid=16563&sele...
> > suggest modifying wfspy to also support 2.0 controls is it the way to
> > go???????????????. By looking at the code the two applications access
> > to the controls on the form almost in the same way...
> > System::Windows::Forms::Control::FromHandle(...) Still trying to
> > figure out how to modifiy wfspy example to show 2.0 application in the
> > treeview and it's properties... any idea or something to start with ?
>
> > just want to make sure i'm going to the right direction.
>
> > Thanks again...- Hide quoted text -
>
> - Show quoted text -

Thanks Ben your post really help me to figure out how it can be done!

I create 3 versions of my application to solve the problem. One
created with VS 2002 (1.0) , one created with VS 2005 (2.0) and one
created with VS 2008 (3.0) The application is similar to ManagedSpy
(http://msdn.microsoft.com/msdnmag/issues/06/04/ManagedSpy/ ) but it
list all the windows of any .net version. When the user select a
different .net version window (Not the same .net version as the .exe)
I need to switch the current .exe to another .exe compiled with the
right .net framework.

- How can i switch between my .exe ?? If the selected window use a
different .net version maybe i can hide the current .exe and show the
other .exe ??? Any ideas to "similate" that the user use the same
application?? (Keep the same place and icon in the task bar )

I know my project turn "managed" but just want to have your suggestion
on this.

Thanks!