diff --git a/Client/View/MainForm.cs b/Client/View/MainForm.cs index e855dd6d..fd393ed9 100644 --- a/Client/View/MainForm.cs +++ b/Client/View/MainForm.cs @@ -88,7 +88,8 @@ namespace CMS_Client.View } else { - NcWindow.ShowNcWindow(); + if(NcWindow.State != Constants.NcState.HIDE) + NcWindow.ShowNcWindow(); } //Refresh Browser Paint @@ -406,7 +407,7 @@ namespace CMS_Client.View { //Start following NC Window if (Config.VendorHmiConfig.Enabled) - NcWindow.StartNcFollowing(MainHandle, IntPtr.Zero, 1024, 768); + NcWindow.StartNcFollowing(MainHandle); else NcWindow.StartStepFollowing(MainHandle); } diff --git a/Client/View/NcWindow.cs b/Client/View/NcWindow.cs index d4f80af3..6f8d480c 100644 --- a/Client/View/NcWindow.cs +++ b/Client/View/NcWindow.cs @@ -80,7 +80,6 @@ namespace CMS_Client.View private static IntPtr ActualHND; private static IntPtr LastHookedHND; - private static IntPtr NcHND; private static Thread CaptureThread; private static Thread FollowNCThread; private static int ncWindowWidth; @@ -398,11 +397,10 @@ namespace CMS_Client.View //Start following Nc Window (bring-to-font the main window) - public static void StartNcFollowing(IntPtr Handle, IntPtr NcHandle, int Width, int Height) + public static void StartNcFollowing(IntPtr Handle) { //Setup the Handle-variable MainViewHandle = Handle; - NcHND = NcHandle; //Set the parent of the window SetParent(ncprocess.MainWindowHandle, MainViewHandle);