How to create an ActiveX Control which hides the Taskbar
This tip shows how to really hide the Windows Taskbar, not to move it outside the desktop, and to avoid the API磗 in the future we can make an ActiveX Control which does the work.
First create a new ActiveX Control project, add a module to it, just like you would in a normal .exe project. Put the following API declaracions into it:
Declare Function ShowWindow Lib _
"user32" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
Declare Function FindWindow Lib _
"user32" Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) _
As LongNow we have to set some properties for the UserControl1.
Name="TaskBar"
BorderStyle=1-Fixed Single
CanGetFocus=False
EditAtDesignTime=False
InvisibleAtRuntime=True
Picture= Choose one
ToolBoxBitmap=Choose one
Adjust the UserControl磗 size to the picture.
Put the following codes to the UserControl:
注释:Creates the property TaskBar.Show
Public Property Let Show(ByVal VShow As Boolean)
TBwnd& = FindWindow("Shell_traywnd", "")
If VShow = True Then
注释:if TaskBar.Show=true it shows the TaskBar
ShowWnd& = ShowWindow(TBwnd&, 1)
Else
注释:if not it hides the TaskBar
ShowWnd& = ShowWindow(TBwnd&, 0)
End If
End PropertySave your project with the name TaskBar and "Make TaskBar.ocx".
Now we have to try the Control so create a new (normal) .exe app and put 2 commandbuttons on form1, with the captions "Show" and "Hide". We have to look for our own control now, click menu-project-components (or right click on the toolbox), normally all ActiveX Controls (.ocx) are located in your windowssystem folder they should appear directlly in the list if not click on the browse button and select the pathTaskBar.ocx, and confirm. The Control should appear in the toolbox with the picture you磛e selected in ToolBoxBitmap.
Place the Control on the form together with the 2 commandbuttons and add the following code to the click events of the commandbuttons:
Private Sub Command1_Click()
taskbar1.Show = True
End Sub
Private Sub Command2_Click()
taskbar1.Show = False
End SubExecute the app. (F5) and click on the buttons.
- 用Photoshop给漂亮的烫发MM抠图
- Photoshop透明婚纱抠图大法
- Photoshop:让MM做个“变色龙”
- 用Photoshop来制作一款精美的宝宝照片墙
- Photoshop绝色美女通道抠图法
- 用Photoshop教你打造绚丽光芒效果
巧巧读书:http://www.qqread.com/vb/e282037.html
进入讨论组讨论。相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- VB+Access设计图书管理系统 (104238次浏览)
- VB设计有语音报时和报警功能的闹钟 (13528次浏览)
- 用VB打造“超酷”个性化菜单 (667次浏览)
- VB基础学习:编码规范 (654次浏览)
- 对注册表进行编程的“捷径” (646次浏览)
- 在IIS中建立WEB站点的例子! (603次浏览)
- 用VB6.0设计简易赛车游戏 (414次浏览)
- VB6 和 VB2005 中的用户界面控件 (339次浏览)
- 导入注册表设置 (308次浏览)
- 用Visual Basic.NET编写扑克牌游戏 (189次浏览)



