2023年12月15日发(作者:)

隐藏或显示托盘图标(Hide or show the tray icon)

Hide or show the tray my life A as B, your life is B

S. Failure is not terrible, the key is not the mother of success.

The students now not too much quality! Come copy feather,

actually by shear! Free to study Feng Shui, after the death of

a tomb is made up of living can't afford to buy a house.

'definition statement

Option Explicit

Private Const WM_USER = &H400

Private Const = TB_BUTTONCOUNT (WM_USER + 24)

Private Const = TB_HIDEBUTTON (WM_USER + 4)

Private Const = TB_GETBUTTONTEXTA (WM_USER + 45)

Private Const = TB_AUTOSIZE (WM_USER + 33)

Private Const MEM_COMMIT = &H1000

Private Const MEM_RESERVE = &H2000

Private Const MEM_RELEASE = &H8000

Private Const PAGE_READWRITE = &H4

Private Const = PROCESS_VM_OPERATION (&H8)

Private Const = PROCESS_VM_READ (&H10)

Private Const = PROCESS_VM_WRITE (&H20)

Private Declare Function FindWindow Lib "user32" Alias

"FindWindowA" (ByVal lpClassName As String ByVal lpWindowName

As String As Long)

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 Long)

Private Declare Function SendMessage Lib "user32" Alias

"SendMessageA" (ByVal hWnd As Long ByVal wMsg As Long ByVal

wParam, As Long, lParam As Any As Long)

Private Declare Function VirtualAllocEx Lib ""

(ByVal hProcess As Long, lpAddress As Any, ByRef dwSize As Long

ByVal flAllocationType, As Long, ByVal flProtect As Long As

Long)

Private Declare Function VirtualFreeEx Lib ""

(ByVal hProcess As Long, lpAddress As Any, ByRef dwSize As Long

ByVal dwFreeType As Long As Long)

Private Declare Function OpenProcess Lib "Kernel32" (ByVal

dwDesiredAccess As Long ByVal bInheritHandle, As Long, ByVal

dwProcessId As Long As Long)

Private Declare Function CloseHandle Lib "Kernel32" (ByVal

hObject As Long As Long)

Private Declare Function GetWindowThreadProcessId Lib

"user32" (ByVal hWnd As Long lpdwProcessId As Long As Long)

Private Declare Function ReadProcessMemory Lib "Kernel32"

(ByVal hProcess As Long, lpBaseAddress As Any,

lpBuffer任何,ByVal nSize为长,长,长lpnumberofbyteswritten)

私人声明函数WriteProcessMemory lib“功能”(ByVal hprocess一样长,lpbaseaddress任何lpBuffer任何,ByVal nSize,长,长时间lpnumberofbyteswritten)

私人声明函数getcurrentprocessid lib“功能”()长

“形式窗体

“需要的控件:command1,Command2、Command3,列表框

“隐藏指定图标私有子command1_click()

昏暗的pidexplorer一样长,二的句柄一样长,hexplorer一样长,lpicontext长

我作为整数暗淡

昏暗的btncount为整数

昏暗的iContext作为字符串

二的句柄= FindWindow(“shell_traywnd”:)

二的句柄= FindWindowEx(二的句柄,0,“traynotifywnd”:)

二的句柄= FindWindowEx(二的句柄,0,“syspager”:)

二的句柄= FindWindowEx(二的句柄,0,“toolbarwindow32”:)

getwindowthreadprocessid二的句柄,pidexplorer

hexplorer = OpenProcess(process_vm_operation或process_vm_read或process_vm_write,虚假,pidexplorer)

lpicontext = virtualallocex(ByVal hexplorer,ByVal 0、Len(iContext),mem_commit或mem_reserve,page_readwrite)

btncount = SendMessage(二的句柄,tb_buttoncount,0, 0)

昏暗的花粉一样长,sbuff作为字符串

我btncount = 0 - 1

(256)美元的iContext =空间

LLEN = SendMessage(二的句柄,tb_getbuttontexta、我、ByVal

lpIconText)

hexplorer ReadProcessMemory,ByVal lpIconText,ByVal IconText,Len(iContext),0

如果同步<> 1然后iContext =美金(iContext,仪器(1美元的iContext,CHR(0))- 1)

如果iContext = List1.列表(List1. ListIndex)然后替换为需要隐藏的图标名称:就是鼠标放在图标上时显示的文字

SendMessage二的句柄,tb_hidebutton,我,ByVal True

SendMessage二的句柄,tb_autosize,0, 0

最后如果

下一个

virtualfreeex hexplorer,lpicontext、Len(iContext),mem_release

hexplorer CloseHandle

端子

“显示指定图标私有子command2_click()

昏暗的pidexplorer长,

hexplorer = OpenProcess(process_vm_operation或process_vm_read或process_vm_write,虚假,pidexplorer)

lpicontext = virtualallocex(ByVal hexplorer,ByVal 0、Len(iContext),mem_commit或mem_reserve,page_readwrite)

btncount = SendMessage(二的句柄,tb_buttoncount,0, 0)

昏暗的花粉一样长,sbuff作为字符串

我btncount = 0 - 1

(256)美元的iContext =空间

LLEN = SendMessage(二的句柄,tb_getbuttontexta、我、ByVal

lpIconText)

hexplorer ReadProcessMemory,ByVal lpIconText,ByVal IconText,Len(iContext),0

如果同步<> 1然后iContext =美金(iContext,仪器(1美元的iContext,CHR(0))- 1)

m iContext

下一个

virtualfreeex hexplorer,lpicontext、Len(iContext),mem_release

hexplorer CloseHandle

端子

私有子form_load()

command3_click

command1_click

端子