VB 任务栏透明
代码:
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Const WS_EX_LAYERED = &H80000
Const GWL_EXSTYLE = (-20)
Const LWA_ALPHA = &H2
Private Sub Form_Load()
dim bHwnd as Long
bHwnd = FindWindow("Shell_TrayWnd", vbNullString)
SetWindowLong bHwnd, GWL_EXSTYLE, GetWindowLong(bHwnd, GWL_EXSTYLE) Or WS_EX_LAYERED
SetLayeredWindowAttributes bHwnd, 0, 128, LWA_ALPHA
'上面的128改成不透明度(0和255之间)
End Sub
取消透明的方法是
Private Sub Command1_Click()
Dim newhwnd
Dim bHwnd As Long
bHwnd = FindWindow("Shell_TrayWnd", vbNullString)
SetWindowLong bHwnd, GWL_EXSTYLE, GetWindowLong _
(bHwnd,GWL_EXSTYLE & WS_EX_LAYERED)
END SUB
相关文档:
通过调用CreateDataSetfromXml取得XML数据
Imports System.Xml
Public Const FILE_CONFIG = "MZZ.xml"
Public Const PATH_CONFIG = "\XML\"
Dim dstXML As DataSet
Dim tblXML_DB As DataTable
Dim dtCod As New DataTable
Dim strSQL As String = ""
clsPublic ......
VB显示透明FLASH效果
演示效果:
代码如下:
公共声明区域
Option Explicit
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetW ......
作者: 佚名, 出处:IT专家网, 责任编辑: 谢妍妍,
2010-04-23 11:20
本文介绍VB对程序运行的监控。
转眼间,本系列文章已经写到了第六个,今天写点什么呢?
还是得写,看似VB做不到的事情,那么今天起就写写VB对操作系统的控制吧。
首先,说一说,VB对于被调用后的程序的监控方法。
原型函数简 ......
使用c#语言在.net平台生成的dll是基于MSIL的二进制代码,通常情况下是无法被native的语言和程序调用的(例如vb,vc,delphi)。但是一般来说windows上native的程序都是可以直接使用com对象的。通过.net平台提供的一些工具,可以为其伪造一个com接口并注册到系统中。此时,可以在native的程序里,通过这个伪com接口来实现此. ......
就这么一个函数就解决了那位仁兄3天多的工作
唉~!真被一个函数玩死了
这里顺便帖出来吧
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Microsoft.VisualBasic.Shell( ......