home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR9
/
WDOS0793.ZIP
/
BONNEAU.ZIP
/
DLGSERVR.C
next >
Wrap
C/C++ Source or Header
|
1993-05-05
|
1KB
|
49 lines
/*****************************************************/
/* dlgservr.c */
/* -- Modeless common dialog server. */
/* -- To compile: */
/* cc dlgservr.c commdlg.lib */
/*****************************************************/
#include <windows.h>
#include <windowsx.h>
#include <commdlg.h>
UINT CALLBACK __export WHook(HWND, UINT, WPARAM, LPARAM);
#ifdef __BORLANDC__
#pragma argsused
#endif
int PASCAL WinMain(HINSTANCE hins, HINSTANCE hinsPrev,
LPSTR lsz, int wShow)
{
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
if (msg.message == WM_USER)
{
((LPCHOOSEFONT)msg.lParam)->lpfnHook =
WHook;
ChooseFont((LPCHOOSEFONT)msg.lParam);
GlobalFreePtr(msg.lParam);
break;
}
return 0;
}
UINT CALLBACK __export WHook(HWND hwnd, UINT wm,
WPARAM wParam, LPARAM lParam)
/*****************************************************/
/* -- Relay messages to client's hook function. */
/*****************************************************/
{
MSG msg;
msg.hwnd = hwnd;
msg.message = wm;
msg.wParam = wParam;
msg.lParam = lParam;
return (UINT)SendMessage(GetWindowOwner(hwnd),
WM_USER, 0, (LPARAM)(LPMSG)&msg);
}