using System; using System.Collections.Generic; using System.Linq; using System.Text; using Foo.Platform.Win32; namespace Foo.WorkspaceMgr.Closers { internal class Closer_Generic : IClose { #region IClose Members /// /// Sends a WM_QUERYENDSESSION to the Window that the Artifact Belongs To /// /// location of the path + file to launch /// public FuncDepBoolType IQueryClose(string strArtifactLocation) { if (!String.IsNullOrEmpty(strArtifactLocation)) { // To Do: Must get hWnd From RAT IntPtr hWnd = IntPtr.Zero; if (Win32Functions.SendMessage(hWnd, (int)WindowMessage.WM_QUERYENDSESSION, IntPtr.Zero, IntPtr.Zero) != 0) { return FuncDepBoolType.Success; } else { return FuncDepBoolType.Failed; } } return FuncDepBoolType.ParametersInvalid; } /// /// Sends a WM_Close to the Window that the Artifact Belongs To /// /// location of the path + file to launch /// public FuncDepBoolType IClose(string strArtifactLocation) { if (!String.IsNullOrEmpty(strArtifactLocation)) { // To Do: Must get hWnd From RAT IntPtr hWnd = IntPtr.Zero; if (Win32Functions.SendMessage(hWnd, (int)WindowMessage.WM_CLOSE, IntPtr.Zero, IntPtr.Zero) == 0) { return FuncDepBoolType.Success; } else { return FuncDepBoolType.Failed; } } return FuncDepBoolType.ParametersInvalid; } #endregion } }