SendMessage? menu

User Tag List

Thread: SendMessage?

Results 1 to 3 of 3
  1. #1
    Uncontrolable's Avatar Active Member
    Reputation
    69
    Join Date
    Feb 2007
    Posts
    339
    Thanks G/R
    5/1
    Trade Feedback
    9 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SendMessage?

    Hello,

    I'm writing a simple pixel bot for personal use, and was wondering if theres any way to consistently use SendMessage for sending input based on pixels?

    I'm trying to do simple stuff like
    Code:
    keybd_event(0x38, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);Sleep(15);
    keybd_event(0x38, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
    Only I'd like to use SendMessage rather than keybd_event, because I can then do other stuff while the pixelbot is running.
    I've tried using this
    Code:
    HWND hWnd = FindWindow(NULL, "World of Warcraft");
        
    
    SendMessage(hWnd, WM_KEYDOWN, VK_SPACE, NULL);
    Sleep(1500);
    SendMessage(hWnd, WM_KEYUP, VK_SPACE, NULL);
    but it works really inconsistently. Today it might work, tomorrow it might not, it changes from time to time when I open WoW.exe

    I've come a little closer, and got it to work when I set the handle in SendMessage myself. Is there a smart way for me to find the window handle, because FindWindow doesnt find the right one it seems.
    Last edited by Uncontrolable; 07-29-2019 at 06:33 AM.

    SendMessage?
  2. #2
    Sychotix's Avatar Moderator Authenticator enabled
    Reputation
    1421
    Join Date
    Apr 2006
    Posts
    3,942
    Thanks G/R
    285/572
    Trade Feedback
    1 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Not sure what language this is... but here is a stackoverflow about how you could lookup the right process by the executable name, or whatever else you want.

    c++ - How to find window handle from exe file's name - Stack Overflow

  3. #3
    Hazzbazzy's Avatar wannabe hackerlol Authenticator enabled
    Reputation
    1335
    Join Date
    Aug 2011
    Posts
    1,206
    Thanks G/R
    243/484
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Uncontrolable View Post
    Hello,

    I'm writing a simple pixel bot for personal use, and was wondering if theres any way to consistently use SendMessage for sending input based on pixels?

    I'm trying to do simple stuff like
    Code:
    keybd_event(0x38, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0);Sleep(15);
    keybd_event(0x38, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
    Only I'd like to use SendMessage rather than keybd_event, because I can then do other stuff while the pixelbot is running.
    I've tried using this
    Code:
    HWND hWnd = FindWindow(NULL, "World of Warcraft");
        
    
    SendMessage(hWnd, WM_KEYDOWN, VK_SPACE, NULL);
    Sleep(1500);
    SendMessage(hWnd, WM_KEYUP, VK_SPACE, NULL);
    but it works really inconsistently. Today it might work, tomorrow it might not, it changes from time to time when I open WoW.exe

    I've come a little closer, and got it to work when I set the handle in SendMessage myself. Is there a smart way for me to find the window handle, because FindWindow doesnt find the right one it seems.
    It might be worth using PostMessage as opposed to SendMessage; if you're not adverse to using .NET somewhat you can easily find the Window Handle with the Process Class. If not, you can enumerate open handles using C++, but this requires a lot more work.
    Last edited by Hazzbazzy; 09-04-2019 at 08:59 AM.
    "HOLY TIME MACHINE BATMAN! it's 1973!"
    https://youtube.com/Hazzbazzy

Similar Threads

  1. [Visual Basic derp] Send keystroke through SendMessage/PostMessage
    By myojinyahiko in forum WoW Memory Editing
    Replies: 10
    Last Post: 02-04-2013, 08:37 AM
  2. Problems with Post/SendMessage to Diablo with c#
    By peterk in forum Diablo 3 Bots Questions & Requests
    Replies: 1
    Last Post: 09-02-2012, 04:44 PM
  3. Replies: 16
    Last Post: 02-08-2012, 08:46 AM
All times are GMT -5. The time now is 09:51 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search