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

📄 mdlsystemoptimizer.bas

📁 一款比较专业
💻 BAS
📖 第 1 页 / 共 3 页
字号:
Attribute VB_Name = "mdlSystemOptimizer"
'---------------------------------------------------------------------------------------'
'                                                                                       '
' SIMPLE MACHINE PROTECT                                                                '
' Copyright (C) 2008 Bagus Judistirah                                                   '
'                                                                                       '
' This program is free software; you can redistribute it and/or modify                  '
' it under the terms of the GNU General Public License as published by                  '
' the Free Software Foundation; either version 2 of the License, or                     '
' (at your option) any later version.                                                   '
'                                                                                       '
' This program is distributed in the hope that it will be useful,                       '
' but WITHOUT ANY WARRANTY; without even the implied warranty of                        '
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                         '
' GNU General Public License for more details.                                          '
'                                                                                       '
' You should have received a copy of the GNU General Public License along               '
' with this program; if not, write to the Free Software Foundation, Inc.,               '
' 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                           '
'                                                                                       '
'---------------------------------------------------------------------------------------'
'                                                                                       '
' Module     : Simple Machine Protect - Portable Edition                                '
' Author     : Bagus Judistirah (bagus_badboy)                                          '
' E-mail     : bagus.judistirah@hotmail.com or bagus_badboy@users.sourceforge.net       '
' Homepage   : http://wwww.e-freshware.com                                              '
'            : http://smp.e-freshware.com                                               '
' Project    : http://sourceforge.net/projects/smpav/                                   '
' License    : GNU General Public License                                               '
' History    : Minor bugs fixed.                                                        '
'                                                                                       '
'---------------------------------------------------------------------------------------'
'                                                                                       '
' Note       : I try to keep my software as bug-free as possible.                       '
'              But it's a general rule that no software ever is error free,             '
'              and the number of errors increases with the complexity of the program.   '
'                                                                                       '
'---------------------------------------------------------------------------------------'
'                                                                                       '
' Control    : Simple Machine Protect has been written and developed using Microsoft    '
'              Visual Basic 6. Portions of the source code of this program have been    '
'              taken from or inspired by the source of the following products. Please   '
'              do not remove these copyright notices. The following code & control was  '
'              used during the development of Simple Machine Protect.                   '
'              * Calculate CRC32 Checksum Precompiled Assembler Code, Get Icon          '
'                Coded by: Noel A Dacara                                                '
'                Downloaded from: http://www.planetsourcecode.com                       '
'              * XP Theme                                                               '
'                Coded by: Steve McMahon                                                '
'                Downloaded from: http://www.vbaccelerator.com                          '
'              * Chameleon Button                                                       '
'                Coded by: Gonchuki                                                     '
'                Downloaded from: http://www.planetsourcecode.com                       '
'              * Cool XP ProgressBar                                                    '
'                Coded by: Mario Flores                                                 '
'                Downloaded from: http://www.planetsourcecode.com                       '
'              * OnSystray                                                              '
'                Coded by: Bagus Judistirah                                             '
'                                                                                       '
'---------------------------------------------------------------------------------------'
'                                                                                       '
' Disclaimer : Modifying the registry can cause serious problems that may require you   '
'              to reinstall your operating system. I cannot guarantee that problems     '
'              resulting from modifications to the registry can be solved.              '
'              Use the information provided at your own risk.                           '
'                                                                                       '
'---------------------------------------------------------------------------------------'
' Thanks     : * SOURCEFORGE.NET [http://www.sourceforge.net]                           '
'              * OGNIZER [http://www.ognizer.net or http://virus.ognizer.net]           '
'              * VIROLOGI [http://www.virologi.info]                                    '
'              * ANSAV [http://www.ansav.com]                                           '
'              * VBACCELERATOR [http://www.vbaccelerator.com]                           '
'              * VBBEGO [http://www.vb-bego.com]                                        '
'              * MIGHTHOST [http://www.mighthost.com]                                   '
'              * UDARAMAYA [http://www.udaramaya.com]                                   '
'              * PSC - The home millions of lines of source code.                       '
'                [http://www.planetsourcecode.com]                                      '
'              * DONIXSOFTWARE - Dony Wahyu Isp [http://donixsoftware.web.id]           '
'              * Aat Shadewa, Jan Kristanto, Boby Ertanto, Irwan Halim, Dony Wahyu Isp, '
'                Yusuf Teretsa Patiku, Erwin, MI People, Nita, Husni, I Gede, Fadil,    '
'                Harry, Jimmy Wijaya, Sumanto Adi, Gafur, Selwin, Deny Kurniawan,       '
'                Paul, Marx, Gonchuki, Noel A Dacara, Steve McMahon, Mario Flores,      '
'                VM, Wardana, Achmad Darmal, Andi, Septian, all my friends,             '
'                Dream Theater, Evanescence, & Umild.                                   '
'              * Free software developer around the world.                              '
'              * Thanks to all for the suggestions and comments.                        '
'                                                                                       '
'---------------------------------------------------------------------------------------'
'                                                                                       '
' Contact    : If you have any questions, suggestions, bug reports or anything else,    '
'              feel free to contact me at bagus.judistirah@hotmail.com or               '
'              bagus_badboy@users.sourceforge.net.                                      '
'                                                                                       '
'---------------------------------------------------------------------------------------'

Private Declare Function SHEmptyRecycleBin Lib _
    "shell32.dll" Alias "SHEmptyRecycleBinA" ( _
    ByVal hwnd As Long, _
    ByVal pszRootPath As String, _
    ByVal dwFlags As Long) As Long
    
