473,387 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Setting the ClassName for a standalone app?

Has anyone ever been able to change the classname for a C# (or even
VB.NET) standalone app?

Using Spy, I can see that the classname .NET gives the app is
"WindowsForms10.Window.8.app*", but I have been unsuccessful and I
haven't seen anyone else who's done it either.

Here's why I'm asking....

SETUP
1 C++ COM DLL who sends messages to an app of the classname
"MyMonitorApp" via SendMessage.
1 C++ MFC EXE who registers it's name as "MyMonitorApp" using the
RegisterClass() call.

TODO
I am attempting to replace ONLY the EXE with a newer .NET version
(the DLL is compiled in too many projects to make a change there right
now).

PROBLEM
The classname. Right now the DLL looks for a specific classname and
..NET assigns one, and won't allow it to be changed (that I know of).

Hewwwp! And, thanks in advance!! :)
Kurt Snyder
ku********************@halliburton.com
Nov 16 '05 #1
2 2739
Hi,

This has something to do with the Control's CreateParams property and the
corresponding structure (and any form is actually indirectly inherited from
the Control class).
I'd try to set the CreateParams.ClassName property in the form's constructor
and see what happens.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"CaptainKS" <ca*********@hotmail.com> wrote in message
news:2b**************************@posting.google.c om...
Has anyone ever been able to change the classname for a C# (or even
VB.NET) standalone app?

Using Spy, I can see that the classname .NET gives the app is
"WindowsForms10.Window.8.app*", but I have been unsuccessful and I
haven't seen anyone else who's done it either.

Here's why I'm asking....

SETUP
1 C++ COM DLL who sends messages to an app of the classname
"MyMonitorApp" via SendMessage.
1 C++ MFC EXE who registers it's name as "MyMonitorApp" using the
RegisterClass() call.

TODO
I am attempting to replace ONLY the EXE with a newer .NET version
(the DLL is compiled in too many projects to make a change there right
now).

PROBLEM
The classname. Right now the DLL looks for a specific classname and
.NET assigns one, and won't allow it to be changed (that I know of).

Hewwwp! And, thanks in advance!! :)
Kurt Snyder
ku********************@halliburton.com


Nov 16 '05 #2
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote in message news:<u6**************@TK2MSFTNGP09.phx.gbl>...
Hi,

This has something to do with the Control's CreateParams property and the
corresponding structure (and any form is actually indirectly inherited from
the Control class).
I'd try to set the CreateParams.ClassName property in the form's constructor
and see what happens.


Well, this is something that I've tried (as it seemed logical), but
when you do so, an .Win32Exception is thrown at the earlier point of
"Application.Run(new Form1());" and it additionally says, "Invalid
window class name".

I also tried the same in VB.NET and it gave a similar exception at the
point of "MyBase.New()" in the form's constructor.
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Charlie T | last post by:
Hello, is there any way to get this to work? myID.innerHTML = "Hello" <DIV id="myID"></DIV> <DIV id="myID"></DIV>
5
by: mark | r | last post by:
i use document.getelementbyid('id').style.colour= a lot anyone know how to set the style of the link in the following code <li id="tab1"><a href="#">moo</a></li> because setting the colour of...
21
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does...
2
by: bmgz | last post by:
I have written a script that highlights a table row when the appropriate checkbox is checked. Using element.style is a bit messy and doesn't really fulfil my needs.. I want to just be able to...
1
by: Dean Slindee | last post by:
Currently using: Dim xtw As New XmlTextWriter (path,system.Text.Encoding.UTF8) which produces: <?xml version="1.0" encoding="utf-8" standalone="yes" ?> how can I produce: <?xml...
8
by: eggie5 | last post by:
Hi, I'm trying to set the class of an element on my page w/ javascript like this: function ResetNavigation(element) { element.className = "active"; }
2
by: insanity | last post by:
Can anyone help me with a problem that I have with apparently unrelated text disappearing in IE7 when I set a className. This does not happen in Firefox. I am trying to create an Ajax driven...
3
Frinavale
by: Frinavale | last post by:
So, the opacity style is rather annoying because every browser seems to handle it differently. I guess it's because opacity wasn't included in the w3c standards to begin with...mind you if it had...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.