rainstormmaster的blog
rainstormmaster的blog

只去掉图标是很困难的(用自绘标题栏可以解决),今天我们讨论的是一种变通的方法,即创建一个空图标代替现有的图标,程序如下:

Option Explicit

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 Const WM_SETICON = &H80
Private Const ICON_SMALL = 0
Private Const ICON_BIG = 1
Private Declare Function CreateIcon Lib "user32" (ByVal hInstance As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal nPlanes As Byte, ByVal nBitsPixel As Byte, lpANDbits As Byte, lpXORbits As Byte) As Long
Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long
Dim hIcon As Long
Private Sub Form_Load()
    '创建一个空图标
    hIcon = CreateIcon(App.hInstance, 0, 0, 0, 0, ByVal 0&, ByVal 0&)
    '修改窗体的图标
    SendMessage Me.hwnd, WM_SETICON, ICON_SMALL, ByVal hIcon
   'SendMessage Me.hwnd, WM_SETICON, ICON_BIG, ByVal hIcon
End Sub

Private Sub Form_Unload(Cancel As Integer)
    '销毁我们创建的空图标
    DestroyIcon hIcon
End Sub

posted on 2006-01-09 16:32  学剑学诗两不成  阅读(1066)  评论(0编辑  收藏  举报