Seems you changed WinQueryDlgItemShort() to WinQueryDlgItemText(), changing it back gets rid of the crash but the program still doesn't seem to work and leaves the DLL loaded. Possibly the DEF needs adjusting to use INITGLOBAL TERMGLOBAL like how it was? I'll test later.
--- mousplay.c.orig 2023-07-30 09:48:22.000000000 -0700
+++ mousplay.c 2023-07-30 13:19:58.000000000 -0700
@@ -7,9 +7,9 @@
/*************************************************************************/
/* Move and play related variables */
/*************************************************************************/
-extern LONG sXCoordinate; /* Make coordinates extern to share */
-extern LONG sYCoordinate; /* with the hook DLL */
-extern CHAR PlayString[]; /* DLL definition of character string */
+extern PSHORT sXCoordinate; /* Make coordinates extern to share */
+extern PSHORT sYCoordinate; /* with the hook DLL */
+extern PSZ PlayString[]; /* DLL definition of character string */
ULONG EXPENTRY MousePlayHookProc(HAB habSpy,BOOL fSkip, PQMSG pQmsg); /* 4 */
ULONG EXPENTRY KeyPlayHookProc(HAB habSpy,BOOL fSkip, PQMSG pQmsg); /* 4 */
ULONG TextLen;
@@ -70,9 +70,9 @@
/* hook */
/***********************************************************/
- if( !WinQueryDlgItemText( hwndDlg, EF_X, (LONG) &sXCoordinate, FALSE ))
+ if( !WinQueryDlgItemShort( hwndDlg, EF_X, (PSHORT)&sXCoordinate, FALSE ))
sXCoordinate=0;
- if( !WinQueryDlgItemText( hwndDlg, EF_Y, (LONG) &sYCoordinate, FALSE ))
+ if( !WinQueryDlgItemShort( hwndDlg, EF_Y, (PSHORT)&sYCoordinate, FALSE ))
sYCoordinate=0;
TextLen=WinQueryDlgItemText( hwndDlg,ID_CHARPLAY, 79, (PSZ) PlayString);
TstTID=_beginthread(PlayThread,0,STACKSIZE,0);