M
Manoj Nair
Hi,
The problem :
Have a system tray application.This has a menu item 'Exit'.
On click of this a differnt application with a UI which runs in the
background should close.
The other application requires a Keyboard combination of Ctrl + Shift + Alt
+ X to close it properly.
After closing the other application the tray app should exit. (Process.Kill
cannot be used)
The following code doesnt work all the times.
Any Ideas.
Thanks in advance
------
//
//[DllImport("user32.dll")] public static extern int FindWindow(string
lpClassName,string lpWindowName);
int handle = Win32.FindWindow(null,"Basic Service");
//[DllImport("user32.dll")]public static extern bool SetForegroundWindow(int
hWnd);
Win32.SetForegroundWindow(handle);
handle = Win32.FindWindow(null,"Basic Service");
//[DllImport("user32.dll")]public static extern bool SetActiveWindow(int
hWnd);
Win32.SetActiveWindow(handle);
SendKeys.SendWait("+^%(x)");
processor.EndTasks();
noiIcon.Visible = false;
this.Close();
------------------------------
The problem :
Have a system tray application.This has a menu item 'Exit'.
On click of this a differnt application with a UI which runs in the
background should close.
The other application requires a Keyboard combination of Ctrl + Shift + Alt
+ X to close it properly.
After closing the other application the tray app should exit. (Process.Kill
cannot be used)
The following code doesnt work all the times.
Any Ideas.
Thanks in advance
------
//
//[DllImport("user32.dll")] public static extern int FindWindow(string
lpClassName,string lpWindowName);
int handle = Win32.FindWindow(null,"Basic Service");
//[DllImport("user32.dll")]public static extern bool SetForegroundWindow(int
hWnd);
Win32.SetForegroundWindow(handle);
handle = Win32.FindWindow(null,"Basic Service");
//[DllImport("user32.dll")]public static extern bool SetActiveWindow(int
hWnd);
Win32.SetActiveWindow(handle);
SendKeys.SendWait("+^%(x)");
processor.EndTasks();
noiIcon.Visible = false;
this.Close();
------------------------------