|
|
ÀÛ¼ºÀÏ : 13-02-22 14:36
±Û¾´ÀÌ :
±Ç¿ÀÁØ
Á¶È¸ : 2,743
|
FUNCTION KillExcel()
LOCAL hWnd := GetDesk32()
LOCAL aWnd := {}
LOCAL nCounter := 0
LOCAL aVisible := {}
LOCAL pID := 0
LOCAL cTitle := ""
cTitle := "MICROSOFT EXCEL"
hWnd := GetTopWindow32 ( hWnd )
aadd ( aWnd, hWnd )
IF IsWndVisible ( hWnd )
aadd ( aVisible, hWnd )
ENDIF
WHILE .T.
hWnd := GetWindow32 ( hWnd, 2 )
IF ASCAN ( aWnd, hWnd ) <> 0
exit
ENDIF
// IF IsWndVisible ( hWnd )
aadd ( aVisible, hWnd )
IF cTitle $ UPPER( GetWindowText( hWnd ) )
GetWindowThreadProcessId( hWnd, @pID )
DR_TERMINATE( pID )
ENDIF
// ENDIF
aadd ( aWnd, hWnd )
ENDDO
RETURN NIL
DLL32 FUNCTION GetDesk32() AS LONG PASCAL FROM "GetDesktopWindow" LIB "user32.dll"
DLL32 FUNCTION GetWindow32( hWnd AS LONG, nCmd AS LONG ) AS LONG PASCAL FROM "GetWindow" LIB "user32.dll"
DLL32 FUNCTION GetTopWindow32( hWnd AS LONG ) AS LONG PASCAL FROM "GetTopWindow" LIB "user32.dll"
DLL32 FUNCTION IsWndVisible( hWnd AS LONG ) AS BOOL PASCAL FROM "IsWindowVisible" LIB "user32.dll"
DLL32 FUNCTION GetWindowThreadProcessId( hWnd AS LONG, @pID AS LONG ) AS LONG PASCAL FROM "GetWindowThreadProcessId" LIB "user32.dll"
|
|
|
³»¿ëÀº ExcelÀÔ´Ï´Ù.
|
|
|
|
|
|
|