Sep 16, 2017 at 8:11pm UTC
i wana delete item with string ds.exe if found in listbox i already get handle for it
HWND hMainWnd = FindWindow(NULL,"board");
HWND hListWnd = FindWindowEx(hMainWnd,NULL,"ListBox",NULL);
DWORD count = SendMessage(hListWnd,LB_GETTEXTLEN,0,0);
char* lpBuff = new char[count+1];
SendMessage(hListWnd,LB_GETTEXT,0,(LPARAM)lpBuff);
cout << "First item in ListBox " << lpBuff << endl;
SendMessage(hListWnd,LB_DELETESTRING,L"ds.exe",(LPARAM)lpBuff);
why can't delete the ds.exe item in list box
Sep 16, 2017 at 8:57pm UTC
Did you ever bother to look at MSDN what LB_DELETESTRING does and what parameters it requires?
Sep 17, 2017 at 4:26am UTC
itry SendMessage(hListWnd,LB_DELETESTRING,(WPARAM)L"ds.exe",(LPARAM)lpBuff);
same result , and i can't understand how to match item with string ds.exe t be deleted ,
itry what i know ,other else i would solve this by myself , but ineed help that's it.
Sep 17, 2017 at 10:39am UTC
HWND hMainWnd = FindWindow(NULL,"board");
HWND hListWnd = FindWindowEx(hMainWnd,NULL,"ListBox",NULL);
DWORD count = SendMessage(hListWnd,LB_GETTEXTLEN,0,0);
char* lpBuff = new char[count+1];
SendMessage(hListWnd,LB_GETTEXT,0,(LPARAM)lpBuff);
//cout << "First item in ListBox " << lpBuff << endl;
DWORD ss=SendMessage(hListWnd,LB_FINDSTRINGEXACT,0,(LPARAM)"ds.exe");
cout << "First item in ListBox " << lpBuff << endl;
SendMessage(hListWnd,LB_DELETESTRING,0,(LPARAM)lpBuff);
i edit the code still not work ?
Last edited on Sep 18, 2017 at 11:05am UTC
Sep 21, 2017 at 3:53pm UTC
Before you can tackle such a task you need to learn the basics. Get a copy of the book I mentioned earlier, study it and you should be able to do it.
If you are not willing to learn, you can post in the job section and if you offer some money probaly someone will do it for you.
Sep 24, 2017 at 5:13am UTC
all i need is one line of code why i need to read whole book to solve just small issue!!
if any one willing to help thanks in advance.