Hi,
The problem :
Have a system tray application.Thi s 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("user 32.dll")] public static extern int FindWindow(stri ng
lpClassName,str ing lpWindowName);
int handle = Win32.FindWindo w(null,"Basic Service");
//[DllImport("user 32.dll")]public static extern bool SetForegroundWi ndow(int
hWnd);
Win32.SetForegr oundWindow(hand le);
handle = Win32.FindWindo w(null,"Basic Service");
//[DllImport("user 32.dll")]public static extern bool SetActiveWindow (int
hWnd);
Win32.SetActive Window(handle);
SendKeys.SendWa it("+^%(x)");
processor.EndTa sks();
noiIcon.Visible = false;
this.Close();
------------------------------