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++] what's wrong with the code ?!?!
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Sep 07, 2008 6:58 am    Post subject: [c++] what's wrong with the code ?!?! Reply with quote

i want to send key with to every window that's open
i tried this but nothing is sent

Code:

PostMessage(0,WM_KEYDOWN,0x58,1);


i dont want to get a handle to a window and then send to this specific window
i want that if i'll focus "Notepad" for example it will write "xxxx" on it and when i'll focus on other window it will send "x"
also tried to shift left the key and send but nothing is sent..

_________________
Stylo
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sun Sep 07, 2008 8:09 am    Post subject: Reply with quote

HWND_BROADCAST
_________________
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Sep 07, 2008 8:36 am    Post subject: Reply with quote

still not sending..
is the wParam and lParam are correct?
i'm always confuse with these parameters

_________________
Stylo
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: Sun Sep 07, 2008 9:20 am    Post subject: Reply with quote

lParam should be the scan code if I'm not mistaken.

Code:

PostMessage(HWND_BROADCAST, WM_KEYDOWN, 0x58, MapVirtualKey(0x58, NULL) << 16);


I'm pretty sure it's something like that.

_________________


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
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Sun Sep 07, 2008 10:23 am    Post subject: Reply with quote

Why would you want to send messages to all top layer windows? lol
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Sep 07, 2008 10:49 am    Post subject: Reply with quote

no .. i don's want to send the message to all the windows at once
i want to send to the window that got the focus at the same time...
if i'll focus on notepad it'll write x on it and if i'll focus on something else it will send the message to the other window
but i think i mixed it with SendKeys and that's why it doesn't make any sens O_O

_________________
Stylo
Back to top
View user's profile Send private message
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Sun Sep 07, 2008 10:53 am    Post subject: Reply with quote

PostMessage(GetActiveWindow(), WM_KEYDOWN, 0x58, MapVirtualKey(0x58, NULL) << 16);
_________________
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Sep 07, 2008 11:44 am    Post subject: Reply with quote

didn't know about that API thx..
but still doesn't work when i open notepad nothing is written

_________________
Stylo
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: Sun Sep 07, 2008 11:54 am    Post subject: Reply with quote

1qaz wrote:
didn't know about that API thx..
but still doesn't work when i open notepad nothing is written


Maybe because you're not sending it to the edit window.
Back to top
View user's profile Send private message MSN Messenger
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun Sep 07, 2008 12:02 pm    Post subject: Reply with quote

Code:

PostMessage(FindWindowEx(GetActiveWindow(),0,_T("Edit"),0), WM_KEYDOWN, 0x58,1);

still the same sh!t o_o

_________________
Stylo
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sun Sep 07, 2008 12:30 pm    Post subject: Reply with quote

WM_CHAR
_________________
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Sun Sep 07, 2008 1:06 pm    Post subject: Reply with quote

SendInput?
_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Sep 07, 2008 1:10 pm    Post subject: Reply with quote

Use sendinput. I dont think notpad handles messages sent by pma.
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Sun Sep 07, 2008 1:14 pm    Post subject: Reply with quote

dnsi0 wrote:
Use sendinput. I dont think notpad handles messages sent by pma.
wrong. there is a child window which accepts messages.
_________________
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Sun Sep 07, 2008 1:19 pm    Post subject: Reply with quote

sponge wrote:
dnsi0 wrote:
Use sendinput. I dont think notpad handles messages sent by pma.
wrong. there is a child window which accepts messages.


FindWindowEx.
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 1, 2  Next
Page 1 of 2

 
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