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 


[C++] PostmessageA
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
ElectroFusion
Grandmaster Cheater
Reputation: 0

Joined: 17 Dec 2006
Posts: 786

PostPosted: Sat Jun 14, 2008 7:57 pm    Post subject: Reply with quote

Nvm, thanks soo muchhh
_________________
qwerty147 wrote:

ghostonline wrote:

what world are you in?

bera

but i live in NZ
Back to top
View user's profile Send private message
Cx
Master Cheater
Reputation: 0

Joined: 27 Jul 2007
Posts: 367

PostPosted: Sat Jun 14, 2008 8:15 pm    Post subject: Reply with quote

GMZorita, what's the point of the & 1?
Nevermind, people in IRC explained it to me (HalfPrime).
But still pointless.

_________________

armed with this small butterfly net
i will face the world alone
& never be lonely.


Last edited by Cx on Sat Jun 14, 2008 8:44 pm; edited 2 times in total
Back to top
View user's profile Send private message
ElectroFusion
Grandmaster Cheater
Reputation: 0

Joined: 17 Dec 2006
Posts: 786

PostPosted: Sat Jun 14, 2008 8:38 pm    Post subject: Reply with quote

Forgot to ask, how do I kill it?
_________________
qwerty147 wrote:

ghostonline wrote:

what world are you in?

bera

but i live in NZ
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat Jun 14, 2008 9:01 pm    Post subject: Reply with quote

Kill what? You mean keep it from keep sending PostMessage? Just loop the call to PostMessage based on the condintion on a varaible. I.e:

Code:

while(bPMA) {
   //call PostMessage blablabla
}


That way it will only call PostMessage is bPMA (boolean variable) is set to true.

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Jun 15, 2008 7:55 am    Post subject: Reply with quote

I don't understand what everyone does this for

Code:
void SendKey(UINT vk_key) {

   skey = MapVirtualKey(vk_key, 0);

   lparam = (skey << 16) + 1;

   PostMessageX(sHandle, WM_KEYUP, vk_key, lparam);
}


It is so redundant.
Your declaring 2 new variables and assigning them seperate values when you can just do it within the function.

Code:
void SendKey(UINT uKey)
{
     PostMessageX( sHandle, WM_KEYDOWN, uKey, (MapVirtualKey( uKey, 0 ) << 16) );
}


or even use this definition that I created to simplify things.
Hell, this function is so small there is no point to it being a function.

Code:
#define MAKELKEY(vk)   MapVirtualKey( (UINT)(vk), 0 ) << 16
#define SendKey(uKey)  PostMessageX( sHandle, WM_KEYDOWN, (UINT)(uKey), MAKELKEY(uKey) );


or

Code:
#define SendKey(uKey)  PostMessageX( sHandle, WM_KEYDOWN, (UINT)(uKey), ( MapVirtualKey( (UINT)(uKey), 0 ) << 16 ) );


but I'd rather use my MAKELKEY definition as it makes everything a whole lot easier to read.

Now look at your code and mine, see the difference, no wasted variables, its much smaller and more efficiant.

_________________
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
Goto page Previous  1, 2, 3
Page 3 of 3

 
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