如题
解决方案 »
- 用EXCEL还是用DataGrid ?
- 请问如何才能打印出正确的标签呢?主要是位置。
- 紧急:variant 数据类型转换到 Byte 时的问题
- 关于水晶报表的问题?急!
- 各位大侠请进,treeview1_nodeclick问题,谢谢!!!
- 怎么样获得WINDOWS系统帐户和密码?
- 一个难题
- 打包问题(急,解决即散分)
- 请问有没有一些好的邮件控件??一定给分,谢谢!!!
- 请问那里可下载免费的ODBC FOR SYBASE(客户端)驱动程序?
- 复选筐怎么用,里面的程序怎么写?
- :::::::::::::::::::::::::::::关于文件改名:::::::::::::::::::::::::::
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long【别名】
GetWindowTextA【说明】
取得一个窗体的标题(caption)文字,或者一个控件的内容(在vb里使用:使用vb窗体或控件的caption或text属性) 【返回值】
Long,复制到lpString的字串长度;不包括空中止字符。会设置GetLastError 【备注】
不能用它从另一个应用程序的编辑控件中获取文字【参数表】
hwnd ----------- Long,欲获取文字的那个窗口的句柄 lpString ------- String,预定义的一个缓冲区,至少有cch+1个字符大小;随同窗口文字载入
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Private Sub Form_Activate()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: [email protected]
Dim MyStr As String
'Create a buffer
MyStr = String(100, Chr$(0))
'Get the windowtext
GetWindowText Me.hwnd, MyStr, 100
'strip the rest of buffer
MyStr = Left$(MyStr, InStr(MyStr, Chr$(0)) - 1)
'Triple the window's text
MyStr = MyStr + MyStr + MyStr
'Set the new window text
SetWindowText Me.hwnd, MyStr
End Sub
Private Const EM_GETLINE = &HC4
Dim Handle As Long
Dim ComboText As StringComboText = Space(255)
SendMessage Handle, EM_GETLINE, 0, ByVal ComboText
MsgBox "Combo中的内容为:" & Left(ComboText, InStr(ComboText, Chr(0)) - 1)