没有合适的资源?快使用搜索试试~ 我知道了~
判断一个控件是否注册
3星 · 超过75%的资源 需积分: 17 49 下载量 161 浏览量
2009-02-18
11:56:46
上传
评论
收藏 1KB TXT 举报
温馨提示
试读
2页
判断一个控件是否注册VB代码,可以完成空件的注册控制
资源推荐
资源详情
资源评论
Private Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
Public Function GetIDEmode() As Boolean
Dim strfileName As String
Dim lngCount As Long
strfileName = String(255, 0)
lngCount = GetModuleFileName(App.hInstance, strfileName, 255)
strfileName = Left(strfileName, lngCount)
If UCase(Right(strfileName, 7)) <> "VB6.EXE" Then
GetIDEmode = False '否
Else
GetIDEmode = True '是
End If
'//也可以获取VB的版本等信息
End Function
完成之后直接结束本vbIDE
Private Sub Timer1_Timer()
'*************现在你不需要修改这里的任何代码***********
On Error Resume Next
If GetIDEmode = True Then '开发环境
Dim lhWndTop As Long
Dim lhWnd As Long
lhWnd = Me.hwnd
lhWndTop = lhWnd
Do While Not (lhWnd = 0)
lhWnd = GetWindow(lhWnd, GW_OWNER)
If Not (lhWnd = 0) Then
Public Function GetIDEmode() As Boolean
Dim strfileName As String
Dim lngCount As Long
strfileName = String(255, 0)
lngCount = GetModuleFileName(App.hInstance, strfileName, 255)
strfileName = Left(strfileName, lngCount)
If UCase(Right(strfileName, 7)) <> "VB6.EXE" Then
GetIDEmode = False '否
Else
GetIDEmode = True '是
End If
'//也可以获取VB的版本等信息
End Function
完成之后直接结束本vbIDE
Private Sub Timer1_Timer()
'*************现在你不需要修改这里的任何代码***********
On Error Resume Next
If GetIDEmode = True Then '开发环境
Dim lhWndTop As Long
Dim lhWnd As Long
lhWnd = Me.hwnd
lhWndTop = lhWnd
Do While Not (lhWnd = 0)
lhWnd = GetWindow(lhWnd, GW_OWNER)
If Not (lhWnd = 0) Then
资源评论
- engqijiang2014-05-31好像不是我想我的代码,不过还是感谢
parksunming
- 粉丝: 1
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功