Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 07:01

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[c++] Hilfe bei Sendmessage

Discussion on [c++] Hilfe bei Sendmessage within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2013
Posts: 1
Received Thanks: 0
[c++] Hilfe bei Sendmessage

Hallo Leute,
ich bin neu hier und hoffe mein Post ist hier richtig.

Ich möchte mir einen einfachen Bot basteln für LoL und ich bin gerade dabei das starten zu automatisieren.

Jetzt zu meinen Problem:

Ich benutze Sendmessage um ein Mauscklick zu simulieren.Ich Versuche den Play Button vom Patcher zu betätigen. Sendmessage gibt auch keine Fehlermeldung wieder aber es passiert nichts.

Hier mein Code:
Code:
lMouseClick(HWND handle, WORD x, WORD y)
{
    if(!SendMessage(handle, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(x, y))
       {
           return false;
       }
    Sleep(100);
    
    if(!SendMessage(handle, WM_LBUTTONUP, MK_LBUTTON, MAKELPARAM(x, y)))
        {
            return false;
        }
    
    return true;
}
Dazu noch ne kleine Frage. Muss man die x/y Koords vom Button relativ zum Fenster oder den Bildschirm nehmen?
Blackhawk6464 is offline  
Old 09/28/2013, 16:34   #2
 
elite*gold: 1000
Join Date: Apr 2012
Posts: 1,003
Received Thanks: 208
Relativ zum Fenster
qkuh is offline  
Old 10/01/2013, 21:36   #3
 
cookie69's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 627
Received Thanks: 688
Quote:
Originally Posted by Blackhawk6464 View Post
Hallo Leute,
ich bin neu hier und hoffe mein Post ist hier richtig.

Ich möchte mir einen einfachen Bot basteln für LoL und ich bin gerade dabei das starten zu automatisieren.

Jetzt zu meinen Problem:

Ich benutze Sendmessage um ein Mauscklick zu simulieren.Ich Versuche den Play Button vom Patcher zu betätigen. Sendmessage gibt auch keine Fehlermeldung wieder aber es passiert nichts.

Hier mein Code:
Code:
lMouseClick(HWND handle, WORD x, WORD y)
{
    if(!SendMessage(handle, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(x, y))
       {
           return false;
       }
    Sleep(100);
    
    if(!SendMessage(handle, WM_LBUTTONUP, MK_LBUTTON, MAKELPARAM(x, y)))
        {
            return false;
        }
    
    return true;
}
Dazu noch ne kleine Frage. Muss man die x/y Koords vom Button relativ zum Fenster oder den Bildschirm nehmen?
It is better to use PostMessage and mouse coords are not needed (but you can keep them).

replace your code by this one and test:

BOOL MouseClick(HWND handle, WORD x, WORD y)
{
PostMessage(handle, WM_LBUTTONDOWN, MK_LBUTTON, NULL);
Sleep(100);
PostMessage(handle, WM_LBUTTONUP, MK_LBUTTON, NULL);

return TRUE;
}


If it is not working, make sure that handle is a good window handle (HWND handle = FindWindow(NULL,<Gamewindowtitle>); )
And if it is not working too, you should make a trampoline function to bypass game guard! => PM me for that!
cookie69 is offline  
Old 10/05/2013, 18:42   #4
 
elite*gold: 1000
Join Date: Apr 2012
Posts: 1,003
Received Thanks: 208
cookie's post can be ignored. Does not make any sense related to your issue. I could help you in 2 days. If you are interested PM me.
qkuh is offline  
Old 10/05/2013, 20:18   #5
 
cookie69's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 627
Received Thanks: 688
Quote:
Originally Posted by qkuh View Post
cookie's post can be ignored. Does not make any sense related to your issue. I could help you in 2 days. If you are interested PM me.
My bad! I didn't understood his problem (I don't speak German)
cookie69 is offline  
Reply

Tags
c++, sendmessage


Similar Threads Similar Threads
PostMessage / SendMessage (C#)
06/23/2013 - CO2 Programming - 2 Replies
I am trying to send key presses & mouse presses to the conquer window using PostMessage in C# but Conquer doesn't seem to respond to anything I send it. I am able to send key presses correctly to windows calculator though. Just wondering if anyone has had success using PostMessage / SendMessage and would be kind enough to share. Is there any other way to send key presses / mouse clicks while the conquer window is minimized? Thanks for any help :)
SendMessage or PostMessage ?
01/26/2013 - Perfect World - 4 Replies
How do i simulate keypress in C++ Builder ? SendMessage or PostMessage ? A Example would be really nice, im new to this all :o
SRO SendMessage API
02/26/2012 - SRO Coding Corner - 5 Replies
Hello. I want make simple clicker on vSRO. but I can't do so would only click on SRO I know I need to use SendMessage API but I do not know how to do it Can someone show me it on this code: Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Timer1.Start()
[Help] C# SendMessage()
05/11/2010 - CO2 Programming - 19 Replies
I'm currenty trying to use the SendMessage Function with CO. According to msdn I need to use this: static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam); My question is: How do I find the hWnd? What are the wParam and lParam? And what can I use as wParam and lParam? Any help will be greatly appreciated.
sendmessage?
12/26/2008 - CO2 Programming - 0 Replies
just wondering how it works in C# tried few tutorials with notepad in it and it doesnt send the letters/close it even it finds the window this is how i got it so far (pretty much copypasted, just to see how it works...) private static extern IntPtr FindWindow(string winClass, string WinName); private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam); private static extern IntPtr PostMessage(IntPtr hWnd,...



All times are GMT +1. The time now is 07:02.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.