Konu: windows ta çalışan programa mudahele
arkadaşlar vfp içerisinden o anda çalışan başka bir programı kapata bilirmiyim (örnegin winamp programını veya mediaplayer gibi ) birde sesi nasıl kapatıp açabilirim
Giriş yapmadınız. Lütfen giriş yapın yada kayıt olun.
arkadaşlar vfp içerisinden o anda çalışan başka bir programı kapata bilirmiyim (örnegin winamp programını veya mediaplayer gibi ) birde sesi nasıl kapatıp açabilirim
bilgisi olan yokmu
bilgisayarı kapatmayı yazmıştık ancak tek proramı kapatma ihtiyacım hiç olmadı. Bilmediğim konuda hiç fikir yürütmek istemem ama madem sordun, ben olsam aşağıdaki yolları denemekle başlardım diyelim:
Shellexecute komutunu "open" ile verip dış programı çalıştırıyorsak, "close" komutu ile kapatacağımızı düşünüyorum. Çetin B. bu konuda bizi keskin bir şekilde aydınlatabilir.
Başkaca aşağıdaki komut var, yalnız handle sözcüğünü hep file işlemlerinde kullanırdık, açıklamada 'job'u başka bir exe program olarak anlıyorum. Lütfen sen dene, bizi de bilgilendir
DECLARE INTEGER CloseHandle IN kernel32 ;
INTEGER hObject
açıklaması:
The CloseHandle function closes handles to the following objects:
- Access token
- Communications device
- Console input
- Console screen buffer
- Event
- File
- File mapping
- Job
- Mailslot
- Mutex
- Named pipe
- Process
- Semaphore
- Socket
- Thread
CloseHandle invalidates the specified object handle, decrements the object's handle count, and performs object retention checks. After the last handle to an object is closed, the object is removed from the system.
Closing a thread handle does not terminate the associated thread. To remove a thread object, you must terminate the thread, then close all handles to the thread.
Use CloseHandle to close handles returned by calls to the CreateFile function. Use FindClose to close handles returned by calls to FindFirstFile.
MAPI: For more information, see Syntax and Limitations for Win32 Functions Useful in MAPI Development
PROCEDURE CloseApplication(tnHwnd)
#define WM_CLOSE 0x0010
#define WM_QUERYENDSESSION 0x0011
#define WM_QUIT 0x0012
DECLARE integer SendMessage IN user32.dll ;
integer hWnd,;
integer Msg, ;
integer wParam, ;
integer lParam
SendMessage(m.tnHwnd,WM_CLOSE,0,0)
endproc
Ancak bu nezaket yontemi. Buna cevap verip kapanmayabilir (değişikleri saklamak istiyor msunuz gibisinden dialog gerektiyse). O zaman TerminateProcess kullan.