| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 685 人关注过本帖
标题:[求助]怎么使用releasedc这个东东
只看楼主 加入收藏
xinglsm
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-6-16
收藏
 问题点数:0 回复次数:0 
[求助]怎么使用releasedc这个东东

Private Type POINTAPI '定义一个坐标变量
x As Long
y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Dim z As POINTAPI
Private Sub Command1_Click()
End
End Sub
Private Sub Timer1_Timer()
Dim a, b, c, d As String
GetCursorPos z '得到坐标
Text1.Text = z.x & "," & z.y
a = GetPixel(GetDC(0), z.x, z.y) '得到当前点的颜色
ReleaseDC 0, GetDC(0)
Text1.Text = "#" + Hex(a)
End Sub
程序基本是这样啦,但不知为啥运行一段时间就会失效,请问一下那个releasedc 应该怎么样用,后面的参数怎么写.

搜索更多相关主题的帖子: releasedc 东东 
2007-06-16 20:30
快速回复:[求助]怎么使用releasedc这个东东
数据加载中...
 
   



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

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