Cannot automate/simulate listview click of another process

I am developing an automation tool. I want to click listview item of another process programatically. I have partially succeeded in doing. But I am getting a slightly different output.I have used NMITEMACTIVATE(I have also used PostMessage Instead of SendMessage in the code below).
C++,Win32
Small code detail:
1
2
3
4
5
6
7
8
9
10
11
NMITEMACTIVATE nmbh;
nmbh.hdr.code = NM_DBLCLK;
nmbh.hdr.hwndFrom=g_hWnd;
nmbh.hdr.idFrom=GetDlgCtrlID(g_hWnd);
nmbh.iItem=itemval;
nmbh.iSubItem=0;
nmbh.uNewState=0;
nmbh.uOldState=0;
nmbh.uChanged=0;
nmbh.uKeyFlags=0;
SendMessage(GetParent(g_hWnd), WM_NOTIFY,(WPARAM)g_hWnd,(LPARAM)&nmbh);



Last edited on
Topic archived. No new replies allowed.