Thread: TextOut

  1. #1
    Banned
    Join Date
    Oct 2004
    Posts
    250

    TextOut

    im very close to releasing my first addons for halo but i cant figure out how to use TextOut cant anyone give me a working example
    Code:
    #include <windows.h>
    using namespace std;
    int main()
    {
       while(true)
       {
           if(GetAsyncKeyState(VK_F7))
           {
               HWND hwnd = FindWindow(NULL, "Halo");
               if(!hwnd)
               {
                   TextOut(hwnd,"error finding halo",0);
               }
               else
               {
                   TextOut(hwnd,"Aimbot ON",0);
               }
           } 
       }               
    }

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    TextOut() requires a device context in order to draw to the screen.

  3. #3
    Banned
    Join Date
    Oct 2004
    Posts
    250
    i cant seem to get it working... you woudent happen to have a working example would you?

  4. #4
    Registered User PanzTec's Avatar
    Join Date
    Sep 2004
    Posts
    24
    heres and example.... and a good one to... as you can see iv just made the changes to your code


    PHP Code:
    #include <windows.h>
    using namespace std;
    int main()
    {
    HWND      hwnd NULL// globally track main window
    HDC                hdc;    // handle to a device context 

        // set the foreground color to random 
    HDC hdc GetDC(hwnd);
        
    SetTextColor(hdcRGB(rand()%256,rand()%256,rand()%256)); 

        
    // set the background color to black 
        
    SetBkColor(hdcRGB(0,0,0)); 

        
    // finally set the transparency mode to transparent 
        
    SetBkMode(hdcTRANSPARENT);
       while(
    true)
       {
           if(
    GetAsyncKeyState(VK_F7))
           {
               
    HWND hdc FindWindow(NULL"Halo");
               if(!
    hwnd)
               {
                   
    TextOut(hdc,0,0,"error finding halo",strlen("error finding halo"));
               }
               else
               {
                   
    TextOut(hdc,0,0,"Aimbot ON",strlen("Aimbot ON"));
               }
           } 
       }    
    // release the dc
    ReleaseDC(hwnd,hdc);           

    Last edited by PanzTec; 11-09-2004 at 03:03 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. TextOut() flickering
    By Xterria in forum Game Programming
    Replies: 6
    Last Post: 01-22-2004, 09:55 PM
  2. TextOut() Questions
    By Dipset in forum Windows Programming
    Replies: 2
    Last Post: 07-05-2003, 11:38 AM
  3. A small problem with TextOut()
    By Devil Panther in forum Windows Programming
    Replies: 4
    Last Post: 06-28-2003, 01:15 AM
  4. print TextOut
    By andrewjf9 in forum Windows Programming
    Replies: 2
    Last Post: 11-21-2002, 11:36 PM
  5. TextOut problem
    By Chimpsag in forum Windows Programming
    Replies: 1
    Last Post: 09-14-2002, 12:02 PM