Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Close a running program

Author
Message
Shady Simpson
23
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 20th Apr 2003 18:49
Hi,(again)

Does anyone know how to close a program that is already running?
Like close Internet Explorer through a command in DarkBasic?

Thanx.
roswell
23
Years of Service
User Offline
Joined: 17th Dec 2002
Location: United States
Posted: 20th Apr 2003 18:53 Edited at: 20th Apr 2003 18:53
Um...actually, I don't know of a way to control the kernel processes on the system through DBPro.

/* You are not expected to understand this. */

Dual Athlon 2.0/1GB RAM/GeForce Ti4200-128/Win2000 Pro
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Apr 2003 23:25
Actually, it can be done - MrTAToad did a plugin to allow you to send messages to another program ( suprise! ) and I have some DBPro code that can do the same job.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th Apr 2003 23:33
I did that with VB a while back - I switched to the app using it's task manager and forced an exit using sendkeys.

However, this might exit the program untidily - so why not have a trigger file that is checked periodically. Like a file named Close.no, then any external program could rename it, which your program could pick up and exit neatly. Just rename it to .no everytime the program boots.


Van-B
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Apr 2003 23:39
I would maybe do it your way myself if the program I wanted to terminate was written by me, but you can't do that with IE for example.
solo
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Israel
Posted: 21st Apr 2003 00:22
helpful article for C++ users:
http://msdn.microsoft.com/msdnmag/issues/02/08/CQA/default.aspx

search the page for the word "outlook" ,there is a good explanation on this one.

[solo]

Shady Simpson
23
Years of Service
User Offline
Joined: 15th Mar 2003
Location: United Kingdom
Posted: 21st Apr 2003 00:30
Ian, could you put the DBPro code up please?

Thanx.

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Apr 2003 13:42
Here's the code I have ATM



You need to know the window title or window class name or both at the moment I'm afraid. I will be following up on Solo's post to find out how to trace an app by executable name.

Login to post a reply

Server time is: 2026-07-11 22:25:15
Your offset time is: 2026-07-11 22:25:15