首页
社区
课程
招聘
[推荐][原创]VB写的CM
发表于: 2009-6-7 01:25 8404

[推荐][原创]VB写的CM

2009-6-7 01:25
8404
收藏
免费 0
支持
分享
最新回复 (17)
雪    币: 2067
活跃值: (82)
能力值: ( LV9,RANK:180 )
在线值:
发帖
回帖
粉丝
2
00407B84   .  FF15 D4104000   call    [<&MSVBVM60.__vbaStrCmp>]
2009-6-7 04:15
0
雪    币: 1450
活跃值: (35)
能力值: (RANK:680 )
在线值:
发帖
回帖
粉丝
3
界面看起来很炫~~
2009-6-7 04:19
0
雪    币: 201
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
   
2009-6-7 05:46
0
雪    币: 116
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
争对 VarBstrCmp 做了处理   
上传的附件:
2009-6-7 05:48
0
雪    币: 2067
活跃值: (82)
能力值: ( LV9,RANK:180 )
在线值:
发帖
回帖
粉丝
6
Base64
2009-6-7 11:33
0
雪    币: 319
活跃值: (49)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
7
界面太牛了。。。。。。。。。。可不可以传源码
2009-6-7 14:00
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
8
不错啊,我来试试吧
2009-6-7 16:15
0
雪    币: 116
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
9
厉害   
2009-6-7 22:12
0
雪    币: 116
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
10
Option Explicit
'=====================================================================================================================
'功能:任意位置气泡
'注意:开始的时候Text1的属性IMEMode应该设置为1必须的
'Option Explicit
'Dim tip As New CTips
'Private Sub Command1_Click()
'tip.Style = ttballoon
'tip.Icon = TTIconError '图标类型
'tip.Title = "aaa"      '标题
'tip.TipText = "bbb"    '内容
'tip.PopupOnDemand = True
'tip.CreateToolTip Text1.hwnd    '气泡所在窗口句柄
'tip.Show 'Text1.Width / Screen.TwipsPerPixelX, Text1.Height / Screen.TwipsPerPixelX / 2 - 1  '//In Pixel only
'End Sub
'Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'tip.Destroy
'End Sub
'======================================================================================================================
Private Declare Function CreateWindowEx Lib "user32.dll" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, ByRef lpParam As Any) As Long
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long
Private Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ClientToScreen Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long

Private Const WM_USER = &H400
Private Const CW_USEDEFAULT = &H80000000

Private Type RECT
    left As Long
    top As Long
    right As Long
    bottom As Long
End Type

Private Type POINTAPI
    x As Long
    Y As Long
End Type

Private Const TTS_NOPREFIX = &H2
Private Const TTF_TRANSPARENT = &H100
Private Const TTF_CENTERTIP = &H2
Private Const TTM_ADDTOOLA = (WM_USER + 4)
Private Const TTM_ACTIVATE = WM_USER + 1
Private Const TTM_UPDATETIPTEXTA = (WM_USER + 12)
Private Const TTM_SETMAXTIPWIDTH = (WM_USER + 24)
Private Const TTM_SETTIPBKCOLOR = (WM_USER + 19)
Private Const TTM_SETTIPTEXTCOLOR = (WM_USER + 20)
Private Const TTM_SETTITLE = (WM_USER + 32)
Private Const TTS_BALLOON = &H40
Private Const TTS_ALWAYSTIP = &H1
Private Const TTF_SUBCLASS = &H10
Private Const TTF_TRACK = &H20
Private Const TTF_IDISHWND = &H1
Private Const TTM_SETDELAYTIME = (WM_USER + 3)
Private Const TTDT_AUTOPOP = 2
Private Const TTDT_INITIAL = 3
Private Const TTM_TRACKACTIVATE = WM_USER + 17
Private Const TTM_TRACKPOSITION = WM_USER + 18
Private Const WS_POPUP = &H80000000

Private Const TOOLTIPS_CLASSA = "tooltips_class32"

Private Type TOOLINFO
    lSize As Long
    lFlags As Long
    hwnd As Long
    lId As Long
    lpRect As RECT
    hInstance As Long
    lpStr As String
    lParam As Long
End Type

