| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 548 人关注过本帖
标题:vb 无标题栏 任务栏显示
取消只看楼主 加入收藏
yunxiao520
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2011-7-3
结帖率:50%
收藏
已结贴  问题点数:20 回复次数:0 
vb 无标题栏 任务栏显示
'添加一个模块,加入以下代码
Option Explicit
Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
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
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const WM_SYSCOMMAND = &H112
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const WM_CLOSE = &H10
Private Const SC_CLOSE = &HF060&
Public lOldproc As Long
'处理一些消息
Public Function WndProc(ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    Select Case Msg
        Case WM_SYSCOMMAND
            '使无边框窗体系统菜单的关闭按钮有效
            If wParam = SC_CLOSE Then
                SendMessage hWnd, WM_CLOSE, ByVal 0&, ByVal 0&
            End If
    End Select
WndProc = CallWindowProc(lOldproc, hWnd, Msg, wParam, lParam)

End Function
'窗体加载事件

'使无边框窗体获得系统菜单
Private Sub Form_Load()
Dim lStyle&
    lStyle = GetWindowLong(Me.hWnd, -16)
    lStyle = lStyle Or &H80000 Or &H20000
    SetWindowLong Me.hWnd, -16, lStyle
    lOldproc = SetWindowLong(Me.hWnd, -4, AddressOf WndProc)
End Sub

Private Sub Timer1_Timer()
Timer1.Enabled = False
Me.Caption = "1"
End Sub
'当时间过后标题名称改变则 任务栏 不能小化及还原了 这个问题怎么处理
搜索更多相关主题的帖子: 标题栏 任务栏 
2015-01-08 23:43
快速回复:vb 无标题栏 任务栏显示
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.038671 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved