mIRC 7.42 - versions.txt 15.Changed script processing method so that Windows no longer thinks mIRC has stopped responding during long loops. I went to make a whilefix dll of my own, but it turns out, mIRC doesn't really need it as much as it used to. Although mIRC doesn't have any functionality during an intensive loop, it at least won't crash mIRC due to unresponsive behavior.
whilefix7.cpp
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#include <assert.h>
#include <string>
using namespace std;
typedef struct {
DWORD mVersion; //!< mIRC Version
HWND mHwnd; //!< mIRC Hwnd
BOOL mKeep; //!< mIRC variable stating to keep DLL in memory
} LOADINFO;
typedef struct {
HANDLE m_hFileMap; //!< Handle to the mIRC DLL File Map
LPSTR m_pData; //!< Pointer to a character buffer of size 900 to send mIRC custom commands
HWND m_mIRCHWND; //!< mIRC Window Handle
} mIRCDLL;
mIRCDLL mIRCLink;
void WINAPI LoadDll(LOADINFO * load) {
mIRCLink.m_hFileMap = CreateFileMapping( INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, 4096, "mIRC" );
mIRCLink.m_pData = (LPSTR) MapViewOfFile( mIRCLink.m_hFileMap, FILE_MAP_ALL_ACCESS, 0, 0, 0 );
mIRCLink.m_mIRCHWND = load->mHwnd;
}
int WINAPI UnloadDll( int timeout ) {
// DLL unloaded because mIRC exits or /dll -u used
if ( timeout == 0 ) {
UnmapViewOfFile( mIRCLink.m_pData );
CloseHandle( mIRCLink.m_hFileMap );
return 1;
}
// Keep DLL In Memory
else
return 0;
}
int __declspec(dllexport) __stdcall whilefix7(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause) {
MSG msg;
PeekMessage(&msg,NULL,0,0,PM_REMOVE);
TranslateMessage(&msg);
DispatchMessage(&msg);
return 1;
}
whilefix7.def
LIBRARY whilefix7
EXPORTS
whilefix7
LoadDll
UnloadDll
whilefix7.mrc
alias whilefix7 {
var %whilefix7.dll $qt(C:\Mirc\whilefix7\whilefix7.dll)
var %i 0
while (%i < 12000) {
inc %i
titlebar %i
echo -s : %i
if ($rand(1,10) == 0) { noop $dll(%whilefix7.dll,whilefix7,0) }
; Allows mIRC a chance to breathe.
}
dll -u %whilefix7.dll
}
the code used was supposedly used in the past whilefix dll, and i had made my own,
which worked well... but it looks like it might not be as relevant now with the upgraded mIRC.
whilefix7.zip