| View previous topic :: View next topic |
| Author |
Message |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Sun Sep 07, 2008 6:58 am Post subject: [c++] what's wrong with the code ?!?! |
|
|
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 |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sun Sep 07, 2008 8:09 am Post subject: |
|
|
HWND_BROADCAST _________________
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Sun Sep 07, 2008 8:36 am Post subject: |
|
|
still not sending..
is the wParam and lParam are correct?
i'm always confuse with these parameters _________________
Stylo |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Sun Sep 07, 2008 9:20 am Post subject: |
|
|
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 |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Sun Sep 07, 2008 10:23 am Post subject: |
|
|
| Why would you want to send messages to all top layer windows? lol |
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Sun Sep 07, 2008 10:49 am Post subject: |
|
|
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 |
|
 |
HalfPrime Grandmaster Cheater
Reputation: 0
Joined: 12 Mar 2008 Posts: 532 Location: Right there...On your monitor
|
Posted: Sun Sep 07, 2008 10:53 am Post subject: |
|
|
PostMessage(GetActiveWindow(), WM_KEYDOWN, 0x58, MapVirtualKey(0x58, NULL) << 16); _________________
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Sun Sep 07, 2008 11:44 am Post subject: |
|
|
didn't know about that API thx..
but still doesn't work when i open notepad nothing is written _________________
Stylo |
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Sun Sep 07, 2008 11:54 am Post subject: |
|
|
| 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 |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Sun Sep 07, 2008 12:02 pm Post subject: |
|
|
| Code: |
PostMessage(FindWindowEx(GetActiveWindow(),0,_T("Edit"),0), WM_KEYDOWN, 0x58,1);
|
still the same sh!t o_o _________________
Stylo |
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sun Sep 07, 2008 12:30 pm Post subject: |
|
|
WM_CHAR _________________
|
|
| Back to top |
|
 |
nog_lorp Grandmaster Cheater
Reputation: 0
Joined: 26 Feb 2006 Posts: 743
|
Posted: Sun Sep 07, 2008 1:06 pm Post subject: |
|
|
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 |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sun Sep 07, 2008 1:10 pm Post subject: |
|
|
| Use sendinput. I dont think notpad handles messages sent by pma. |
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Sun Sep 07, 2008 1:14 pm Post subject: |
|
|
| 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 |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Sun Sep 07, 2008 1:19 pm Post subject: |
|
|
| 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 |
|
 |
|