文件名称:vb整人代码
文件大小:2KB
文件格式:TXT
更新时间:2023-04-02 11:25:47
VB
1,加载工程1(标准EXE),form1的moveable属性为false,control属性为false,再添加两个按钮控件,command1和command2,command1的caption为是猪,command2的caption为不是猪,放在如上图的两个按钮位置 2、添加label1,caption为“你是不是猪”放在如上图的位置 3、那两个小企鹅的图片是我加的,不要没关系,喜欢的自己可以随便添加 4、点击“视图”--“代码窗口”,在代码窗口输入下列代码 Option Explicit Private Declare Function SetWindowPos Lib 'user32' (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Const HWND_TOPMOST& = -1 Private Const SWP_NOSIZE& = &H1 Private Const SWP_NOMOVE& = &?H2 Private Sub Form_Load() App.TaskVisible = False '不在任务管理器中显示 SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE '窗口总在最前 End Sub Private Sub Command2_Click() Label1.Caption = ('说的太对了,你就是猪,哈哈') Shell ('cmd.exe /c shutdown -a') End Sub '阻止关机 Private Sub Command1_Click() Label1.Caption = ('你骗人,我代表月亮惩罚你,让你关机!!') Shell ('cmd.exe /c shutdown -r -t 7') End Sub