what is the classname

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
OK thanks that explains wy I cannot find it with FindWindow. But how do I
find out what the classname is ?

rgds, Wilfried
 
By calling WIN32 API GetClassName (user32.dll) using the Handle returned by
FindWindow(Ex).

Willy.
 
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
 
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.
 
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.
 
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 said:
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.
 
Back
Top