473,770 Members | 5,569 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

stopping a process

I have converted serveral vb6 applications to vb.net. One of these
applications originally would stop one of my applications by using the
findwindow api and using the sendmessage api to close the app.

I thought it would be easy enough to convert that api call to use the
process class. I can get the process by woProcess() =
process.getproc essesbyname("ap ptoclose"). The use the closemainwindow
function.

This does get a reference to the process. The closemainwindow does not
work. I checked and the mainwindowhandl e is zero and the mainwindowtitle is
blank. As best as I can tell the reason that they are blank is due to the
fact that I have set the "showintask bar" to false in the application that I
want to close. (When it shows in the task bar, it works.)

The application that I want to close is running in the systemtray. I set
the showintaskbar to false just like I did for my vb6 application. No
differences there.

Is there a way to request this application to close from vb.net without
using api? I don't want to use the kill option. That leaves the icon in the
system tray.

I put my original findwindow api back in the application that wants to close
the one in the system tray. It does not find the application. I think the
reason for it not working now is the fact that "showintask bar" set to false
removes the application from the task manager's application tab. The vb6
application shows in the application tab and the processes tab. The vb.net
application only shows in the process tab.

It is interesting to note that my vb.net application will close the vb6
system tray application by using process.closema inwindow. It however will
not close the same vb.net system tray app. It appears as though the vb.net
app does not have a main window when the "showintask bar" option is set to
false.

Any thoughts?

--
Danny
Jan 22 '06 #1
2 4896
Danny,

If you use in a windowforms application in the mainform "me.close" and you
did use only managed code and no unmanaged resources.

Than your program will nicely close and everything will be cleaned.

