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

Way is my program still running after i have pressed the X on the form?

I am using Win XP and when I exit my program by clicking the X it locks like
it is closed but if I check the Activity Handler( I don't know the right
English word for it) it is still there under program...

Do I need to do anything in the code handle the shut down?

Yours, Jonas
Jul 17 '05 #1
8 3983
> I am using Win XP and when I exit my program by clicking the X it locks like
it is closed but if I check the Activity Handler( I don't know the right
English word for it) it is still there under program... The name of it Task Manager, but you're so close!
Do I need to do anything in the code handle the shut down?

Not unless you have things still running in your program. The program does not
close if it has code still executing, such as an open form, API commands which
are still processing (or haven't been 'closed'), Timer controls still running,
etc.
If you do have such bits running, use the Query_Unload event to somehow stop
them by some form of global variable (Such as haltEverything = True) which is
checked in these other subroutines (If haltEverything = True Then Exit Sub or
whatever) which causes a mass close down of the program, then clear if need be
(delete temporary files, set variables to Empty, etc).
When the program then issues it's final command, hopefully the program will end.
However, after a clear up, I still use the End command to ensure everything else
ends (Some people would disagree).

Hope this helps, and hope it makes sense.

--
QuickHare
(QuickHare "at" Hotmail "dot" com)
Jul 17 '05 #2
You still have a reference in use. Post the precise code you use to show
the form, the code you use to close it, as well as any code in the
queryunload, unload and terminate events.

--

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"BadOmen" <ba*******@hotmail.com> wrote in message
news:n7********************@newsb.telia.net...
: I am using Win XP and when I exit my program by clicking the X it locks
like
: it is closed but if I check the Activity Handler( I don't know the right
: English word for it) it is still there under program...
:
: Do I need to do anything in the code handle the shut down?
:
: Yours, Jonas
:
:
Jul 17 '05 #3
thanx
I had to unload a form that I use to display what button is pressed on a
remote control, I am just making it visible true or false to show the button
pressed.
Now it works as it should. :-)

Just out of curiosity:

I am using some API's and a Timer.

My API's are mostly about getting foreground window and SendInput and
setting some window positions.
Can you give me some examples when I have to close an API?
And how to close??

The timer makes the form that displays the button pressed to show just 3 sec
and then go invisible.
When do I need to disable a time control?

I am just about to learn VB :)


"QuickHare" <Qu*******@Hotmail.c> skrev i meddelandet
news:c1*************@athena.ex.ac.uk...
I am using Win XP and when I exit my program by clicking the X it locks like it is closed but if I check the Activity Handler( I don't know the right
English word for it) it is still there under program... The name of it Task Manager, but you're so close!


I will try to remember that :)
Do I need to do anything in the code handle the shut down? Not unless you have things still running in your program. The program does

not close if it has code still executing, such as an open form, API commands which are still processing (or haven't been 'closed'), Timer controls still running, etc.
If you do have such bits running, use the Query_Unload event to somehow stop them by some form of global variable (Such as haltEverything = True) which is checked in these other subroutines (If haltEverything = True Then Exit Sub or whatever) which causes a mass close down of the program, then clear if need be (delete temporary files, set variables to Empty, etc).
When the program then issues it's final command, hopefully the program will end. However, after a clear up, I still use the End command to ensure everything else ends (Some people would disagree).

Hope this helps, and hope it makes sense.

--
QuickHare
(QuickHare "at" Hotmail "dot" com)

Jul 17 '05 #4
On Thu, 26 Feb 2004 23:51:27 GMT, "BadOmen" <ba*******@hotmail.com>
wrote:
thanx
I had to unload a form that I use to display what button is pressed on a
remote control, I am just making it visible true or false to show the button
pressed.
Now it works as it should. :-)

Just out of curiosity:

I am using some API's and a Timer.

My API's are mostly about getting foreground window and SendInput and
setting some window positions.
Can you give me some examples when I have to close an API?
And how to close??

The timer makes the form that displays the button pressed to show just 3 sec
and then go invisible.
When do I need to disable a time control?

I am just about to learn VB :)


In the Query_Unload event
put Timer1.Enabled = False

I am not sure what you mean by 'closing an API'
Jul 17 '05 #5
> >My API's are mostly about getting foreground window and SendInput and
setting some window positions.
Can you give me some examples when I have to close an API?
And how to close??


I am not sure what you mean by 'closing an API'


I'm sorry. I coined the phrase. What I meant was that some APIs prefer to be
'closed', eg. Registry commands or video streaming APIs. These require to close
the Registry, video stream, file, etc so that Windows can release the memory or
unlock files, etc.
You can spot these APIs by the fact you must use one to open something, another
to use the feature, then use a final API to close and finish with the feature.

