用PICTURE,API画阿,这有什么难的 画的时候根据自己需要大小就可以哪,很简单的Public Sub DrawImage(ByVal rctLeft As Long, ByVal rctTop As Long, ByVal rctWidth As Long, ByVal rctHeight As Long, picImage As Picture, oPalette As Object, Optional ByVal clrMaskColor As OLE_COLOR = -1, Optional ByVal clrBackColor As OLE_COLOR = -1, Optional ByVal bEnabled As Integer = True)
Dim lhbmMemory As Long Dim lhbmMemoryOld As Long Dim lhdcMem As Long 'HDC Dim lBackColor As Long Dim udtPictureFrame As RECT Dim udtPictureRect As RECT Dim bUseMask As Boolean Dim lhPal As Long Dim lhPalOld As Long Dim lhbrBack As Long Dim bHavePalette As Boolean Dim oDrawTool As New clsDrawPictures
On Error Resume Next 'Error will occur if the Ambient.Palette is not supported bHavePalette = CBool(oPalette) '(Not oPalette Is Nothing) '(Not UserControl.Ambient.Palette Is Nothing) If Err.Number <> 0 Then bHavePalette = False Err.Clear If bHavePalette Then 'If the Palette or hPal property fails 'resume next and use the halftone palette lhPal = oPalette.hPal 'UserControl.Ambient.Palette.hPal If lhPal = 0 Then lhPal = mlhHalftonePal Err.Clear Else lhPal = mlhHalftonePal 'If there is no specified palette 'use the halftone palette. End If On Error GoTo DrawImage_Error
'Create memory DC and bitmap to do all of the painting work lhdcMem = CreateCompatibleDC(m_hdc) 'UserControl.hdc) lhbmMemory = CreateCompatibleBitmap(m_hdc, udtPictureRect.Right, udtPictureRect.Bottom) '(UserControl.hdc, mudtButtonRect.Right, mudtButtonRect.Bottom) lhbmMemoryOld = SelectObject(lhdcMem, lhbmMemory) lhPalOld = SelectPalette(lhdcMem, lhPal, True) RealizePalette lhdcMem
'fill the memory DC with the background color of the screen dc If clrBackColor = -1 Then clrBackColor = GetBkColor(m_hdc) End If OleTranslateColor clrBackColor, 0, lBackColor 'UserControl.BackColor, 0, lBackColor SetBkColor lhdcMem, lBackColor lhbrBack = CreateSolidBrush(lBackColor) FillRectAPI lhdcMem, udtPictureRect, lhbrBack 'mudtButtonRect, lhbrBack If Not picImage Is Nothing Then 'Not m_picPictured Is Nothing Then If picImage.Type = vbPicTypeBitmap Then 'If m_picPictured.Type = vbPicTypeBitmap Then If clrMaskColor <> -1 Then bUseMask = True End If If Not bEnabled Then 'If button is disabled draw disabled picture on memory dc oDrawTool.DrawDisabledPicture lhdcMem, picImage, udtPictureRect.Left, udtPictureRect.Top, udtPictureRect.Left + udtPictureRect.Right, udtPictureRect.Top + udtPictureRect.Bottom, lBackColor, bUseMask, clrMaskColor, lhPal 'lhdcMem, m_picPictured, udtPictureRect.Left, udtPictureRect.Top, mudtPicturePoint.x, mudtPicturePoint.y, lBackColor, bUseMask, m_clrMaskColor, lhPal ElseIf bUseMask Then 'if using mask color draw transparent bitmap on memory dc oDrawTool.DrawTransparentBitmap lhdcMem, picImage, udtPictureRect.Left, udtPictureRect.Top, udtPictureRect.Left + udtPictureRect.Right, udtPictureRect.Top + udtPictureRect.Bottom, clrMaskColor, lhPal 'lhdcMem, picImage, udtPictureRect.Left, udtPictureRect.Top, mudtPicturePoint.x, mudtPicturePoint.y, m_clrMaskColor, lhPal Else 'otherwise draw picture with no effects on button If picImage.Type = vbPicTypeBitmap Then 'If m_picPictured.Type = vbPicTypeBitmap Then oDrawTool.DrawBitmapToHDC lhdcMem, picImage, udtPictureRect.Left, udtPictureRect.Top, udtPictureRect.Left + udtPictureRect.Right, udtPictureRect.Top + udtPictureRect.Bottom, lhPal 'lhdcMem, m_picPictured, udtPictureRect.Left, udtPictureRect.Top, mudtPicturePoint.x, mudtPicturePoint.y, lhPal ElseIf picImage.Type = vbPicTypeIcon Then 'ElseIf m_picPictured.Type = vbPicTypeIcon Then DrawIcon lhdcMem, udtPictureRect.Left, udtPictureRect.Top, picImage.Handle 'm_picPictured.Handle End If End If End If
DrawImage: BitBlt m_hdc, udtPictureFrame.Left, udtPictureFrame.Top, udtPictureFrame.Right, udtPictureFrame.Bottom, lhdcMem, 0, 0, vbSrcCopy 'UserControl.hdc, 0, 0, udtPictureFrame.Right, udtPictureFrame.Bottom, lhdcMem, 0, 0, vbSrcCopyDrawImageCleanUp: DeleteObject lhbrBack SelectPalette lhdcMem, lhPalOld, True RealizePalette (lhdcMem) DeleteObject SelectObject(lhdcMem, lhbmMemoryOld) DeleteDC lhdcMem Exit SubDrawImage_Error: Select Case Err.Number Case giOBJECT_VARIABLE_NOT_SET Resume DrawImage Case giINVALID_PICTURE Resume DrawImage Case Else Resume DrawImageCleanUp End Select End Sub
对方收到的是特殊符号
但是显示的是图片而且 输入的时候可以在任意的位置上
显示也不出错~~无论字体大小 心情符所占的空格不变
还有的是 按删除键的时候 他可以当一个文字一样删除掉我试过用richtextbox+剪贴板来实现 但是 图片可以调大小 晕~~
怎么样能在像QQ一样实现呢,除了网页方式~~有没有简单直接的方式去做就是这个问题 不是这么难吧~~把人都难倒了吗??~~~~~~~~~晕死ING
楼主: 本软件是我在业余时间完成,我的目标是将它做成国内一流的客户端邮件软件.现在初具模型.正在修改中.它有一下特点:
1. 基于SDK模式开发
2. 大量源代码:软件中用到的所有组件,包括每一个按钮,均是自己所写.形成了自己风格的完整的一套组件库.他们包括:列表,文件管理,菜单等
所有代码均参照标准协议写成3. 由以下功能模块组成:邮件;新闻组;FTP;任务及其在之基础上的相应管理.如文件管理等.
4. 合作方式:转让经营权;根据你们需要提供技术支持;作为贵公司产品发布等,我们可以详细谈.我的联系方式是:[email protected] 13062323245一下为该软件部分运行界面图:
安装盘下:ftp://[email protected]/SmartMai_Setup.EXE代码下:ftp://[email protected]/SmartMail_Code.rarftp密码:uploads建议大家先下安装盘,因为比较新,支持皮肤改变,自己定义哦
http://bbs.2ccc.com/uploads/huangtao/picture.jpg
安装盘下:ftp://[email protected]/SmartMai_Setup.EXE
代码下:ftp://[email protected]/SmartMail_Code.rar
ftp密码:uploads
画的时候根据自己需要大小就可以哪,很简单的Public Sub DrawImage(ByVal rctLeft As Long, ByVal rctTop As Long, ByVal rctWidth As Long, ByVal rctHeight As Long, picImage As Picture, oPalette As Object, Optional ByVal clrMaskColor As OLE_COLOR = -1, Optional ByVal clrBackColor As OLE_COLOR = -1, Optional ByVal bEnabled As Integer = True)
Dim lhbmMemory As Long
Dim lhbmMemoryOld As Long
Dim lhdcMem As Long 'HDC
Dim lBackColor As Long
Dim udtPictureFrame As RECT
Dim udtPictureRect As RECT
Dim bUseMask As Boolean
Dim lhPal As Long
Dim lhPalOld As Long
Dim lhbrBack As Long
Dim bHavePalette As Boolean
Dim oDrawTool As New clsDrawPictures
On Error GoTo DrawImage_Error
udtPictureRect.Left = 0
udtPictureRect.Top = 0
udtPictureRect.Right = rctWidth
udtPictureRect.Bottom = rctHeight
udtPictureFrame.Left = rctLeft
udtPictureFrame.Top = rctTop
udtPictureFrame.Right = rctLeft + rctWidth
udtPictureFrame.Bottom = rctTop + rctHeight
On Error Resume Next
'Error will occur if the Ambient.Palette is not supported
bHavePalette = CBool(oPalette) '(Not oPalette Is Nothing) '(Not UserControl.Ambient.Palette Is Nothing)
If Err.Number <> 0 Then bHavePalette = False
Err.Clear
If bHavePalette Then
'If the Palette or hPal property fails
'resume next and use the halftone palette
lhPal = oPalette.hPal 'UserControl.Ambient.Palette.hPal
If lhPal = 0 Then lhPal = mlhHalftonePal
Err.Clear
Else
lhPal = mlhHalftonePal 'If there is no specified palette
'use the halftone palette.
End If
On Error GoTo DrawImage_Error
'Create memory DC and bitmap to do all of the painting work
lhdcMem = CreateCompatibleDC(m_hdc) 'UserControl.hdc)
lhbmMemory = CreateCompatibleBitmap(m_hdc, udtPictureRect.Right, udtPictureRect.Bottom) '(UserControl.hdc, mudtButtonRect.Right, mudtButtonRect.Bottom)
lhbmMemoryOld = SelectObject(lhdcMem, lhbmMemory)
lhPalOld = SelectPalette(lhdcMem, lhPal, True)
RealizePalette lhdcMem
'fill the memory DC with the background color of the screen dc
If clrBackColor = -1 Then
clrBackColor = GetBkColor(m_hdc)
End If
OleTranslateColor clrBackColor, 0, lBackColor 'UserControl.BackColor, 0, lBackColor
SetBkColor lhdcMem, lBackColor
lhbrBack = CreateSolidBrush(lBackColor)
FillRectAPI lhdcMem, udtPictureRect, lhbrBack 'mudtButtonRect, lhbrBack
If Not picImage Is Nothing Then 'Not m_picPictured Is Nothing Then
If picImage.Type = vbPicTypeBitmap Then 'If m_picPictured.Type = vbPicTypeBitmap Then
If clrMaskColor <> -1 Then bUseMask = True
End If
If Not bEnabled Then
'If button is disabled draw disabled picture on memory dc
oDrawTool.DrawDisabledPicture lhdcMem, picImage, udtPictureRect.Left, udtPictureRect.Top, udtPictureRect.Left + udtPictureRect.Right, udtPictureRect.Top + udtPictureRect.Bottom, lBackColor, bUseMask, clrMaskColor, lhPal 'lhdcMem, m_picPictured, udtPictureRect.Left, udtPictureRect.Top, mudtPicturePoint.x, mudtPicturePoint.y, lBackColor, bUseMask, m_clrMaskColor, lhPal
ElseIf bUseMask Then
'if using mask color draw transparent bitmap on memory dc
oDrawTool.DrawTransparentBitmap lhdcMem, picImage, udtPictureRect.Left, udtPictureRect.Top, udtPictureRect.Left + udtPictureRect.Right, udtPictureRect.Top + udtPictureRect.Bottom, clrMaskColor, lhPal 'lhdcMem, picImage, udtPictureRect.Left, udtPictureRect.Top, mudtPicturePoint.x, mudtPicturePoint.y, m_clrMaskColor, lhPal
Else
'otherwise draw picture with no effects on button
If picImage.Type = vbPicTypeBitmap Then 'If m_picPictured.Type = vbPicTypeBitmap Then
oDrawTool.DrawBitmapToHDC lhdcMem, picImage, udtPictureRect.Left, udtPictureRect.Top, udtPictureRect.Left + udtPictureRect.Right, udtPictureRect.Top + udtPictureRect.Bottom, lhPal 'lhdcMem, m_picPictured, udtPictureRect.Left, udtPictureRect.Top, mudtPicturePoint.x, mudtPicturePoint.y, lhPal
ElseIf picImage.Type = vbPicTypeIcon Then 'ElseIf m_picPictured.Type = vbPicTypeIcon Then
DrawIcon lhdcMem, udtPictureRect.Left, udtPictureRect.Top, picImage.Handle 'm_picPictured.Handle
End If
End If
End If
DrawImage:
BitBlt m_hdc, udtPictureFrame.Left, udtPictureFrame.Top, udtPictureFrame.Right, udtPictureFrame.Bottom, lhdcMem, 0, 0, vbSrcCopy 'UserControl.hdc, 0, 0, udtPictureFrame.Right, udtPictureFrame.Bottom, lhdcMem, 0, 0, vbSrcCopyDrawImageCleanUp:
DeleteObject lhbrBack
SelectPalette lhdcMem, lhPalOld, True
RealizePalette (lhdcMem)
DeleteObject SelectObject(lhdcMem, lhbmMemoryOld)
DeleteDC lhdcMem
Exit SubDrawImage_Error:
Select Case Err.Number
Case giOBJECT_VARIABLE_NOT_SET
Resume DrawImage
Case giINVALID_PICTURE
Resume DrawImage
Case Else
Resume DrawImageCleanUp
End Select
End Sub
关于:那个游戏的密码输入框中。请问要怎么做啊?
注意我要的关键是第二步!第一步已经搞定!是啊,那个被找的窗体上有两个 edit 控件,如何区别他们!!区别出我要的那一个
可以这样:
Public Const WC_WEBBROWSER = "Shell Embedding"
"Shell Embedding"替换为EDIT组件的类名
m_hwndEdit = FindWindowEx(Form.hwnd, ByVal 0&, WC_WEBBROWSER, vbNullString)
得到EDIT组件句柄了
If m_Form.hwnd Then Call SubClassExplorerDirectionary(m_hwndWB, AddressOf WBWndProcExplorerDirectionary, Me)SubClassExplorerDirectionary 为钩子
WBWndProcExplorerDirectionary为回调函数
在回调函数中根据消息判断就可以哪!!
根据坐标,句柄和sendmessage 就可以发TXT到编辑框阿此为一个演示,自己修改其他部分!