|
-
Jan 22nd, 2000, 10:58 AM
#1
Thread Starter
So Unbanned
Easiest way of putting this is like the Control+Alt+Delete menu where you can 'End Task' a program I want to do this same thing in VB.
Thanks in advance.
------------------
DiGiTaIErRoR
-
Jan 22nd, 2000, 05:36 PM
#2
Lively Member
well, this is the only way i know how to do it.
Code:
appactivate "[the program's caption]"
sendkeys "%{F4}", true
hope it helps 
------------------
Charlie Jacquez
16 Year Old Software Developer
Email: [email protected]
Web: CJWARES Online
AIM: CJWARES, SlimmShadee2000, or BIOSzapper
ICQ: 58493454
I program: Basic, Visual Basic, HTML, and TI-Calculators
My System Specs: Click here
-
Jan 22nd, 2000, 05:53 PM
#3
Thread Starter
So Unbanned
I need more of a way to 'force it'.
------------------
DiGiTaIErRoR
-
Jan 22nd, 2000, 07:21 PM
#4
Hyperactive Member
There are two ways to force an application.
At first, try
Const NILL = 0&
Const WM_SYSCOMMAND = &H112
Const SC_CLOSE = &HF060
lpClassName$ = "SciCalc"
lpCaption$ = "Calculator"
'* Determine the handle to the Calculator window.
Handle = FindWindow(lpClassName$, lpCaption$)
'* Post a message to Calc to end it's existence.
X& = SendMessage(Handle, WM_SYSCOMMAND, SC_CLOSE, NILL)
' Enter each of the following Declare statements on one, single line:
Declare Function FindWindow% Lib "user" (ByVal lpClassName As Any,
ByVal lpCaption As Any)
Declare Function SendMessage& Lib "user" (ByVal hwnd%, ByVal wMsg%,
ByVal wParam%, ByVal lParam As Long)
----------------remarks: if you don't know the ClassName, use vbNullString-----------
I can't find the second method at the moment, I will look up and write you.
PS: There is a small group of programs (e.g. Acces) that won't end.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|