Put simply, if you don't use something which states you must close it after use,
then no need to worry.
Sorry if my meaning was unclear. I was a tiring night...

--
QuickHare
(QuickHare "at" Hotmail "dot" com)
Jul 17 '05 #6
On Fri, 27 Feb 2004 22:20:40 -0000, "QuickHare" <Qu*******@Hotmail.c>
wrote:
>My API's are mostly about getting foreground window and SendInput and
>setting some window positions.
>Can you give me some examples when I have to close an API?
>And how to close??


I am not sure what you mean by 'closing an API'


I'm sorry. I coined the phrase. What I meant was that some APIs prefer to be
'closed', eg. Registry commands or video streaming APIs. These require to close
the Registry, video stream, file, etc so that Windows can release the memory or
unlock files, etc.
You can spot these APIs by the fact you must use one to open something, another
to use the feature, then use a final API to close and finish with the feature.

Put simply, if you don't use something which states you must close it after use,
then no need to worry.


Ah, I see what you mean
- files are no problem
- not sure about the rest ... interesting ...
Jul 17 '05 #7
Thanx guys!

Now you have cleared up some things for me :)

Yours, Jonas

"J French" <er*****@nowhere.com> skrev i meddelandet
news:40****************@news.btclick.com...
On Fri, 27 Feb 2004 22:20:40 -0000, "QuickHare" <Qu*******@Hotmail.c>
wrote:
>My API's are mostly about getting foreground window and SendInput and
>setting some window positions.
>Can you give me some examples when I have to close an API?
>And how to close??

I am not sure what you mean by 'closing an API'


I'm sorry. I coined the phrase. What I meant was that some APIs prefer to be'closed', eg. Registry commands or video streaming APIs. These require to closethe Registry, video stream, file, etc so that Windows can release the memory orunlock files, etc.
You can spot these APIs by the fact you must use one to open something, anotherto use the feature, then use a final API to close and finish with the feature.
Put simply, if you don't use something which states you must close it after use,then no need to worry.


Ah, I see what you mean
- files are no problem
- not sure about the rest ... interesting ...

Jul 17 '05 #8
Thanx but I have got the answers I need already :)

"Randy Birch" <rg************@mvps.org> skrev i meddelandet
news:Vj*******************@news04.bloor.is.net.cab le.rogers.com...
You still have a reference in use. Post the precise code you use to show
the form, the code you use to close it, as well as any code in the
queryunload, unload and terminate events.

--

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"BadOmen" <ba*******@hotmail.com> wrote in message
news:n7********************@newsb.telia.net...
: I am using Win XP and when I exit my program by clicking the X it locks
like
: it is closed but if I check the Activity Handler( I don't know the right
: English word for it) it is still there under program...
:
: Do I need to do anything in the code handle the shut down?
:
: Yours, Jonas
:
:

Jul 17 '05 #9

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

Similar topics

15
by: shyren | last post by:
Hi All, I have a php program which calls a c++ program using exec. However when user presses stop button in the browser or closes it this program keeps on running on the server. How can I stop it...
3
by: John Cho | last post by:
/* This program is a database program that will store video tape names, minutes, year released, and price I want it to be professional so that *YOU* will want to buy it and use it for a video...
16
by: deko | last post by:
I have a sub routine that searches the Outlook PST for a message sent to/from a particular email address. Obviously, this can take a long time when the PST contains thousands of messages. I'd...
8
by: dixie | last post by:
I want to run an event when I press the Ctl key simultaneously with the K key. How do I achieve this in VBA? dixie
10
by: Amit Nath | last post by:
Hi! I am running a C program and need to pause the program and change some of the variables. Is there any function that checks if there is a character in the Standard Input Buffer, else the...
8
by: koorb | last post by:
I am starting a program from a module with the Sub main procedure and I want it to display two forms for the program's interface, but when I run the program both forms just open and then program...
19
by: darrel | last post by:
On my vb.net page, I have 4 sets of inputs + form buttons. example: Search: (GO) Zip: (GO) County: (GO) County: (GO) The problem is if I go to the page, type in a zip code, and hit...
4
by: garyusenet | last post by:
Hi. I am trying to learn about array lists, and found an example on MSDN. I tried to compile it but it's not producing any output. I can't see why. Any ideas? Here is what I did. 1....
3
by: prileep | last post by:
Hi, If i enable and display a Form in my application i will get the events like form_keydown() , form_keypressed(). But here the form willl not be activated, even it will not be visible but...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...

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.