Public Enum ttIconType
    TTNoIcon = 0
    TTIconInfo = 1
    TTIconWarning = 2
    TTIconError = 3
End Enum

Public Enum ttStyleEnum
    TTStandard
    ttballoon
End Enum

Private mvarBackColor As Long
Private mvarTitle As String
Private mvarForeColor As Long
Private mvarIcon As ttIconType
Private mvarCentered As Boolean
Private mvarStyle As ttStyleEnum
Private mvarTipText As String
Private mvarVisibleTime As Long
Private mvarDelayTime As Long
Private mvarPopupOnDemand As Boolean

Private m_lTTHwnd As Long
Private m_lParentHwnd As Long
Private ti As TOOLINFO
Private Sub Class_Initialize()
    mvarDelayTime = 500
    mvarVisibleTime = 5000
    mvarPopupOnDemand = False
End Sub
Private Sub Class_Terminate()
    Destroy
End Sub
Public Property Get VisibleTime() As Long
    VisibleTime = mvarVisibleTime
End Property
Public Property Let VisibleTime(ByVal lData As Long)
    mvarVisibleTime = lData
End Property
Public Property Get DelayTime() As Long
    DelayTime = mvarDelayTime
End Property
Public Property Let DelayTime(ByVal lData As Long)
    mvarDelayTime = lData
End Property
Public Property Let Icon(ByVal vData As ttIconType)
    mvarIcon = vData
    If m_lTTHwnd <> 0 And mvarTitle <> Empty And mvarIcon <> TTNoIcon Then
        SendMessage m_lTTHwnd, TTM_SETTITLE, CLng(mvarIcon), ByVal mvarTitle
    End If
End Property

Public Property Get Icon() As ttIconType
    Icon = mvarIcon
End Property
Public Property Let ForeColor(ByVal vData As Long)
    mvarForeColor = vData
    If m_lTTHwnd <> 0 Then
        SendMessage m_lTTHwnd, TTM_SETTIPTEXTCOLOR, mvarForeColor, 0&
    End If
End Property
Public Property Get ForeColor() As Long
    ForeColor = mvarForeColor
End Property
Public Property Let Title(ByVal vData As String)
    mvarTitle = vData
    If m_lTTHwnd <> 0 And mvarTitle <> Empty And mvarIcon <> TTNoIcon Then
        SendMessage m_lTTHwnd, TTM_SETTITLE, CLng(mvarIcon), ByVal mvarTitle
    End If
End Property
Public Property Get Title() As String '修改了下
    'Title = ti.lpStr
    Title = mvarTitle
End Property
Public Property Let PopupOnDemand(ByVal vData As Boolean)
    mvarPopupOnDemand = vData
End Property
Public Property Get PopupOnDemand() As Boolean
    PopupOnDemand = mvarPopupOnDemand
End Property
Public Property Let BackColor(ByVal vData As Long)
    mvarBackColor = vData
    If m_lTTHwnd <> 0 Then
        SendMessage m_lTTHwnd, TTM_SETTIPBKCOLOR, mvarBackColor, 0&
    End If
End Property
Public Property Get BackColor() As Long
    BackColor = mvarBackColor
End Property
Public Property Let TipText(ByVal vData As String)
    mvarTipText = vData
    ti.lpStr = vData
    If m_lTTHwnd <> 0 Then
        SendMessage m_lTTHwnd, TTM_UPDATETIPTEXTA, 0&, ti
    End If
End Property
Public Property Get TipText() As String
    TipText = mvarTipText
End Property
Public Property Let Style(ByVal vData As ttStyleEnum)
    mvarStyle = vData
End Property

Public Property Get Style() As ttStyleEnum
    Style = mvarStyle
End Property
Public Property Let Centered(ByVal vData As Boolean)
    mvarCentered = vData
End Property
Public Property Get Centered() As Boolean
    Centered = mvarCentered
