What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

wow process id

seafunk

New Member
Joined
Feb 23, 2011
Messages
273
Reaction score
4
This might be a stupid question since i could access it through the hb window's titlebar and all, but is there any easier, direct way to access wow's process id or even the mainwindowhandle so i can perform sendmessages?

assuming we have multiple clients running ofc. i know how to enumerate and all, but since hb should have it stored in a var internally somewhere, this would ofc be preferred...

as always, input is much appreciated! :)
 
PHP:
 Styx.Helpers.Logging.Write(Styx.WoWInternals.ObjectManager.WoWProcess.Id.ToString());

That should do it
 
you the man!!!! how come i didnt find that though lol... me with stoopid. thank you!

Code:
Styx.WoWInternals.ObjectManager.WoWProcess.MainWindowHandle
is what ill use. :)


btw your gift of flight plugin link is dead.
 
Last edited:
Styx.Helpers.KeyboardManager.SendMessage(uint, uint, uint)

^^LOL!

hehe i hear you. just brought the daughter to bed so ill have a cpl of hours for coding ;)
 
Ok I'm done. In case anyone ever needs to send single (!) keystrokes to wow, this is how it's done:

Code:
KeyboardManager.SendMessage(WM_KEYDOWN, 0x0000000D, 0x001C0001);	//
KeyboardManager.SendMessage(WM_CHAR, 0x0000000D, 0x001C0001);		// Enter
KeyboardManager.SendMessage(WM_KEYUP, 0x0000000D, 0x001C0001);		//
					
KeyboardManager.SendMessage(WM_KEYDOWN, 0x00000010, 0x002A0001);	//
KeyboardManager.SendMessage(WM_KEYDOWN, 0x00000037, 0x00080001);	//
KeyboardManager.SendMessage(WM_CHAR, 0x0000002F, 0x00080001);		// Shift + 7 -> "/"
KeyboardManager.SendMessage(WM_KEYUP, 0x00000037, 0x00080001);		//
KeyboardManager.SendMessage(WM_KEYUP, 0x00000010, 0x002A0001);		//
					
KeyboardManager.SendMessage(WM_KEYDOWN, 0x00000052, 0x00130001);	//
KeyboardManager.SendMessage(WM_CHAR, 0x00000072, 0x00130001);		// r
KeyboardManager.SendMessage(WM_KEYUP, 0x00000052, 0x00130001);		//
					
KeyboardManager.SendMessage(WM_KEYDOWN, 0x00000045, 0x00120001);	//
KeyboardManager.SendMessage(WM_CHAR, 0x00000065, 0x00120001);		// e
KeyboardManager.SendMessage(WM_KEYUP, 0x00000045, 0x00120001);		//
					
KeyboardManager.SendMessage(WM_KEYDOWN, 0x0000004C, 0x00260001);	//
KeyboardManager.SendMessage(WM_CHAR, 0x0000006C, 0x00260001);		// l
KeyboardManager.SendMessage(WM_KEYUP, 0x0000004C, 0x00260001);		//
					
KeyboardManager.SendMessage(WM_KEYDOWN, 0x00000004F, 0x0018C0001);	//
KeyboardManager.SendMessage(WM_CHAR, 0x00000006F, 0x00180001);		// o
KeyboardManager.SendMessage(WM_KEYUP, 0x0000004F, 0x00180001);		//
					
KeyboardManager.SendMessage(WM_KEYDOWN, 0x00000041, 0x001E0001);	//
KeyboardManager.SendMessage(WM_CHAR, 0x00000061, 0x001E0001);		// a
KeyboardManager.SendMessage(WM_KEYUP, 0x00000041, 0x001E0001);		//
					
KeyboardManager.SendMessage(WM_KEYDOWN, 0x00000044, 0x00200001);	//
KeyboardManager.SendMessage(WM_CHAR, 0x00000064, 0x00200001);		// d
KeyboardManager.SendMessage(WM_KEYUP, 0x00000044, 0x00200001);		//
					
KeyboardManager.SendMessage(WM_KEYDOWN, 0x0000000D, 0x001C0001);	//
KeyboardManager.SendMessage(WM_CHAR, 0x0000000D, 0x001C0001);		// Enter
KeyboardManager.SendMessage(WM_KEYUP, 0x0000000D, 0x001C0001);		//

You can find out what's going on in the wow window with a tool called Spy++. It comes with VS 2010 Ultimate (and probably cheaper versions too), which you can dl from microsoft (and if you're an outlaw you can easily find a key, since ms only ever made 1 key for vs2010 ultimate lol!). You can target the wow window with it, thereby recording all internal messages which you can further limit to keyboard events only. It's easy to use and can come in very handy.

I'm not writing this to be a smartass, but because I had a godawful time when I first had to teach myself this shit.
 
I got VS pro and I haven't seen Spy++ anywhere.
 
You could have asked, we already have something in Styx.Helpers called "KeyboardManager" (I think), that handles faking keyboard input to the game.

Edit; you can also just do Lua.DoString("RunMacroText('/reload')")
 
Edit; you can also just do Lua.DoString("RunMacroText('/reload')")
He already tried that, but it requires hardware event. Which is why he went to "other methods" :P
 
hey u2, thanks for the input. ive been using keyboardmanager a lot, but keyupdown is fail for single keystrokes. i managed to get it done with keyboard manager sendmessages, eventhough the windows api wouldve worked just as well, i didnt need the process id after all. :)

it turns out that sending Lua.DoString("ReloadUI"); worked as well though, just Lua.DoString("RunMacroText('/reload')") has been blocked by blizz very recently. they could theoretically block sendmessages as well with the aid of windows api, but i doubt theyll go through the pain of doing that.

the addon is finished btw, in case anyone cant be arsed looting his mailbox for 30minutes, its lightning fast and seems very stable. :)

again, thanks to everyone who helped out here!
 
Back
Top