Simulate mouse without focus menu

Shout-Out

User Tag List

Results 1 to 11 of 11
  1. #1
    JuJuBoSc's Avatar Banned for scamming CoreCoins Purchaser
    Reputation
    1019
    Join Date
    May 2007
    Posts
    922
    Thanks G/R
    1/3
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simulate mouse without focus

    Hi,

    First, sorry for my bad english, i'm french.
    I have a little problem about sending click to WoW, atm for the keyboard i use PostMessage, work pretty good, for the mouse i use SetCursorPos, but if anyone know how to simulate mouse click with coordinate without focus, it could be cool

    Thanks

    Simulate mouse without focus
  2. #2
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by JuJuBoSc View Post
    Hi,

    First, sorry for my bad english, i'm french.
    I have a little problem about sending click to WoW, atm for the keyboard i use PostMessage, work pretty good, for the mouse i use SetCursorPos, but if anyone know how to simulate mouse click with coordinate without focus, it could be cool

    Thanks
    Keep using PostMessage for mouse movement. (There's a message you can send for mouse movement, and the lParam will be the coord.)

    Google, and you'll find it.

    "Moving the mouse with PostMessage C#"

  3. #3
    JuJuBoSc's Avatar Banned for scamming CoreCoins Purchaser
    Reputation
    1019
    Join Date
    May 2007
    Posts
    922
    Thanks G/R
    1/3
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have test with PostMessage, but for the coord, how to convert X axis and Y axis to coord for postmessage ?

    X Y coord of screen size, or wow window size ?

    Thanks Apoc

  4. #4
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <Return: MarshalAs(UnmanagedType.Bool)> _
    <DllImport("user32.dll", SetLastError := True)> _
    Private Shared Function PostMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Boolean
    End Function
    Public Shared Sub MoveMouse(ByVal hWnd As IntPtr, ByVal x As Integer, ByVal y As Integer)
        'const uint WM_MOUSEMOVE = 0x0200;
        PostMessage(hWnd, &H200, IntPtr.Zero, DirectCast((y * &H10000 + x), IntPtr))
    End Sub
    Also, you'll want to play around with whether it's full screen coords, or WoW screen coords.

  5. #5
    JuJuBoSc's Avatar Banned for scamming CoreCoins Purchaser
    Reputation
    1019
    Join Date
    May 2007
    Posts
    922
    Thanks G/R
    1/3
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So, "0,0" is top left of WoW, or top left of screen ?

  6. #6
    suicidity's Avatar Contributor
    Reputation
    207
    Join Date
    Oct 2006
    Posts
    1,439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    We have no idea, what you should do instead of taking 5 minutes to post then waiting 16 hours to get a "I don't know" post; Is simply start WoW in windowed mode, pass the function and see if it clicks out of focus. Then you would know.


  7. #7
    Trollin's Avatar Contributor
    Reputation
    204
    Join Date
    Nov 2008
    Posts
    1,093
    Thanks G/R
    0/1
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by suicidity View Post
    We have no idea, what you should do instead of taking 5 minutes to post then waiting 16 hours to get a "I don't know" post; Is simply start WoW in windowed mode, pass the function and see if it clicks out of focus. Then you would know.
    I second that.
    ____________________________________________

    ____________________________________________

  8. #8
    suicidity's Avatar Contributor
    Reputation
    207
    Join Date
    Oct 2006
    Posts
    1,439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I didn't mean to sound or come of as a dick, but I was just being blatantly honest.


  9. #9
    JuJuBoSc's Avatar Banned for scamming CoreCoins Purchaser
    Reputation
    1019
    Join Date
    May 2007
    Posts
    922
    Thanks G/R
    1/3
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Because i don't get it to work, my real mouse need to be over object i want to click, with or without the focus.

  10. #10
    suicidity's Avatar Contributor
    Reputation
    207
    Join Date
    Oct 2006
    Posts
    1,439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's possible the game doesn't accept clicks outside of focus; But I doubt that, try sending it to WoW's MainWindowHandle and that you simulate Down and Up for the mouse;


  11. #11
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    WoW's MainWindowHandle won't let you do what you want. You need to send the move/click messages to the actual game window. (Which requires you to enumerate over the windows for the WoW process. Use Spy++ to get the class name and parent of the draw window.)

Similar Threads

  1. Simulate mouse/keyword input from C#
    By booba in forum Diablo 3 Bots and Programs
    Replies: 2
    Last Post: 08-07-2012, 09:52 AM
  2. PostMessage to simulate mouse input
    By Anadrol in forum Programming
    Replies: 7
    Last Post: 09-13-2009, 11:33 AM
  3. Hotkeys without focus
    By Araredon in forum Programming
    Replies: 3
    Last Post: 03-12-2009, 03:17 PM
  4. (Exploit\trick) Flying without using the keyboard and mouse!
    By dragoonman in forum World of Warcraft Exploits
    Replies: 19
    Last Post: 07-04-2008, 12:41 AM
  5. Talk to NPC without Mouse clicks
    By _duracell in forum World of Warcraft General
    Replies: 0
    Last Post: 07-01-2007, 02:27 PM
All times are GMT -5. The time now is 07:48 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search