Açık Pencereleri Kapatmak - Vb6 Dersleri [ BigFear ] - Google Fan Webmaster Forum
Google Fan Webmaster Forum  
herşeyi sana yazdım

Geri git   Google Fan Webmaster Forum > Genel Programlama > Programlama
KEY
Kayıt ol Articles Sosyal Gruplar Forumları Okundu Kabul Et

Programlama C ++ , C # , COMPONENT, DELPHI , FLASH, JAVA - JSP, VISUAL BASIC ,VISUAL BASIC.NET ,WML, XML

Cevapla
 
LinkBack Seçenekler
  1  
Alt 02-02-2012, 13:06:55
Üyeliği durduruldu
 
Standart Açık Pencereleri Kapatmak - Vb6 Dersleri [ BigFear ]

1.Yol Görev yöneticisiymis gibi kapattırmak.

ad.exe yerine kapatmasını istedigin program ismi.


2.Yol

En Başa Bunu Yaz
Dim Komut As New AutoItX3Lib.AutoItX3

Daha Sonra
Autoıtx3.dll dosyasını okuttur.

Button oluştur icine sunu yaz.

PHP- Kodu:
komut.ProcessClose("Uygulama.exe"
uygulama.exe yerine kapatılacak programın ismini yaz.


3.Yol

modul'e yazılacak kısım

PHP- Kodu:
Option Explicit

Private Declare Function Process32First Lib "kernel32" (ByVal hSnapshot As Longlppe As PROCESSENTRY32) As Long
Private Declare Function Process32Next Lib "kernel32" (ByVal hSnapshot As Longlppe As PROCESSENTRY32) As Long
Private Declare Function CloseHandle Lib "Kernel32.dll" (ByVal Handle As Long) As Long
Private Declare Function OpenProcess Lib "Kernel32.dll" (ByVal dwDesiredAccessas As LongByVal bInheritHandle As LongByVal dwProcId As Long) As Long
Private Declare Function EnumProcesses Lib "psapi.dll" (ByRef lpidProcess As LongByVal cb As LongByRef cbNeeded As Long) As Long
Private Declare Function GetModuleFileNameExA Lib "psapi.dll" (ByVal hProcess As LongByVal hModule As LongByVal ModuleName As StringByVal nSize As Long) As Long
Private Declare Function EnumProcessModules Lib "psapi.dll" (ByVal hProcess As LongByRef lphModule As LongByVal cb As LongByRef cbNeeded As Long) As Long
Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As LongByVal th32ProcessID As Long) As Long
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As LongByVal uExitCode As Long) As Long

Private Type PROCESSENTRY32
dwSize 
As Long
cntUsage 
As Long
th32ProcessID 
As Long
th32DefaultHeapID 
As Long
th32ModuleID 
As Long
cntThreads 
As Long
th32ParentProcessID 
As Long
pcPriClassBase 
As Long
dwFlags 
As Long
szExeFile 
As String 260
End Type

Private Type OSVERSIONINFO
dwOSVersionInfoSize 
As Long
dwMajorVersion 
As Long
dwMinorVersion 
As Long
dwBuildNumber 
As Long
dwPlatformId 
As Long
szCSDVersion 
As String 128
End Type

Private Const PROCESS_TERMINATE = &H1
Private Const VER_PLATFORM_WIN32_WINDOWS 1
Private Const PROCESS_QUERY_INFORMATION 1024
Private Const PROCESS_VM_READ 16
Private Const TH32CS_SNAPPROCESS = &H2

Private Function CheckVersion() As Long
Dim tOS 
As OSVERSIONINFO
tOS
.dwOSVersionInfoSize Len(tOS)
Call GetVersionEx(tOS)
CheckVersion tOS.dwPlatformId
End 
Function

Private Function 
GetEXEProcessID(ByVal sEXE As String) As Long
Dim aPID
() As Long
Dim lProcesses 
As Long
Dim lProcess 
As Long
Dim lModule 
As Long
Dim sName 
As String
Dim iIndex 
As Integer
Dim bCopied 
As Long
Dim lSnapShot 
As Long
Dim tPE 
As PROCESSENTRY32
Dim bDone 
As Boolean

