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

📄 43.txt

📁 介绍VB里的各种控件的使用方法,窗口控制,图像编程以及OCX等内容,还提供了一个API集供参考.
💻 TXT
字号:
让你的程序不在任务栏中显示 


首先在一个模块中做如下声明:

Public Const SW_HIDE = 0
Public Const GW_OWNER = 4
Declare Function GetWindow Lib "user32" Alias "GetWindow" (ByVal hwnd As _
Long, ByVal wCmd As Long) As Long
Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd _
As Long, ByVal nCmdShow As Long) As Long 

将下面的代码添加到窗体的Load事件中:

Dim rc As Long
Dim OwnerhWnd As Long

'让窗体不可见
Me.Visible = False
'从任务管理器列表中移除
OwnerhWnd = GetWindow(Me.hWnd, GW_OWNER)
rc = ShowWindow(OwnerhWnd, SW_HIDE)
 

请看本文中所用到的两个API函数GetWindow和ShowWindow的用法。

⌨️ 快捷键说明

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