Autoit SendMessage and Imagesearch in minimized window -


i have code send mouse actions inactive window, don't know why it's not working, , doesn't give error. include part <> removed them. in example want draw line in paint. need dll or au3 file imagesearch in minimized windows. searched whole net, couldn't find 1 works. appreciate help.

include sendmessage.au3

include winapi.au3

global $whandle = "untitled - paint"

controlclickdrag($whandle,"left",300,300,100,80)

func controlclickdrag($whandle, $button="left", $x1="", $y1="", $x2="", $y2="")

local $mk_lbutton = 0x0001

local $wm_lbuttondown = 0x0201

local $wm_lbuttonup = 0x0202

local $mk_rbutton = 0x0002

local $wm_rbuttondown = 0x0204

local $wm_rbuttonup = 0x0205

local $wm_mousemove = 0x0200

local $i = 0

select

case $button = "left"

$button = $mk_lbutton

$buttondown = $wm_lbuttondown

$buttonup = $wm_lbuttonup

case $button = "right"

$button = $mk_rbutton

$buttondown = $wm_rbuttondown

$buttonup = $wm_rbuttonup

endselect

dllcall("user32.dll", "int", "sendmessage", "hwnd", $whandle, "int", $buttondown, "int", $button, "long", _makelong($x1, $y1))

dllcall("user32.dll", "int", "sendmessage", "hwnd", $whandle, "int", $buttonup, "int", $button, "long", _makelong($x2, $y2))

endfunc

func _makelong($loword,$hiword)

return bitor($hiword * 0x10000, bitand($loword, 0xffff))

endfunc

global $whandle = "untitled - paint"

this isn't handle. it's string.

replace this:

global $whandle =   controlgethandle("untitled - paint", "",[class:afx:00007ff7b1bd0000:8; instance:1]") 

you can use au3info.exe necessary information other programs.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -