473,288 Members | 1,726 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,288 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 3980
> 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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
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: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
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: 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...

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.