![]() |
| |||||||
| Home | GzP Upload | GzP Arcade | Register | vbBux / vbPlaza | All Albums | FAQ | Donate | Members List | Calendar | Mark Forums Read |
| Soldier Front Hacks Discussion Discuss anything about Soldier Front hacks. Soldier Front Aimbot, Soldier Front Wallhacks. |
![]() |
| | Thread Tools | Display Modes |
| | #1 |
| Registered User | Making a cross hair wid C++ TUT With this code you can draw anything on your screen. In the example below a red crosshair is drawn in the centre of the screen. To turn it on or off press F10. To close it turn the crosshair off and press F11+F12. code: #include <windows.h> bool stdcross=false; bool on=true; void crosshair(); void crosshair2(); void crosshair3(); void crosshair4(); int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) { HANDLE cross1, cross2, cross3, cross4; //multithreading DWORD ThreadID; //get thread id cross1 = CreateThread(NULL, //thread name 0, (LPTHREAD_START_ROUTINE) crosshair, //void name NULL, NULL, &ThreadID); cross2 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) crosshair2, NULL, NULL, &ThreadID); cross3 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) crosshair3, NULL, NULL, &ThreadID); cross4 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) crosshair4, NULL, NULL, &ThreadID); while(on){ Sleep(1); if(GetAsyncKeyState(VK_F10)& (1==1)){ stdcross=!stdcross; } if(GetAsyncKeyState(VK_F11)& GetAsyncKeyState(VK_F12)){ on=false; } } } void crosshair(){ while(on){ Sleep(1); if(stdcross){ int cx = GetSystemMetrics(SM_CXSCREEN); //resolution int cy = GetSystemMetrics(SM_CYSCREEN); int pos1=cx/2; //centre points int pos2=cy/2; HDC hwnd = GetDC(0); //needed to draw while(stdcross && on){ Sleep(1); for(int xhair1=5;xhair1<10;xhair1++) //draw a line 5 pixels long{ SetPixel(hwnd,pos1+xhair1,pos2,RGB(0,255,0)); //set each pixel } } } } } void crosshair2(){ while(on){ Sleep(1); if(stdcross){ int cx = GetSystemMetrics(SM_CXSCREEN); int cy = GetSystemMetrics(SM_CYSCREEN); int pos1=cx/2; int pos2=cy/2; HDC hwnd = GetDC(0); while(stdcross && on){ Sleep(1); for(int xhair1=5;xhair1<10;xhair1++){ SetPixel(hwnd,pos1-xhair1,pos2,RGB(0,255,0)); } } } } } void crosshair3(){ while(on){ Sleep(1); if(stdcross){ int cx = GetSystemMetrics(SM_CXSCREEN); int cy = GetSystemMetrics(SM_CYSCREEN); int pos1=cx/2; int pos2=cy/2; HDC hwnd = GetDC(0); while(stdcross && on){ Sleep(1); for(int xhair1=5;xhair1<10;xhair1++){ SetPixel(hwnd,pos1,pos2+xhair1,RGB(0,255,0)); } } } } } void crosshair4(){ while(on){ Sleep(1); if(stdcross){ int cx = GetSystemMetrics(SM_CXSCREEN); int cy = GetSystemMetrics(SM_CYSCREEN); int pos1=cx/2; int pos2=cy/2; HDC hwnd = GetDC(0); while(stdcross && on){ Sleep(1); for(int xhair1=5;xhair1<10;xhair1++){ SetPixel(hwnd,pos1,pos2-xhair1,RGB(0,255,0)); } } } } } |
| |
| The Following User Says Thank You to Ma44hew For This Useful Post: | kevinbronxx (08-03-2007) |
| Sponsored Links |
| |
| | #2 |
| Registered User | Re: Making a cross hair wid C++ TUT Sorry for not participating in the act, but is this the finished code? |
| |
| | #4 |
| Registered User | Re: Making a cross hair wid C++ TUT #include <windows.h> bool stdcross=false; bool on=true; void crosshair(); void crosshair2(); void crosshair3(); void crosshair4(); int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) { HANDLE cross1, cross2, cross3, cross4; //multithreading DWORD ThreadID; //get thread id cross1 = CreateThread(NULL, //thread name 0, (LPTHREAD_START_ROUTINE) crosshair, //void name NULL, NULL, &ThreadID); cross2 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) crosshair2, NULL, NULL, &ThreadID); cross3 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) crosshair3, NULL, NULL, &ThreadID); cross4 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) crosshair4, NULL, NULL, &ThreadID); while(on){ Sleep(1); if(GetAsyncKeyState(VK_F10)& (1==1)){ stdcross=!stdcross; } if(GetAsyncKeyState(VK_F11)& GetAsyncKeyState(VK_F12)){ on=false; } } } void crosshair(){ while(on){ Sleep(1); if(stdcross){ int cx = GetSystemMetrics(SM_CXSCREEN); //resolution int cy = GetSystemMetrics(SM_CYSCREEN); int pos1=cx/2; //centre points int pos2=cy/2; HDC hwnd = GetDC(0); //needed to draw while(stdcross && on){ Sleep(1); for(int xhair1=5;xhair1<10;xhair1++) //draw a line 5 pixels long{ SetPixel(hwnd,pos1+xhair1,pos2,RGB(0,255,0)); //set each pixel } } } } } void crosshair2(){ while(on){ Sleep(1); if(stdcross){ int cx = GetSystemMetrics(SM_CXSCREEN); int cy = GetSystemMetrics(SM_CYSCREEN); int pos1=cx/2; int pos2=cy/2; HDC hwnd = GetDC(0); while(stdcross && on){ Sleep(1); for(int xhair1=5;xhair1<10;xhair1++){ SetPixel(hwnd,pos1-xhair1,pos2,RGB(0,255,0)); } } } } } void crosshair3(){ while(on){ Sleep(1); if(stdcross){ int cx = GetSystemMetrics(SM_CXSCREEN); int cy = GetSystemMetrics(SM_CYSCREEN); int pos1=cx/2; int pos2=cy/2; HDC hwnd = GetDC(0); while(stdcross && on){ Sleep(1); for(int xhair1=5;xhair1<10;xhair1++){ SetPixel(hwnd,pos1,pos2+xhair1,RGB(0,255,0)); } } } } } void crosshair4(){ while(on){ Sleep(1); if(stdcross){ int cx = GetSystemMetrics(SM_CXSCREEN); int cy = GetSystemMetrics(SM_CYSCREEN); int pos1=cx/2; int pos2=cy/2; HDC hwnd = GetDC(0); while(stdcross && on){ Sleep(1); for(int xhair1=5;xhair1<10;xhair1++){ SetPixel(hwnd,pos1,pos2-xhair1,RGB(0,255,0)); } } } } } what to do with it? |
| |
| | #5 |
| Banned | Re: Making a cross hair wid C++ TUT What do you think? You're supposed to compile it, durr. Oh, and I haven't tested this myself so I don't even know if it works, but nice. And you might want to replace TUT with CODE, because this isn't a tutorial, you just plain-out pasted the script. |
| |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |