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:

  1. call getwindowthreadprocessid() retrieve toolbar's process id
  2. call openprocess() handle process
  3. call virtualallocex() allocate structure inside of process
  4. send tb_getbutton message(s) toolbar, specifying pointer returned virtualallocex()
  5. call readprocessmemory() copy structure data own process can process needed
  6. call virtualfreeex() free allocated memory.

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -