Code: Select all
[DllExport("HideWnd", CallingConvention.StdCall)]
public static int HideWnd(string sTitle)
{
int ret = 0;
var win = FindWindowsWithText(sTitle);
foreach (int wnd in win)
{
hwndHiddenWnd = wnd;
ret = ShowWindow(hwndHiddenWnd, 0); //// SW_HIDE
}
return ret;
}
/// <summary>
/// Shows the window.
/// </summary>
/// <returns>Whether the ShowWindow call fails or not</returns>
[DllExport("ShowWnd", CallingConvention.StdCall)]
public static int ShowWnd()
{
int ret = 0;
ret = ShowWindow(hwndHiddenWnd, 1); ////SW_SHOWNORMAL
hwndHiddenWnd = 0;
return ret;
}
}
Code: Select all
Let>Lib=D:\ArgoDev\trunk\ArgoEmpiScriptingTools\bin\x64\Release\ArgoEmpiScriptingTools.dll
LibLoad>Lib,hLib
LibFunc>hLib,HideWnd,funcHide,WinDiff
LibFunc>hLib,ShowWnd,funcShow
LibFree>hLib
Has anyone gotten a C# DLL to work with Macro Scheduler? If so, would you mind telling me how you did it?
I've even gone so far as to create a C++ DLL with just a simple "HelloWorld" function and even that won't load:
Code: Select all
#ifndef ARGOEMPICPPSCRIPTINGTOOLS_H
#define ARGOEMPICPPSCRIPTINGTOOLS_H
extern "C"
{
#ifdef EXPORTING_DLL
extern __declspec(dllexport) int __stdcall HelloWorld();
#else
extern __declspec(dllimport) int HelloWorld();
#endif
}
#endif
Code: Select all
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#define EXPORTING_DLL
#include "ArgoEmpiCppScriptingTools.h"
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
return TRUE;
}
extern "C"
{
int HelloWorld(void)
{
return 1;
}
}
Code: Select all
Let>Lib=D:\ArgoDev\trunk\ArgoEmpiCppScriptingTools\x64\Release\ArgoEmpiCppScriptingTools.dll
LibLoad>Lib,hLib
LibFunc>hLib,HelloWorld,r
LibFree>hLib