DLL's Parent Window Or ParentWindow PID.
How can I get a DLL's Parent Window Title? OR How can I get the PID of the process that loaded my DLL?
I need this so I can make a file for each process that loads my DLL but the file has to contain some sort of identifier. Something like File.PID.
I decided to use Process ID because I want to do this in a portable way. Is there any portable ways to get the PID that loaded my dll?
Also is there a way I can program for linux on windows? Basically I want to see if a linux system will run my dll (even though I didn't have any ifdef __linux). I'd like to make my DLL run on both windows and linux.
triumphost
Practically a Master Poster
625 posts since Oct 2009
Reputation Points: 59
Solved Threads: 55
Skill Endorsements: 1
Attempting to do it a "portable" way is useless becuse *nix doesn't support DLLs, instead it has shared libraries with *.so exension.
Also is there a way I can program for linux on windows?
Only if you run *nix in a virtual machine window and use a compiler for *nix such as gcc and/or g++. Have you looked at any of boost cross-platform libraries to see if there is something you can use?
How can I get a DLL's Parent Window Title?
GetModuleFileName() will return the fully qualified path to the processes that loaded your DLL.
Ancient Dragon
Achieved Level 70
32,159 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,577
Skill Endorsements: 69
Yeah but it's not the path to the process I want. It's the process ID. I can compile my code into a .so? How do I get this shared library thing?
The reason I want the PID is because if one application has many instances, the paths will all be the same. The PID is the only way I can think of to distinguish which one ran it.
triumphost
Practically a Master Poster
625 posts since Oct 2009
Reputation Points: 59
Solved Threads: 55
Skill Endorsements: 1
Ancient Dragon
Achieved Level 70
32,159 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,577
Skill Endorsements: 69