vb程序隐藏运行代码

' 在任务管理器的应用程序栏中隐身
Private   Declare   Function  GetWindow  Lib   " user32 "  ( ByVal  hwnd  As   Long ByVal  wCmd  As   Long As   Long
Private   Declare   Function  ShowWindow  Lib   " user32 "  ( ByVal  hwnd  As   Long ByVal  nCmdShow  As   Long As   Long

Private   Const  SW_HIDE  =   0
Private   Const  GW_OWNER  =   4
Private   Const  WM_CLOSE  =   & H10

Private   Sub  Form1_Load()
    
' 以下代码使程序隐身
     ' 在任务管理器的“应用程序”栏隐藏
      Dim  rc  As   Long
    
Dim  ownerhwnd  As   Long
    
Me .Visible  =   False
    ownerhwnd 
=  GetWindow( Me .hwnd, GW_OWNER)
    rc 
=  ShowWindow(ownerhwnd, SW_HIDE)
end sub

你可能感兴趣的:(vb)