Jump to content

Join our Discord

Talk to other users and have a great time
Discord Server

Welcome to our Community

Click here to get your Exiled Bot license
Donation Store
Sign in to follow this  
Druzil

SendMessage

Recommended Posts

Hi, not realy Bot related, but its for a little program that want to write learning more about poE and stuff.

 

1st Goal is to Klick the Gem-level-Up button only when there is a Gem to level.

All of that without searching for any  graphics.

 

The Poe UI has a lot of "windows" one of those is the one for the Gem leveluo.

that Window has a child window for every gem that is ready to level.

each of those windows has 2 more Chils. the 2nd one is the level-up button.

 

i can alread read the position, and when i move the Mouse to that posiont and send a Click it works well leveling that Gem.

 

BUT : 

i don't Want to MOVE the mouse, instead i just want to simulate a Click at the specified Position.

 

i thougt it would work wit the sendmessage-api from User32 dll.

 

c#-code

 

        [DllImport("user32.dll", CharSet = CharSet.Auto)]
        static extern IntPtr SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, ref Point lParam);
 
 
        public const int  WM_LBUTTONDOWN = 0x201;
        public const int  WM_LBUTTONUP = 0x202;
 
 
public void DoMouseClick(int X, int Y )
        {
 
            Point p = new Point(X, Y);
            SendMessage(poe.Window.Process.MainWindowHandle, WM_LBUTTONDOWN, IntPtr.Zero, ref p);
            SendMessage(poe.Window.Process.MainWindowHandle, WM_LBUTTONUP, IntPtr.Zero, refp);
}
 
it sends a klick, but always to the current position
 
can anyone hint me in the right direction ?
 
 
 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...