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

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.getprocessesbyname("apptoclose"). The use the closemainwindow
function.

This does get a reference to the process. The closemainwindow does not
work. I checked and the mainwindowhandle 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 "showintaskbar" 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 "showintaskbar" 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.closemainwindow. 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 "showintaskbar" option is set to
false.

Any thoughts?

--
Danny
Jan 22 '06 #1
2 4879
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***@newsgroup.nospam> schreef in bericht
news:84**********************************@microsof t.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.getprocessesbyname("apptoclose"). The use the closemainwindow
function.

This does get a reference to the process. The closemainwindow does not
work. I checked and the mainwindowhandle 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 "showintaskbar" 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 "showintaskbar" 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.closemainwindow. 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 "showintaskbar" 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***@newsgroup.nospam> schreef in bericht
news:84**********************************@microsof t.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.getprocessesbyname("apptoclose"). The use the closemainwindow
function.

This does get a reference to the process. The closemainwindow does not
work. I checked and the mainwindowhandle 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 "showintaskbar" 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 "showintaskbar" 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.closemainwindow. 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 "showintaskbar" 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
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...
12
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...
0
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...
3
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
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...
4
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...
6
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...
2
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...
1
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.