728x90

'기타' 카테고리의 다른 글

유튜브 동영상  (0) 2021.06.07
티스토리 API - Authentication code 발급 방법  (0) 2021.05.16
728x90

파이썬 - 빗썸 API 이용한 코인 정보 가져오기

빗썸 API - apidocs.bithumb.com/docs/ticker

Public API 참고

소스

from urllib.request import urlopen
import json

order_currency = "BTC" # 검색 화폐
payment_currency = "KRW"

BASE_URL = "https://api.bithumb.com/public/ticker/{}_{}".format(order_currency, payment_currency)
response = urlopen(BASE_URL).read().decode('utf-8')
responseJson = json.loads(response)

print(responseJson.get("status")) # 결과 상태 코드 (정상: 0000, 그 외 에러 코드 참조)
print(responseJson.get("data").get("opening_price")) # 시가 00시 기준
print(responseJson.get("data").get("closing_price")) # 종가 00시 기준

 

 

728x90

파이썬 WinAPI - FindWindow API (카카오톡)

2021.05.01 - [프로그램] - Microsoft Spy++ V10.0

 

Microsoft Spy++ V10.0

Microsoft Spy++ V10.0

clanguage.tistory.com

설치

pip install pypiwin32

소스

import win32gui

kakao = win32gui.FindWindow(None, "채팅창 이름") # Class, caption

print("10진수 :", kakao)
print("16진수 :", hex(kakao))

class name 또는 caption name* 으로 검색하여 handle 값을 반환

*caption name : 윈도우 상에 보이는 이름

 

spy++

 

출력

10진수 : 1247720
16진수 : 0x1309e8

 

FindWindow, FindWindowEX, Sendmessage, Postmessage API 이용하여 카카오톡 채팅 메시지 보내기를 사용할 수 있다.

728x90

'선언
Private Declare Function Beep Lib "kernel32.dll" _
(ByVal dwFreq As Long, ByVal dwDuration As Long) As Long

'사용방법 및 예제
Private Sub Form_Load()
Call Beep(5000, 1000) '  Beep(주파수,재생시간) 1000 = 약 1초
End Sub


참쉽죠?

키워드 : Microsoft Visual Basic 6.0 , Win32 Api , Beep
728x90











FlashWindow API는 작업표시줄에 있는 프로그램목록을 깜빡(?)이는 API이다.

 
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FlashWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal bInvert As Long) As Long

Private Sub Command1_Click()
FlashWindow FindWindow(vbNullString, "네이버 카페 채팅"), 1 '켜짐
FlashWindow FindWindow(vbNullString, "네이버 카페 채팅"), 0 '꺼짐
End Sub

예제파일없음
728x90








Sleep API는 프로그램자체를 일정시간 정지시키는 API이다.

Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)


Private Sub Timer1_Timer()
Sleep 1000
MsgBox "첫번째로나오고 3초 정지후 두번째 메세지"
Sleep 1000
MsgBox "두번째로나오고"
End Sub ' Ctrl + Pause Break 로 빠져나오시길..^^*

예제파일없음
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 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

예제파일없음
728x90

















GetWindowRect API 바탕화면의 해상도를 구할수있는 API이다.

Private Declare Function GetDesktopWindow Lib "user32.dll" () As Long
Private Declare Function GetWindowRect Lib "user32.dll" (ByVal hwnd As Long, ByRef lpRect As RECT) As Long
Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Private Sub Form_Load()
Dim De As RECT
GetWindowRect GetDesktopWindow, De
MsgBox De.Right & " x " & De.Bottom
End Sub

예제파일없음
728x90












GetDC API, GetWindowDC API 두개의 API모두 DC값을 구할수 있는 API이다.

Private Declare Function GetDC Lib "user32.dll" (ByVal hwnd As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32.dll" () As Long
Private Declare Function GetWindowDC Lib "user32.dll" (ByVal hwnd As Long) As Long

Private Sub Form_Load()
MsgBox GetDC(GetDesktopWindow)
MsgBox GetWindowDC(GetDesktopWindow)
End Sub

예제파일없음
728x90

 

 

 

 


GetDesktopWindow API는 데스크탑 핸들값을 구하는 API이다.

Private Declare Function GetDesktopWindow Lib "user32.dll" () As Long

Private Sub Form_Load()
MsgBox GetDesktopWindow ' 메시지창으로 데스크탑 핸들값을 띄움
End Sub


예제파일없음

+ Recent posts