Private Const SHERB_NOCONFIRMATION = &H1
Private Const SHERB_NOPROGRESSUI = &H2
Private Const SHERB_NOSOUND = &H4
Private Const WITHOUT_ANY = SHERB_NOCONFIRMATION Or _
    SHERB_NOPROGRESSUI Or SHERB_NOSOUND

Public Sub FillSystemOptimizer(lvw As ListView)
    On Error GoTo ErrHandle
    Dim SysItem(22) As String
    SysItem(1) = "从内存中始终卸载未使用的动态库(DLL)."
    SysItem(2) = "自动结束任务计划时不进行回应."
    SysItem(3) = "关机清除."
    SysItem(4) = "关机时清除分页文件."
    SysItem(5) = "退出清除历史列表."
    SysItem(6) = "在关机时删除虚拟内存."
    SysItem(7) = "禁用桌面清理向导."
    SysItem(8) = "禁用磁盘空间不足警告."
    SysItem(9) = "禁用最近历史记录."
    SysItem(10) = "禁止窗体动画"
    SysItem(11) = "系统崩溃时,显示BSOD(蓝屏死机)."
    SysItem(12) = "不把删除文件放到回收站."
    SysItem(13) = "不显示系统登录入门欢迎屏幕."
    SysItem(14) = "优化桌面进程."
    SysItem(15) = "优化操作系统开机速度."
    SysItem(16) = "优化硬盘驱动器."
    SysItem(17) = "优化开始菜单."
    SysItem(18) = "快速重启操作系统."
    SysItem(19) = "关闭“开始”菜单动画提示."
    SysItem(20) = "删除浏览器临时文件."
    SysItem(21) = "关闭自动播放."
    SysItem(22) = "使用大系统缓存"
    Dim i As Integer
    For i = 1 To UBound(SysItem)
        lvw.ListItems.Add , , SysItem(i), , 4
    Next i
ErrHandle:
End Sub

Public Sub CheckOptimizer(lvw As ListView)
    On Error Resume Next
    Dim sRegStrOpt As String
    Dim lDword As Integer
    With lvw
        sRegStrOpt = GetSTRINGValue(HKEY_LOCAL_MACHINE, _
            "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AlwaysUnloadDLL", "")
        If Val(sRegStrOpt) <> 1 Then
            .ListItems.Item(1).Checked = False
        Else
            .ListItems.Item(1).Checked = True
        End If
        sRegStrOpt = GetSTRINGValue(HKEY_CURRENT_USER, "Control Panel\Desktop", _
            "AutoEndTasks")
        If Val(sRegStrOpt) <> 1 Then
            .ListItems.Item(2).Checked = False
        Else
            .ListItems.Item(2).Checked = True
        End If
        lDword = GetDWORDValue(HKEY_CURRENT_USER, _
            "Software\Microsoft\Windows\CurrentVersion\Explorer", "CleanShutdown")
        If Val(lDword) <> 1 Then
            .ListItems.Item(3).Checked = False
        Else
            .ListItems.Item(3).Checked = True
        End If
        lDword = GetDWORDValue(HKEY_LOCAL_MACHINE, _
            "SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management", _
            "ClearPageFileAtShutdown")
        If Val(lDword) <> 1 Then
            .ListItems.Item(4).Checked = False
        Else
            .ListItems.Item(4).Checked = True
        End If
        lDword = GetDWORDValue(HKEY_CURRENT_USER, _
            "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", _
            "ClearRecentDocsOnExit")
        If Val(lDword) <> 1 Then
            .ListItems.Item(5).Checked = False
        Else
            .ListItems.Item(5).Checked = True
        End If
        lDword = GetDWORDValue(HKEY_LOCAL_MACHINE, _
            "SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management", _
            "DisablePagingExecutive")
        If Val(lDword) <> 1 Then
            .ListItems.Item(6).Checked = False
        Else
            .ListItems.Item(6).Checked = True
        End If
        lDword = GetDWORDValue(HKEY_CURRENT_USER, _
            "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", _
            "NoDesktopCleanupWizard")
        If Val(lDword) <> 1 Then
            .ListItems.Item(7).Checked = False
        Else
            .ListItems.Item(7).Checked = True
        End If
        lDword = GetDWORDValue(HKEY_CURRENT_USER, _
            "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", _
            "NoLowDiskSpaceChecks")
        If Val(lDword) <> 1 Then
            .ListItems.Item(8).Checked = False
        Else
            .ListItems.Item(8).Checked = True
        End If
        lDword = GetDWORDValue(HKEY_CURRENT_USER, _
            "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", _
            "NoRecentDocsHistory")
        If Val(lDword) <> 1 Then
            .ListItems.Item(9).Checked = False
        Else
            .ListItems.Item(9).Checked = True
        End If
        sRegStrOpt = GetSTRINGValue(HKEY_CURRENT_USER, _
            "Control Panel\Desktop\WindowMetrics", "MinAnimate")
        If Val(sRegStrOpt) <> 1 Then
            .ListItems.Item(10).Checked = True
        Else
            .ListItems.Item(10).Checked = False
        End If
        lDword = GetDWORDValue(HKEY_LOCAL_MACHINE, _
        "SYSTEM\ControlCurrentSet\Control\CrashControl", "AutoReboot")
        If Val(lDword) <> 1 Then

⌨️ 快捷键说明

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