Jump to content

_SendMessage function help


Recommended Posts

Hey. Anyone knows how can i hold down the CTRL key on minimized window? Send("{CTRLDOWN}") doesn't works on minimized window.

The code with active window is:

Send("{CTRLDOWN}")

MouseClick("",$area_x,$area_y,1,1)

Send("{CTRLUP}")

The code with minimized window would be:

_SendMessage(WinGetHandle($clientname),???)

ControlClick($clientname,"","[iNSTANCE: 1]","left",1,$area_x - $client_pos[0],$area_y - $client_pos[1])

_SendMessage(WinGetHandle($clientname),???)

How should i use the _SendMessage function or how could i make this with any other function(s)? I didn't find any useful command in help/Windows Message Codes. Any ideas?

Edited by CyRius

[font="Courier New"][size="3"]CyRius Developments[/size][/font][list][*]CO Proxy[*]CO Assembly tool[*]CO PacketSniffer[*]Larkinor proxy[*]BoIM Messenger[*]Encrypt/Decrypt[*]Hashtables[*]Slowest, but greatest skins ever xD[/list]

Link to comment
Share on other sites

ControlSend() don't work. I already tried it.

I have an autohotkey code which hold down the CTRL but i dont understand how it is works:(

$hwnd := ControlFromPoint($XX,$YY,$ProcessID1,\"\")

PostMessage, 0x201, 0x8 | 0x1, cX & 0xFFFF | (cY & 0xFFFF) << 16,, ahk_id %hwnd%

PostMessage, 0x202, 0x8 , cX & 0xFFFF | (cY & 0xFFFF) << 16,, ahk_id %hwnd%

Edited by CyRius

[font="Courier New"][size="3"]CyRius Developments[/size][/font][list][*]CO Proxy[*]CO Assembly tool[*]CO PacketSniffer[*]Larkinor proxy[*]BoIM Messenger[*]Encrypt/Decrypt[*]Hashtables[*]Slowest, but greatest skins ever xD[/list]

Link to comment
Share on other sites

Any replyes? I think that anybody should knows something about this LoL. :D

[font="Courier New"][size="3"]CyRius Developments[/size][/font][list][*]CO Proxy[*]CO Assembly tool[*]CO PacketSniffer[*]Larkinor proxy[*]BoIM Messenger[*]Encrypt/Decrypt[*]Hashtables[*]Slowest, but greatest skins ever xD[/list]

Link to comment
Share on other sites

ok after spending about 6 hours looking/learning about this (i had the same problem)... in autoit the call would look be this...

$X = 
$Y = 
$windowname = 
$controlID =

DllCall("user32.dll", "int", "SendMessage", "hwnd",  ControlGetHandle ( $windowname, "", $controlID ), "int",   0x0201, "int", BitOR (0x0001, 0x0008), "long",  _MakeLong($X, $Y))
    
DllCall("user32.dll", "int", "SendMessage", "hwnd",  ControlGetHandle ( $windowname, "", $controlID ), "int",   0x0202, "int", BitOR (0x0001, 0x0008), "long",  _MakeLong($X, $Y))

Func _MakeLong($LoWord,$HiWord)
  Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
EndFunc

btw this is in the form of a dll call, but it is the same as _sendmessage function and autohotkeys PostMessage

Edited by UPSman2
Link to comment
Share on other sites

ok so i maybe i little udf for this...

#include-once
; Credits:  Evanxxx, for the help with translating the autohotkey form of this
;          Valik with the  _MakeLong function
;          and the original author "forgot name" who wrote it in autohotkey
;          and a whole lot of other people on autoit forms and across the web, thx :p
;==================================================================================
; Function:         CtrlMouse($WindowName, $WindowText , $ControlID, $X_Coord, $Y_Coord)

; Description:      Sends ctrl+left mouse click  to the defined control.

; Parameter(s):     $WindowName - the name of the window that your control is located in.
;                  $WindowText - you can leave this as "" but its the text of the window
;                                to access, read more about it in ControlGetHandle function 
;                                 help
;                   $ControlID - the id of the control your wanting to send ctrl+leftmouse
;                  $X_Coord - the X coord you want to send the ctrl + leftmouse in the defined control
;                  $Y_Coord - the Y coord you want to send the ctrl + leftmouse in the defined control

; Requirement(s):   None.
; Return Value(s):  On Success - Returns an array containing the Dll handle and an
;                                open handle to the specified process.
;                   On Failure - Returns 0
;                   @Error - 0 = No error.
;                            1 = No window Found.
; Author(s):        UPSman2
;==================================================================================

Func CtrlMouse($WindowName, $WindowText , $ControlID, $X_Coord, $Y_Coord)
    If WinExists($WindowName) Then
    ;mouse down
        DllCall("user32.dll", "int", "SendMessage", "hwnd",  ControlGetHandle ( $WindowName, $WindowText, $ControlID ), "int",   0x0201, "int",   BitOR (0x0001, 0x0008), "long",  _MakeLong($X_Coord, $Y_Coord))
    ;mouse up
        DllCall("user32.dll", "int", "SendMessage", "hwnd",  ControlGetHandle ( $WindowName, $WindowText, $ControlID ), "int",   0x0202, "int", 0x0001, "long",  _MakeLong($X_Coord, $Y_Coord))
    Else
        SetError(1)
    EndIf
EndFunc 

Func _MakeLong($LoWord,$HiWord)
  Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
EndFunc

and heres an example...

#Include <UPSmouse.au3>
ctrlmouse("[Conquer2.0]","","#327701", 120, 150)

UPSmouse.au3

Link to comment
Share on other sites

Lol:) Thank you:) I was searching for Evanxxx's script but i didn't find it:D Thank you this works great:)

[font="Courier New"][size="3"]CyRius Developments[/size][/font][list][*]CO Proxy[*]CO Assembly tool[*]CO PacketSniffer[*]Larkinor proxy[*]BoIM Messenger[*]Encrypt/Decrypt[*]Hashtables[*]Slowest, but greatest skins ever xD[/list]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...