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

📄 main.bas

📁 OpenPlayer代码
💻 BAS
字号:
Attribute VB_Name = "Module2"
Option Explicit
'=========================================
'程序入口
'=========================================
Private Declare Function PwdChangePassword Lib "mpr" Alias "PwdChangePasswordA" _
                                (ByVal lpcRegkeyname As String, ByVal hwnd As Long, ByVal uiReserved1 As _
                                Long, ByVal uiReserved2 As Long) As Long
'屏蔽系统键
Public Declare Function SystemParametersInfo& Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long)
'SystemParametersInfo SPL_SCREENSAVERRUNNING, True, ByVal 1&, 0         '屏蔽
'SystemParametersInfo SPL_SCREENSAVERRUNNING, False, ByVal 1&, 0        '撒消
Const SC_SCREENSAVE = &HF140&
Const SPL_SCREENSAVERRUNNING = 97
   
Sub Main() '程序运行入口
    Dim PW As String
    Dim ValueType As Long
 
    Dim ClassName As String * 64                '存放窗口的类名
    Dim ExeCmd As String                        '存放命令行参数
  
  
    ExeCmd = UCase(Command$)                    '将调用的屏保的参数转换成大写后存放在变量ExeCmd里
    If Not (InStr(ExeCmd, "/P") = 0) Then       '检查屏保的调用参数中是否有"/P"参数,设置
       ClosePreWindow (WM_SET)
       SCR_Look
    ElseIf Not (InStr(ExeCmd, "/S") = 0) Then   '运行
       Scr_Run
    ElseIf Not (InStr(ExeCmd, "/A") = 0) Then
     '从注册表中读取屏幕保护密码的值。其值位于"\HKEY_CURRENT_USER\Control Panel\desktop\ScreenSave_Data"
      'RetString = Query_Reg_Value("Control Panel\desktop", "ScreenSave_Data", ValueType)
      'PW = Getsecret
      'PwdChangePassword "SCRSAVE", Val(Right(Command$, Len(Command$) - 2)), 0, 0
      ChangePassWord.Show 1
      'Form5.Show
    Else
       Scr_Setup
    End If
End Sub


Public Sub ClosePreWindow(WinCaption As String)
'关闭窗口
    Dim PreWnd As Long
        PreWnd = FindWindow(vbNull, WinCaption)                         '寻找类名为ClassName,标题为WinCaption的窗口
    If Not (PreWnd = 0) Then Call SendMessage(PreWnd, WM_CLOSE, 0, 0)   '如果窗口已找到则关闭它
End Sub

   
Public Sub SCR_Look()
    '在小窗口实现预览(将Form3装入小窗口)
    Dim LookScrWnd As Long
    Dim Style As Long
    Dim LookRect As RECT
   
    Form3.Caption = WM_LOOK                                 '赋上具有相应运行方式的标题
   
    LookScrWnd = Val(Right(Command$, Len(Command$) - 2))    '取得小屏幕的窗口句柄
   
    Style = GetWindowLong(Form3.hwnd, GWL_STYLE)            '取得窗口的样式
    Style = Style Or WS_CHILD                               '在窗口的样式中加入子窗体常数
    SetWindowLong Form3.hwnd, GWL_STYLE, Style              '改变窗体的样式
    SetParent Form3.hwnd, LookScrWnd                        '设置窗体的父窗体
    GetClientRect LookScrWnd, LookRect                      '取得小屏幕的大小
                                                            '显示窗体并将窗体的大小设置为小屏幕的大小以便覆盖小屏幕
    SetWindowPos Form3.hwnd, HWND_TOP, 0, 0, LookRect.Right, LookRect.Bottom, SWP_NOZORDER Or SWP_NOACTIVATE Or SWP_SHOWWINDOW
    
  End Sub
   
Public Sub Scr_Setup()
    '显示设置窗口
    Form4.Show
End Sub
   
Public Sub Scr_Run()
    Dim ClassName As String * 64
    Dim h As Long
      
    '防止程序多重运行!很重要,否则,可以造成当机!!
    If App.PrevInstance = True Then
        If Not (FindWindow("ThunderRT6FormDC", WM_RUN) = 0) Then End
    End If
     
    Form1.Show
    Form1.Visible = True
     
    Unload Form3
    ClosePreWindow (WM_SET)
    ClosePreWindow (WM_LOOK)
     
    Form1.Caption = WM_RUN                                                  '赋上具有相应运行方式的标题
    ShowCursor False                                                        '隐藏鼠标
    h& = SystemParametersInfo(SPL_SCREENSAVERRUNNING, True, ByVal 1&, 0)    '使系统处于屏保状态,屏蔽Ctrl+Alt+Del
End Sub
    
Sub EndSaver()
    If fso.FileExists(Filename) Then                                        '删除临时文件
        fso.DeleteFile (Filename)
    End If
    If hHook Then
        hHook = UnhookWindowsHookEx(hHook)
        hHook = 0
    End If
    Set fso = Nothing
    ShowCursor True                                                         '显示鼠标
    SystemParametersInfo SPL_SCREENSAVERRUNNING, False, ByVal 1&, 0         '撒消
    End
End Sub
   
   

⌨️ 快捷键说明

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