|
Hi,
I am looking for a way to change the default WindowClassName of a .NET form into a custom one.
The default WindowClassName is .NET is: (VS.NET 2005/.NET 2.0)
WindowsForms10.Window.8.app.0.3ce0bb8
The reason is that I want to use FindWindow with a my unique class name, and currently I am forced to find the window by window title (very fragile solution).
In C++ it was very easy, but in .NET it seems to be deeply hidden in Windows Forms.
Anyone has a good hack/solution to this problem?
Thanks
Yuval
"The true sign of intelligence is not knowledge but imagination." - Albert Einstein
|
|
|
|
|
Hi,
I'm not entirely sure if this is what you're asking, but I find individual open forms in my application using this code block:
foreach (Form frm in Application.OpenForms)
{
if (frm is MyFormClass)
{
return (MyFormClass)frm;
}
}
Where MyFormClass is the class of the form I want to find.
Hope that helps.
ChrisB
|
|
|
|
|
Hi Chris,
I am asking to change the Window Class name.
Your solution find open forms inside a .NET process.
I am trying to find a window from another process. So there is no access to Application.OpenForms.
The API to do this is called FindWindow, it is a Win32 API.
In Win32 each window has a ClassName which is a classifier and nothing to do with C++/C# classes.
Use the Spy++ with .NET windows (forms) and you will see that the Window ClassName is not unique (all .NET forms have the same ClassName).
I simply want to customize this ClassName for my forms.
Thanks anyway.
Yuval
"The true sign of intelligence is not knowledge but imagination." - Albert Einstein
|
|
|
|
|
Hi,
I'm looking for a way to specify the port numbers of a TCP connection via a TCPChannel object. I use the TCPChannel because
I need to receive callbacks in my client application:
<channel ref="tcp" port="8085" rejectRemoteRequests="false" exclusiveAddressUse="true" useIpAddress="false">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full"/>
<provider ref="secureHandshake" />
</serverProviders>
</channel>
The client instantiates the remote object in a common manner:
(ILogin) Activator.GetObject(typeof(LoginProvider), serverPath) // serverPath="....:7912"
Sysinternal TCPViewer tells me about the following established remoting endpoints:
Process Local Remote
Client.exe nb2h130c:8085 nbgh62091033:2147 // Connection#1 used for Callbacks
Client.exe nb2h130c:2176 nbgh62091033:7912 // Connection#2
Question:
Is there a way to specify the client port number (2176) of connection#2 and the number of the server port (2147)
Another strange behavior is, that these both connections will be periodically removed and new established with other port numbers, while client and server are still working without any problem.
In the internet, I only came across the information to set a fixed endpoint for COM+ applications.
Thanks for every reply
Thomas
|
|
|
|
|
I have made a deployment Setup Project in VS2005. I have two question reagrding it.
1. How can I check before the installation starts whether service pack is installed on the machine or not?
2. It generates a couple of files and folder. How can i package them into single self extracting executable file?
Any kind of help, suggestion or link would be highly appreciated.
Regards,
Wasif Ehsan.
|
|
|
|
|
Hi.
How do I get the size of a COM object in C#?
Note that the COM objects I refer to support IPersistStream, but the MaxSize property isn't really supported by them.
Thanks alot.
Dirk
|
|
|
|
|
Hi,
I have a question on the article mentioned in the Subject.
I find it really helpfull but i have one Probleme.
I working with .Net 2005 an MS Outlook 2007.
To bring it to the point my Problem is that my PropertyPage is not Displayed in the Options Menü.
I don't understand that because he is perfoming the pages.Add(new OptPage(), "UsrPage") Method but nothing happens.
I used the Debug mode and I realised that the Caption Property is ignored (never performed)
[DispId(-518)]
public string Caption
{
get{return "DEMO";}
}
But I really don't know why because up to this point everything is performed in the same way.
So I would be really thankfull if someone can help me
Thx in advanced
SquallNaruto
If one eye is focused on the goal
then only one eye is left to find the way
|
|
|
|
|
To get work done a little faster with a datagridview I thought about assigning shortcut keys to value in one column. These shortcuts are configurable so that the user can change them. The code to find the right item for a given shortcut looks like this:
if (shortcutparts[0].ToLower() == "alt" && e.Alt &&<br />
shortcutparts[1].ToLower() == e.KeyCode.ToString())<br />
{<br />
itemsGridView.CurrentRow.Cells[1].Value = <br />
group.Name;<br />
}<br />
else if (shortcutparts[0].ToLower() == "ctrl" &&<br />
e.Control &&<br />
shortcutparts[1].ToLower() == e.KeyCode.ToString())<br />
{<br />
itemsGridView.CurrentRow.Cells[1].Value = group.Name;<br />
}
But there's a problem, that column is edited using a combobox, which doesn't accept the value I assigned to it, eventhough it does show the right value the first time. Anybody have an idea how I can get it to work?
WM.
What about weapons of mass-construction?
|
|
|
|
|
hello all,
I am new to C# and would like your help in this matter.
I know this is the syntax to declare a single dimensional arraylist in C#
ArrayList arraylist_name = new ArrayList().
Can anybody tell me as to how I can declare a 2 dimensional arraylist and access the same?
Thanks in advance.
Keshav V. Kamat
Systems Engineer
Siemens
India.
|
|
|
|
|
The best way to create that is to use the hashtable, although its a map and not a list you can still access the keys as if they were a list of values.
Hashtable table = new Hashtable();
To create a two dimensional arraylist you will have to write something like this:
ArrayList list1 = new ArrayList();
for(int x = 0; x < 10; x++) {
list1.Add(new ArrayList());
}
but this uses significant more memory and is not advisable if you only need the first lists index to access the second list. In that case you are better of with a hashtable that uses an Int32 value as key and ArrayList as value.
WM.
What about weapons of mass-construction?
|
|
|
|
|
thanks.
i will try that out.
Keshav V. Kamat
Systems Engineer
Siemens
India.
|
|
|
|
|
Ther are 2 things you could do.
1) If you know the size of the dimention you want to create, you could make an array of ArrayList.
ArrayList []list = new ArrayList[10];
for( int i = 0; i < 10; i++ )
{
list[i] = new ArrayList();
}
2) If you want a variable length (dont know the length) you could create an ArrayList of ArrayLists.
ArrayList list = new ArrayList();
ArrayList subList = new ArrayList();
list.Add(subList);
|
|
|
|
|
ArrayList list = new ArrayList();
ArrayList<string> list2 = new ArrayList<string>();
for the normal array its
String[] strings = new String[10];
WM.
What about weapons of mass-construction?
|
|
|
|
|
Thanks for the reply.
But I dont think you got my question right.
I dont want to declare 2 single-dimensional arrays separately.
I want to declare a 2-dimensional array like the one you do with the normal array like this
string[,] string_name=new string[10,10];
See if you know.
Keshav V. Kamat
Systems Engineer
Siemens
India.
|
|
|
|
|
Hmm, something is up with the post
I just saw two posts and now there's just one... Ah well, must be me sleeping again. See the answer posted earlier
WM.
What about weapons of mass-construction?
|
|
|
|
|
Hi
how can i add avi files to my application.
is three any control for this purpose
|
|
|
|
|
Hi,
in the directx library,
there exist a video library,
that you play, forward, reward, gather the current position,
total duration properties and methods like play pause stop.. etc..
just downlad the directx latest sdk...
but it is a little big size to download...
|
|
|
|
|
I want to set the datetime format in gridview control column.
|
|
|
|
|
HI
when i open a flderbrowse dialog box and select folder
"F:\Documents and Settings\Parshant\Local Settings\Application Data\Identities\{9A42BBED-20C1-4620-9381-F7ACFB5D1809}\Microsoft\Outlook Express"
then it throw a exception "invalid access to memory location"
But when select at another location it works perfect.
i written the code
DialogResult result = folderBrowserDialog.ShowDialog();
if(result==DialogResult.OK)
lbl_dbx_folder_info.Text=folderBrowserDialog.SelectedPath.ToString();
Parshant
|
|
|
|
|
HI,
you either don't have access to that folder or it is simply not found.
jamil abou khalil
|
|
|
|
|
But in case of "openfiledialog"
file is simply seleted in side
"F:\Documents and Settings\Parshant\Local Settings\Application Data\Identities\{9A42BBED-20C1-4620-9381-F7ACFB5D1809}\Microsoft\Outlook Express"
no exception thrown.But in folderbrowsedialoge problem occure.
plz help
|
|
|
|
|
Hello All,
I have a user control. which contains a tree view as well as list view control. One at a time will show. I have problem with ListView. I am adding item in at runtime on OnDraw method. I have also override OnMesureItem. Now i want to clear the the item. But there is some problem with it. When i click on submit button, old items should cleared and new ones should be added. But when i click on submit button. The new items added to the list , they are not getting cleared.
I used:-
Item.Clear();
Can anybody help me.
|
|
|
|
|
How do we create events for a user control which is dynamically added?
Thanks in advance
R.K
|
|
|
|
|
In Your control which is too added class;-
Declare delegate:-
public delegate void ShowTextEvent(string str,EventArgs e);
Declare event:-
public void ShowTextEvent MyEvent;
/////////////////////////////////////////////////////////////////////
void somemethod()
{
//////////////////////////////// Control is added
Controls.Add(NewControl);
/////////////////////////////// Setting Event to this.
NewControl.MyEvent+=new ShowTextEvent(OnMyEvent);
}
////Handler
void OnMyEvent(string str,EventArgs e)
{
}
|
|
|
|
|
Hi aslam,
i have a user control created with a button on it.
I am creating an instance of this user control using statments
IComponent newComponent = Activator.CreateInstance(componentClass, objparams) as IComponent;
now i need to add event to this component.
i want the click event of the user control.
please help.
thanks in advance.
|
|
|
|