Jump to content


Photo

how do i access fields in an external app that uses TNextGrid


  • Please log in to reply
8 replies to this topic

#1 d6user

d6user
  • Members
  • 94 posts

Posted 26 November 2012 - 06:16 AM

hi, i realize that this is an unusual request. but there is this windows app that uses the tnextgrid control.

i used a findwindow() function to reveal that it is a tnextgrid windows control.

ok, so the grid has four controls in it: (#, text, text, text)

i would like to access (or, mirror) all of them. what i want to do is capture them in a similar nextgrid control rather than having to use that app. if i can do that then i can expand on my main windows app with that app's contents and move further in this project.

can someone help me with this, thank you.

#2 Luben

Luben
  • Members
  • 116 posts

Posted 26 November 2012 - 08:06 AM

Without extra support in the other application it will be very difficult (if not impossible) to get access to this data. The easiest extra support I can imagine (which should work) is the other application to receive Windows messages with requests to read some specific grid cell. On response to the message it can send back the content of the cell.

Theoretically if you can read without any extra support in the other app from the TnextGrid then it will be also possible to read from any component as TLabel, TEdit, etc.. It sounds too good for me to be possible but I'll be pleased to hear if such solution exists - I also need in many cases to to exactly what you requested.

Best regards,
Luben

#3 d6user

d6user
  • Members
  • 94 posts

Posted 26 November 2012 - 08:20 AM

i'm really pooped with searching and also working on various projects. but i found this code on, (below) but too tired to try it out at 12:16am. but i'm sure it can be modified to work. give it shot and let us know.

http://stackoverflow...m-a-delphi-grid

the next level to this is to read a SysListView32 since that is what i need to work with in many of the apps i work with at work. we have lots of apps (and window screens) that have many listbox's of detail info that i need to convert and/or work with as-is. i use the bergs nextgrid compoents to help organize this info when i can or i use ms excel. it all depends on if i have to sort or filter it. but thanks to google searches and my tweaks i made a listbox sniffer app for this purpose, but it does not snif the current SysListView32 that most apps use these days. this one is a tough one to figure out. if you figure it, let us know. i'm sure i'm not the only one on this. hey, good luck on the link above.

#4 Luben

Luben
  • Members
  • 116 posts

Posted 26 November 2012 - 10:18 AM

Hi,
As I see from the post you still need common DLL otherwise there is no way you can see the component properties from outside the application. But I'll be pleased if there is some way to do this.

#5 d6user

d6user
  • Members
  • 94 posts

Posted 26 November 2012 - 07:50 PM

it took some degugging, it kept crashing. but i managed to get the routine working last night. but it was only reading my tstringgrid's data, not the one i made in annother app window that was running on my desktop.

what is this DLL that you talk of ?

maybe we can create a dummy dll as a mediary between two apps with the same controls somehow. i once created an app to add a button on another external window. there must be a way to at least 'read' contents from other windows controls. we can do it when they are text box's, but string grids are a little tricky so far. but i have a few ideas to try later when i come home from work.

#6 Luben

Luben
  • Members
  • 116 posts

Posted 26 November 2012 - 08:03 PM

Hi,
In the link you've sent me - http://stackoverflow...m-a-delphi-grid
they talk about DLL.

But the proper way to do data exchange between two applications is to use Windows messages - it works fine and there are no surprises.

#7 d6user

d6user
  • Members
  • 94 posts

Posted 26 November 2012 - 08:53 PM

oh, so you got the routine working, great!

#8 Luben

Luben
  • Members
  • 116 posts

Posted 26 November 2012 - 09:37 PM

Sure, I'm using data exchange between different applications almost all the time. If using Windows messages there is no problem to update dynamically n real time component properties from one application from the component properties from other application. Even if there is some narrow path to do what you want through RTTI it will be much slower and not reliable.

#9 d6user

d6user
  • Members
  • 94 posts

Posted 15 December 2012 - 01:12 AM

some progress updates..

i finally managed to learn how to get the values from a SysListView32 control into another running windows app into my app. so i just need to add that to my listboxsniffer app. next, i hope to figure out my original quest, to read nextgrid values. i'm working on that when i have time.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users