sendmessage

as we know, sendmessage in win32 api is able to send a message to some window based controls so that the callback proc will deal with it.

 

for thos controls don't reside in the same process, we may try to get their hwnds first. These hwnds should be placed in a shared area (usually, these hwnds are defined

within the block #pragma data_seg("shared") #pragma data_seg()

 

otherwise, the sendmessage doesn't work.

 

reference: check the book windows via c/c++ by Jeffry ricther

it is a great book for windows programming.

 

ps: in an early post, i said i needed to hook the process before using sendmessage, however i was wrong. sendmessage can work directly as long as the hwnd is not passed from other process.

你可能感兴趣的:(C++,c,windows,C#)