PC Review


Reply
Thread Tools Rate Thread

what is the classname

 
 
=?Utf-8?B?V2lsZnJpZWQgTWVzdGRhZ2g=?=
Guest
Posts: n/a
 
      12th Feb 2005
Hi,

I want to post a message from another application to my C# application. It
works but I cannot fint the window if I fill in the class name. eg:

namespace SomeNameSpace
{
partial class Main: Form
{
Text = "this is the title";

and in the other program
ClassName := 'Main';
WindowTitle := 'this is the title';
Win := FindWindow(ClassName, WindowTitle);

does only work if I make ClassName := nil

--
rgds, Wilfried
http://www.mestdagh.biz
 
Reply With Quote
 
 
 
 
Mattias Sjögren
Guest
Posts: n/a
 
      12th Feb 2005

>I want to post a message from another application to my C# application. It
>works but I cannot fint the window if I fill in the class name. eg:


The Win32 window class name isn't the same as your Form class name.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
 
Reply With Quote
 
=?Utf-8?B?V2lsZnJpZWQgTWVzdGRhZ2g=?=
Guest
Posts: n/a
 
      12th Feb 2005
OK thanks that explains wy I cannot find it with FindWindow. But how do I
find out what the classname is ?

rgds, Wilfried
 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      12th Feb 2005
By calling WIN32 API GetClassName (user32.dll) using the Handle returned by
FindWindow(Ex).

Willy.

"Wilfried Mestdagh" <(E-Mail Removed)> wrote in
message news:31C56825-79F3-49FE-9AE7-(E-Mail Removed)...
> OK thanks that explains wy I cannot find it with FindWindow. But how do I
> find out what the classname is ?
>
> rgds, Wilfried



 
Reply With Quote
 
=?Utf-8?B?V2lsZnJpZWQgTWVzdGRhZ2g=?=
Guest
Posts: n/a
 
      12th Feb 2005
the classname returns: "WindowsForms10.Window.8.app.0.bf7771"

question is: where does this come from ? I want to say to customars to
FindWindow with specific class and title, just as it is the case in win32
progrrams where the classname is the class name of the window (the form).

rgds, Wilfried
 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      12th Feb 2005
The class name is the name given by Windows Forms when it is registering the
"Window class" by calling Win32's RegisterClass(Ex), you have no way to
control this in .NET.

Not sure what you mean with your last sentence, there is no notion of a
"form" in Win32, there is only a Classname by which you register the class
(RegisterClass(Ex)) and CreateWindow.

Willy.

"Wilfried Mestdagh" <(E-Mail Removed)> wrote in
message news:2956F02A-1CE0-4ECB-991A-(E-Mail Removed)...
> the classname returns: "WindowsForms10.Window.8.app.0.bf7771"
>
> question is: where does this come from ? I want to say to customars to
> FindWindow with specific class and title, just as it is the case in win32
> progrrams where the classname is the class name of the window (the form).
>
> rgds, Wilfried



 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      12th Feb 2005
Sorry, when I said there is a way to control this, I meant no "easy way".
The NativeWindow class encapsulates this low level Window stuff, search the
MSDN doc's for more info and a sample.

Willy.

"Wilfried Mestdagh" <(E-Mail Removed)> wrote in
message news:2956F02A-1CE0-4ECB-991A-(E-Mail Removed)...
> the classname returns: "WindowsForms10.Window.8.app.0.bf7771"
>
> question is: where does this come from ? I want to say to customars to
> FindWindow with specific class and title, just as it is the case in win32
> progrrams where the classname is the class name of the window (the form).
>
> rgds, Wilfried



 
Reply With Quote
 
Mattias Sjögren
Guest
Posts: n/a
 
      18th Feb 2005
>Sorry, when I said there is a way to control this, I meant no "easy way".
>The NativeWindow class encapsulates this low level Window stuff, search the
>MSDN doc's for more info and a sample.


And you can also override the CreateParams property of a Control or
Form. But that will only let you change the "Window" part of the whole
window class name.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      18th Feb 2005

"Mattias Sjögren" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> >Sorry, when I said there is a way to control this, I meant no "easy way".
>>The NativeWindow class encapsulates this low level Window stuff, search
>>the
>>MSDN doc's for more info and a sample.

>
> And you can also override the CreateParams property of a Control or
> Form. But that will only let you change the "Window" part of the whole
> window class name.
>


Mattias,

Same problem with the NativeWindow class, only a System class name (CONTROL)
is allowed as classname, and this also becomes a part of the whole window
class name, quite unusable IMO.

Willy.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Groupwise Classname? =?Utf-8?B?REJT?= Microsoft Access 3 24th Aug 2006 05:55 PM
Userfriendly classname cody Microsoft C# .NET 4 6th Jul 2006 07:37 PM
How get the classname of an app in Win2000? Rick Charnes Microsoft Windows 2000 3 6th Apr 2005 07:03 PM
what is the .exe classname .net vs vb6 Gary Kahrau Microsoft VB .NET 3 15th Mar 2005 12:32 AM
ClassName or WindowName =?Utf-8?B?S2V2aW4=?= Microsoft Excel Programming 2 31st Mar 2004 03:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:25 AM.