Send keystrokes/clicks to minized window? menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    wootpeng's Avatar Contributor
    Reputation
    154
    Join Date
    Jun 2008
    Posts
    227
    Thanks G/R
    0/0
    Trade Feedback
    6 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Send keystrokes/clicks to minized window?

    Is it possible to send keystrokes or clicks to Diablo III. Every attempt I have tried has failed. Has anyone had any success with this?

    Send keystrokes/clicks to minized window?
  2. #2
    Sychotix's Avatar Moderator Authenticator enabled
    Reputation
    1415
    Join Date
    Apr 2006
    Posts
    3,942
    Thanks G/R
    285/571
    Trade Feedback
    1 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Don't you use functions like as SendMessage/PostMessage? (or whatever it is called)

  3. #3
    evil2's Avatar Active Member
    Reputation
    27
    Join Date
    Feb 2009
    Posts
    164
    Thanks G/R
    25/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    send keystroke to background window via WINAPI:

    [DllImport("user32.dll", EntryPoint="PostMessageA")]
    private static extern int PostMessage(IntPtr hwnd, int wMsg, int wParam, uint lParam);

    private const int WM_KEYDOWN = 0x100;
    private const int WM_KEYUP = 0x101;
    // vkCode_0-9 = 0x30-39
    // vkCode_A-Z = 0x41-5A

    PostMessage(hwnd, WM_KEYDOWN, vkCode, 0); // key down
    PostMessage(hwnd, WM_KEYUP, vkCode, 0xC0000000); // key up

    make sure to include some delay 30ms+

  4. #4
    zewt's Avatar Member
    Reputation
    13
    Join Date
    Nov 2008
    Posts
    127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks evil2. works perfectly
    Last edited by zewt; 06-08-2012 at 05:17 AM.

  5. #5
    Devilo's Avatar Member
    Reputation
    1
    Join Date
    Feb 2007
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm running a W7 64Bit, made a couple of changes to make it 64bit friendly..
    Code:
            [DllImport("user32.dll", EntryPoint = "PostMessageA", SetLastError = true)]
            private static extern int PostMessage(IntPtr hwnd, uint wMsg, IntPtr wParam, IntPtr lParam);
    
    
            private const int WM_KEYDOWN = 0x100;
            private const int WM_KEYUP = 0x101;
    
            private void button1_Click(object sender, EventArgs e)
            {
                PostMessage(proc.MainWindowHandle, (uint)Keys.S, (IntPtr)WM_KEYDOWN, (IntPtr)0x0);
                PostMessage(proc.MainWindowHandle, (uint)Keys.S, (IntPtr)WM_KEYUP, (IntPtr)0x0);
            }
    But for some reason the Skill page will not show up, what am i doing wrong? how does one debug Postmessage?

  6. #6
    st0724's Avatar Member
    Reputation
    2
    Join Date
    Feb 2007
    Posts
    60
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try having a delay

  7. #7
    zewt's Avatar Member
    Reputation
    13
    Join Date
    Nov 2008
    Posts
    127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and to expand upon that in C++ see below.

    Code:
    void leftClick(HWND mwnd, int x, int y) 
    
    {
    
        SetCursorPos(x,y);
    
        PostMessage(mwnd, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(x,y-22));
    
        return;
    
    }
    just swap the L with R and you got yourself a right click!

    usage:

    Code:
    HWND hwnd = FindWindow(0, _T("Diablo III"));
    
    LeftClick(hwnd,50,50);
    and to create a delay just throw this function between your keydowns and ups.

    Code:
    #include <time.h>
    void sleep(unsigned int mseconds)
    {
    
        clock_t goal = mseconds + clock();
        
        while(goal>clock());
    
    }


    now... the problem i am having with postmessage is... when i tell my character to click on the waypoint in game, he runs to waypoint but i dont get waypoint menu! he is just literally standing directly on top of it and the postmessage click cannot interact with it anyone know how i can do this so it works?
    Last edited by zewt; 06-08-2012 at 05:49 AM.

  8. #8
    kallellkryptonite's Avatar Knight
    Reputation
    60
    Join Date
    Jan 2012
    Posts
    202
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    edit, i'm tired. i read this entire thread wrong.
    Last edited by kallellkryptonite; 06-08-2012 at 11:39 AM.

  9. #9
    evil2's Avatar Active Member
    Reputation
    27
    Join Date
    Feb 2009
    Posts
    164
    Thanks G/R
    25/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by kallellkryptonite View Post
    Wouldn't this constitute injection? if so, i'd be pretty careful with it as this is the type of shit warden picks up. You are probably safe keeping it entirely private, but i'd venture a guess to say warden can still detect some of the low level more common injections?
    this has absolutely nothing to do with injection.


    Originally Posted by Devilo
    But for some reason the Skill page will not show up, what am i doing wrong? how does one debug Postmessage?
    you mixed up the PostMessage paramenters.

  10. #10
    Devilo's Avatar Member
    Reputation
    1
    Join Date
    Feb 2007
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Evil2, You my good sir have a valid point.
    Damnit!

  11. #11
    darthv's Avatar Member
    Reputation
    1
    Join Date
    Feb 2007
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm having the same problem, where clicking on the screen using Postmessage works, but not for entering doorways/checkpoints etc, it just moves to them instead.
    I've tried emulating exactly what spy++ captures when I click it manually, but to no avail yet.

    Anyone have a solution for this?

  12. #12
    zewt's Avatar Member
    Reputation
    13
    Join Date
    Nov 2008
    Posts
    127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by darthv View Post
    I'm having the same problem, where clicking on the screen using Postmessage works, but not for entering doorways/checkpoints etc, it just moves to them instead.
    I've tried emulating exactly what spy++ captures when I click it manually, but to no avail yet.

    Anyone have a solution for this?
    Find a solution? im still stuck on this.

  13. #13
    UserNamex32's Avatar Member
    Reputation
    3
    Join Date
    Nov 2010
    Posts
    16
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One method I've thought about and talked with someone would be to have a parent window absorb the D3 window so that it thinks that it always has focus, but you would be able to minimize the parent window.
    Although his main point is to get slower cpu useage so we talked about the possibility of every time an action was called that needed the window to be up you could just give focus to the window in it's parent window for a split second and then re-minimize it.

  14. #14
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think you can send keystrokes to minimized windows well you probablly can but most games enter "sleep" mode when you minize it, like diable rendering and other shit like that to save resources.

  15. #15
    nightUA's Avatar Private
    Reputation
    2
    Join Date
    Jun 2012
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Diablo does not... Atleast it reacts on WM_LBUTTONDOWN greatly.

Page 1 of 2 12 LastLast

Similar Threads

  1. [Auto-Clicker] Autoit doesn't send keystrokes / mouse clicks
    By Seminko in forum Black Desert Online Exploits|Hacks
    Replies: 9
    Last Post: 03-13-2016, 01:12 PM
  2. [Help][C#] Sending keystrokes to WoW
    By wowhackz0r in forum Programming
    Replies: 13
    Last Post: 11-11-2010, 08:44 PM
  3. How to Send Keystrokes to a DirectX Game in C#?
    By luciferc in forum WoW Memory Editing
    Replies: 19
    Last Post: 10-09-2008, 02:01 AM
  4. Sending keystrokes to AoC window in background
    By Ghazban in forum Age of Conan Exploits|Hacks
    Replies: 1
    Last Post: 07-01-2008, 04:18 AM
  5. Freebie method for sending keys to multiple WoW windows
    By tomit12 in forum World of Warcraft Guides
    Replies: 6
    Last Post: 03-03-2008, 10:49 AM
All times are GMT -5. The time now is 06:33 AM. 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