Jump to content

Why is Window Info not working in this program?


 Share

Recommended Posts

So I was making a small program...again...to help me understand my script more and I ran into a hassle. With the window Info Tool given with Autoit It will not retrieve any information at all from World of Warcraft after it has been launched, is this because WoW can over ride and block it out? I assume it is but I was wondering if there is anything i can do. I don't wont to bot, I just want to find the values of a button for my program to login for me. Any help would be great, thank you!

Link to comment
Share on other sites

WOW most likely uses direct3d and not standard controls. Try using send and mouseclick.

If CLASS:GxWindowClassD3d is Direct 3d(which sadly it is), than yes it does =(

My goal was to be able to "click" on the first input box (Username) and 2nd input box (Password) of the main screen, and "click" Login even if WoW was not the slected window, that way it ensures it will do the commands always. Is there any alternative way or alternative program that might help me out? I am not familiar with what Direct3D really is, so is this not even possible to sends controls?

Link to comment
Share on other sites

If CLASS:GxWindowClassD3d is Direct 3d(which sadly it is), than yes it does =(

My goal was to be able to "click" on the first input box (Username) and 2nd input box (Password) of the main screen, and "click" Login even if WoW was not the slected window, that way it ensures it will do the commands always. Is there any alternative way or alternative program that might help me out? I am not familiar with what Direct3D really is, so is this not even possible to sends controls?

You can not send or mouseclick WoW unless it is the active window.

:<

And no you can't send to controls because technically there are none.

Edited by jebus495
Link to comment
Share on other sites

How do bots do it than? I know of a few bots that can run while minimized, my only guess is a DLL? But I know nothing of DLL's and if there is no other way than forget it =( I will have to stick with sucky scipts. However how can I make sure the mouse is clicking where it needs to(input1, input2, and login button)? Cause depending on monitor and screen resolution coordinates won't always be the same. So if I try and run this on my second monitor it won't come close to working properly. =(

Link to comment
Share on other sites

How do bots do it than? I know of a few bots that can run while minimized, my only guess is a DLL? But I know nothing of DLL's and if there is no other way than forget it =( I will have to stick with sucky scipts. However how can I make sure the mouse is clicking where it needs to(input1, input2, and login button)? Cause depending on monitor and screen resolution coordinates won't always be the same. So if I try and run this on my second monitor it won't come close to working properly. =(

And thats where good coding comes in. :) If you search the forum you should find a function called mouseclickplus. This works on minimized windows. Also you should see if you can come up with an algorithm that determines where the buttons and such will be depending on the screen res.

Edited by P5ych0Gigabyte
HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Link to comment
Share on other sites

How do you propose I write an algorithm? seems extremely tricky, is there a resource I could maybe get a lead off of? Thanks.

From what I understand this is a #include script correct? This is by Insolence.

;===============================================================================

;
; Function Name: _MouseClickPlus()
; Version added: 0.1
; Description: Sends a click to window
; minimized.
; Parameter(s): $Window = Title of the window to send click to
; $Button = "left" or "right" mouse button
; $X = X coordinate
; $Y = Y coordinate
; $Clicks = Number of clicks to send
; Remarks: You MUST be in "MouseCoordMode" 0 to use this without bugs.
; Author(s): Insolence <insolence_9@yahoo.com>
;
;===============================================================================

Func _MouseClickPlus($Window, $Button = "left", $X = "", $Y = "", $Clicks = 1)
Local $MK_LBUTTON = 0x0001
Local $WM_LBUTTONDOWN = 0x0201
Local $WM_LBUTTONUP = 0x0202

Local $MK_RBUTTON = 0x0002
Local $WM_RBUTTONDOWN = 0x0204
Local $WM_RBUTTONUP = 0x0205

Local $WM_MOUSEMOVE = 0x0200

Local $i = 0

Select
Case $Button = "left"
$Button = $MK_LBUTTON
$ButtonDown = $WM_LBUTTONDOWN
$ButtonUp = $WM_LBUTTONUP
Case $Button = "right"
$Button = $MK_RBUTTON
$ButtonDown = $WM_RBUTTONDOWN
$ButtonUp = $WM_RBUTTONUP
EndSelect

If $X = "" OR $Y = "" Then
$MouseCoord = MouseGetPos()
$X = $MouseCoord[0]
$Y = $MouseCoord[1]
EndIf

For $i = 1 to $Clicks
DllCall("user32.dll", "int", "SendMessage", "hwnd", WinGetHandle($Window), "int", $WM_MOUSEMOVE, "int", 0, "long", _MakeLong($X, $Y))

DllCall("user32.dll", "int", "SendMessage", "hwnd", WinGetHandle($Window), "int", $ButtonDown, "int", $Button, "long", _MakeLong($X, $Y))

DllCall("user32.dll", "int", "SendMessage", "hwnd", WinGetHandle($Window), "int", $ButtonUp, "int", $Button, "long", _MakeLong($X, $Y))
Next
EndFunc

Func _MakeLong($LoWord,$HiWord)
Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
EndFunc

Now I am not exactly sure what to do, I am guessing that I save this in the Include file of auto, and use it in my script, but I do not know if I need to edit this at all, do I need to set the values of x,y, etc?

Edited by kjpolker
Link to comment
Share on other sites

How exactly do I use MouseClickPlus? I read a few topics on it that gave me a better understanding of it, but I still can't figure it out, so far I have in my while loop:

MouseClickPlus()
EndSwitch
WEnd

Func MouseClickPlus()
_MouseClickPlus("[TITLE:World of Warcraft]", x, y, 1)
EndFunc

Now I don't have my source at the moment but I believe it is similar to that above as the function, i might be missing a few things though. Am I taking this code the wrong way? I can't seem to find out how to work it. And how can I have more than one mouseclickplus? I need to click at 3 locations on my window.

Edited by kjpolker
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...