| View previous topic :: View next topic |
| Author |
Message |
AwayTheWInd Master Cheater
Reputation: 0
Joined: 11 Sep 2007 Posts: 450
|
Posted: Wed Apr 02, 2008 5:19 pm Post subject: last C++ question.. |
|
|
ye.. last qusetion for today..
whats wrong with this cuz i get some really weird message when i try this:
char Angle [256];
printf(Angle,"Angle = %d")
MessageBoxA(0,Angle,"Angle",MB_OK);
?
_________________
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Wed Apr 02, 2008 5:44 pm Post subject: |
|
|
why dont u just post in the same topic?
We just! went over this.
printf's Syntax is TEXT THEN VARIABLES
printf( "Text %d, %s, %c", aDecimal, aString, aChar );
anyways, what you want is "sprintf". It copies a string of text you define to an array of charecters or a string.
| Code: | char Angel[256];
int AngelsVal = 1;
sprintf(Angel,"Angel = %d", AngelsVal);
MessageBox( 0, Angel, "Angle", MB_OK ); |
_________________
|
|
| Back to top |
|
 |
AwayTheWInd Master Cheater
Reputation: 0
Joined: 11 Sep 2007 Posts: 450
|
Posted: Sat Apr 05, 2008 9:45 pm Post subject: |
|
|
ok..cuz lurc wants me to post in the same topic...
is it possible to have a messagebox u make pop over a window like gunbound.
and...
if thats not possible. can someone post the function for drawing text over a window cuz i cant understand the stuff i find on google o.O
ty in advace?
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sat Apr 05, 2008 9:52 pm Post subject: |
|
|
The first param of a MessageBox is the handle to the window the owns the message box. Leaving it 0 means no owner so it does not take focus over anything. Instead, pass the hWnd of the program you want it to show over, such as the handle to Gunbound like you want.
_________________
- Retired. |
|
| Back to top |
|
 |
AwayTheWInd Master Cheater
Reputation: 0
Joined: 11 Sep 2007 Posts: 450
|
Posted: Sat Apr 05, 2008 9:55 pm Post subject: |
|
|
so like i define gunbound first:
HWND GunBound
blahblahblah....
MessageBoxA(hGunBound,"blah","blah",0)
is that right?
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sat Apr 05, 2008 10:04 pm Post subject: |
|
|
Your define was:
HWND GunBound;
So you would need to use:
MessageBox( GunBound, ....
_________________
- Retired. |
|
| Back to top |
|
 |
AwayTheWInd Master Cheater
Reputation: 0
Joined: 11 Sep 2007 Posts: 450
|
Posted: Mon Apr 07, 2008 8:34 pm Post subject: |
|
|
um.. that doesnt work. and i think u dont understand. im injecting a DLL into gunbound. so i dont need htat first param. i want it to POP OVER gunbound. ure method just does the same thing as 0, make it pop behind it so i have to alt tab. is there a drawing function? or is there a way to solve this? +rep for effort xD
edit: cant rep o.O
_________________
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Mon Apr 07, 2008 9:06 pm Post subject: |
|
|
i believe that in the last param you can use
MB_OK | MB_SETFORGROUND
It may pop up above.
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Apr 08, 2008 1:48 am Post subject: |
|
|
| AwayTheWInd wrote: | um.. that doesnt work. and i think u dont understand. im injecting a DLL into gunbound. so i dont need htat first param. i want it to POP OVER gunbound. ure method just does the same thing as 0, make it pop behind it so i have to alt tab. is there a drawing function? or is there a way to solve this? +rep for effort xD
edit: cant rep o.O |
I do understand you, I was correcting your error in your post above.
And just because you are injected does not mean you do not need that param. The first param is the owner window handle:
MessageBox: http://msdn2.microsoft.com/en-us/library/ms645505(VS.85).aspx
[in] Handle to the owner window of the message box to be created. If this parameter is NULL, the message box has no owner window.
You can use MB_SYSTEMMODAL as the flag to force the person to click the messagebox before continuing, along with that, MB_SYSTEMMODAL gets a style of WS_EX_TOPMOST, or you can simply use MB_TOPMOST like lurc said to give it topmost.
_________________
- Retired. |
|
| Back to top |
|
 |
AwayTheWInd Master Cheater
Reputation: 0
Joined: 11 Sep 2007 Posts: 450
|
Posted: Tue Apr 08, 2008 6:57 pm Post subject: |
|
|
um..apparently gunbound doesnt like it when there are stuff on top of it.
how can i use the draw function to write words? whenever i search it up, its always about drawing shapes.
---->>>>> draw(?????????????????????)
how would i do thatl iek i want to draw "buffer" on top of GunBound?
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Tue Apr 08, 2008 11:12 pm Post subject: |
|
|
| AwayTheWInd wrote: | um..apparently gunbound doesnt like it when there are stuff on top of it.
how can i use the draw function to write words? whenever i search it up, its always about drawing shapes.
---->>>>> draw(?????????????????????)
how would i do thatl iek i want to draw "buffer" on top of GunBound? |
Depending on the engine used by the game you could hook (which GameGuard will probably stop you from doing this..) the interface that is being used (DirectX, OpenGL, etc.) and output text yourself through the engines drawing functions.
You can also draw to the window of the game using the GDI functions such as:
- DrawText http://msdn2.microsoft.com/en-us/library/ms533909(VS.85).aspx
- TextOut http://msdn2.microsoft.com/en-us/library/ms534019(VS.85).aspx
If the game has a console in the game, you could obtain the pointer to the function call and send messages to the console from your hook.
_________________
- Retired. |
|
| Back to top |
|
 |
AwayTheWInd Master Cheater
Reputation: 0
Joined: 11 Sep 2007 Posts: 450
|
Posted: Wed Apr 09, 2008 2:39 pm Post subject: |
|
|
it wont work the way the syntax is...so i propose another idea to solve my problem which i have not clearly stated. is there any way i can make a messagebox exit itself after like 250 milliseconds?
_________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Apr 09, 2008 3:42 pm Post subject: |
|
|
| Wiccaan wrote: | | AwayTheWInd wrote: | um..apparently gunbound doesnt like it when there are stuff on top of it.
how can i use the draw function to write words? whenever i search it up, its always about drawing shapes.
---->>>>> draw(?????????????????????)
how would i do thatl iek i want to draw "buffer" on top of GunBound? |
Depending on the engine used by the game you could hook (which GameGuard will probably stop you from doing this..) the interface that is being used (DirectX, OpenGL, etc.) and output text yourself through the engines drawing functions.
You can also draw to the window of the game using the GDI functions such as:
- DrawText http://msdn2.microsoft.com/en-us/library/ms533909(VS.85).aspx
- TextOut http://msdn2.microsoft.com/en-us/library/ms534019(VS.85).aspx
If the game has a console in the game, you could obtain the pointer to the function call and send messages to the console from your hook. |
I imagine using GDI would be flickery as hell though, right?
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Apr 10, 2008 12:05 am Post subject: |
|
|
If used correctly it wont flicker at all.
_________________
- Retired. |
|
| Back to top |
|
 |
AwayTheWInd Master Cheater
Reputation: 0
Joined: 11 Sep 2007 Posts: 450
|
Posted: Thu Apr 10, 2008 2:21 pm Post subject: |
|
|
what do u mean by "hooked"?
_________________
|
|
| Back to top |
|
 |
|