Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Remove textout text

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Mon Apr 21, 2008 6:01 am    Post subject: Remove textout text Reply with quote

hey, i was wondering if anyone knew how to get rid of text made by using the TextOut function
_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Apr 21, 2008 8:04 am    Post subject: Reply with quote

ReleaseDC
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Mon Apr 21, 2008 8:48 am    Post subject: Reply with quote

i tried that, it made the text stick there even more, im making it on notepad btw
_________________
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Mon Apr 21, 2008 8:55 am    Post subject: Reply with quote

Release it and then call WM_PAINT?
Back to top
View user's profile Send private message MSN Messenger
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Mon Apr 21, 2008 9:19 am    Post subject: Reply with quote

umm, ill try

im doing this in delphi btw, WindowProc only takes 1 parameter

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Mon Apr 21, 2008 10:16 am    Post subject: Reply with quote

UpdateWindow API will send WM_PAINT message to the given window handle.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Mon Apr 21, 2008 11:15 pm    Post subject: Reply with quote

just looking at the code, it's already got update window in it, and releaseDC, but the text stays

Code:
procedure DrawMyText(windowcaption: string; x: integer; y: integer; text: string; characters: integer);
begin
   windowhandle := FindWindowA(nil, PChar(windowcaption));
   mydc := GetDC(windowhandle);
   SetBkColor(mydc,clBlack);
   //SetBkMode(mydc, 1);

   SetTextColor(mydc,clWhite);
   TextOut(mydc,x,y, PChar(text), characters);

   UpdateWindow(windowhandle);
   ReleaseDC(windowhandle, mydc);
end;

_________________
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Apr 21, 2008 11:23 pm    Post subject: Reply with quote

e: Maybe look into RedrawWindow

Last edited by hcavolsdsadgadsg on Mon Apr 21, 2008 11:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Mon Apr 21, 2008 11:30 pm    Post subject: Reply with quote

Code:
   UpdateWindow(windowhandle);
   ReleaseDC(windowhandle, mydc);
   UpdateWindow(windowhandle);


nope, didn't work

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Tue Apr 22, 2008 6:25 am    Post subject: Reply with quote

Release the DC before you attempt to refresh and update the window. Along with that try making a call to:

1. ReleaseDC
2. InvalidateRect
3. RedrawWindow
4. UpdateWindow

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Tue Apr 22, 2008 6:48 am    Post subject: Reply with quote

yay, thanks wicaan, i got it to work using InvalidateRect, i actually tried it before, but gave up after a while
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites