先加入如下声明: 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 EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long Dim GW As Long然后在需要隐藏开始菜单时执行如下代码: GW = FindWindowEx(FindWindow("Shell_TrayWnd", ""), 0, "Button", "") EnableWindow GW, 0而在需要显示开始菜单时执行如下代码: EnableWindow GW, 1可以给我加分吗?
我试了,可以的给fanzai(帆仔)加分吧
to poweruser(天使的眼睛和魔鬼的心): 谢谢你!但是我怎么没有见到分数?是不是你不知如何加分?还是你在跟我开玩笑?…………$%@#$&@#
是在抱歉,这是我的失误!以下是更正后的程序。 先加入如下声明: 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 ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long Const SW_HIDE = 0 Const SW_RESTORE = 9 Dim SW As Long, SB As Long然后在需要隐藏开始菜单时执行如下代码: SW = FindWindow("Shell_TrayWnd", "") SB = FindWindowEx(SW, 0, "Button", "") ShowWindow SB, SW_HIDE SetParent SB, Me.hwnd而在需要显示开始菜单时执行如下代码: ShowWindow SB, SW_RESTORE SetParent SB, SW这回应该不会有问题了。
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 EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
Dim GW As Long然后在需要隐藏开始菜单时执行如下代码:
GW = FindWindowEx(FindWindow("Shell_TrayWnd", ""), 0, "Button", "")
EnableWindow GW, 0而在需要显示开始菜单时执行如下代码:
EnableWindow GW, 1可以给我加分吗?
谢谢你!但是我怎么没有见到分数?是不是你不知如何加分?还是你在跟我开玩笑?…………$%@#$&@#
Procedure DisableStartButton;
begin
ShowWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil), SW_HIDE);
Windows.SetParent(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'Button', nil), GetDesktopWindow);
end;
先加入如下声明:
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 ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Const SW_HIDE = 0
Const SW_RESTORE = 9
Dim SW As Long, SB As Long然后在需要隐藏开始菜单时执行如下代码:
SW = FindWindow("Shell_TrayWnd", "")
SB = FindWindowEx(SW, 0, "Button", "")
ShowWindow SB, SW_HIDE
SetParent SB, Me.hwnd而在需要显示开始菜单时执行如下代码:
ShowWindow SB, SW_RESTORE
SetParent SB, SW这回应该不会有问题了。