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
Printable View
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
well, this is the only way i know how to do it.
hope it helps :)Code:appactivate "[the program's caption]"
sendkeys "%{F4}", true
------------------
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
I need more of a way to 'force it'.
------------------
DiGiTaIErRoR
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.