请问如何弹出Windows登陆窗口?就是按了Ctrl+Alt+Del之后出现的那个窗口,是通过调用哪个API来实现的?

解决方案 »

  1.   

    Option   Explicit   
      Private   Declare   Function   LockWorkStation   Lib   "user32.dll"   ()   As   Long   
      Private   Declare   Function   ExitWindowsEx   Lib   "user32"   (ByVal   uFlags   As   Long,   ByVal   dwReserved   As   Long)   As   Long   
        
      Sub   Main()   
              Dim   i   
              i   =   MsgBox("关机还是锁定?"   +   Chr(10)   +   "关机请选择‘是’,锁定选择‘否’",   vbYesNoCancel   +   vbInformation,   ":)")   
              If   i   =   vbYes   Then   
                      CloseComputer   
              ElseIf   i   =   vbNo   Then   
                      LockWorkStation   
              End   If   
      End   Sub   
      Public   Sub   CloseComputer()   
      ExitWindowsEx   13,   0   
      End   Sub