البته این دستور ممکن است با هر برنامه ای سازگار نباشد
نمونه این دستور به شکل زیر می باشد (فایل مورد نظر: اسم برنامه shell)
Private Sub Command1_Click()
Shell "Mspaint E:\Love.bmp"
End Sub

آموزش ویژوال بیسیک
البته این دستور ممکن است با هر برنامه ای سازگار نباشد
نمونه این دستور به شکل زیر می باشد (فایل مورد نظر: اسم برنامه shell)
Private Sub Command1_Click()
Shell "Mspaint E:\Love.bmp"
End Sub
Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessId As Long
dwThreadId As Long
End Type
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Private Declare Function CreateProcess Lib "kernel32" _
Alias "CreateProcessA" _
(ByVal lpApplicationName As String, _
ByVal lpCommandLine As String, _
lpProcessAttributes As Any, _
lpThreadAttributes As Any, _
ByVal bInheritHandles As Long, _
ByVal dwCreationFlags As Long, _
lpEnvironment As Any, _
ByVal lpCurrentDriectory As String, _
lpStartupInfo As STARTUPINFO, _
lpProcessInformation As PROCESS_INFORMATION) As Long
Private Declare Function OpenProcess Lib "kernel32.dll" _
(ByVal dwAccess As Long, _
ByVal fInherit As Integer, _
ByVal h As Long) As Long
Private Declare Function TerminateProcess Lib "kernel32" _
(ByVal hProcess As Long, _
ByVal uExitCode As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" _
(ByVal h As Long) As Long
Const SYNCHRONIZE = 1048576
Const NORMAL_PRIORITY_CLASS = &H20&
Private Sub Form_Click()
Dim pInfo As PROCESS_INFORMATION
Dim sInfo As STARTUPINFO
Dim sNull As String
Dim lSuccess As Long
Dim lRetValue As Long
sInfo.cb = Len(sInfo)
lSuccess = CreateProcess(sNull, "Calc.exe", _
ByVal 0&, ByVal 0&, 1&, _
NORMAL_PRIORITY_CLASS, ByVal 0&, sNull, sInfo, pInfo)
MsgBox "Calculator has been launched!"
lRetValue = TerminateProcess(pInfo.hProcess, 0&)
lRetValue = CloseHandle(pInfo.hThread)
lRetValue = CloseHandle(pInfo.hProcess)
MsgBox "Calculator has terminated!"
End Sub
Public Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As _
String, ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
"Exampel Call Shell2("c:\temp\a.exe")
Function Shell2(Program As String, Optional ShowCmd As Long = _
vbNormalNoFocus, Optional ByVal WorkDir As Variant) As Long
Dim FirstSpace As Integer, Slash As Integer
If Left(Program, 1) = """" Then
FirstSpace = InStr(2, Program, """")
If FirstSpace <> 0 Then
Program = Mid(Program, 2, FirstSpace - 2) & _
Mid(Program, FirstSpace + 1)
FirstSpace = FirstSpace - 1
End If
Else
FirstSpace = InStr(Program, " ")
End If
If FirstSpace = 0 Then FirstSpace = Len(Program) + 1
If IsMissing(WorkDir) Then
For Slash = FirstSpace - 1 To 1 Step -1
If Mid(Program, Slash, 1) = "\" Then Exit For
Next
If Slash = 0 Then
WorkDir = CurDir
ElseIf Slash = 1 Or Mid(Program, Slash - 1, 1) = ":" Then
WorkDir = Left(Program, Slash)
Else
WorkDir = Left(Program, Slash - 1)
End If
End If
Shell2 = ShellExecute(0, vbNullString, _
Left(Program, FirstSpace - 1), LTrim(Mid(Program, _
FirstSpace)), WorkDir, ShowCmd)
If Shell2 < 32 Then VBA.Shell Program, ShowCmd "To raise Error
End Function
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessID As Long
dwThreadID As Long
End Type
Private Declare Function WaitForSingle Lib "kernel32" (ByVal _
hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function CreateProcessA Lib "kernel32" (ByVal _
lpApplicationName As Long, ByVal lpCommandLine As String, ByVal _
lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, _
ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, _
ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, _
lpStartupInfo As STARTUPINFO, lpProcessInformation As _
PROCESS_INFORMATION) As Long
Private Declare Function CloseHandle Lib "kernel32" _
(ByVal h As Long) As Long
Private Declare Function GetExitCodeProcess Lib "kernel32" _
(ByVal hProcess As Long, lpExitCode As Long) As Long
Private Const NORMAL_PRIORITY_CLASS = &H20&
Private Const INFINITE = -1&
Public Function ExecCmd(cmdline$)
Dim proc As PROCESS_INFORMATION
Dim start As STARTUPINFO
" Initialize the STARTUPINFO structure:
start.cb = Len(start)
" Start the shelled application:
ret& = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, _
NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)
" Wait for the shelled application to finish:
ret& = WaitForSingle(proc.hProcess, INFINITE)
Call GetExitCodeProcess(proc.hProcess, ret&)
Call CloseHandle(proc.hProcess)
ExecCmd = ret&
End Function
برنامه ای که قصد معرفی اون رو دارم VB AntiCrack هست که محصول شرکت GPcH Soft می باشد
این برنامه کلیه رشته های موجود در پروژه وی بی را تبدیل به مجموعه ای از کاراکترها می کند که کرک برنامه را مشکل می نماید
VB AntiCrack is used to make it more difficult to crack your programs written in Visual Basic 6.0. Most crackers will not be able to crack your program because they will not find a single text strings in your EXE file, which will make searching for the code they need much more complicated. As you can guess, it makes sense to use this program only if your program is not freeware and has a time limitation or password protection, which makes it interesting for those who crack software protection.
شما می توانید برنامه را از آدرس زیر دانلود کنید:
http://www.gpchsoft.com/vb_anticrack.htm
این هم یوزر و پسورد برنامه:
NamE : Pharaohs Come Team
CodE : F981-0693-F96F-0690
اینم یه برنامه کامل برای تغییر عکس پس زمینه که با وی بی نوشتم
امیدوارم به کارتون بیاد
لطفا نظر فراموش نشه.
حتما با کامپوننت فاردیت آشنا هستید
اگه به شکل ظاهری این کامپوننت نیازی ندارید و فقط می خواهید از توابع اون استفاده کنید این کلاس کار شما رو راحت می کنه و دیگه نیازی به کامپوننت ندارید
اینم یه ماژول کامل درباره کار با رجیستری
توابع این ماژول
SetDWORDValue
GetDWORDValue
SetBinaryValue
GetBinaryValue
SetStringValue
GetStringValue
CreateKey
DeleteKey
DelValue
KeyExists
برای اینکار کدهای زیر رو داخل یک ماژول بذارید
Const MAX_PATH = 260
Const TH32CS_SNAPPROCESS = 2&
Private Type PROCESSENTRY32
lSize As Long
lUsage As Long
lProcessId As Long
lDefaultHeapId As Long
lModuleId As Long
lThreads As Long
lParentProcessId As Long
lPriClassBase As Long
lFlags As Long
sExeFile As String * MAX_PATH
End Type
Private Declare Sub CloseHandle Lib "kernel32" (ByVal hPass As Long)
Private Declare Function CreateToolhelpSnapshot Lib "kernel32" _
Alias "CreateToolhelp32Snapshot" (ByVal lFlags As Long, _
ByVal lProcessId As Long) As Long
Private Declare Function ProcessFirst Lib "kernel32" _
Alias "Process32First" (ByVal hSnapshot As Long, _
uProcess As PROCESSENTRY32) As Long
Private Declare Function ProcessNext Lib "kernel32" _
Alias "Process32Next" (ByVal hSnapshot As Long, _
uProcess As PROCESSENTRY32) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, _
ByVal blnheritHandle As Long, ByVal dwAppProcessId As Long) As Long
Private Declare Function TerminateProcess Lib "kernel32" (ByVal ApphProcess As Long, _
ByVal uExitCode As Long) As Long
Public Sub EndProcess(procName As String)
Dim sExeName As String
Dim sPid As String
Dim sParentPid As String
Dim lSnapShot As Long
Dim r As Long
Dim uProcess As PROCESSENTRY32
Dim fProc As Long
lSnapShot = CreateToolhelpSnapshot(TH32CS_SNAPPROCESS, 0&)
uProcess.lSize = Len(uProcess)
r = ProcessFirst(lSnapShot, uProcess)
Do While r
sExeName = Left(uProcess.sExeFile, InStr(1, uProcess.sExeFile, vbNullChar) - 1)
If LCase(sExeName) = LCase(procName) Then
fProc = uProcess.lProcessId
Exit Do
End If
r = ProcessNext(lSnapShot, uProcess)
Loop
CloseHandle (lSnapShot)
Dim mProcID As Long
mProcID = OpenProcess(1&, -1&, fProc)
TerminateProcess mProcID, 0&
End Sub
و بصورت زیر تابع رو صدا بزنید
EndProcess (نام فایل اجرایی)
برای اینکار خط زیر رو داخل یک ماژول قرار دهید:
Private Declare Function LoadKeyboardLayout Lib "user32" Alias "LoadKeyboardLayoutA" (ByVal pwszKLID As String, ByVal flags As Long) As Long
سپس از دستور زیر برای تغییر زبان استفاده کنید:
LoadKeyboardLayout "00000429", 1
429 کد زبان فارسی
409 کد زبان انگلیسی
شما می تونید با لود شدن فرم اصلی زبان رو فارسی کرده و با بسته شدن فرم زبان رو انگلیسی کنید.
طراح قالب: رضا امین زاده** پارسی بلاگ پیشرفته ترین سیستم مدیریت وبلاگ |