You could use the memory mapped file feature in mIRC to send the text.

Declaration:
Code:
#include <windows.h>
#include <pcrt32.h>

long	WM_MCOMMAND = WM_USER + 200;

typedef struct {
	DWORD  mVersion;
	HWND   mHwnd;
	BOOL   mKeep;
} LOADINFO;


class mIRC {
public:
	int mSendMessage(char *);
	HWND hWnd;
};

int mIRC::mSendMessage(char *sText)
{
	if (!hWnd) return 0;
	
	void *hFile;
	void *pData;

	hFile = CreateFileMapping(INVALID_HANDLE_VALUE,NULL,PAGE_READWRITE,0,1024,"mIRC");

	if (!hFile)
		MessageBox(hWnd,(char *)"Can't create a file mapping object.",(char *)"Error...",MB_OK);

	pData = MapViewOfFile(hFile,FILE_MAP_ALL_ACCESS,0,0,0);

	if (!pData)
		MessageBox(hWnd,(char *)"Can't map view of the file.",(char *)"Error...",MB_OK);
	
	if (pData) {
		_fstrcpy((char *)pData,sText);

		SendMessage(hWnd,WM_MCOMMAND,1,0);

		UnmapViewOfFile(pData);
		CloseHandle(hFile);
		
		return 0;
	}
	return 1;
}



Code:
int __stdcall SampleFunction(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL print, BOOL nopause)
{	
	mIRC mObject;
	mObject.hWnd = mWnd;
	mObject.mSendMessage("/msg #chan This is a string");
	return 0;
}