Thx for your answers.
The problem is: It has to click to coordinates not to an object - The object has no name, so i can use it not directly.
I would be very happy to see an liddl example.
You want to click what button?Sorry. I think i wrote it a liddl hard to understand. I dont need a click to wow position coordinates. I need A click in an interface from wow what has no name. Is this although possible with ctm?!
Thank you very much. You give me some hopeIt would be really nice to get an working answer.
The position etc. should not be a problem. Just to make the click. Perfect would be wow window coordinates.
uint Msg, // message
uint wParam, // first message parameter [Always 0]
uint lParam // second message parameter [Coordinates]
public int MakeLParam(int LoWord, int HiWord)
{
return ((HiWord << 16) | (LoWord & 0xffff));
}
public enum WMessages : uint
{
WM_LBUTTONDOWN = 0x201, //Left mousebutton down
WM_LBUTTONUP = 0x202, //Left mousebutton up
WM_LBUTTONDBLCLK = 0x203, //Left mousebutton doubleclick
WM_RBUTTONDOWN = 0x204, //Right mousebutton down
WM_RBUTTONUP = 0x205, //Right mousebutton up
WM_RBUTTONDBLCLK = 0x206, //Right mousebutton doubleclick
WM_KEYDOWN = 0x100, //Key down
WM_KEYUP = 0x101, //Key up
}
tell me what addon and i could help you
edit: or do as smart says - because he is smarter than me
Honorbuddy slightly wrapped SendMessage: Styx.Helpers.KeyboardManager.SendMessage(uint msg, uint wParam, uint lParam).
/run local f=GetMouseFocus();print(f:GetName() or tostring(f))
/run ButtonNameHere:Click()
KeyboardManager.KeyUpDown((char)Keys.F10);
I read somewhere there wow removes bogus mouse click messages from the message pump and I couldn't get it to work for me so I'm guessing that's probably true.
An alternative is to find the name of the button you want to press using this macro and call its Click() method.
Put macro on key bar and mouseover the button you want to grab the name of and press the macro key
Code:/run local f=GetMouseFocus();print(f:GetName() or tostring(f))
Then make another macro like this.
now you can stimulate a key press like this.Code:/run ButtonNameHere:Click() and keybind this macro.
This example presses the F10 key.Code:KeyboardManager.KeyUpDown((char)Keys.F10);
you can get all created frames(buttons included), even unnamed ones via EnumerateFrames().EnumerateFrames - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons . Could identify the button by unique properties such as parent, size,location, etcThat won't work for what he's asking, as I said. Auctioneer and other addons declare the buttons locally, and they can't be clicked by that method.
you can get all created frames(buttons are frames), even unnamed ones via EnumerateFrames().EnumerateFrames - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons . Could identify the button by unique properties.Size,location, etc
I tried it briefly on Auctioneer and it worked fine for me. Here is the macro I used to click Batch Post button and the followup confirmation popup.I should've been more specific, sorry. The way Auctioneer is written, calling Click does nothing. Maybe you know something I don't but i've tried everything.
/run local f=EnumerateFrames(AuctionFrame) while f do if f:GetObjectType() == 'Button' and f:GetText() == 'Batch post' then f:Click('RightButton') end f = EnumerateFrames(f) end if AuctioneerPostPromptYes then AuctioneerPostPromptYes:Click() end
KeyboardManager.KeyUpDown((char)Keys.F10);
I tried it briefly on Auctioneer and it worked fine for me. Here is the macro I used to click Batch Post button and the followup confirmation popup.
Code:/run local f=EnumerateFrames(AuctionFrame) while f do if f:GetObjectType() == 'Button' and f:GetText() == 'Batch post' then f:Click('RightButton') end f = EnumerateFrames(f) end if AuctioneerPostPromptYes then AuctioneerPostPromptYes:Click() end
I keybound the macro button to F10 and than tested it by running this in HBConsole.
Code:KeyboardManager.KeyUpDown((char)Keys.F10);
this doesn't run the scan (by holding down Alt key when clicking the 'Batch post' button but shouldn't be hard to add that.