// This is a skeleton implementation file for a Mime criteria plugin DLL
//
// Criteria functions MUST BE functionnameCriteria, eg: FileOpenWord(), FileOpenWordCriteria()

#include "stdafx.h"
#include <windows.h>
#include <winuser.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

// Typedef for struct used to pass criteria for window from a gesture action plugin DLL back to the main Mime
// system. This struct is included in every plugin DLL so must not be changed. Note the non-class fields (ie:
// windowname, parentname etc) are pattern matching, so "otepa" in the criteria will match "Notepad"
typedef struct _tagWindowCriteria
{
	char	m_szWindowName[MAX_PATH];
	char	m_szWindowClassName[MAX_PATH];
	char	m_szParentWindowName[MAX_PATH];
	char	m_szParentWindowClassName[MAX_PATH];
	char	m_szOverallWindowName[MAX_PATH];
	char	m_szOverallWindowClassName[MAX_PATH];
} WINDOWCRITERIA;

// Typedef for struct used for version control. Plugin developers should not alter this code. Mime uses this
// to determine which revision of the plugin system this DLL uses. It allows for backwards compatibility - old
// plugins can be used by new Mime. Please visit the Mime developers page to see which version numbers you
// should use and which features they enable.
typedef struct _tagActionVersion
{
	int		m_iMajorVersion;
	int		m_iMinorVersion;
	int		m_iBuildVersion;
} ACTIONVERSION;

// The version export function
extern "C" __declspec(dllexport) void GetPluginMimeInterfaceVersion(ACTIONVERSION* pVersion)
{
	// The current version numbers to go here can be found on the Brass website, in the Mime developer
	// "Quick Reference" section.
	pVersion->m_iMajorVersion = 0;
	pVersion->m_iMinorVersion = 1;
	pVersion->m_iBuildVersion = 1;
}

// *************************************************************************************************************
// ExampleFunction
// *************************************************************************************************************

extern "C" __declspec(dllexport) void ExampleFunction(HWND hWnd, const char* szParam)
{
	// This can be deleted if the action doesn't require a parameter
    if(strlen(szParam) == 0 || strcmp("0", szParam))
    {
        // No parameter was supplied by the user, handle this
    }

    // Normal implementation
}

extern "C" __declspec(dllexport) void ExampleFunction(WINDOWCRITERIA* pCriteria)
{
	ZeroMemory(pCriteria, sizeof(WINDOWCRITERIA));
	//strcpy(pCriteria->m_szWindowName, _T("Window Name/Title"));
	//strcpy(pCriteria->m_szWindowClassName, _T("Window Class"));
	//strcpy(pCriteria->m_szParentWindowName, _T("Parent Window Name/Title"));
	//strcpy(pCriteria->m_szParentWindowClassName, _T("Parent Window Class"));
	//strcpy(pCriteria->m_szOverallWindowName, _T("Overall Top Level Window Name/Title"));
	//strcpy(pCriteria->m_szOverallWindowClassName, _T("Overall Top Level Window Class"));
}

