⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmain.frm

📁 vb得100个编程实例
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmMain 
   Caption         =   "Form1"
   ClientHeight    =   2160
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   2160
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "出现"
      Height          =   375
      Left            =   2760
      TabIndex        =   1
      Top             =   960
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "隐藏"
      Height          =   375
      Left            =   960
      TabIndex        =   0
      Top             =   960
      Width           =   1095
   End
End
Attribute VB_Name = "FrmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Const RSP_SIMPLE_SERVICE = 1
Const RSP_UNREGISTER_SERVICE = 0
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long


Private Sub Command1_Click()
 MakeMeService
End Sub

Private Sub Command2_Click()
    UnMakeMeService
End Sub

Private Sub MakeMeService()
    Dim pId As Long
    Dim Regserv As Long
    pId = GetCurrentProcessId()
    Regserv = RegisterServiceProcess(pId, RSP_SIMPLE_SERVICE)
End Sub

Private Sub UnMakeMeService()
    Dim pId As Long
    Dim Regserv As Long
    pId = GetCurrentProcessId()
    Regserv = RegisterServiceProcess(pId, RSP_UNREGISTER_SERVICE)
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -