Home > Software engineering >  SysTreeView32 tree control, simulate mouse click no, please advise...
SysTreeView32 tree control, simulate mouse click no, please advise...

Time:09-25



I want the software to automatically click on bulk purchase of new shares subscription of new shares, which tall person to provide a train of thought, try to use SendMessage, PostMessage also did not achieve success,

Check my class for using spy++ SysTreeView32,

CodePudding user response:

May also notice that the location of the mouse,
When SPY++ monitoring message, see double click which messages,

CodePudding user response:

http://www.autohotkey.com

CodePudding user response:

 GetWindowThreadProcessId (hwnd7, & amp; ProcessId); 
HANDLE the process=: : OpenProcess (PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE, false, processId);
PVOID buffer=VirtualAllocEx (process, NULL, bufferLength, MEM_COMMIT, PAGE_READWRITE);
Item - & gt; Mask=TVIF_TEXT;
Item - & gt; CchTextMax=512;
Item - & gt; PszText=LPTSTR ((PBYTE) buffer + sizeof (TVITEM));
Item - & gt; (HTREEITEM hItem=) : : SendMessage (hwnd7, TVM_GETNEXTITEM, TVGN_ROOT, 0);

While (item - & gt; HItem)
{
: : SendMessage (hwnd7, TVM_SELECTITEM TVGN_CARET, (long) item - & gt; HItem);
WriteProcessMemory (process, buffer, item, sizeof (TVITEM), NULL);
: : SendMessage (hwnd7 TVM_GETITEM, 0, (LPARAM) buffer);
ReadProcessMemory (process, buffer, item, bufferLength, NULL);
Text=(LPTSTR) ((PBYTE) item + sizeof (TVITEM));
If (1!=text. The Find (_T (" new shares subscription ")))
{
: : SendMessage (hwnd7, TVM_EXPAND TVE_EXPAND, (long) item - & gt; HItem);
: : SendMessage (hwnd7, TVM_SELECTITEM TVGN_CARET, (long) item - & gt; HItem);
break;
}
Item - & gt; (HTREEITEM hItem=) : : SendMessage (hwnd7 TVM_GETNEXTITEM, TVGN_NEXTVISIBLE, (long) item - & gt; HItem);

}
Item - & gt; (HTREEITEM hItem=) : : SendMessage (hwnd7, TVM_GETNEXTITEM, TVGN_CHILD, 0);
While (item - & gt; HItem)
{
: : SendMessage (hwnd7, TVM_SELECTITEM TVGN_CARET, (long) item - & gt; HItem);
WriteProcessMemory (process, buffer, item, sizeof (TVITEM), NULL);
: : SendMessage (hwnd7 TVM_GETITEM, 0, (LPARAM) buffer);
ReadProcessMemory (process, buffer, item, bufferLength, NULL);
Text=(LPTSTR) ((PBYTE) item + sizeof (TVITEM));
If (1!=text. The Find (_T (" new shares "batch purchase)))
{
: : SendMessage (hwnd7, TVM_EXPAND TVE_EXPAND, (long) item - & gt; HItem);
: : SendMessage (hwnd7, TVM_SELECTITEM TVGN_CARET, (long) item - & gt; HItem);
break;
}
Item - & gt; (HTREEITEM hItem=) : : SendMessage (hwnd7 TVM_GETNEXTITEM, TVGN_NEXTVISIBLE, (long) item - & gt; HItem);
  • Related