Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <windows.h>
- HWND hWnd = GetForegroundWindow();
- HDC hdc = GetWindowDC(hWnd);
- COORD P = { 0 };
- HPEN hPen1 = CreatePen(PS_SOLID, 2, RGB(255, 0, 0)),
- hPen2 = CreatePen(PS_SOLID, 7, RGB( 25, 220, 0)),
- hPen3 = CreatePen(PS_SOLID, 2, RGB( 84, 79, 171)),
- hPen4 = CreatePen(PS_SOLID, 2, RGB(214, 73, 151));
- void foo(int x, int y);
- ////////////////////////////////////////////////////////////////////////////////
- int main() //
- {
- RECT pRECT = { 0 };
- GetClientRect(hWnd, &pRECT);
- HDC hdc = GetWindowDC(hWnd);
- SetBkMode(hdc, 1); // TRANSPARENT
- EXTLOGPEN pINFO;
- GetObject(hPen1, sizeof(EXTLOGPEN), &pINFO);
- SelectObject(hdc, hPen3);
- for (int i = 0; i < 200; i +=30)
- {
- MoveToEx(hdc, 50, 120 + i, 0);
- LineTo(hdc, 230, 120 + i);
- MoveToEx(hdc, 50 + i, 120, 0);
- LineTo(hdc, 50 + i, 300);
- Sleep(1000);
- }
- for(int i = 1; i < 7; i++)
- {
- Sleep(100);
- foo(i, i);
- }
- for(int i = 1; i < 7; i++)
- {
- Sleep(100);
- foo(1, i);
- }
- }
- ////////////////////////////////////////////////////////
- void foo(int x, int y)
- {
- SelectObject(hdc, hPen1);
- P.X = 35 + (y*30);
- P.Y = 105 + (x*30);
- Ellipse(hdc,
- P.X - 5,
- P.Y + 5,
- P.X + 5,
- P.Y - 5);
- }
- /*
- #include <stdio.h>
- void foo(int* p);
- //////////////////////////////////////////////
- int main()
- {
- int nA = 2;
- foo(&nA);
- printf("nA = %d\n", nA);
- }
- //////////////////////////////////////////////
- void foo(int* p)
- {
- int nB = 55;
- int r1 = nB;
- nB = *p;
- printf("nB = %d\n", nB);
- *p = r1;
- }
- */
- // int& r1 = nB;
- /*
- #include <stdio.h>
- #include <windows.h>
- //#define WM_SETFONT 0x0030
- HWND hWnd = GetForegroundWindow();
- HDC hdc = GetWindowDC(hWnd);
- COORD P = { 0 };
- HPEN hPen1 = CreatePen(PS_SOLID, 2, RGB(255, 0, 0)),
- hPen2 = CreatePen(PS_SOLID, 7, RGB( 25, 220, 0)),
- hPen3 = CreatePen(PS_SOLID, 2, RGB( 84, 79, 171)),
- hPen4 = CreatePen(PS_SOLID, 2, RGB(214, 73, 151));
- HFONT hFont[20] = { (HFONT)GetStockObject(10), // ¹0 OEM_FIXED_FONT
- (HFONT)GetStockObject(11), // ¹1 ANSI_FIXED_FONT
- (HFONT)GetStockObject(12), // ¹2 ANSI_VAR_FONT
- (HFONT)GetStockObject(13), // ¹3 SYSTEM_FONT
- (HFONT)GetStockObject(16), // ¹4 SYSTEM_FIXED_FONT
- (HFONT)GetStockObject(17) }; // ¹5 DEFAULT_GUI_FONT
- void foo(int x, int y);
- ////////////////////////////////////////////////////////////////////////////////
- int main() //
- {
- RECT pRECT = { 0 };
- GetClientRect(hWnd, &pRECT);
- HDC hdc = GetWindowDC(hWnd);
- SetBkMode(hdc, 1); // TRANSPARENT
- EXTLOGPEN pINFO;
- GetObject(hPen1, sizeof(EXTLOGPEN), &pINFO);
- SelectObject(hdc, hPen3);
- for (int i = 0; i < 200; i +=30)
- {
- MoveToEx(hdc, 50, 120 + i, 0);
- LineTo(hdc, 230, 120 + i);
- MoveToEx(hdc, 50 + i, 120, 0);
- LineTo(hdc, 50 + i, 300);
- Sleep(100);
- }
- for(int i = 0; i < 6; i++)
- {
- Sleep(200);
- // SelectObject(hdc, (HFONT)GetStockObject(10));
- SelectObject(hdc, hFont[i]);
- SetTextColor(hdc, RGB (50*i, 200, 255- (50*i)));
- TextOut(hdc, 300, 130+(20*i), "SONY", 4);
- }
- for(int i = 1; i < 7; i++)
- {
- Sleep(200);
- foo(i, i);
- }
- for(int i = 1; i < 7; i++)
- {
- Sleep(200);
- foo(1, i);
- }
- }
- ////////////////////////////////////////////////////////
- void foo(int x, int y)
- {
- SelectObject(hdc, hPen1);
- P.X = 125- 90 + (y*30);
- P.Y = 225-120 + (x*30);
- Ellipse(hdc,
- P.X - 5,
- P.Y + 5,
- P.X + 5,
- P.Y - 5);
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement