|
Thread |
Forum |
Last Post |
Posts |
Views |
 |
Clock aus tut wird nicht angezeigt
Posted on: Thu 6. Oct 2011, 21:25
7xCore
Preview
Go To Post
Hallo. In einem Tut wird ja gezeigt , wie man ne uhr ingame anzeigen lassen kann. Der code compeliert super , aber die uhr sieht man nicht. CPP Code: #include <windows.h> //zum Zeichnen #include <time.h> //für die Uhrzeit #include <stdio.h> bool an = true, draw = false; struct tm *aktuellezeit; time_t aktuelle_zeit; char zeit[256]; HWND foreground = NULL; HDC hdc = NULL; int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { while(an) //Programm am Laufen halten { //Tastaturabfrage if(GetAsyncKeyState(VK_F11)) draw = !draw; else if(GetAsyncKeyState(VK_F12)) an = !an; if(draw) { //Zeit besorgen time(&aktuelle_zeit); aktuellezeit = localtime(&aktuelle_zeit); sprintf(zeit,"[%02d:%02d:%02d]",aktuellezeit->tm_hour,aktuellezeit->tm_min,aktuellezeit->tm_sec); //Text zeichnen foreground = GetForegroundWindow(); hdc = GetDC(foreground); SetBkMode(hdc, TRANSPARENT); SetTextColor(hdc,RGB(255,0,0)); TextOutA(hdc,10,10, zeit,10); //der letzte Parameter muss u.U. angepasst werden UpdateWindow(foreground); ReleaseDC(foreground,hdc); } //wir lassen das Programm 1ms schlafen, damit es nicht 100% Auslastung verursacht Sleep(10); } return 0; }
weiß irgendjemand was ?
|
Tutorials |
Thu 10. Nov 2011, 03:16
by yourmt
|
1 |
398 |
 |
SWBF 2 hilfe
Posted on: Wed 5. Oct 2011, 16:39
7xCore
Preview
Go To Post
Hallo Forumcommunity. Ich hab gerade vor , für das Spiel Starwars Battlefront 2 so anzufangen , hacks zu programmieren. Das ist für mich ziehmliches Neuland , ich habe nur gute erfahrung in c++.Anfangen werde ich natürlich erstmal , zu versuchen text in dem fenster des spiels anzeigen zu lassen.Ich hab mich schon ein bisschen umgesehen und bin bis jetzt so weit , das ich auf das fenster Zugriff habe. CPP Code: #include <windows.h> #include <iostream> #include <string> using namespace std; typedef unsigned int uint; HANDLE hproc; DWORD procid; int main(void) { HWND hWnd; hWnd = FindWindow(0,L"Star Wars Battlefront II"); if(!hWnd){ system("color 0C"); cout << "Window nicht gefunden" << endl; char x; cin >> x; return 0; } system("color 0A"); cout << hWnd << " gefunden" << endl; GetWindowThreadProcessId(hWnd, &procid); hproc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procid); CloseHandle(hproc); return 0; }
So nun hab ich die Funktion SendText gesehen , doch geht das senden von strings nicht, also es wird kein text angezeigt.Jetzt würd ich gerne wissen , wie man das macht , ob es da libs or guis gibt.Oder ein bsp code. Danke - 7xCore
|
VB, C/C++, Delphi, etc |
Wed 5. Oct 2011, 16:39
by 7xCore
|
0 |
298 |