home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
wint1_92
/
shaw
/
winapp.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1991-11-04
|
2KB
|
58 lines
// winapp.cpp
#include<windows.h>
#include"winapp.h"
HANDLE WinApplication::ApphInstance;
HANDLE WinApplication::hPrevInstance;
LPSTR WinApplication::lpszCmdLine;
int WinApplication::nCmdShow;
int WinApplication::Run(void) // default message loop processing
{
MSG msg;
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
static void *pWindow = NULL;
long far pascal Window::WndProc(HWND hWnd, WORD msg, WORD wParam,
LONG lParam)
{
pWindow = (void *)GetPointer(hWnd);
if(msg == WM_CREATE)
{
pWindow = (void *)((LPCREATESTRUCT)lParam)->lpCreateParams;
SetPointer(hWnd, pWindow);
((Window *)pWindow)->WHandle = hWnd;
}
if(pWindow && ((Window *)pWindow)->UserWndProc)
return ((Window *)pWindow)->UserWndProc(hWnd, msg, wParam, lParam);
return DefWindowProc(hWnd, msg, wParam, lParam);
}
long far pascal Window::MDIChildWndProc(HWND hWnd, WORD msg, WORD wParam,
LONG lParam)
{
pWindow = (void *)GetPointer(hWnd);
if(msg == WM_CREATE)
{
pWindow = (void *)((LPMDICREATESTRUCT)
((LPCREATESTRUCT)lParam)->lpCreateParams)->lParam;
SetPointer(hWnd, pWindow);
((Window *)pWindow)->WHandle = hWnd;
}
if(pWindow && ((Window *)pWindow)->UserWndProc)
return ((Window *)pWindow)->UserWndProc(hWnd, msg, wParam, lParam);
return DefMDIChildProc(hWnd, msg, wParam, lParam);
}