473,385 Members | 1,597 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,385 software developers and data experts.

1.Default button runtime 2. App running after unistall

Hello,

I am working on C# using vs.net 2003. I have faced two interesting
problems.

1. Dynamically setting Default Button:
I created a form and used it in various contexts. On basis of the context,
the panel of a form which contains various buttons , are shown or hides. Now
at design time i set the default button property to one of button. But when
the form object is created in different context and set visibilty of default
one false while some other buttons is/are visible then no one has default
button. My main form is basically a derived form from a control called
TD.SandDock.DockControl. Now on function which is called before display the
form but after creating its object, set the buttons , where i need to set the
default button as well. But i find no helper function/property to do so! How
can i achieve the same.

I cant set the default button to be appear on there (& set its
text) ,as its click event process is completely differ.

2. I created a small server application which basically listen on a port
for its client. Its GUI is absent and its only appear in taskbar icon(with
right click menu). One interesting thing i note is that this
applicaiton(.net) when uninstalled (installer is created using default .net
installation) while the applicaiton running. it doesnt complaint for
uninstall and thus it uninstalls the application while server applicaiton is
still running. As i create a mutex in applicaiton startup to check wherether
applicaiton is running or not . Hence when user install again the server
(note that server is still running even after uinstall) and runs the program
it says applcation is already running.

How can i assure that either it should not uninstall the applicaiton or it
should close the server applicaiton.

Thanks
Anil
--
Anil Kumar Sharma
(Project Lead)
India
May 25 '06 #1
3 1536
You might use Process.GetProcessByName to obtain a list of processes having
the same name. If it's existing, sounds like it's running.

"Anil Kumar Sharma" wrote:
Hello,

I am working on C# using vs.net 2003. I have faced two interesting
problems.

1. Dynamically setting Default Button:
I created a form and used it in various contexts. On basis of the context,
the panel of a form which contains various buttons , are shown or hides. Now
at design time i set the default button property to one of button. But when
the form object is created in different context and set visibilty of default
one false while some other buttons is/are visible then no one has default
button. My main form is basically a derived form from a control called
TD.SandDock.DockControl. Now on function which is called before display the
form but after creating its object, set the buttons , where i need to set the
default button as well. But i find no helper function/property to do so! How
can i achieve the same.

I cant set the default button to be appear on there (& set its
text) ,as its click event process is completely differ.

2. I created a small server application which basically listen on a port
for its client. Its GUI is absent and its only appear in taskbar icon(with
right click menu). One interesting thing i note is that this
applicaiton(.net) when uninstalled (installer is created using default .net
installation) while the applicaiton running. it doesnt complaint for
uninstall and thus it uninstalls the application while server applicaiton is
still running. As i create a mutex in applicaiton startup to check wherether
applicaiton is running or not . Hence when user install again the server
(note that server is still running even after uinstall) and runs the program
it says applcation is already running.

How can i assure that either it should not uninstall the applicaiton or it
should close the server applicaiton.

Thanks
Anil
--
Anil Kumar Sharma
(Project Lead)
India

May 25 '06 #2
About your first query, the "default" state of a button is defined at buttons
creation time. Regarding win32 api (CreateWindow - Button Styles), it might
be possible but with some tricks. You can ask a control to recreate himself
(might need to derive the class to access needed method to use SetStyle and
UpdateStyles).

Hope it helps.
"Anil Kumar Sharma" wrote:
Hello,

I am working on C# using vs.net 2003. I have faced two interesting
problems.

1. Dynamically setting Default Button:
I created a form and used it in various contexts. On basis of the context,
the panel of a form which contains various buttons , are shown or hides. Now
at design time i set the default button property to one of button. But when
the form object is created in different context and set visibilty of default
one false while some other buttons is/are visible then no one has default
button. My main form is basically a derived form from a control called
TD.SandDock.DockControl. Now on function which is called before display the
form but after creating its object, set the buttons , where i need to set the
default button as well. But i find no helper function/property to do so! How
can i achieve the same.

I cant set the default button to be appear on there (& set its
text) ,as its click event process is completely differ.

2. I created a small server application which basically listen on a port
for its client. Its GUI is absent and its only appear in taskbar icon(with
right click menu). One interesting thing i note is that this
applicaiton(.net) when uninstalled (installer is created using default .net
installation) while the applicaiton running. it doesnt complaint for
uninstall and thus it uninstalls the application while server applicaiton is
still running. As i create a mutex in applicaiton startup to check wherether
applicaiton is running or not . Hence when user install again the server
(note that server is still running even after uinstall) and runs the program
it says applcation is already running.

How can i assure that either it should not uninstall the applicaiton or it
should close the server applicaiton.

Thanks
Anil
--
Anil Kumar Sharma
(Project Lead)
India

May 25 '06 #3
Hi sebastieng,
Thanks for kind and prompt reply. But you see, when creating installer
in .net build in installer, i cant find a way to code in it (as we do in
install shield). Thats why my application creates a mutex and checks the
other instance of same applicaiton. So my server application wont run twice
in any case. In code i can do this but when insataller of .net is in picture,
its look tough to go through it.
To be straight how can in installer i check for it. For other application
, one can not delete/uninstall the application while its running. But
surprisingly my server application exe can be deleted and hence uninstalled
even when its running.
Thanks again.
Anil

--
Anil Kumar Sharma
(Project Lead)
India
"sebastieng" wrote:
You might use Process.GetProcessByName to obtain a list of processes having
the same name. If it's existing, sounds like it's running.

"Anil Kumar Sharma" wrote:
Hello,

I am working on C# using vs.net 2003. I have faced two interesting
problems.

1. Dynamically setting Default Button:
I created a form and used it in various contexts. On basis of the context,
the panel of a form which contains various buttons , are shown or hides. Now
at design time i set the default button property to one of button. But when
the form object is created in different context and set visibilty of default
one false while some other buttons is/are visible then no one has default
button. My main form is basically a derived form from a control called
TD.SandDock.DockControl. Now on function which is called before display the
form but after creating its object, set the buttons , where i need to set the
default button as well. But i find no helper function/property to do so! How
can i achieve the same.

I cant set the default button to be appear on there (& set its
text) ,as its click event process is completely differ.

2. I created a small server application which basically listen on a port
for its client. Its GUI is absent and its only appear in taskbar icon(with
right click menu). One interesting thing i note is that this
applicaiton(.net) when uninstalled (installer is created using default .net
installation) while the applicaiton running. it doesnt complaint for
uninstall and thus it uninstalls the application while server applicaiton is
still running. As i create a mutex in applicaiton startup to check wherether
applicaiton is running or not . Hence when user install again the server
(note that server is still running even after uinstall) and runs the program
it says applcation is already running.

How can i assure that either it should not uninstall the applicaiton or it
should close the server applicaiton.

Thanks
Anil
--
Anil Kumar Sharma
(Project Lead)
India

May 25 '06 #4

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

Similar topics

4
by: Naresh | last post by:
I have Windows 2000 advanced server with SP4 installed. I also have Biztalk Server 2004 installed. I am using VS.NET 2003. I create any class library without setting any additional external...
2
by: MLH | last post by:
I would like to allow users to set, as an application default, a specific printer to send reports to. I don't know how to bring up a list of valid print devices in A97, nor do I know how to...
8
by: Bern McCarty | last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains other than the default AppDomain? Is there any means at all of doing this? Mixed-mode is incredibly convenient, but if I...
1
by: bruce | last post by:
hi.. i'm trying to figure out how to uninstall "mechanize". i don't see an "unistall" from the "python --help-commands" function... i'm looking to rebuild/reinstall mechanize from the svn...
5
by: siggi | last post by:
Hi all, installing a package with 'setup.py' is easy. But how do I uninstall the package, once I want to get rid of it again? Thanks, siggi
0
by: =?Utf-8?B?bmVlcmFqYkBub2lkYS5ub3NwYW1oY2x0ZWNoLmNv | last post by:
Hi, We have created new .NET web service and running it through the default test page and it's working fine in our development environment. When we moved the web service to the acceptance...
7
by: Norman Diamond | last post by:
A project depends on VC runtime from Visual Studio 2005 SP1, and DotNet Framework 2. Options are set in the setup project properties, so if these two dependencies are not already installed then...
0
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
5
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.