首页 > 电脑专区 > 电脑教程 >

vb源码:隐藏音量图标QQ图标,隐藏任务栏图标

来源:互联网 2023-02-21 20:35:27 版权归原作者所有,如有侵权,请联系我们

vb 隐藏音量图标QQ图标,隐藏任务栏任意图标,在这基础上可以加上全局快捷键,实现呼叫隐藏等功能,老板键,一键切换都不是问题了。OXU办公区 - 实用经验教程分享!

工具/原料

  • vb6
  • WINDOWS系统电脑一台

方法/步骤

  • 1

    添加一个窗体,代码如下:OXU办公区 - 实用经验教程分享!

    Private Sub Check1_Click()OXU办公区 - 实用经验教程分享!

    HideVolIcon Check1.Value = 1OXU办公区 - 实用经验教程分享!

    End SubOXU办公区 - 实用经验教程分享!

    vb源码:隐藏音量图标QQ图标,隐藏任务栏图标OXU办公区 - 实用经验教程分享!

  • 2

    有音量图标OXU办公区 - 实用经验教程分享!

    vb源码:隐藏音量图标QQ图标,隐藏任务栏图标OXU办公区 - 实用经验教程分享!

  • 2相关内容未经许可获取自百度经验
  • 3

    打勾之后,隐藏了吧OXU办公区 - 实用经验教程分享!

    vb源码:隐藏音量图标QQ图标,隐藏任务栏图标OXU办公区 - 实用经验教程分享!

  • 4

    vb工程OXU办公区 - 实用经验教程分享!

    vb源码:隐藏音量图标QQ图标,隐藏任务栏图标OXU办公区 - 实用经验教程分享!

  • 5

    添加模块,代码如下OXU办公区 - 实用经验教程分享!

    Option ExplicitOXU办公区 - 实用经验教程分享!

    OXU办公区 - 实用经验教程分享!

    Private Const WM_USER = &H400OXU办公区 - 实用经验教程分享!

    Private Const TB_BUTTONCOUNT = (WM_USER 24)OXU办公区 - 实用经验教程分享!

    Private Const TB_HIDEBUTTON = (WM_USER 4)OXU办公区 - 实用经验教程分享!

    Private Const TB_GETBUTTONTEXTA = (WM_USER 45)OXU办公区 - 实用经验教程分享!

    Private Const TB_AUTOSIZE = (WM_USER 33)OXU办公区 - 实用经验教程分享!

    OXU办公区 - 实用经验教程分享!

    Private Const MEM_COMMIT = &H1000&OXU办公区 - 实用经验教程分享!

    Private Const MEM_RESERVE = &H2000&OXU办公区 - 实用经验教程分享!

    Private Const MEM_RELEASE = &H8000&OXU办公区 - 实用经验教程分享!

    OXU办公区 - 实用经验教程分享!

    Private Const PAGE_READWRITE = &H4OXU办公区 - 实用经验教程分享!

    OXU办公区 - 实用经验教程分享!

    Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hwnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As LongOXU办公区 - 实用经验教程分享!

    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As LongOXU办公区 - 实用经验教程分享!

    Private Declare Function VirtualAllocEx Lib "kernel32.dll" (ByVal hProcess As Long, lpAddress As Any, ByRef dwSize As Long, ByVal flAllocationType As Long, ByVal flProtect As Long) As LongOXU办公区 - 实用经验教程分享!

    Private Declare Function VirtualFreeEx Lib "kernel32.dll" (ByVal hProcess As Long, lpAddress As Any, ByRef dwSize As Long, ByVal dwFreeType As Long) As LongOXU办公区 - 实用经验教程分享!

    Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As LongOXU办公区 - 实用经验教程分享!

    Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As LongOXU办公区 - 实用经验教程分享!

    Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As Long, lpdwProcessId As Long) As LongOXU办公区 - 实用经验教程分享!

    Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As LongOXU办公区 - 实用经验教程分享!

    OXU办公区 - 实用经验教程分享!

    Sub HideVolIcon(Optional HideIco As Boolean = True) '隐藏音量图标OXU办公区 - 实用经验教程分享!

    '用法:隐藏音量图标 HideVolIcon(True)OXU办公区 - 实用经验教程分享!

    '显示音量图标:HideVolIcon(False)OXU办公区 - 实用经验教程分享!

    Dim Hideit As LongOXU办公区 - 实用经验教程分享!

    Hideit = IIf(HideIco, -1, 0)OXU办公区 - 实用经验教程分享!

    Dim pIdExplorer As Long, hwnd2 As Long, hExplorer As Long, lpIconText As LongOXU办公区 - 实用经验教程分享!

    Dim i As IntegerOXU办公区 - 实用经验教程分享!

    Dim BtnCount As IntegerOXU办公区 - 实用经验教程分享!

    Dim IconText As StringOXU办公区 - 实用经验教程分享!

    Dim lLen As Long, sBuff As StringOXU办公区 - 实用经验教程分享!

    OXU办公区 - 实用经验教程分享!

    hwnd2 = FindWindowEx(0, 0, "Shell_TrayWnd", vbNullString)OXU办公区 - 实用经验教程分享!

    hwnd2 = FindWindowEx(hwnd2, 0, "TrayNotifyWnd", vbNullString)OXU办公区 - 实用经验教程分享!

    hwnd2 = FindWindowEx(hwnd2, 0, "SysPager", vbNullString)OXU办公区 - 实用经验教程分享!

    hwnd2 = FindWindowEx(hwnd2, 0, "ToolbarWindow32", vbNullString)OXU办公区 - 实用经验教程分享!

    OXU办公区 - 实用经验教程分享!

    GetWindowThreadProcessId hwnd2, pIdExplorerOXU办公区 - 实用经验教程分享!

    hExplorer = OpenProcess(56, False, pIdExplorer)OXU办公区 - 实用经验教程分享!

    lpIconText = VirtualAllocEx(ByVal hExplorer, ByVal 0&, Len(IconText), MEM_COMMIT Or MEM_RESERVE, PAGE_READWRITE)OXU办公区 - 实用经验教程分享!

    BtnCount = SendMessage(hwnd2, TB_BUTTONCOUNT, 0, 0)OXU办公区 - 实用经验教程分享!

    For i = 0 To BtnCount - 1OXU办公区 - 实用经验教程分享!

    IconText = Space$(256)OXU办公区 - 实用经验教程分享!

    lLen = SendMessage(hwnd2, TB_GETBUTTONTEXTA, i, ByVal lpIconText)OXU办公区 - 实用经验教程分享!

    ReadProcessMemory hExplorer, ByVal lpIconText, ByVal IconText, Len(IconText), 0OXU办公区 - 实用经验教程分享!

    If lLen > -1 Then IconText = Left$(IconText, InStr(1, IconText, Chr$(0)) - 1)OXU办公区 - 实用经验教程分享!

    'ByVal -1&//IconText = "音量"OXU办公区 - 实用经验教程分享!

    'IIf(HideIco, -1, 0)OXU办公区 - 实用经验教程分享!

    OXU办公区 - 实用经验教程分享!

    If (IconText Like "扬声器*") Or (IconText Like "*音量*") ThenOXU办公区 - 实用经验教程分享!

    SendMessage hwnd2, TB_HIDEBUTTON, i, ByVal Hideit&OXU办公区 - 实用经验教程分享!

    Exit ForOXU办公区 - 实用经验教程分享!

    End IfOXU办公区 - 实用经验教程分享!

    NextOXU办公区 - 实用经验教程分享!

    VirtualFreeEx hExplorer, lpIconText, Len(IconText), MEM_RELEASEOXU办公区 - 实用经验教程分享!

    CloseHandle hExplorerOXU办公区 - 实用经验教程分享!

    End SubOXU办公区 - 实用经验教程分享!

  • 以上方法由办公区教程网编辑摘抄自百度经验可供大家参考!OXU办公区 - 实用经验教程分享!


    标签: 任务栏隐藏音量任务

    办公区 Copyright © 2016-2023 www.bgqu.net. Some Rights Reserved. 备案号:湘ICP备2020019561号