End Property
'显示出来
Public Sub Show(Optional x As Long = 0, Optional Y As Long = 0)
    Dim pt As POINTAPI
    Dim ptTip As Long
    Dim ret As Long

    With pt
        .x = x
        .Y = Y
    End With

    ret = ClientToScreen(m_lParentHwnd, pt)
    ptTip = pt.Y * &H10000
    ptTip = ptTip + pt.x
    ret = SendMessage(m_lTTHwnd, TTM_TRACKPOSITION, 0, ByVal ptTip)
    ret = SendMessage(m_lTTHwnd, TTM_TRACKACTIVATE, True, ti)
End Sub
'创建对象
Public Function CreateToolTip(ByVal ParentHwnd As Long) As Boolean
    Dim lWinStyle As Long
    If m_lTTHwnd <> 0 Then
        DestroyWindow m_lTTHwnd
    End If
    m_lParentHwnd = ParentHwnd
    If mvarStyle = ttballoon Then lWinStyle = lWinStyle Or TTS_BALLOON
    m_lTTHwnd = CreateWindowEx(0&, TOOLTIPS_CLASSA, vbNullString, lWinStyle, 0&, 0&, 0&, 0&, m_lParentHwnd, 0&, 0&, 0&)
    With ti
        If mvarCentered Then
            If mvarPopupOnDemand = False Then
                .lFlags = TTF_SUBCLASS Or TTF_CENTERTIP Or TTF_IDISHWND
            Else
                .lFlags = TTF_IDISHWND Or TTF_TRACK Or TTF_CENTERTIP
            End If
        Else
            If mvarPopupOnDemand = False Then
                .lFlags = TTF_SUBCLASS Or TTF_IDISHWND
            Else
                .lFlags = TTF_IDISHWND Or TTF_TRACK Or TTF_TRANSPARENT
            End If
        End If
        .hwnd = m_lParentHwnd
        .lId = m_lParentHwnd
        .hInstance = App.hInstance
        .lSize = Len(ti)
    End With
    SendMessage m_lTTHwnd, TTM_ADDTOOLA, 0&, ti
    If mvarTitle <> vbNullString Or mvarIcon <> TTNoIcon Then
        SendMessage m_lTTHwnd, TTM_SETTITLE, CLng(mvarIcon), ByVal mvarTitle
    End If
    If mvarForeColor <> Empty Then
        SendMessage m_lTTHwnd, TTM_SETTIPTEXTCOLOR, mvarForeColor, 0&
    End If
    If mvarBackColor <> Empty Then
        SendMessage m_lTTHwnd, TTM_SETTIPBKCOLOR, mvarBackColor, 0&
    End If
    SendMessageLong m_lTTHwnd, TTM_SETDELAYTIME, TTDT_AUTOPOP, mvarVisibleTime
    SendMessageLong m_lTTHwnd, TTM_SETDELAYTIME, TTDT_INITIAL, mvarDelayTime
End Function
'销毁对象
Public Sub Destroy()
    If m_lTTHwnd <> 0 Then
        DestroyWindow m_lTTHwnd
    End If
End Sub

一个朋友给的  我感觉也挺炫的    :)
2009-6-7 22:13
0
雪    币: 2067
活跃值: (82)
能力值: ( LV9,RANK:180 )
在线值:
发帖
回帖
粉丝
11

这个坛可能有 250,080 个人会
2009-6-8 01:30
0
雪    币: 104
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
12
Vb的都比较晕,下载搞下
2009-6-8 09:50
0
雪    币: 116
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
13
世界很大   自己真渺小   看来要更努力的  学习了
2009-6-9 04:25
0
雪    币: 251
活跃值: (25)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
14
机器码:5SW0L97H
注册码:NVNXMEw5N0g=

再送上一个爆破的。
上传的附件:
2009-6-9 06:27
0
雪    币: 116
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
15
你们都很优秀喔   
2009-6-9 07:25
0
雪    币: 256
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
16
9TE0AYYR
OVRFMEFZWVI=
2009-6-9 14:20
0
雪    币: 318
活跃值: (10)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
17
第一个是明码比较比较简单
机器码:WD-WCAS26446229
注册码:V0QtV0NBUzI2NDQ2MjI5
2009-6-9 19:57
0
雪    币: 50
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
18
WD-WCANMH311830
V0QtV0NBTk1IMzExODMw

我新手
2009-6-13 13:49
0
游客
登录 | 注册 方可回帖
返回
//