Functions | |
void | ViewerThreadProcess (cBasicViewer *pViewer) |
LRESULT WINAPI | ViewerWndProc (HWND hWnd, UINT uMsg, UINT uParam, LONG lParam) |
void BVThread::ViewerThreadProcess | ( | cBasicViewer * | pViewer | ) |
This is the main function of the thread created by cBasicViewer objects. Take as parameter a pointer to the object that created the thread It creates the viewer window and a memory device contex that receives the user GDI calls
The thread main function. Take as parameter a pointer to the object that created the thread. It creates a graphic window, then enters a message loop. Commands are sent to it by the TH_MESSAGE messages.
Definition at line 26 of file BVThreadFun.cpp.
References BV_WNDSTYLE, cBasicViewer::ClassName, cBasicViewer::height, cBasicViewer::hwnd, cBasicViewer::Registered, cBasicViewer::RegisterViewerClass(), TH_CHECK, TH_DIE, TH_HIDE, TH_MESSAGE, TH_SHOW, TH_UPDATE, cBasicViewer::ThreadID, cBasicViewer::title, and cBasicViewer::width.
LRESULT WINAPI BVThread::ViewerWndProc | ( | HWND | hWnd, | |
UINT | uMsg, | |||
UINT | uParam, | |||
LONG | lParam | |||
) |
This is the viewer window function. It handles currently only the WM_PAINT and WM_CLOSE messages. All other messages are repassed to DefWndProc.
On WM_PAINT messages, the function will try to get the DCMutex to lock the memory device context. If it succeeds, the function redraws the client area of the window. If not, the function does nothig. The system will keep sending WM_PAINT until we can repaint the window
On WM_CLOSE messages, the function just hides the window. We don't want to destroy the window now, because a TH_SHOW message to the thread would requires the recreation of the window
The window Procedure. Handles all messages sent to the window.
Definition at line 162 of file BVThreadFun.cpp.
References cBasicViewer::DCMutex, cBasicViewer::height, cBasicViewer::hMemDC, and cBasicViewer::width.