0028110: Configuration - specify Unicode charset instead of multibyte in project...
[occt.git] / src / WNT / WNT_WClass.hxx
CommitLineData
42cf5bc1 1// Created on: 1996-01-26
2// Created by: PLOTNIKOV Eugeny
3// Copyright (c) 1996-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _WNT_WClass_HeaderFile
18#define _WNT_WClass_HeaderFile
19
20#include <Standard.hxx>
42cf5bc1 21
1ce0716b 22#if defined(_WIN32) && !defined(OCCT_UWP)
23
42cf5bc1 24#include <Aspect_Handle.hxx>
25#include <Standard_Address.hxx>
ad03c234 26#include <Standard_CString.hxx>
42cf5bc1 27#include <Standard_Integer.hxx>
ad03c234 28#include <Standard_Transient.hxx>
29#include <Standard_Type.hxx>
30#include <TCollection_AsciiString.hxx>
31#include <WNT_Uint.hxx>
42cf5bc1 32
33//! This class defines a Windows NT window class.
34//! A window in Windows NT is always created based on a
35//! window class. The window class identifies the window
36//! procedure that processes messages to the window. Each
37//! window class has unique name ( character string ). More
38//! than one window can be created based on a single window
39//! class. For example, all button windows in Windows NT
40//! are created based on the same window class. The window
41//! class defines the window procedure and some other
42//! characteristics ( background, mouse cursor shape etc. )
43//! of the windows that are created based on that class.
44//! When we create a window, we define additional
45//! characteristics of the window that are unique to that
46//! window. So, we have to create and register window
47//! class before creation of any window. Of course, it's possible
48//! to create a new window class for each window inside
49//! the Window class and do not use the WClass at all.
50//! We implemented this class for sake of flexibility of
51//! event processing.
ad03c234 52class WNT_WClass : public Standard_Transient
42cf5bc1 53{
ad03c234 54 friend class WNT_Window;
55 DEFINE_STANDARD_RTTIEXT(WNT_WClass, Standard_Transient)
42cf5bc1 56public:
42cf5bc1 57
58 //! Creates a Windows NT window class and registers it.
ad03c234 59 Standard_EXPORT WNT_WClass (const TCollection_AsciiString& theClassName,
60 const Standard_Address theWndProc,
61 const WNT_Uint& theStyle,
62 const Standard_Integer theClassExtra = 0,
63 const Standard_Integer theWindowExtra = 0,
64 const Aspect_Handle theCursor = NULL,
65 const Aspect_Handle theIcon = NULL,
66 const TCollection_AsciiString& theMenuName = TCollection_AsciiString());
67
42cf5bc1 68 //! Destroys all resources attached to the class
e6f550da 69 Standard_EXPORT ~WNT_WClass();
42cf5bc1 70
ad03c234 71 //! Returns address of window procedure.
72 Standard_Address WndProc() const { return myWndProc; }
42cf5bc1 73
ad03c234 74 //! Returns a class name.
75 const TCollection_AsciiString& Name() const { return myClassName; }
42cf5bc1 76
ad03c234 77 //! Returns a program instance handle.
78 Aspect_Handle Instance() const { return myAppInstance; }
42cf5bc1 79
80protected:
81
ad03c234 82 TCollection_AsciiString myClassName;
83 Aspect_Handle myAppInstance;
84 Standard_Address myWndProc;
42cf5bc1 85
42cf5bc1 86};
87
ad03c234 88DEFINE_STANDARD_HANDLE(WNT_WClass, Standard_Transient)
42cf5bc1 89
1ce0716b 90#endif // _WIN32
42cf5bc1 91#endif // _WNT_WClass_HeaderFile