B
BrianKE
I am attempting to create an app that will run "on top" of another app.
My app will create a transparent window over the other app for the
purpose of displaying information.
I am able to create my transparent app but cannot get the size and
position of the other app. I can get the handle of the other app using
the DllImport("user32")...FindWindow method. However, when I try to
get this size/position of this other window using
DllImport("gdi32")...GetBoundsRect it does not assign any value to the
Rectangle object referenced by GetBoundsRect.
I believe my problem lies in the 'flags' attribute of GetBoundsRect.
The method signature is as follows:
[DllImport("gdi32.dll")]
public static extern int GetBoundsRect(int hWnd, // handle to window
ref Rectangle rect, // bounding rectangle
int flags); // function options
All of the documentation I have found on this method refer to only one
valid value for the 'flags' variable: DCB_RESET (Clears the bounding
rectangle after returning it. If this flag is not set, the bounding
rectangle will not be cleared.) I cannot figure out how to set or
retrieve this value. Do I need to get this value from somewhere or do
I need to initialize in my program before using? Any help would be
appreciated.
I am fairly new to C# (coming from a Java background) and am using
Visual Studio 2005 Professional.
TIA,
Brian Enderle
My app will create a transparent window over the other app for the
purpose of displaying information.
I am able to create my transparent app but cannot get the size and
position of the other app. I can get the handle of the other app using
the DllImport("user32")...FindWindow method. However, when I try to
get this size/position of this other window using
DllImport("gdi32")...GetBoundsRect it does not assign any value to the
Rectangle object referenced by GetBoundsRect.
I believe my problem lies in the 'flags' attribute of GetBoundsRect.
The method signature is as follows:
[DllImport("gdi32.dll")]
public static extern int GetBoundsRect(int hWnd, // handle to window
ref Rectangle rect, // bounding rectangle
int flags); // function options
All of the documentation I have found on this method refer to only one
valid value for the 'flags' variable: DCB_RESET (Clears the bounding
rectangle after returning it. If this flag is not set, the bounding
rectangle will not be cleared.) I cannot figure out how to set or
retrieve this value. Do I need to get this value from somewhere or do
I need to initialize in my program before using? Any help would be
appreciated.
I am fairly new to C# (coming from a Java background) and am using
Visual Studio 2005 Professional.
TIA,
Brian Enderle