MyApp (.NET c#) is triggered by OtherApp (c++).
When triggered my app takes over the whole screen and gives the user two options. One option quits MyApp and returns to the OtherApp home screen. The 2nd option exits the intial screen and shows another screen for user input - after input it exits and returns to the OtherApp.
On occasion the OtherApp screen does not repaint(can only see the background, not buttons) - I can not easily replicate this (when I do it seems like a fluke), but I have seen it on a number of applications.
Is there a way that MyApp can force a screen repaint of OtherApp?
What could be causing this?
CLARIFICATION - OTHER APP IS NOT OURS. Our client uses OtherApp. MyApp is triggered by a filewatcher event. When we see a file, we process it. If this is the file we are looking for we give the user two options. OtherApp does not know MyApp exists.
Try and get the hwnd of OtherApp's main window and invalidate the whole thing:
[DllImport("user32.dll")]
static extern bool InvalidateRect(IntPtr hWnd, IntPtr lpRect, bool bErase);
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
static void InvalidateOtherApp()
{
IntPtr hWnd = FindWindow(null, "OtherApp's Main Window's Title");
if (hWnd != IntPtr.Zero)
InvalidateRect(hWnd, IntPtr.Zero, true);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With