Category : Files from Magazines
Archive   : WDJUN92.ZIP
Filename : 3N06025A

 
Output of file : 3N06025A contained in archive : WDJUN92.ZIP
/******************************************************************
Inter.c Intercepting dll functions demonstration.
(c) Timothy Adams 1992
Windows SDK V. 3.0 and 3.1
Microsoft C V. v6.0
Windows V. 3.0 and 3.1

******************************************************************/
#define _WINDOWS
#include

VOID FAR PASCAL Patch(HWND hWndList);
VOID FAR PASCAL UnPatch(VOID);
int PASCAL WinMain(HANDLE, HANDLE, LPSTR, int);
BOOL FAR PASCAL InterDlgProc(HWND hDlg,WORD message,WORD wParam,LONG lParam);

/*Intercept Dlg Box Defines*/
#define IDD_INTER 100
#define IDL_INTER 101

HANDLE hInst;
HWND hWndInter;

int PASCAL WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow)
HANDLE hInstance;
HANDLE hPrevInstance;
LPSTR lpCmdLine;
int nCmdShow;
{
FARPROC lpfnInter;
MSG msg;

hInst=hInstance;
if (hPrevInstance)
return 0;
lpfnInter=MakeProcInstance(InterDlgProc,hInst); /*Open the Dialog Box*/
hWndInter=CreateDialog(hInst,MAKEINTRESOURCE(IDD_INTER),NULL,lpfnInter);

Patch(GetDlgItem(hWndInter,IDL_INTER)); /*Patch WinExec Function*/
while (GetMessage(&msg,NULL,NULL, NULL))
{
if (IsDialogMessage(hWndInter,&msg))
continue;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
FreeProcInstance(lpfnInter);
UnPatch(); /*UnPatch WinExec Function*/
return (msg.wParam);
}


BOOL FAR PASCAL InterDlgProc(HWND hDlg,WORD message,WORD wParam,LONG lParam)
{
int nWidth,nHeight;
RECT rc;

switch (message)
{
case WM_INITDIALOG:
/*Center Window*/
nWidth=GetSystemMetrics(SM_CXSCREEN);
nHeight=GetSystemMetrics(SM_CYSCREEN);
GetClientRect(hDlg,&rc);
SetWindowPos (hDlg,NULL,
nWidth/2-rc.right/2,
nHeight/2-rc.bottom/2,
0,0,SWP_NOSIZE);
return TRUE;
case WM_COMMAND:
switch (wParam)
{
case IDCANCEL:
DestroyWindow(hDlg);
PostQuitMessage(0);
return TRUE;
}
}
return FALSE;
}


  3 Responses to “Category : Files from Magazines
Archive   : WDJUN92.ZIP
Filename : 3N06025A

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/