Hello,
I want to send button click message in Toolbar using Win32 API.
So, I made code like below.
TBBUTTON TB_Data={0};
int btn_count= 0, i = 0;
...
...
btn_count = SendMessage(Parent_hWnd, TB_BUTTONCOUNT, 0, 0);
i = SendMessage(Parent_hWnd, TB_GETBUTTON, (WPARAM)5, (LPARAM)(&TB_Data));
SendMessage(Parent_hWnd, TB_PRESSBUTTON, (WPARAM)TB_Data.idCommand, (LPARAM)TRUE);
SendMessage(Parent_hWnd, TB_PRESSBUTTON, (WPARAM)TB_Data.idCommand, (LPARAM)FALSE);
But it doesn't work.
As I know, below code means that information of fifth button save in TB_Data.
And then, If this code success, SendMessage return 1.
i = SendMessage(..,TB_GETBUTTON, 5, &TB_Data);
i value is 1.
But It doesn't seem right data save in TB_Data.
Of course SendMessage(..,TB_PRESSBUTTON, ..) doesn't work.
Please advise me about this code.
What I have tried:
I want to send button click message in Toolbar using Win32 API.