| 1 | /* $Id: win32class.h,v 1.14 2001-02-22 10:37:30 sandervl Exp $ */
|
|---|
| 2 | /*
|
|---|
| 3 | * Win32 Window Class Managment Code for OS/2
|
|---|
| 4 | *
|
|---|
| 5 | *
|
|---|
| 6 | * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl)
|
|---|
| 7 | * Copyright 1999 Daniela Engert (dani@ngrt.de)
|
|---|
| 8 | *
|
|---|
| 9 | */
|
|---|
| 10 | #ifndef __WIN32CLASS_H__
|
|---|
| 11 | #define __WIN32CLASS_H__
|
|---|
| 12 |
|
|---|
| 13 | #include <gen_object.h>
|
|---|
| 14 |
|
|---|
| 15 | class Win32WndClass : public GenericObject
|
|---|
| 16 | {
|
|---|
| 17 | public:
|
|---|
| 18 | Win32WndClass(WNDCLASSEXA *wndclass, BOOL fUnicode = FALSE);
|
|---|
| 19 | ~Win32WndClass();
|
|---|
| 20 |
|
|---|
| 21 | ULONG getClassLongA(int index, BOOL fUnicode = FALSE);
|
|---|
| 22 | ULONG getClassLongW(int index)
|
|---|
| 23 | {
|
|---|
| 24 | return getClassLongA(index, TRUE);
|
|---|
| 25 | };
|
|---|
| 26 | WORD getClassWord(int index);
|
|---|
| 27 |
|
|---|
| 28 | ULONG setClassLongA(int index, LONG lNewVal, BOOL fUnicode = FALSE);
|
|---|
| 29 | ULONG setClassLongW(int index, LONG lNewVal)
|
|---|
| 30 | {
|
|---|
| 31 | return setClassLongA(index, lNewVal, TRUE);
|
|---|
| 32 | }
|
|---|
| 33 | WORD setClassWord(int index, WORD wNewVal);
|
|---|
| 34 |
|
|---|
| 35 | ATOM getAtom() { return (ATOM) classAtom; };
|
|---|
| 36 | BOOL getClassInfo(WNDCLASSEXA *wndclass);
|
|---|
| 37 | BOOL getClassInfo(WNDCLASSEXW *wndclass);
|
|---|
| 38 |
|
|---|
| 39 | ULONG getClassName(LPSTR lpszClassName, ULONG cchClassName);
|
|---|
| 40 | ULONG getClassName(LPWSTR lpszClassName, ULONG cchClassName);
|
|---|
| 41 |
|
|---|
| 42 | WNDPROC getWindowProc() { return windowProc; };
|
|---|
| 43 | LPSTR getMenuNameA() { return menuNameA; };
|
|---|
| 44 | DWORD getExtraWndBytes() { return nrExtraWindowBytes; };
|
|---|
| 45 |
|
|---|
| 46 | HICON getIcon() { return hIcon; };
|
|---|
| 47 | HICON getIconSm() { return hIconSm; };
|
|---|
| 48 | HCURSOR getCursor() { return hCursor; };
|
|---|
| 49 |
|
|---|
| 50 | HINSTANCE getInstance() { return hInstance; };
|
|---|
| 51 |
|
|---|
| 52 | HBRUSH getBackgroundBrush() { return backgroundBrush; };
|
|---|
| 53 | ULONG getStyle() { return windowStyle; };
|
|---|
| 54 |
|
|---|
| 55 | HDC getClassDC() { return hdcClass; };
|
|---|
| 56 |
|
|---|
| 57 | void setMenuName(LPSTR newMenuName);
|
|---|
| 58 |
|
|---|
| 59 | void IncreaseWindowCount() { cWindows++; };
|
|---|
| 60 | void DecreaseWindowCount() { cWindows--; };
|
|---|
| 61 | DWORD GetWindowCount() { return cWindows; };
|
|---|
| 62 |
|
|---|
| 63 | BOOL hasClassName(LPSTR classname, BOOL fUnicode = FALSE);
|
|---|
| 64 |
|
|---|
| 65 | BOOL isAppClass(ULONG curProcessId);
|
|---|
| 66 |
|
|---|
| 67 | static BOOL UnregisterClassA(HINSTANCE hinst, LPSTR id);
|
|---|
| 68 |
|
|---|
| 69 | static Win32WndClass *FindClass(HINSTANCE hinst, LPSTR id);
|
|---|
| 70 | static Win32WndClass *FindClass(HINSTANCE hinst, LPWSTR id);
|
|---|
| 71 |
|
|---|
| 72 | static void DestroyAll();
|
|---|
| 73 |
|
|---|
| 74 | private:
|
|---|
| 75 | BOOL isUnicode;
|
|---|
| 76 |
|
|---|
| 77 | //Standard class words/longs
|
|---|
| 78 | ULONG windowStyle; //GCL_STYLE * must be offset 14h *
|
|---|
| 79 | ULONG nrExtraClassBytes; //GCL_CBCLSEXTRA
|
|---|
| 80 | ULONG nrExtraWindowBytes; //GCL_CBWNDEXTRA
|
|---|
| 81 | HBRUSH backgroundBrush; //GCL_HBRBACKGROUND
|
|---|
| 82 | HCURSOR hCursor; //GCL_HCURSOR
|
|---|
| 83 | HICON hIcon; //GCL_HICON
|
|---|
| 84 | HINSTANCE hInstance; //GCL_HMODULE
|
|---|
| 85 | PCHAR menuNameA; //GCL_MENUNAME
|
|---|
| 86 | WCHAR *menuNameW; //GCL_MENUNAME
|
|---|
| 87 | WNDPROC windowProc; //GCL_WNDPROC
|
|---|
| 88 | ULONG classAtom; //GCW_ATOM
|
|---|
| 89 |
|
|---|
| 90 | PCHAR classNameA;
|
|---|
| 91 | WCHAR *classNameW;
|
|---|
| 92 | HICON hIconSm; //GCW_HICONSM
|
|---|
| 93 | HDC hdcClass;
|
|---|
| 94 |
|
|---|
| 95 | //User data class bytse
|
|---|
| 96 | char *userClassBytes;
|
|---|
| 97 | ULONG processId;
|
|---|
| 98 |
|
|---|
| 99 | //nr of windows created with this class
|
|---|
| 100 | ULONG cWindows;
|
|---|
| 101 |
|
|---|
| 102 | static GenericObject *wndclasses;
|
|---|
| 103 | };
|
|---|
| 104 |
|
|---|
| 105 | #endif //__WIN32CLASS_H__
|
|---|