0024530: TKMesh - remove unused package IntPoly
[occt.git] / src / WNT / WNT_WClass.cxx
CommitLineData
b311480e 1// Copyright (c) 1996-1999 Matra Datavision
973c2be1 2// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 3//
973c2be1 4// This file is part of Open CASCADE Technology software library.
b311480e 5//
973c2be1 6// This library is free software; you can redistribute it and / or modify it
7// under the terms of the GNU Lesser General Public version 2.1 as published
8// by the Free Software Foundation, with special exception defined in the file
9// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10// distribution for complete text of the license and disclaimer of any warranty.
b311480e 11//
973c2be1 12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
7fd59977 14
15#include <windows.h>
16#include <WNT_WClass.ixx>
17
dc3fe572 18#include <Standard_PCharacter.hxx>
7fd59977 19#include <InterfaceGraphic_WNT.hxx>
20
21#include <string.h>
22
23//=======================================================================
24//function : WNT_WClass
25//purpose :
26//=======================================================================
27
28WNT_WClass::WNT_WClass (
29 const Standard_CString aClassName,
30 const Standard_Address aWndProc,
31 const WNT_Uint& aStyle,
32 const Standard_Integer aClassExtra,
33 const Standard_Integer aWindowExtra,
34 const Aspect_Handle aCursor,
35 const Aspect_Handle anIcon,
36 const Standard_CString aMenuName
37 ) {
38
39 WNDCLASS wc;
40
41 hInstance = GetModuleHandle ( NULL );
42
43 wc.style = aStyle;
44 wc.lpfnWndProc = ( aWndProc ) ? ( WNDPROC )aWndProc : DefWindowProc;
45 wc.cbClsExtra = aClassExtra;
46 wc.cbWndExtra = aWindowExtra + sizeof ( WINDOW_DATA* );
47 wc.hInstance = ( HINSTANCE )hInstance;
48 wc.hIcon = ( anIcon ) ? ( HICON )anIcon :
49 LoadIcon ( NULL, IDI_APPLICATION );
50 wc.hCursor = ( aCursor ) ? ( HCURSOR )aCursor :
51 LoadCursor ( NULL, IDC_NO );
52 wc.hbrBackground = 0;
53 wc.lpszMenuName = aMenuName;
54 wc.lpszClassName = aClassName;
55
56 if ( !RegisterClass ( &wc ) )
57
58 WNT_ClassDefinitionError :: Raise ( "Unable to register window class" );
59
60 lpszName = new char[ strlen ( aClassName ) + 1 ];
61 strcpy ( (Standard_PCharacter)lpszName, aClassName );
62 lpfnWndProc = wc.lpfnWndProc;
63
64} // end constructor
65
66//=======================================================================
67//function : Destroy
68//purpose :
69//=======================================================================
70
71void WNT_WClass::Destroy ()
72{
73
74 UnregisterClass ( lpszName, ( HINSTANCE )hInstance );
75 delete [] (Standard_PCharacter)lpszName;
76
77} // end WNT_WClass :: Destroy
78