Quote:
Originally posted by RussG1
What other controls are you not able to get working? (different contol's respond to different messages. A message that works with 1 control, will not necessarily work for another. The same message may have a different meaning for different controls)
I tried with a quick sample VB application I created to test with.
I added 2 Labels, 2 TextBoxes, and a Button, and was able to get the text of all of the controls.
So far, from VB application,i can grab text for TextBox, ComboBox, Button.. from my VC++ application, across the process. All this i am using WM_GETTEXT to achieve the task.
Now, VERY INTERESTING!! interesting part is, this is not enough. I really need to be able to grab text from ListBox, MSFlexControl (an add in components available both in VB and VC++). I believe this controls doesn't process the WM_GETTEXT message.
So fro list box, i do the following, which works fine., i got back the text according to the index.
Code:
ListBox_GetText(listboxHwnd, 1, Mybuffer);
For ListView control, this doesn't work:-
The reason simply because the address of structure lvi is interpreted differently across the process.
Code:
ListView_GetItem(listViewHwnd, &lvi);
However, i can solve this problem by passing a pointer to a buffer that is relative to the remote process, initialize the pointer to the byte in the remotely allocated memory block using Read and Write ProcessMemory. This is a bit complicated, but that is ok, as long as i got what i want.
Now, the problem is with other controls such as MSFlexGrid Control. I can get the handle for this control, but how can i send a message to this remote control to ask him to do the task as in listView control, such as GetText, GetRows, GetColumns etc etc, the rest of the operations can be seen if you add this components into yout VC++ project, it created the Class called CMSFlexGrid. If you can provide some sample codes to me on how to get around this problem, i really appreciate.. it may not be easy, but i am getting very desperate now. Come to that, MSFlexGrid is actually an activeX, but i just don know how i can make use of this feature to get what i want.. i need some working examples.. really.
Quote:
Originally posted by RussG1
Again HTML dialogs, or web browser controls (or similair type of controls) work differently. You would have to use COM/DOM , etc with these type of controls.
Does this apply to the MSFlexGrid? it is an activex control, but again, if so, really appreciate your working samples..
Quote:
Originally posted by RussG1
If you are trying to build an application that will work (without modification) with all the different possible applications that the developers may build, that would be difficult as you would have to account for every type of control, and know what messages work with different types of controls, and try to figure out how to pull it all together.
That is what i plan to do, however, for now, i just want to have those common controls, label, and some uncommon one such as MSFlexGrid.. listbox etc. then i would be very happy already.
Quote:
Originally posted by RussG1
There are probably better ways to do whatever it is you are going to be doing in the long run. Maybe the developers could develop the programs so that the controls can be accessed externally (through VBScript or similair), etc.
Well, i can't think of better way now, i have totally no control of the application source or the way it is being developed. All i want is to support existing application with those common controls and a couple of uncommon controls such as MSFlexGrid.