initial oogynize check in _ this actually used to work!
This commit is contained in:
62
WorkspaceMgr/Closers/Closer_Generic.cs
Normal file
62
WorkspaceMgr/Closers/Closer_Generic.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
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
|
||||
|
||||
/// <summary>
|
||||
/// Sends a WM_QUERYENDSESSION to the Window that the Artifact Belongs To
|
||||
/// </summary>
|
||||
/// <param name="strArtifactLocation">location of the path + file to launch</param>
|
||||
/// <returns></returns>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a WM_Close to the Window that the Artifact Belongs To
|
||||
/// </summary>
|
||||
/// <param name="strArtifactLocation">location of the path + file to launch</param>
|
||||
/// <returns></returns>
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user