0

In my work were using application called Pivotal - eRelationships, it is a CRM app.

In it every user can create list of business objects.

Basically this looks like this:

enter image description here

User select from menu 'Static lists' then he see all available lists, when he select one list it content is displayed. In this example if he choose 'zzzz' he will see all elements on that list.

My job was to create a form that will display details for list items. So if user select something from 'zzzz' list my custom form should show.

I can get ID of selected element, but what I need is the ID of list having that element.

This can't be done normally because of application architecture.

Custom forms are done as dll's. Simple class implementing interface.

So my idea was to get last active window title and than having it I will be able to search for Static List ID in database - this is my only option.

So for testing purposes I would like to create a simple application that will get last active window title.

I know that this isn't the best solution there is, but I think this might work.

Any ideas, suggestions and examples are welcome.

Misiu
  • 4,738
  • 21
  • 94
  • 198
  • 1
    Take a look at http://stackoverflow.com/questions/1857037/determine-the-parent-process-of-the-current-app – Alex K. May 25 '12 at 10:34
  • Thanks I didn't found this one. As always google and some time spend searching helped. But this is in delphi. I would appreciate C# version. – Misiu May 25 '12 at 10:37
  • *[c#] th32ParentProcessID* in the search box for examples; also perf counter method in c#; http://stackoverflow.com/questions/394816/how-to-get-parent-process-in-net-in-managed-way – Alex K. May 25 '12 at 10:41
  • Have a look at this question: http://stackoverflow.com/questions/394816/how-to-get-parent-process-in-net-in-managed-way – Neil_M May 25 '12 at 10:53
  • possible duplicate of [How can I get the PID of the parent process of my application](http://stackoverflow.com/questions/2531837/how-can-i-get-the-pid-of-the-parent-process-of-my-application) – Hans Passant May 25 '12 at 11:07
  • @Hans - This will give me process ID, what I need is previous windows title. Application that will start mine has 4 windows but they are visible as one process. – Misiu May 25 '12 at 11:23
  • How would a process know that one of those 4 windows is "special"? Ignoring the option to pass info through the command line is a mistake. There's no guessing when you just give the process the info it needs. – Hans Passant May 25 '12 at 11:38
  • @HansPassant - As I was writing before I can't pass param. Every window from host application has different name- db table name. I need that name to process some data. My only option is to read previous active window title. – Misiu May 25 '12 at 11:43
  • You gave yourself no reasonable options to make this work. Always hard to help programmers that put themselves in a corner they can't get out of without them explaining at all how they ended up into that corner. Voting to close. – Hans Passant May 25 '12 at 11:55
  • I'm adding full description to my problem, just wait a second' I'm editing my question. – Misiu May 25 '12 at 12:01
  • Your question is far from clear. Are you writing another app that "mines" the list box in another application? What part of the "ID of the list" do you need? (that doesn't make sense), etc. – Peter Ritchie May 25 '12 at 13:46
  • I'm writing a dll that will create a custom form. This is called DCOM. I can pass to it name and id of selected element from right list(on my image), but I also need to pass this list name or ID, but this isn't possible-pivotal isn't giving any api for this. So I would like to get windows (static list) name from my dll. As I was saying Pivotal can call method from dll (DCOM) to do some calculations, create window, call dll method. – Misiu May 25 '12 at 13:54

0 Answers0