T
TMS
Hi there
I´ve been trying to get the id of a word application instance launched from
my aplication. I´ve a container (dsoFramer) where I open an word document.
What I want to do is when I open a document inside this frame... I want to
return the Process ID of the word application instance.
This is the code that i´m tryng to work it:
[DllImport("user32")]
public static extern IntPtr FindWindow(
string lpClassName, string lpWindowName);
[DllImport("user32")]
public static extern uint GetWindowThreadProcessId(
IntPtr hWnd, out IntPtr lpdwProcessId);
private AxDSOFramer.AxFramerControl axFramer;
private void CreateDocument()
{
this.axFramer.CreateNew("Word.Document");
uint wPID = GetProcessID();
}
private uint GetProcessID()
{
System.IntPtr ptr = FindWindow("OpusApp", null);
return GetWindowThreadProcessId(ptr, out myDummyPointer);
}
Thanks in advice for any help
I´ve been trying to get the id of a word application instance launched from
my aplication. I´ve a container (dsoFramer) where I open an word document.
What I want to do is when I open a document inside this frame... I want to
return the Process ID of the word application instance.
This is the code that i´m tryng to work it:
[DllImport("user32")]
public static extern IntPtr FindWindow(
string lpClassName, string lpWindowName);
[DllImport("user32")]
public static extern uint GetWindowThreadProcessId(
IntPtr hWnd, out IntPtr lpdwProcessId);
private AxDSOFramer.AxFramerControl axFramer;
private void CreateDocument()
{
this.axFramer.CreateNew("Word.Document");
uint wPID = GetProcessID();
}
private uint GetProcessID()
{
System.IntPtr ptr = FindWindow("OpusApp", null);
return GetWindowThreadProcessId(ptr, out myDummyPointer);
}
Thanks in advice for any help