home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
JFKLIB.ZIP
/
DIALOG.CPP
< prev
next >
Wrap
Text File
|
1991-05-11
|
1KB
|
73 lines
/*
DIALOG.CPP - Generic DialogBox-Class
(C) 1991 by Joachim Kainz 'On a mission from Bhudda'
*/
#include "dialog.hpp"
#include "dlgtemp.hpp"
FARPROC2 DIALOG::lpFnOOPWndProc = NULL;
EXPORT DIALOG::DIALOG (
LPSTR lpDlg,
HWND hWndParent,
HICON hIcon,
FARPROC lpfnProc,
DWORD dwParam
): WINDOW (
NULL,
LoadCursor (NULL, IDC_ARROW),
hIcon,
COLOR_WINDOW+1,
0,
DLGWINDOWEXTRA,
"jfk",
DefDlgProc
)
{
DLGTEMPLATE dlg (lpDlg);
dlg.SetClass ("jfk");
PSTR pDlg = (PSTR) dlg;
if (!pDlg)
return;
hWnd = CreateDialogIndirectParam (
GetInstance (),
(LPSTR) pDlg,
hWndParent,
lpfnProc,
dwParam
);
LocalFree ((HANDLE) pDlg);
if (!hWnd)
return;
SetWindowLong (GetWindowHandle (), DLGWINDOWEXTRA, (long) this);
lpDefWndProc =
(FARPROC2) SetWindowLong (
GetWindowHandle (),
GWL_WNDPROC,
(long) GetOOPWndProc ()
);
SendMessage (self, WM_INITDIALOG, NULL, dwParam);
wResult = NULL;
}
FARPROC2 DIALOG::GetOOPWndProc () const
{
if (!lpFnOOPWndProc)
lpFnOOPWndProc = (FARPROC2) MakeProcInstance (
(FARPROC) DefOOPDlgProc,
GetInstance ()
);
return lpFnOOPWndProc;
}