/*-------------------------------------------------------- SIMPLE WINDOW --------------------------------------------------------*/ //#include #include #include #include #include //////////////////// !!! hart surface model definition Patient pat; //pat.SetInternalModel(); Manager m; Hart hart; Breast breast; ElectrodeSet elset; Surface sss; TList lll; f() { sss.Initialize(3,3); //sss.Add(); //sss.Add(); } ///////////////////////// outsurf(Surface& sur ) { ofstream out("dupa.scr"); out<x ) = 1; out<x ); out<Next() ); pc = ( pc -> Next() ); } } long FAR PASCAL _export WndProc (HWND, WORD, WORD, LONG) ; class Main { public: static HANDLE hInstance; static HANDLE Main::hPrevInstance; static int nCmdShow; static int MessageLoop( void ); }; //Seting initial values for static members of class Main HANDLE Main::hInstance = 0; HANDLE Main::hPrevInstance = 0; int Main::nCmdShow = 0; int Main::MessageLoop( void ) { MSG msg; while( GetMessage( &msg, NULL, 0, 0 ) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } return msg.wParam; } class Window { public: HWND hwnd ; HDC hdc ; PAINTSTRUCT ps ; RECT rect ; void Paint(HWND hwnd); void Register(HANDLE hInstance); Window(); }; void Window::Register(HANDLE hInstance) { WNDCLASS wndclass ; wndclass.style = CS_HREDRAW | CS_VREDRAW ; wndclass.lpfnWndProc = WndProc ; wndclass.cbClsExtra = 0 ; wndclass.cbWndExtra = 0 ; wndclass.hInstance = hInstance ; wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ; wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ; wndclass.hbrBackground = GetStockObject (WHITE_BRUSH) ; wndclass.lpszMenuName = NULL ; wndclass.lpszClassName = "szWindow" ; RegisterClass (&wndclass) ; } void Window::Window() { if (!Main::hPrevInstance) { Register(Main::hInstance); } hwnd = CreateWindow ("szWindow", // window class name "Single Window", // window caption WS_OVERLAPPEDWINDOW|WS_VISIBLE, // window style CW_USEDEFAULT, // initial x position CW_USEDEFAULT, // initial y position CW_USEDEFAULT, // initial x size CW_USEDEFAULT, // initial y size NULL, // parent window handle NULL, // window menu handle Main::hInstance, // program instance handle NULL ); // creation parameters //ShowWindow (hwnd, Main::nCmdShow) ; //UpdateWindow (hwnd) ; } void Window::Paint(HWND hwnd) { hdc = BeginPaint (hwnd, &ps) ; GetClientRect (hwnd, &rect) ; //DrawText (hdc, "Hello, Windows!", -1, &rect, //DT_SINGLELINE | DT_CENTER | DT_VCENTER) ; char str[100]; DrawText (hdc, itoa( (sss.cu),str,10), -1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER) ; EndPaint (hwnd, &ps) ; } Window AppWnd; int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow) { Main::hInstance = hInstance; Main::hPrevInstance = hPrevInstance; Main::nCmdShow = nCmdShow; //////////////////////////////////////////////////////// //////////////////////////////////////////////////////// //////////////////////////////////////////////////////// //////////////////////////////////////////////////////// pat.SetInternalModel(); m.Save(pat, "pppk.scr","ACAD", 0); m.Save(pat, "hhhk.scr","ACAD", 1); m.Save(pat, "bbbk.scr","ACAD", 2); m.Save(pat, "eeek.scr","ACAD", 3); return Main::MessageLoop(); } long FAR PASCAL _export WndProc (HWND hwnd, WORD message, WORD wParam, LONG lParam) { switch (message) { case WM_CREATE: return 0 ; // Errors may occur case WM_PAINT: AppWnd.Paint(hwnd); return 0 ; case WM_DESTROY: PostQuitMessage (0) ; return 0 ; } return DefWindowProc (hwnd, message, wParam, lParam) ; }