I'm trying to make a macro for use in a directx program. It is for a game, although not poker, but for a NeverWinter Nights Mod created by me -- the macro is used for testing.
Anyways, the game is in window mode. There seems to be two sets of mouse pointers. One when the game is activate and the other when the desktop is active.
I.E. The desktop pointer and game pointer do not follow each other.
When running a macro to move the mouse inside the active game window, it will not. It won't record those mouse movements inside the game window either.
To move the mouse pointer, QM internally uses Windows API function SendInput. Another function that can be used is SetCursorPos (can be used from macros too). Also, using journal playback hook. I don't know how DirectX programs get mouse position. Probably it is at lower level, ie they don't get input generated programmatically.
Yeah, it's weird. You think you could use the simple record fuction and then simulate user control even within directx, i mean i thought they would be getting the mouse input from the same place - i guess not.
here is something odd --
when using this line of code (along with activating the window)
mou 163 406
lef+ 10 104
it will move the mouse position inside the directx app, but only to the top left corner. If i reverse the code (lef+ first) it goes to the very bottom right corner.
The X Y position don't effect it either (cause if it did, i wouldnt be writing this post).
autohotkey.com works with the directx app and it moves the mouse
but i the interface (or lackthereof). I would love if quick macros could fix it or come up with a workaround to this issue, i would buy it in a second. i love it for everything else.
There is another free program, AutoIt. These 2 programs are similar. AutoIt has a COM component that includes some its functions. You can try it. Example (in QM):
In the example used AutoItX3.dll is installed with AutoIt. Maybe autohotkey has a COM component too, I don't know (maybe it can be downloaded separately).
so close yet so far, unless im doing something wrong.
The code you made works, but changing the X Y to the positions for the window (using AutoIt Active Window Info) makes the mouse, again, go up to the top left or bottom right corner.
I noticed using AutoIt Active window finder, if the X Y of the macro was 500 500 it will try and go to 20 20, or something odd like that.
I can't explain why this is happening, other then something to do with the two mouse cursors and directx.
I installed Neverwinter Nights Demo. In full screen mode QM mouse commands work well. How to set window mode? Do i need your Mod? Or full version? Or newer DirectX?
I'm curious about this as well because I am in a similar situation. I have a fairly complex script which works wonderfully, but it fails to pass along the mouse clicks to the DirectX window. How was this eventually resolved?
Gintaras Wrote:There is another free program, AutoIt. These 2 programs are similar. AutoIt has a COM component that includes some its functions. You can try it. Example (in QM):
In the example used AutoItX3.dll is installed with AutoIt. Maybe autohotkey has a COM component too, I don't know (maybe it can be downloaded separately).
I installed the autoit to use your code above, can be run, but I created the code, but can not run, I hope you can help me have a look, thanks a lot
However, in the autoit editor, it can be run successfully, the following picture
I am not too understand the autoit, I hope you can help me look at the QM, how to use Autohotkey input passwords, passwords can not correctly enter the problem, I have been troubled by a month, Thank you very much :oops:
You are right, but I do not understand why .au3 file, do not need to add those parameters, add parameters will be very troublesome, do not add can be achieved?
I put the dll file, put the QM folder, and then generate exe file, and then exe files and Dll files together to copy to another computer, double-click the exe file does not respond, how is this going on?
On the local computer also did not respond, but QM debugging is successful hock:
;;this works, if the COM dll is registered ;typelib AUTOIT "C:\Program Files (x86)\AutoIt3\AutoItX\AutoItX3.dll" ;AUTOIT.AutoItX3 ai._create
;;this also works, if the COM dll is registered ;IDispatch ai._create("AutoItX3.Control")
;this will work in exe on computers where the COM dll is not registered typelibAUTOIT"C:\Program Files (x86)\AutoIt3\AutoItX\AutoItX3.dll" AUTOIT.AutoItX3 ai._create(0"C:\Program Files (x86)\AutoIt3\AutoItX\AutoItX3.dll") ;The first path - where is the dll on your computer when creating exe. ;The second path - where is the dll when the exe runs.
;this works in any case
ai.Run("notepad.exe"""1)
ai.WinWaitActive("Untitled - Notepad"""0)
ai.Send("This is some text."0)
;;this works works only if registered ;IDispatch d=ai ;d.Run("notepad.exe" "" 1) ;d.WinWaitActive("Untitled - Notepad") ;d.Send("This is some text.")