Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

win32class.h

Go to the documentation of this file.
00001 /* $Id: win32class.h,v 1.15 2001/06/09 14:50:20 sandervl Exp $ */
00002 /*
00003  * Win32 Window Class Managment Code for OS/2
00004  *
00005  *
00006  * Copyright 1998-1999 Sander van Leeuwen (sandervl@xs4all.nl)
00007  * Copyright 1999      Daniela Engert (dani@ngrt.de)
00008  *
00009  */
00010 #ifndef __WIN32CLASS_H__
00011 #define __WIN32CLASS_H__
00012 
00013 #include <gen_object.h>
00014 
00015 #define RELEASE_CLASSOBJ(a)       { a->release(); a = NULL; }
00016 
00017 class Win32WndClass : public GenericObject
00018 {
00019 public:
00020         Win32WndClass(WNDCLASSEXA *wndclass, BOOL fUnicode = FALSE);
00021        ~Win32WndClass();
00022 
00023          ULONG  getClassLongA(int index, BOOL fUnicode = FALSE);
00024          ULONG  getClassLongW(int index)
00025          {
00026                 return getClassLongA(index, TRUE);
00027          };
00028          WORD   getClassWord(int index);
00029 
00030          ULONG  setClassLongA(int index, LONG lNewVal, BOOL fUnicode = FALSE);
00031          ULONG  setClassLongW(int index, LONG lNewVal)
00032          {
00033                 return setClassLongA(index, lNewVal, TRUE);
00034          }
00035          WORD   setClassWord(int index, WORD wNewVal);
00036 
00037          ATOM   getAtom()       { return (ATOM) classAtom; };
00038          BOOL   getClassInfo(WNDCLASSEXA *wndclass);
00039          BOOL   getClassInfo(WNDCLASSEXW *wndclass);
00040 
00041          ULONG  getClassName(LPSTR  lpszClassName, ULONG cchClassName);
00042          ULONG  getClassName(LPWSTR lpszClassName, ULONG cchClassName);
00043 
00044        WNDPROC  getWindowProc()         { return windowProc; };
00045          LPSTR  getMenuNameA()          { return menuNameA; };
00046          DWORD  getExtraWndBytes()      { return nrExtraWindowBytes; };
00047 
00048          HICON  getIcon()               { return hIcon; };
00049          HICON  getIconSm()             { return hIconSm; };
00050         HCURSOR getCursor()             { return hCursor; };
00051 
00052       HINSTANCE getInstance()           { return hInstance; };
00053 
00054         HBRUSH  getBackgroundBrush()    { return backgroundBrush; };
00055          ULONG  getStyle()              { return windowStyle; };
00056 
00057            HDC  getClassDC()            { return hdcClass; };
00058 
00059           void  setMenuName(LPSTR newMenuName);
00060 
00061           BOOL  hasClassName(LPSTR classname, BOOL fUnicode = FALSE);
00062 
00063           BOOL  isAppClass(ULONG curProcessId);
00064 
00065  static   BOOL  UnregisterClassA(HINSTANCE hinst, LPSTR id);
00066 
00067  //Locates class in linked list and increases reference count (if found)
00068  //Class object must be unreferenced after usage
00069  static Win32WndClass *FindClass(HINSTANCE hinst, LPSTR id);
00070  static Win32WndClass *FindClass(HINSTANCE hinst, LPWSTR id);
00071 
00072  static  void   DestroyAll();
00073 
00074 private:
00075  BOOL           isUnicode;
00076 
00077  //Standard class words/longs
00078  ULONG          windowStyle;            //GCL_STYLE     * must be offset 14h *
00079  ULONG          nrExtraClassBytes;      //GCL_CBCLSEXTRA
00080  ULONG          nrExtraWindowBytes;     //GCL_CBWNDEXTRA
00081  HBRUSH         backgroundBrush;        //GCL_HBRBACKGROUND
00082  HCURSOR        hCursor;                //GCL_HCURSOR
00083  HICON          hIcon;                  //GCL_HICON
00084  HINSTANCE      hInstance;              //GCL_HMODULE
00085  PCHAR          menuNameA;              //GCL_MENUNAME
00086  WCHAR         *menuNameW;              //GCL_MENUNAME
00087  WNDPROC        windowProc;             //GCL_WNDPROC
00088  ULONG          classAtom;              //GCW_ATOM
00089 
00090  PCHAR          classNameA;
00091  WCHAR         *classNameW;
00092  HICON          hIconSm;                //GCW_HICONSM
00093  HDC            hdcClass;
00094 
00095  //User data class bytse
00096  char          *userClassBytes;
00097  ULONG          processId;
00098 
00099  static GenericObject *wndclasses;
00100  static CRITICAL_SECTION critsect;
00101 };
00102 
00103 #endif //__WIN32CLASS_H__

Generated on Wed Jan 23 23:17:45 2002 for ODIN-user32 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001