winapi - Win32, How to access button on toolbar -
let's have compiled binary program runs , exposes gui on screen. need program in win32 access toolbar, find button , click on it.
i know how find hwnd of toolbar, don't know how enumerate buttons on it. ideas how in win32 calls?
is there tool spy++ capable of showing button handles under toolbar? spy++ doesn't it.
thanks
if standard win32 toolbar control, send toolbar tb_buttoncount message determine how many buttons on toolbar, send tb_getbutton message retrieve information button @ given index.
the tricky part tbbutton structure receives button info needs allocated in same process owns toolbar, have to:
- call
getwindowthreadprocessid()retrieve toolbar's process id - call
openprocess()handleprocess - call
virtualallocex()allocate structure inside of process - send
tb_getbuttonmessage(s) toolbar, specifying pointer returnedvirtualallocex() - call
readprocessmemory()copy structure data own process can process needed - call
virtualfreeex()free allocated memory.
Comments
Post a Comment