(Try to make your newsgroup messages shorter. It gives you more change on a
answer. If somebody don't understand you, than he will tell that)

I hope this helps,

Cor

"Danny" <da***@newsgrou p.nospam> schreef in bericht
news:84******** *************** ***********@mic rosoft.com...
I have converted serveral vb6 applications to vb.net. One of these
applications originally would stop one of my applications by using the
findwindow api and using the sendmessage api to close the app.

I thought it would be easy enough to convert that api call to use the
process class. I can get the process by woProcess() =
process.getproc essesbyname("ap ptoclose"). The use the closemainwindow
function.

This does get a reference to the process. The closemainwindow does not
work. I checked and the mainwindowhandl e is zero and the mainwindowtitle
is
blank. As best as I can tell the reason that they are blank is due to the
fact that I have set the "showintask bar" to false in the application that
I
want to close. (When it shows in the task bar, it works.)

The application that I want to close is running in the systemtray. I set
the showintaskbar to false just like I did for my vb6 application. No
differences there.

Is there a way to request this application to close from vb.net without
using api? I don't want to use the kill option. That leaves the icon in
the
system tray.

I put my original findwindow api back in the application that wants to
close
the one in the system tray. It does not find the application. I think
the
reason for it not working now is the fact that "showintask bar" set to
false
removes the application from the task manager's application tab. The vb6
application shows in the application tab and the processes tab. The
vb.net
application only shows in the process tab.

It is interesting to note that my vb.net application will close the vb6
system tray application by using process.closema inwindow. It however will
not close the same vb.net system tray app. It appears as though the
vb.net
app does not have a main window when the "showintask bar" option is set to
false.

Any thoughts?

--
Danny

Jan 23 '06 #2
Cor,
The system tray application will close if I click on the X associated
with it's window. It uses all managed resources. I am trying to close it
from a second application without using unmanaged api.
--
Danny
"Cor Ligthert [MVP]" wrote:
Danny,

If you use in a windowforms application in the mainform "me.close" and you
did use only managed code and no unmanaged resources.

Than your program will nicely close and everything will be cleaned.

(Try to make your newsgroup messages shorter. It gives you more change on a
answer. If somebody don't understand you, than he will tell that)

I hope this helps,

Cor

"Danny" <da***@newsgrou p.nospam> schreef in bericht
news:84******** *************** ***********@mic rosoft.com...
I have converted serveral vb6 applications to vb.net. One of these
applications originally would stop one of my applications by using the
findwindow api and using the sendmessage api to close the app.

I thought it would be easy enough to convert that api call to use the
process class. I can get the process by woProcess() =
process.getproc essesbyname("ap ptoclose"). The use the closemainwindow
function.

This does get a reference to the process. The closemainwindow does not
work. I checked and the mainwindowhandl e is zero and the mainwindowtitle
is
blank. As best as I can tell the reason that they are blank is due to the
fact that I have set the "showintask bar" to false in the application that
I
want to close. (When it shows in the task bar, it works.)

The application that I want to close is running in the systemtray. I set
the showintaskbar to false just like I did for my vb6 application. No
differences there.

Is there a way to request this application to close from vb.net without
using api? I don't want to use the kill option. That leaves the icon in
the
system tray.

I put my original findwindow api back in the application that wants to
close
the one in the system tray. It does not find the application. I think
the
reason for it not working now is the fact that "showintask bar" set to
false
removes the application from the task manager's application tab. The vb6
application shows in the application tab and the processes tab. The
vb.net
application only shows in the process tab.

It is interesting to note that my vb.net application will close the vb6
system tray application by using process.closema inwindow. It however will
not close the same vb.net system tray app. It appears as though the
vb.net
app does not have a main window when the "showintask bar" option is set to
false.

Any thoughts?

--
Danny


Jan 23 '06 #3

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

Similar topics

2
1439
by: UJ | last post by:
I've got a program that will do some updates to the system. During that time, if a certain program, called a.exe is running, I want to stop the program, do what I need to do and restart the program. How can I find out if a.exe is currently running and stop it? TIA - UJ.
12
6084
by: VMI | last post by:
My Windows form has two buttons: "Start" and "Stop". How can I stop the form from doing whatever it is doing without closing the whole application? The "Stop" button would have to stop a process that's being run in another class, not from within the form. Thanks.
0
1427
by: Glen Wolinsky | last post by:
I am creating a Windows service that will check a request queue (database) for pending requests. It will then process each individual request until completed, wait a set time interval and then move on to the next one in the list. The processing routine could take 1-2 minutes to finish processing one request. My question is this: If the service is stopped while the process routine is running, how can I make sure the processing of that...
3
1031
by: Husam | last post by:
Hi EveryBody: How can I get the process by its name and stop it ? Any help will be appreciate regard's Husam
6
8119
by: D | last post by:
I have a simple file server utility that I wish to configure as a Windows service - using the examples of the Python Win32 book, I configured a class for the service, along with the main class functions __init__, SvcStop, and SvcDoRun (which contains my server code). After registering the service, I am able to start it with no problems. However, it never stops correctly (net stop returns "service could not be stopped") and service is left...
4
2043
by: bjm | last post by:
I am writing a program that will automate a series of application installations. I want to give the user the option of stopping the program's execution in between installations (for example, give the user the chance to stop the program after the second installation before it continues on to the third installation). However, I want the user to be able to start the installations and walk away as well, so I can't ask the user if he wants to...
6
1454
by: Ed Bitzer | last post by:
You have taught me how to start another program using System.Diagnostics.Process.Start and suggested a good tip site and Google search for future reference. My problem now is how to stop that program I started. Even if I close my main program this program remains listed in the Task Manager. I promise you I searched but using words like end, stop, close found me lots of information but not my specific need. Appreciate if you would help...
2
3369
by: Steve | last post by:
Hi All, I've been trying to come up with a good way to run a certain process at a timed interval (say every 5 mins) using the SLEEP command and a semaphore flag. The basic thread loop was always sitting in the sleep command and not able to be interrupted. When the time came to set the semaphore flag to false (stopping the thread), my program would have to wait up to the entire sleep time to break out of the loop. I have finally found...
1
2535
by: raghudr | last post by:
Hi all, I am displaying a splash screen for which i have created a thread.Since my whole project is launched by windows service and that service will start automatically at the start of the PC and sometimes when i start or restart the PC i have observed that even though the long process is completed splash
0
9592
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10231
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10005
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6679
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.