본문 바로가기
728x90
반응형

봉인72

GetPixel #include #include #include int main() { HDC hdc; HWND hwnd; int x=200; int y=300; hwnd = FindWindow(0, "AFR"); hdc = GetDC(hwnd); int pixel = GetPixel(hdc, x, y); printf("%x\n", pixel); int Color_1 = 0x4064ff; int Color_2 = 0x3964ff; if (pixel == Color_1 || pixel == Color_2) { printf("현재 색상은 %x\n", pixel); } MessageBox(0, pixel, "메시지 박스", MB_OK); MessageBox(0, "마우스 왼쪽 버튼을 눌렀습니다","메시지 박스",MB_OK);.. 2022. 7. 27.
참조 (Ampersand) #include #include /* param에 5를 복사하고 이 param을 func_Amp에 매개변수로 전달(복사 아님)한다. int& a = param이 되고 param에 a 별명을 붙여준다. func_Amp는 별명을 반환하는 함수다. */ int& func_Amp(int& a) //주소 받을 때는 int* a { return a; } int main() { //param을 바꿨을 때 temp도 값이 바뀜 int param = 5; int &temp = func_Amp(param); //별명을 반환 std::cout 2022. 7. 27.
함수 재정의와 함수 오버라이딩(virtual) 1.함수 재정의 #include using namespace std; class Base { public: ① virtual void f() {cout f()를 호출했다고 판단하여 Base::f()가 실행된다. 2. 함수 오버라이딩 #include using namespace std; class Base { public: ① void f() {cout f()는 Base의 f()에 대한 호출로 인지되지만 이를 Derived의 f()로 연결시킴 최종적으로 동적 바인딩을 통해 Derived의 f()가 호출 2022. 7. 27.
pixel color fast https://stackoverflow.com/questions/10515646/get-pixel-color-fastest-way Get Pixel color fastest way? I'm trying to make an auto-cliker for an windows app. It works well, but it's incredibly slow! I'm currently using the method "getPix... stackoverflow.com I'm trying to make an auto-cliker for an windows app. It works well, but it's incredibly slow! I'm currently using the method "getPixel" whic.. 2022. 7. 27.
728x90
반응형