|
-
Apr 7th, 2006, 06:02 AM
#1
Thread Starter
Hyperactive Member
SysListView32 [resolved]
The class for the list box I am trying to get data from is SysListView32.. I was wondering how I could get the text that is selected from that list box ? This listbox is from an external application, I want my application to get the highlighted text.
Thanks
Last edited by bail3yz; Apr 7th, 2006 at 02:31 PM.
Reason: resolved
-
Apr 7th, 2006, 11:19 AM
#2
Frenzied Member
Re: SysListView32
There are a few ways to do it. One way is to inject the code into the external process.
The code you want to inject is something like this:
Code:
LVITEM* lvItem;
lvItem = new LVITEM;
lvItem->iSubItem = 0;
lvItem->cchTextMax = 255;
lvItem->pszText = lpText;
int totalItem = SendMessage(TargetHwnd, LVM_GETITEMCOUNT, 0, 0);
for(int i = 0; i < totalItem; i++)
{
int res2 = SendMessage(TargetHwnd, LVM_GETITEMSTATE, i, LVIS_SELECTED);
if(res2 == LVIS_SELECTED)
SendMessage(TargetHwnd, LVM_GETITEMTEXT, i, (long)lvItem);
}
the text is in lvItem->pszText.
Last edited by benmartin101; Apr 7th, 2006 at 11:22 AM.
-
Apr 7th, 2006, 02:30 PM
#3
Thread Starter
Hyperactive Member
-
Jun 27th, 2006, 12:30 AM
#4
Frenzied Member
Re: SysListView32 [resolved]
benmartin101 could u show me how to select perticuler external listbox item . Thanks
-
Jun 27th, 2006, 01:31 PM
#5
Frenzied Member
Re: SysListView32 [resolved]
-
Aug 2nd, 2006, 09:00 AM
#6
Member
Re: SysListView32 [resolved]
benmartin101 if the data in "Syslistview32" updates dynamically like a stocks trading platform how could we copy the data in to a excel sheet automatically.
-
Aug 4th, 2006, 03:48 PM
#7
Frenzied Member
Re: SysListView32 [resolved]
Well, I'm guessing you could create a hook that would intercept all LVM_SETITEMTEXT messages to that listview. Then from that intercepted message, just get the text and just create a code that would send the text to the excel sheet. I'm assuming that your already familiar with hooks, if not, then there are many threads here that explains how to make one.
-
Aug 5th, 2006, 10:20 AM
#8
Member
Re: SysListView32 [resolved]
 Originally Posted by benmartin101
Well, I'm guessing you could create a hook that would intercept all LVM_SETITEMTEXT messages to that listview. Then from that intercepted message, just get the text and just create a code that would send the text to the excel sheet. I'm assuming that your already familiar with hooks, if not, then there are many threads here that explains how to make one.
benmartin101 I am new to programming.The application which I use displays data in "syslistview32".That is executable application only.How Can i get the data that is displayed to be displayed in Excel.If it is a small thing can you write the code for me
-
Aug 17th, 2006, 04:01 AM
#9
Member
Re: SysListView32 [resolved]
Mr benmartin101
Pl guide me which books i have to read,about hooks .Particularly VB.net wnvironment
-
Aug 22nd, 2006, 03:32 PM
#10
Frenzied Member
Re: SysListView32 [resolved]
I didn't really read any books to learn about hooks. I mainly looked at the threads, and to understand what is happening, I just googled in the internet. Understanding the concept first is probably best to do first. Then you could look at the codes(that are shown in many of the threads in here) and just learn what they are doing.
For example, when you click on a button, a "WM_LBUTTONDOWN message" is sent to the button's window procedure. The window procedure then processes that message.
Now, if you installed a WH_GETMESSAGE hook(there are other types of hooks other than this, and they differ in usage), it will intercept that WM_LBUTTONDOWN message before it gets to the button's window procedure. You can then manipulate or process the data that came with the WM_LBUTTONDOWN message depending on what you're trying to do. After you're finished processing the message, it then goes to the window procedure.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|