If CheckVersion() = VER_PLATFORM_WIN32_WINDOWS Then
'Windows 9x
'
Create a SnapShot of the Currently Running Processes
lSnapShot 
CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS0)
If 
lSnapShot 0 Then Exit Function
tPE.dwSize Len(tPE)
'Buffer the First Processes Info..
bCopied = Process32First(lSnapShot, tPE)
Do While bCopied
'
While there are Processes List them..
sName Left$(tPE.szExeFileInStr(tPE.szExeFileChr(0)) - 1)
sName Mid(sNameInStrRev(sName"\") + 1)
If InStr(sName, Chr(0)) Then
sName = Left(sName, InStr(sName, Chr(0)) - 1)
End If
bCopied = Process32Next(lSnapShot, tPE)
If StrComp(sEXE, sName, vbTextCompare) = 0 Then
GetEXEProcessID = tPE.th32ProcessID
Exit Do
End If
Loop

Else
'Windows NT
'The EnumProcesses Function doesn't indicate how many Process there are,
'so you need to pass a large array and trim off the empty elements
'as cbNeeded will return the no. of Processes copied.
ReDim aPID(255)
Call EnumProcesses(aPID(0), 1024, lProcesses)
lProcesses = lProcesses / 4
ReDim Preserve aPID(lProcesses)

For iIndex = 0 To lProcesses - 1
'Get the Process Handle, by Opening the Process
lProcess = OpenProcess(PROCESS_QUERY_INFORMATION Or PROCESS_VM_READ, 0, aPID(iIndex))
If lProcess Then
'Just get the First Module, all we need is the Handle to get
'the Filename..
If EnumProcessModules(lProcess, lModule, 4, 0&) Then
sName = Space(260)
Call GetModuleFileNameExA(lProcess, lModule, sName, Len(sName))
If InStr(sName, "
\") > 0 Then
sName = Mid(sName, InStrRev(sName, "
\") + 1)
End If
If InStr(sName, Chr(0)) Then
sName = Left(sName, InStr(sName, Chr(0)) - 1)
End If
If StrComp(sEXE, sName, vbTextCompare) = 0 Then
GetEXEProcessID = aPID(iIndex)
bDone = True
End If
End If
'Close the Process Handle
CloseHandle lProcess
If bDone Then Exit For
End If
Next
End If
End Function

Public Function TerminateEXE(ByVal sEXE As String) As Boolean
Dim lPID As Long
Dim lProcess As Long

lPID = GetEXEProcessID(sEXE)
If lPID = 0 Then Exit Function
lProcess = OpenProcess(PROCESS_TERMINATE, 0, lPID)
Call TerminateProcess(lProcess, 0&)
Call CloseHandle(lProcess)

TerminateEXE = True
End Function 

bunlarda forma yazılacak :

PHP- Kodu:
Dim blnRet As Boolean
blnRet 
TerminateEXE("notepad.exe")
If 
Not blnRet Then
MsgBox 
"kapatamadim"
End if 
Alıntı ile Cevapla
  2  
Alt 02-02-2012, 18:32:03
 
Standart

VB 6 mı kaldı, paylaşım yapıp forumu doldurma bence.
__________________
BigCodeR
Alıntı ile Cevapla
  3  
Alt 02-02-2012, 18:33:01
 
Standart

bende ona bakiyordum, vb6 yazmayali sanirim 10 sene olmustur..
__________________
BotExtra Yuzlerce tam otomatik akilli bot
Alıntı ile Cevapla
Cevapla


Bookmarks

Seçenekler

Yetkileriniz
Konu Acma Yetkiniz Yok
Cevap Yazma Yetkiniz Yok
Eklenti Yükleme Yetkiniz Yok
Mesajınızı Değiştirme Yetkiniz Yok

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-Kodu Kapalı
Trackbacks are Kapalı
Pingbacks are Kapalı
Refbacks are Açık



Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 07:44:42.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

“İnsanların en hayırlısı, insanlara faydalı olandır”. H.Ş

Hosting by Radore Hosting

İçerik sağlayacı paylaşım sitelerinden biri olan R10.net WebMaster Forum Adresimizde 5651 Sayılı Kanun’un 8. Maddesine ve T.C.K’nın 125. Maddesine göre TÜM ÜYELERİMİZ yaptıkları paylaşımlardan sorumludur. R10.net hakkında yapılacak tüm hukuksal Şikayetler adresi ile iletişime geçilmesi halinde ilgili kanunlar ve yönetmelikler çerçevesinde en geç 1 (Bir) Hafta içerisinde R10.net yönetimi olarak tarafımızdan gereken işlemler yapılacak ve Avukatlarımız size dönüş yapacaktır.
ARGUS_OK

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252