728x90
GetPixel API는 마우스포인터에 위치해 있는 픽셀을 가져오는 API입니다.
Private Declare Function GetDesktopWindow Lib "user32.dll" () As Long
Private Declare Function GetPixel Lib "gdi32.dll" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function GetWindowDC Lib "user32.dll" (ByVal hwnd As Long) As Long
Private Declare Function GetCursorPos Lib "user32.dll" (ByRef lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function GetPixel Lib "gdi32.dll" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function GetWindowDC Lib "user32.dll" (ByVal hwnd As Long) As Long
Private Declare Function GetCursorPos Lib "user32.dll" (ByRef lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Timer1_Timer() 'Timer1.Interval = 1
Static MP As POINTAPI
GetCursorPos MP
Form1.Cls
Print Hex(GetPixel(GetWindowDC(GetDesktopWindow), MP.x, MP.y))
End Sub
Static MP As POINTAPI
GetCursorPos MP
Form1.Cls
Print Hex(GetPixel(GetWindowDC(GetDesktopWindow), MP.x, MP.y))
End Sub
예제파일없음
'2020 이전 자료 > Visual Basic 6.0' 카테고리의 다른 글
명인's 싸이월드 스크랩 올리기 Returns Ver 1.1 (2) | 2008.11.29 |
---|---|
명인's 싸이월드 스크랩 올리기 Returns Ver 1.0 (0) | 2008.11.27 |
FlashWindow API 사용방법 (4) | 2008.10.27 |
Sleep API 사용방법 ( 프로그램일시정지 ) (0) | 2008.10.27 |
GetWindowRect API 사용방법 ( 바탕화면해상도구하기 ) (0) | 2008.10.27 |
GetDC API, GetWindowDC API 사용해보자 ( DC값구하기 ) (0) | 2008.10.27 |
GetDesktopWindow API 사용방법 ( 데스크탑핸들구하기 ) (0) | 2008.10.27 |
GetCursorPos API 사용 예제 ( 마우스좌표값알아내기 ) (0) | 2008.10.27 |
VB 유마일 프리셋 쉽게 수정하기 Upgrade (0) | 2008.10.12 |