AutoHotkey Community

It is currently May 26th, 2012, 9:30 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: August 6th, 2009, 2:01 am 
.. Hi there,


I know, there are 3-4 Posts here about that, but they didnt help me alot..
im a complete noob in such things, my first script, and then its a bigone :/


All i need is to send the key "H" to a window called "Darfkall Online" even when the window isnt active (minimized or not, dont matter)

what i tryed out so far is:

Code:
Numpad1::

SetTitleMatchMode, 2
PostMessage, 0x111, Darkfall Online, H


Where i get the code was:
http://www.autohotkey.com/docs/misc/SendMessage.htm

But i dont get it, 0x111 should stand for a wm_command.. but i dont know what that is..
so im lost at the very first word of the code :/

hopefully someone can help me out here! :)

thx a lot!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 6th, 2009, 2:58 am 
Offline

Joined: May 17th, 2007, 6:03 pm
Posts: 391
Location: Titan
I believe you'd better try using the ControlSend command rather than Post/Sendmessage.
________
MERCEDES-BENZ 190 SPECIFICATIONS


Last edited by lilalurl.T32 on March 13th, 2011, 7:43 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 6th, 2009, 9:22 pm 
With ControlSend, i can send to an inactive window too?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 6th, 2009, 9:41 pm 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
Darkfaller wrote:
But i dont get it, 0x111 should stand for a wm_command.. but i dont know what that is..

[pictorial] Find WM_COMMAND parameter with Winspector
(thanks SKAN! :D)

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 7th, 2009, 2:21 am 
Ok, this shows me how to put the menus and stuff in..

but all i want is to send a simple letter (hotkey in the game) to the game..

nothing more, i just dont get it..

Winspy wount show me any messages when i press "H"..


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 7th, 2009, 6:35 am 
Offline

Joined: May 17th, 2007, 6:03 pm
Posts: 391
Location: Titan
It seems you are taking the terms "PostMessage" literally, as in "chat" message, while what PostMessage actually does is posting a "computer" message.

What you want to do is Send a simulated keystroke. Therefore, have a look at Send and ControlSend (which can send to an inactive window).
________
Uggs


Last edited by lilalurl.T32 on March 13th, 2011, 7:44 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 7th, 2009, 8:38 pm 
Ok, thx for the Infos..

Now it seems, i cant send to Darkfall Online a key.. it just wont work..

my code is this:

Code:
NumPad1::


SetTitleMatchMode, 2
ControlSend,, m, ahk_id SFMainWindow ;tryied this
ControlSend,, m, Darkfall Online ; tryied this aswell.. wont work..


Dont know why it wont work, maybe the game is made that it wont work?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 8th, 2009, 7:26 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
If using IE, this should work:
Code:
NumPad1::
DetectHiddenWindows, On ; allow sending to a minimized window
SetTitleMatchMode, 2
ControlSend, Internet Explorer_Server1, m, Darkfall
Return

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, JSLover and 60 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group