View previous topic :: View next topic |
Author |
Message |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Apr 21, 2008 6:01 am Post subject: Remove textout text |
|
|
hey, i was wondering if anyone knew how to get rid of text made by using the TextOut function
_________________
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Mon Apr 21, 2008 8:04 am Post subject: |
|
|
ReleaseDC
|
|
Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Apr 21, 2008 8:48 am Post subject: |
|
|
i tried that, it made the text stick there even more, im making it on notepad btw
_________________
|
|
Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Mon Apr 21, 2008 8:55 am Post subject: |
|
|
Release it and then call WM_PAINT?
|
|
Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Apr 21, 2008 9:19 am Post subject: |
|
|
umm, ill try
im doing this in delphi btw, WindowProc only takes 1 parameter
_________________
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8585 Location: 127.0.0.1
|
Posted: Mon Apr 21, 2008 10:16 am Post subject: |
|
|
UpdateWindow API will send WM_PAINT message to the given window handle.
_________________
- Retired. |
|
Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Apr 21, 2008 11:15 pm Post subject: |
|
|
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 |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Mon Apr 21, 2008 11:23 pm Post subject: |
|
|
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 |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Mon Apr 21, 2008 11:30 pm Post subject: |
|
|
Code: | UpdateWindow(windowhandle);
ReleaseDC(windowhandle, mydc);
UpdateWindow(windowhandle); |
nope, didn't work
_________________
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8585 Location: 127.0.0.1
|
Posted: Tue Apr 22, 2008 6:25 am Post subject: |
|
|
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 |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Tue Apr 22, 2008 6:48 am Post subject: |
|
|
yay, thanks wicaan, i got it to work using InvalidateRect, i actually tried it before, but gave up after a while
_________________
|
|
Back to top |
|
 |
|