SendMessage? menu

These ads disappear when you log in.

Thread: SendMessage?

Results 1 to 3 of 3
  1. #1
    Uncontrolable's Avatar Active Member CoreCoins User
    Reputation
    69
    Join Date
    Feb 2007
    Posts
    328
    Thanks G/R
    1/1
    Trade Feedback
    6 (100%)

    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.

  2. #2
    Sychotix's Avatar Moderator CoreCoins User Authenticator enabled
    Reputation
    1111
    Join Date
    Apr 2006
    Posts
    3,323
    Thanks G/R
    177/292
    Trade Feedback
    1 (100%)
    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 CoreCoins User Authenticator enabled
    Reputation
    1267
    Join Date
    Aug 2011
    Posts
    1,019
    Thanks G/R
    155/440
    Trade Feedback
    0 (0%)
    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; 2 Weeks Ago 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 04:39 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved. Digital Point modules: Sphinx-based search