diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /public/sdk/inc/mfc30 | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'public/sdk/inc/mfc30')
90 files changed, 28678 insertions, 0 deletions
diff --git a/public/sdk/inc/mfc30/afx.h b/public/sdk/inc/mfc30/afx.h new file mode 100644 index 000000000..9e879fd0c --- /dev/null +++ b/public/sdk/inc/mfc30/afx.h @@ -0,0 +1,1533 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFX_H__ +#define __AFX_H__ + +#ifndef __cplusplus + #error MFC requires C++ compilation (use a .cpp suffix) +#endif + +///////////////////////////////////////////////////////////////////////////// + +#include <afxver_.h> // Target version control + +#ifndef _AFX_NOFORCE_LIBS +#ifndef _MAC + +///////////////////////////////////////////////////////////////////////////// +// Win32 libraries + +#ifndef _AFXDLL + #ifndef _USRDLL + #ifndef _UNICODE + #ifdef _DEBUG + #pragma comment(lib, "nafxcwd.lib") + #else + #pragma comment(lib, "nafxcw.lib") + #endif + #else + #ifdef _DEBUG + #pragma comment(lib, "uafxcwd.lib") + #else + #pragma comment(lib, "uafxcw.lib") + #endif + #endif + #else //!_USRDLL + #ifndef _UNICODE + #ifdef _DEBUG + #pragma comment(lib, "nafxdwd.lib") + #else + #pragma comment(lib, "nafxdw.lib") + #endif + #else + #ifdef _DEBUG + #pragma comment(lib, "uafxdwd.lib") + #else + #pragma comment(lib, "uafxdw.lib") + #endif + #endif + #endif //_USRDLL + #ifdef _MT + #pragma comment(lib, "libcmt.lib") + #else + #pragma comment(lib, "libc.lib") + #endif +#else + #ifndef _AFXCTL + #ifndef _UNICODE + #ifdef _DEBUG + #pragma comment(lib, "cfm30d.lib") + #else + #pragma comment(lib, "cfm30.lib") + #endif + #else + #ifdef _DEBUG + #pragma comment(lib, "cfm30ud.lib") + #else + #pragma comment(lib, "cfm30u.lib") + #endif + #endif + #endif + #pragma comment(lib, "crtdll.lib") +#endif + +#pragma comment(lib, "kernel32.lib") +#pragma comment(lib, "user32.lib") +#pragma comment(lib, "gdi32.lib") +#pragma comment(lib, "comdlg32.lib") +#pragma comment(lib, "winspool.lib") +#pragma comment(lib, "advapi32.lib") +#pragma comment(lib, "shell32.lib") + +#else //!_MAC + +////////////////////////////////////////////////////////////////////////////// +// Macintosh libraries + +#ifndef _AFXDLL + #ifdef _DEBUG + #ifdef _68K_ + #pragma comment(lib, "nafxcmd.lib") + #else + #pragma comment(lib, "nafxcpd.lib") + #endif + #pragma comment(lib, "wlmd.lib") + #else + #ifdef _68K_ + #pragma comment(lib, "nafxcm.lib") + #else + #pragma comment(lib, "nafxcp.lib") + #endif + #pragma comment(lib, "wlm.lib") + #endif +#else + #ifdef _DEBUG + #ifdef _68K_ + #pragma comment(lib, "mfc30md.lib") + #else + #pragma comment(lib, "mfc30pd.lib") + #endif + #pragma comment(lib, "msvcwlmd.lib") + #else + #ifdef _68K_ + #pragma comment(lib, "mfc30m.lib") + #else + #pragma comment(lib, "mfc30p.lib") + #endif + #pragma comment(lib, "msvcwlm.lib") + #endif +#endif + +#ifdef _68K_ + #pragma comment(lib, "libcs.lib") + #pragma comment(lib, "sanes.lib") + #ifdef _DEBUG + #pragma comment(lib, "swapd.lib") + #else + #pragma comment(lib, "swap.lib") + #endif +#endif + +#ifdef _PPC_ + #ifndef _AFXDLL + #pragma comment(lib, "libc.lib") + #else + #pragma comment(lib, "msvcrt.lib") + #endif + #pragma comment(lib, "privint.lib") + #pragma comment(lib, "aocelib.lib") + #pragma comment(lib, "math.lib") + #pragma comment(lib, "threads.lib") + #pragma comment(lib, "translat.lib") + #pragma comment(lib, "interfac.lib") +#endif + +#endif //_MAC +#endif //!_AFX_NOFORCE_LIBS + +///////////////////////////////////////////////////////////////////////////// +// Classes declared in this file +// in addition to standard primitive data types and various helper macros + +struct CRuntimeClass; // object type information + +class CObject; // the root of all objects classes + + class CException; // the root of all exceptions + class CMemoryException; // out-of-memory exception + class CNotSupportedException; // feature not supported exception + class CArchiveException;// archive exception + class CFileException; // file exception + + class CFile; // raw binary file + class CStdioFile; // buffered stdio text/binary file + class CMemFile; // memory based file + +// Non CObject classes +class CString; // growable string type +class CTimeSpan; // time/date difference +class CTime; // absolute time/date +struct CFileStatus; // file status information +struct CMemoryState; // diagnostic memory support + +class CArchive; // object persistence tool +class CDumpContext; // object diagnostic dumping + +///////////////////////////////////////////////////////////////////////////// +// Other includes from standard "C" runtimes + +#include <string.h> +#include <stdio.h> +#include <stdlib.h> +#include <time.h> + +#ifdef _AFX_OLD_EXCEPTIONS +// use setjmp and helper functions instead of C++ keywords +#pragma warning(disable: 4611) +#include <setjmp.h> +#endif + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +///////////////////////////////////////////////////////////////////////////// +// Basic types + +typedef void* POSITION; // abstract iteration position + +struct _AFX_DOUBLE { BYTE doubleBits[sizeof(double)]; }; +struct _AFX_FLOAT { BYTE floatBits[sizeof(float)]; }; + +// Standard constants +#undef FALSE +#undef TRUE +#undef NULL + +#define FALSE 0 +#define TRUE 1 +#define NULL 0 + +///////////////////////////////////////////////////////////////////////////// +// Diagnostic support + +#ifdef _DEBUG + +void AFX_CDECL AfxTrace(LPCTSTR lpszFormat, ...); +// Note: file names are still ANSI strings (filenames rarely need UNICODE) +BOOL AFXAPI AfxAssertFailedLine(LPCSTR lpszFileName, int nLine); +void AFXAPI AfxAssertValidObject(const CObject* pOb, + LPCSTR lpszFileName, int nLine); +void AFXAPI AfxDump(const CObject* pOb); // Dump an object from CodeView + +#define TRACE ::AfxTrace +#define THIS_FILE __FILE__ +#define ASSERT(f) \ + do \ + { \ + if (!(f) && AfxAssertFailedLine(THIS_FILE, __LINE__)) \ + AfxDebugBreak(); \ + } while (0) \ + +#define VERIFY(f) ASSERT(f) +#define ASSERT_VALID(pOb) (::AfxAssertValidObject(pOb, THIS_FILE, __LINE__)) + +// The following trace macros are provided for backward compatiblity +// (they also take a fixed number of parameters which provides +// some amount of extra error checking) +#define TRACE0(sz) ::AfxTrace(_T(sz)) +#define TRACE1(sz, p1) ::AfxTrace(_T(sz), p1) +#define TRACE2(sz, p1, p2) ::AfxTrace(_T(sz), p1, p2) +#define TRACE3(sz, p1, p2, p3) ::AfxTrace(_T(sz), p1, p2, p3) + +// These AFX_DUMP macros also provided for backward compatibility +#define AFX_DUMP0(dc, sz) dc << _T(sz) +#define AFX_DUMP1(dc, sz, p1) dc << _T(sz) << p1 + +#else // _DEBUG + +#define ASSERT(f) ((void)0) +#define VERIFY(f) ((void)(f)) +#define ASSERT_VALID(pOb) ((void)0) +inline void AFX_CDECL AfxTrace(LPCTSTR, ...) { } +#define TRACE 1 ? (void)0 : ::AfxTrace +#define TRACE0(sz) +#define TRACE1(sz, p1) +#define TRACE2(sz, p1, p2) +#define TRACE3(sz, p1, p2, p3) + +#endif // !_DEBUG + +///////////////////////////////////////////////////////////////////////////// +// Turn off warnings for /W4 +// To resume any of these warning: #pragma warning(default: 4xxx) +// which should be placed after the AFX include files +#ifndef ALL_WARNINGS +// warnings caused by normal optimizations +#ifndef _DEBUG +#pragma warning(disable: 4701) // local variable *may* be used without init +#pragma warning(disable: 4702) // unreachable code caused by optimizations +#pragma warning(disable: 4791) // loss of debugging info in retail version +#endif +// warnings generated with common MFC/Windows code +#pragma warning(disable: 4127) // constant expression for TRACE/ASSERT +#pragma warning(disable: 4134) // message map member fxn casts +#pragma warning(disable: 4201) // nameless unions are part of C++ +#pragma warning(disable: 4511) // private copy constructors are good to have +#pragma warning(disable: 4512) // private operator= are good to have +#pragma warning(disable: 4514) // unreferenced inlines are common +#pragma warning(disable: 4705) // TRACE turned into statement with no effect +#pragma warning(disable: 4710) // private constructors are disallowed +// warnings specific to _AFXDLL version +#ifdef _AFXDLL +#pragma warning(disable: 4204) // non-constant aggregate initializer +#endif +#endif //!ALL_WARNINGS + +///////////////////////////////////////////////////////////////////////////// +// Other implementation helpers + +#define BEFORE_START_POSITION ((void*)-1L) + +///////////////////////////////////////////////////////////////////////////// +// explicit extern for version API/Windows 3.0 loader problem + +extern "C" int AFXAPI AFX_EXPORT _afx_version(); +void AFXAPI AfxInitialize(); + +#undef AFX_DATA +#define AFX_DATA AFX_CORE_DATA + +///////////////////////////////////////////////////////////////////////////// +// Basic object model + +struct CRuntimeClass +{ +// Attributes + LPCSTR m_lpszClassName; + int m_nObjectSize; + UINT m_wSchema; // schema number of the loaded class + void (PASCAL* m_pfnConstruct)(void* p); // NULL => abstract class +#ifdef _AFXDLL + CRuntimeClass* (PASCAL* m_pfnGetBaseClass)(); +#else + CRuntimeClass* m_pBaseClass; +#endif + +// Operations + CObject* CreateObject(); + +// Implementation + BOOL ConstructObject(void* pThis); + void Store(CArchive& ar); + static CRuntimeClass* PASCAL Load(CArchive& ar, UINT* pwSchemaNum); + + // CRuntimeClass objects linked together in simple list + CRuntimeClass* m_pNextClass; // linked list of registered classes + + // special debug diagnostics +#ifdef _DEBUG + BOOL IsDerivedFrom(const CRuntimeClass* pBaseClass) const; +#endif +}; + +///////////////////////////////////////////////////////////////////////////// +// class CObject is the root of all compliant objects + +class CObject +{ +public: + +// Object model (types, destruction, allocation) + virtual CRuntimeClass* GetRuntimeClass() const; + virtual ~CObject(); // virtual destructors are necessary + + // Diagnostic allocations + void* AFX_CDECL operator new(size_t, void* p); + void* AFX_CDECL operator new(size_t nSize); + void AFX_CDECL operator delete(void* p); + +#ifdef _DEBUG + // for file name/line number tracking using DEBUG_NEW + void* AFX_CDECL operator new(size_t nSize, LPCSTR lpszFileName, int nLine); +#endif + + // Disable the copy constructor and assignment by default so you will get + // compiler errors instead of unexpected behaviour if you pass objects + // by value or assign objects. +protected: + CObject(); +private: + CObject(const CObject& objectSrc); // no implementation + void operator=(const CObject& objectSrc); // no implementation + +// Attributes +public: + BOOL IsSerializable() const; + BOOL IsKindOf(const CRuntimeClass* pClass) const; + +// Overridables + virtual void Serialize(CArchive& ar); + + // Diagnostic Support + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; + +// Implementation +public: + static AFX_DATA CRuntimeClass classCObject; +#ifdef _AFXDLL + static CRuntimeClass* PASCAL _GetBaseClass(); +#endif +}; + +// Helper macros +#define RUNTIME_CLASS(class_name) (&class_name::class##class_name) + +////////////////////////////////////////////////////////////////////////////// +// Helper macros for declaring compliant classes + +#ifdef _AFXDLL +#define DECLARE_DYNAMIC(class_name) \ +protected: \ + static CRuntimeClass* PASCAL _GetBaseClass(); \ +public: \ + static AFX_DATA CRuntimeClass class##class_name; \ + virtual CRuntimeClass* GetRuntimeClass() const; \ + +#else +#define DECLARE_DYNAMIC(class_name) \ +public: \ + static AFX_DATA CRuntimeClass class##class_name; \ + virtual CRuntimeClass* GetRuntimeClass() const; \ + +#endif + +// not serializable, but dynamically constructable +#define DECLARE_DYNCREATE(class_name) \ + DECLARE_DYNAMIC(class_name) \ + static void PASCAL Construct(void* p); + +#define DECLARE_SERIAL(class_name) \ + DECLARE_DYNCREATE(class_name) \ + friend CArchive& AFXAPI operator>>(CArchive& ar, class_name* &pOb); + +// generate static object constructor for class registration +struct AFX_CLASSINIT + { AFX_CLASSINIT(CRuntimeClass* pNewClass); }; + +#ifdef _AFXDLL +#define _IMPLEMENT_RUNTIMECLASS(class_name, base_class_name, wSchema, pfnNew) \ + CRuntimeClass* PASCAL class_name::_GetBaseClass() \ + { return RUNTIME_CLASS(base_class_name); } \ + AFX_DATADEF CRuntimeClass class_name::class##class_name = { \ + #class_name, sizeof(class_name), wSchema, pfnNew, \ + &class_name::_GetBaseClass, NULL }; \ + static const AFX_CLASSINIT _init_##class_name(&class_name::class##class_name); \ + CRuntimeClass* class_name::GetRuntimeClass() const \ + { return &class_name::class##class_name; } \ + +#else +#define _IMPLEMENT_RUNTIMECLASS(class_name, base_class_name, wSchema, pfnNew) \ + AFX_DATADEF CRuntimeClass class_name::class##class_name = { \ + #class_name, sizeof(class_name), wSchema, pfnNew, \ + RUNTIME_CLASS(base_class_name), NULL }; \ + static const AFX_CLASSINIT _init_##class_name(&class_name::class##class_name); \ + CRuntimeClass* class_name::GetRuntimeClass() const \ + { return &class_name::class##class_name; } \ + +#endif + +#define IMPLEMENT_DYNAMIC(class_name, base_class_name) \ + _IMPLEMENT_RUNTIMECLASS(class_name, base_class_name, 0xFFFF, NULL) + +#define IMPLEMENT_DYNCREATE(class_name, base_class_name) \ + void PASCAL class_name::Construct(void* p) \ + { new(p) class_name; } \ + _IMPLEMENT_RUNTIMECLASS(class_name, base_class_name, 0xFFFF, \ + class_name::Construct) + +#define IMPLEMENT_SERIAL(class_name, base_class_name, wSchema) \ + void PASCAL class_name::Construct(void* p) \ + { new(p) class_name; } \ + _IMPLEMENT_RUNTIMECLASS(class_name, base_class_name, wSchema, \ + class_name::Construct) \ + CArchive& AFXAPI operator>>(CArchive& ar, class_name* &pOb) \ + { pOb = (class_name*) ar.ReadObject(RUNTIME_CLASS(class_name)); \ + return ar; } \ + +// optional bit for schema number that enables object versioning +#define VERSIONABLE_SCHEMA (0x80000000) + +///////////////////////////////////////////////////////////////////////////// +// other helpers + +// zero fill everything after the vtbl pointer +#define AFX_ZERO_INIT_OBJECT(base_class) \ + memset(((base_class*)this)+1, 0, sizeof(*this) - sizeof(base_class)); + +///////////////////////////////////////////////////////////////////////////// +// Exceptions + +class CException : public CObject +{ + // abstract class for dynamic type checking + DECLARE_DYNAMIC(CException) + +public: +// Constructors + CException(); // sets m_bAutoDelete = TRUE + CException(BOOL bAutoDelete); // sets m_bAutoDelete = bAutoDelete + +// Operations + void Delete(); // use to delete exception in 'catch' block + +// Implementation (setting m_bAutoDelete to FALSE is advanced) +public: + virtual ~CException(); + BOOL m_bAutoDelete; + +protected: + void AFX_CDECL operator delete(void* p); +#ifdef _DEBUG + BOOL m_bReadyForDelete; +#endif +}; + +// helper routines for non-C++ EH implementations +#ifdef _AFX_OLD_EXCEPTIONS + BOOL AFXAPI AfxCatchProc(CRuntimeClass* pClass); + void AFXAPI AfxThrow(CException* pException); +#else + // for THROW_LAST auto-delete backward compatiblity + void AFXAPI AfxThrowLastCleanup(); +#endif + +// other out-of-line helper functions +void AFXAPI AfxTryCleanup(); + +#ifndef _AFX_JUMPBUF +// Use portable 'jmp_buf' defined by ANSI by default. +#define _AFX_JUMPBUF jmp_buf +#endif + +// Placed on frame for EXCEPTION linkage, or CException cleanup +struct AFX_EXCEPTION_LINK +{ +#ifdef _AFX_OLD_EXCEPTIONS + union + { + _AFX_JUMPBUF m_jumpBuf; + struct + { + void (PASCAL* pfnCleanup)(AFX_EXCEPTION_LINK* pLink); + void* pvData; // extra data follows + } m_callback; // callback for cleanup (nType != 0) + }; + UINT m_nType; // 0 for setjmp, !=0 for user extension +#endif //!_AFX_OLD_EXCEPTIONS + + AFX_EXCEPTION_LINK* m_pLinkPrev; // previous top, next in handler chain + CException* m_pException; // current exception (NULL in TRY block) + + AFX_EXCEPTION_LINK(); // for initialization and linking + ~AFX_EXCEPTION_LINK() // for cleanup and unlinking + { AfxTryCleanup(); }; +}; + +// Exception global state - never access directly +struct AFX_EXCEPTION_CONTEXT +{ + AFX_EXCEPTION_LINK* m_pLinkTop; + + // Note: most of the exception context is now in the AFX_EXCEPTION_LINK +}; + +void AFXAPI AfxAbort(); +void AFX_CDECL AfxStandardTerminate(); +int AFX_CDECL AfxNewHandler(size_t nSize); + +// Obsolete and non-portable: setting terminate handler +// use CWinApp::ProcessWndProcException for Windows apps instead +// can also use set_terminate which is part of C++ standard library +// (these are provided for backward compatibility) +void AFXAPI AfxTerminate(); +typedef void (AFXAPI* AFX_TERM_PROC)(); +AFX_TERM_PROC AFXAPI AfxSetTerminate(AFX_TERM_PROC); + +///////////////////////////////////////////////////////////////////////////// +// Exception macros using try, catch and throw +// (for backward compatibility to previous versions of MFC) + +#ifndef _AFX_OLD_EXCEPTIONS + +#define TRY { AFX_EXCEPTION_LINK _afxExceptionLink; try { + +#define CATCH(class, e) } catch (class* e) \ + { ASSERT(e->IsKindOf(RUNTIME_CLASS(class))); \ + _afxExceptionLink.m_pException = e; + +#define AND_CATCH(class, e) } catch (class* e) \ + { ASSERT(e->IsKindOf(RUNTIME_CLASS(class))); \ + _afxExceptionLink.m_pException = e; + +#define END_CATCH } } + +#define THROW(e) throw e +#define THROW_LAST() (AfxThrowLastCleanup(), throw) + +// Advanced macros for smaller code +#define CATCH_ALL(e) } catch (CException* e) \ + { ASSERT(e->IsKindOf(RUNTIME_CLASS(CException))); \ + _afxExceptionLink.m_pException = e; + +#define AND_CATCH_ALL(e) } catch (CException* e) \ + { ASSERT(e->IsKindOf(RUNTIME_CLASS(CException))); \ + _afxExceptionLink.m_pException = e; + +#define END_CATCH_ALL } } + +#define END_TRY } catch (CException* e) \ + { ASSERT(e->IsKindOf(RUNTIME_CLASS(CException))); \ + _afxExceptionLink.m_pException = e; } } + +#else //_AFX_OLD_EXCEPTIONS + +///////////////////////////////////////////////////////////////////////////// +// Exception macros using setjmp and longjmp +// (for portability to compilers with no support for C++ exception handling) + +#define TRY \ + { AFX_EXCEPTION_LINK _afxExceptionLink; \ + if (::setjmp(_afxExceptionLink.m_jumpBuf) == 0) + +#define CATCH(class, e) \ + else if (::AfxCatchProc(RUNTIME_CLASS(class))) \ + { class* e = (class*)_afxExceptionLink.m_pException; + +#define AND_CATCH(class, e) \ + } else if (::AfxCatchProc(RUNTIME_CLASS(class))) \ + { class* e = (class*)_afxExceptionLink.m_pException; + +#define END_CATCH \ + } else { ::AfxThrow(NULL); } } + +#define THROW(e) AfxThrow(e) +#define THROW_LAST() AfxThrow(NULL) + +// Advanced macros for smaller code +#define CATCH_ALL(e) \ + else { CException* e = _afxExceptionLink.m_pException; + +#define AND_CATCH_ALL(e) \ + } else { CException* e = _afxExceptionLink.m_pException; + +#define END_CATCH_ALL } } + +#define END_TRY } + +#endif //_AFX_OLD_EXCEPTIONS + +///////////////////////////////////////////////////////////////////////////// +// Standard Exception classes + +class CMemoryException : public CException +{ + DECLARE_DYNAMIC(CMemoryException) +public: + CMemoryException(); + +// Implementation + CMemoryException(BOOL bAutoDelete); + virtual ~CMemoryException(); +}; + +class CNotSupportedException : public CException +{ + DECLARE_DYNAMIC(CNotSupportedException) +public: + CNotSupportedException(); + +// Implementation + CNotSupportedException(BOOL bAutoDelete); + virtual ~CNotSupportedException(); +}; + +class CArchiveException : public CException +{ + DECLARE_DYNAMIC(CArchiveException) +public: + enum { + none, + generic, + readOnly, + endOfFile, + writeOnly, + badIndex, + badClass, + badSchema + }; + +// Constructor + CArchiveException(int cause = CArchiveException::none); + +// Attributes + int m_cause; + +// Implementation + virtual ~CArchiveException(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; +#endif +}; + +class CFileException : public CException +{ + DECLARE_DYNAMIC(CFileException) + +public: + enum { + none, + generic, + fileNotFound, + badPath, + tooManyOpenFiles, + accessDenied, + invalidFile, + removeCurrentDir, + directoryFull, + badSeek, + hardIO, + sharingViolation, + lockViolation, + diskFull, + endOfFile + }; + +// Constructor + CFileException(int cause = CFileException::none, LONG lOsError = -1); + +// Attributes + int m_cause; + LONG m_lOsError; + +// Operations + // convert a OS dependent error code to a Cause + static int PASCAL OsErrorToException(LONG lOsError); + static int PASCAL ErrnoToException(int nErrno); + + // helper functions to throw exception after converting to a Cause + static void PASCAL ThrowOsError(LONG lOsError); + static void PASCAL ThrowErrno(int nErrno); + +// Implementation + virtual ~CFileException(); +#ifdef _DEBUG + virtual void Dump(CDumpContext&) const; +#endif +}; + +///////////////////////////////////////////////////////////////////////////// +// Standard exception throws + +void AFXAPI AfxThrowMemoryException(); +void AFXAPI AfxThrowNotSupportedException(); +void AFXAPI AfxThrowArchiveException(int cause); +void AFXAPI AfxThrowFileException(int cause, LONG lOsError = -1); + +///////////////////////////////////////////////////////////////////////////// +// File - raw unbuffered disk file I/O + +class CFile : public CObject +{ + DECLARE_DYNAMIC(CFile) + +public: +// Flag values + enum OpenFlags { + modeRead = 0x0000, + modeWrite = 0x0001, + modeReadWrite = 0x0002, + shareCompat = 0x0000, + shareExclusive = 0x0010, + shareDenyWrite = 0x0020, + shareDenyRead = 0x0030, + shareDenyNone = 0x0040, + modeNoInherit = 0x0080, + modeCreate = 0x1000, + typeText = 0x4000, // typeText and typeBinary are used in + typeBinary = (int)0x8000 // derived classes only + }; + + enum Attribute { + normal = 0x00, + readOnly = 0x01, + hidden = 0x02, + system = 0x04, + volume = 0x08, + directory = 0x10, + archive = 0x20 + }; + + enum SeekPosition { begin = 0x0, current = 0x1, end = 0x2 }; + + enum { hFileNull = -1 }; + +// Constructors + CFile(); + CFile(int hFile); + CFile(LPCTSTR lpszFileName, UINT nOpenFlags); + +// Attributes + UINT m_hFile; + + virtual DWORD GetPosition() const; + BOOL GetStatus(CFileStatus& rStatus) const; + +// Operations + virtual BOOL Open(LPCTSTR lpszFileName, UINT nOpenFlags, + CFileException* pError = NULL); + + static void PASCAL Rename(LPCTSTR lpszOldName, + LPCTSTR lpszNewName); + static void PASCAL Remove(LPCTSTR lpszFileName); + static BOOL PASCAL GetStatus(LPCTSTR lpszFileName, + CFileStatus& rStatus); + static void PASCAL SetStatus(LPCTSTR lpszFileName, + const CFileStatus& status); + + DWORD SeekToEnd(); + void SeekToBegin(); + + // backward compatible ReadHuge and WriteHuge + DWORD ReadHuge(void* lpBuffer, DWORD dwCount); + void WriteHuge(const void* lpBuffer, DWORD dwCount); + +// Overridables + virtual CFile* Duplicate() const; + + virtual LONG Seek(LONG lOff, UINT nFrom); + virtual void SetLength(DWORD dwNewLen); + virtual DWORD GetLength() const; + + virtual UINT Read(void* lpBuf, UINT nCount); + virtual void Write(const void* lpBuf, UINT nCount); + + virtual void LockRange(DWORD dwPos, DWORD dwCount); + virtual void UnlockRange(DWORD dwPos, DWORD dwCount); + + virtual void Abort(); + virtual void Flush(); + virtual void Close(); + +// Implementation +public: + virtual ~CFile(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + enum BufferCommand { bufferRead, bufferWrite, bufferCommit, bufferCheck }; + virtual UINT GetBufferPtr(UINT nCommand, UINT nCount = 0, + void** ppBufStart = NULL, void** ppBufMax = NULL); + +protected: + BOOL m_bCloseOnDelete; +}; + +///////////////////////////////////////////////////////////////////////////// +// STDIO file implementation + +class CStdioFile : public CFile +{ + DECLARE_DYNAMIC(CStdioFile) + +public: +// Constructors + CStdioFile(); + CStdioFile(FILE* pOpenStream); + CStdioFile(LPCTSTR lpszFileName, UINT nOpenFlags); + +// Attributes + FILE* m_pStream; // stdio FILE + // m_hFile from base class is _fileno(m_pStream) + +// Operations + virtual void WriteString(LPCTSTR lpsz); + // write a string -- like "C" fputs + virtual LPTSTR ReadString(LPTSTR lpsz, UINT nMax); + // read a string -- like "C" fgets + +// Implementation +public: + virtual ~CStdioFile(); +#ifdef _DEBUG + void Dump(CDumpContext& dc) const; +#endif + virtual DWORD GetPosition() const; + virtual BOOL Open(LPCTSTR lpszFileName, UINT nOpenFlags, + CFileException* pError = NULL); + virtual UINT Read(void* lpBuf, UINT nCount); + virtual void Write(const void* lpBuf, UINT nCount); + virtual LONG Seek(LONG lOff, UINT nFrom); + virtual void Abort(); + virtual void Flush(); + virtual void Close(); + + // Unsupported APIs + virtual CFile* Duplicate() const; + virtual void LockRange(DWORD dwPos, DWORD dwCount); + virtual void UnlockRange(DWORD dwPos, DWORD dwCount); +}; + +//////////////////////////////////////////////////////////////////////////// +// Memory based file implementation + +class CMemFile : public CFile +{ + DECLARE_DYNAMIC(CMemFile) + +public: +// Constructors + CMemFile(UINT nGrowBytes = 1024); + +// Advanced Overridables +protected: + virtual BYTE* Alloc(DWORD nBytes); + virtual BYTE* Realloc(BYTE* lpMem, DWORD nBytes); + virtual BYTE* Memcpy(BYTE* lpMemTarget, const BYTE* lpMemSource, UINT nBytes); + virtual void Free(BYTE* lpMem); + virtual void GrowFile(DWORD dwNewLen); + +// Implementation +protected: + UINT m_nGrowBytes; + DWORD m_nPosition; + DWORD m_nBufferSize; + DWORD m_nFileSize; + BYTE* m_lpBuffer; + +public: + virtual ~CMemFile(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; + virtual void AssertValid() const; +#endif + virtual DWORD GetPosition() const; + BOOL GetStatus(CFileStatus& rStatus) const; + virtual LONG Seek(LONG lOff, UINT nFrom); + virtual void SetLength(DWORD dwNewLen); + virtual UINT Read(void* lpBuf, UINT nCount); + virtual void Write(const void* lpBuf, UINT nCount); + virtual void Abort(); + virtual void Flush(); + virtual void Close(); + virtual UINT GetBufferPtr(UINT nCommand, UINT nCount = 0, + void** ppBufStart = NULL, void** ppBufMax = NULL); + + // Unsupported APIs + virtual CFile* Duplicate() const; + virtual void LockRange(DWORD dwPos, DWORD dwCount); + virtual void UnlockRange(DWORD dwPos, DWORD dwCount); +}; + +///////////////////////////////////////////////////////////////////////////// +// Strings + +// Note: _AFX_NO_BSTR_SUPPORT can be defined if you are including OLE2.H +// directly instead of using AFXDISP.H. This will disable CString's direct +// support for BSTRs, however. + +#ifndef _AFX_NO_BSTR_SUPPORT +#ifndef _OLEAUTO_H_ + typedef LPTSTR BSTR; // must (semantically) match typedef in oleauto.h +#endif +#endif + +class CString +{ +public: + +// Constructors + CString(); + CString(const CString& stringSrc); + CString(TCHAR ch, int nRepeat = 1); + CString(LPCSTR lpsz); + CString(LPCWSTR lpsz); + CString(LPCTSTR lpch, int nLength); + CString(const unsigned char* psz); + +// Attributes & Operations + // as an array of characters + int GetLength() const; + BOOL IsEmpty() const; + void Empty(); // free up the data + + TCHAR GetAt(int nIndex) const; // 0 based + TCHAR operator[](int nIndex) const; // same as GetAt + void SetAt(int nIndex, TCHAR ch); + operator LPCTSTR() const; // as a C string + + // overloaded assignment + const CString& operator=(const CString& stringSrc); + const CString& operator=(TCHAR ch); +#ifdef _UNICODE + const CString& operator=(char ch); +#endif + const CString& operator=(LPCSTR lpsz); + const CString& operator=(LPCWSTR lpsz); + const CString& operator=(const unsigned char* psz); + + // string concatenation + const CString& operator+=(const CString& string); + const CString& operator+=(TCHAR ch); +#ifdef _UNICODE + const CString& operator+=(char ch); +#endif + const CString& operator+=(LPCTSTR lpsz); + + friend CString AFXAPI operator+(const CString& string1, + const CString& string2); + friend CString AFXAPI operator+(const CString& string, TCHAR ch); + friend CString AFXAPI operator+(TCHAR ch, const CString& string); +#ifdef _UNICODE + friend CString AFXAPI operator+(const CString& string, char ch); + friend CString AFXAPI operator+(char ch, const CString& string); +#endif + friend CString AFXAPI operator+(const CString& string, LPCTSTR lpsz); + friend CString AFXAPI operator+(LPCTSTR lpsz, const CString& string); + + // string comparison + int Compare(LPCTSTR lpsz) const; // straight character + int CompareNoCase(LPCTSTR lpsz) const; // ignore case + int Collate(LPCTSTR lpsz) const; // NLS aware + + // simple sub-string extraction + CString Mid(int nFirst, int nCount) const; + CString Mid(int nFirst) const; + CString Left(int nCount) const; + CString Right(int nCount) const; + + CString SpanIncluding(LPCTSTR lpszCharSet) const; + CString SpanExcluding(LPCTSTR lpszCharSet) const; + + // upper/lower/reverse conversion + void MakeUpper(); + void MakeLower(); + void MakeReverse(); + + // trimming whitespace (either side) + void TrimRight(); + void TrimLeft(); + + // searching (return starting index, or -1 if not found) + // look for a single character match + int Find(TCHAR ch) const; // like "C" strchr + int ReverseFind(TCHAR ch) const; + int FindOneOf(LPCTSTR lpszCharSet) const; + + // look for a specific sub-string + int Find(LPCTSTR lpszSub) const; // like "C" strstr + + // simple formatting + void Format(LPCTSTR lpszFormat, ...); + + // input and output +#ifdef _DEBUG + friend CDumpContext& AFXAPI operator<<(CDumpContext& dc, + const CString& string); +#endif + friend CArchive& AFXAPI operator<<(CArchive& ar, const CString& string); + friend CArchive& AFXAPI operator>>(CArchive& ar, CString& string); + + // Windows support + BOOL LoadString(UINT nID); // load from string resource + // 255 chars max +#ifndef _UNICODE + // ANSI <-> OEM support (convert string in place) + void AnsiToOem(); + void OemToAnsi(); +#endif + +#ifndef _AFX_NO_BSTR_SUPPORT + // OLE 2.0 BSTR support (use for OLE automation) + BSTR AllocSysString(); + BSTR SetSysString(BSTR* pbstr); +#endif + + // Access to string implementation buffer as "C" character array + LPTSTR GetBuffer(int nMinBufLength); + void ReleaseBuffer(int nNewLength = -1); + LPTSTR GetBufferSetLength(int nNewLength); + void FreeExtra(); + +// Implementation +public: + ~CString(); + int GetAllocLength() const; + +protected: + // lengths/sizes in characters + // (note: an extra character is always allocated) + LPTSTR m_pchData; // actual string (zero terminated) + int m_nDataLength; // does not include terminating 0 + int m_nAllocLength; // does not include terminating 0 + + // implementation helpers + void Init(); + void AllocCopy(CString& dest, int nCopyLen, int nCopyIndex, int nExtraLen) const; + void AllocBuffer(int nLen); + void AssignCopy(int nSrcLen, LPCTSTR lpszSrcData); + void ConcatCopy(int nSrc1Len, LPCTSTR lpszSrc1Data, int nSrc2Len, LPCTSTR lpszSrc2Data); + void ConcatInPlace(int nSrcLen, LPCTSTR lpszSrcData); + static void SafeDelete(LPTSTR lpch); + static int SafeStrlen(LPCTSTR lpsz); +}; + +// Compare helpers +BOOL AFXAPI operator==(const CString& s1, const CString& s2); +BOOL AFXAPI operator==(const CString& s1, LPCTSTR s2); +BOOL AFXAPI operator==(LPCTSTR s1, const CString& s2); +BOOL AFXAPI operator!=(const CString& s1, const CString& s2); +BOOL AFXAPI operator!=(const CString& s1, LPCTSTR s2); +BOOL AFXAPI operator!=(LPCTSTR s1, const CString& s2); +BOOL AFXAPI operator<(const CString& s1, const CString& s2); +BOOL AFXAPI operator<(const CString& s1, LPCTSTR s2); +BOOL AFXAPI operator<(LPCTSTR s1, const CString& s2); +BOOL AFXAPI operator>(const CString& s1, const CString& s2); +BOOL AFXAPI operator>(const CString& s1, LPCTSTR s2); +BOOL AFXAPI operator>(LPCTSTR s1, const CString& s2); +BOOL AFXAPI operator<=(const CString& s1, const CString& s2); +BOOL AFXAPI operator<=(const CString& s1, LPCTSTR s2); +BOOL AFXAPI operator<=(LPCTSTR s1, const CString& s2); +BOOL AFXAPI operator>=(const CString& s1, const CString& s2); +BOOL AFXAPI operator>=(const CString& s1, LPCTSTR s2); +BOOL AFXAPI operator>=(LPCTSTR s1, const CString& s2); + +// conversion helpers +int _wcstombsz(char* mbstr, const wchar_t* wcstr, size_t count); +int _mbstowcsz(wchar_t* wcstr, const char* mbstr, size_t count); + +// Globals +extern const AFX_DATA CString afxEmptyString; +extern AFX_DATA TCHAR afxChNil; + +///////////////////////////////////////////////////////////////////////////// +// CTimeSpan and CTime + +class CTimeSpan +{ +public: + +// Constructors + CTimeSpan(); + CTimeSpan(time_t time); + CTimeSpan(LONG lDays, int nHours, int nMins, int nSecs); + + CTimeSpan(const CTimeSpan& timeSpanSrc); + const CTimeSpan& operator=(const CTimeSpan& timeSpanSrc); + +// Attributes + // extract parts + LONG GetDays() const; // total # of days + LONG GetTotalHours() const; + int GetHours() const; + LONG GetTotalMinutes() const; + int GetMinutes() const; + LONG GetTotalSeconds() const; + int GetSeconds() const; + +// Operations + // time math + CTimeSpan operator-(CTimeSpan timeSpan) const; + CTimeSpan operator+(CTimeSpan timeSpan) const; + const CTimeSpan& operator+=(CTimeSpan timeSpan); + const CTimeSpan& operator-=(CTimeSpan timeSpan); + BOOL operator==(CTimeSpan timeSpan) const; + BOOL operator!=(CTimeSpan timeSpan) const; + BOOL operator<(CTimeSpan timeSpan) const; + BOOL operator>(CTimeSpan timeSpan) const; + BOOL operator<=(CTimeSpan timeSpan) const; + BOOL operator>=(CTimeSpan timeSpan) const; + + CString Format(LPCSTR pFormat) const; + // Note: for _UNICODE variant, pFormat is still 'char' + + // serialization +#ifdef _DEBUG + friend CDumpContext& AFXAPI operator<<(CDumpContext& dc,CTimeSpan timeSpan); +#endif + friend CArchive& AFXAPI operator<<(CArchive& ar, CTimeSpan timeSpan); + friend CArchive& AFXAPI operator>>(CArchive& ar, CTimeSpan& rtimeSpan); + +private: + time_t m_timeSpan; + friend class CTime; +}; + +class CTime +{ +public: + +// Constructors + static CTime PASCAL GetCurrentTime(); + + CTime(); + CTime(time_t time); + CTime(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec); + CTime(WORD wDosDate, WORD wDosTime); + CTime(const CTime& timeSrc); + + CTime(const SYSTEMTIME& sysTime); + CTime(const FILETIME& fileTime); + const CTime& operator=(const CTime& timeSrc); + const CTime& operator=(time_t t); + +// Attributes + struct tm* GetGmtTm(struct tm* ptm = NULL) const; + struct tm* GetLocalTm(struct tm* ptm = NULL) const; + + time_t GetTime() const; + int GetYear() const; + int GetMonth() const; // month of year (1 = Jan) + int GetDay() const; // day of month + int GetHour() const; + int GetMinute() const; + int GetSecond() const; + int GetDayOfWeek() const; // 1=Sun, 2=Mon, ..., 7=Sat + +// Operations + // time math + CTimeSpan operator-(CTime time) const; + CTime operator-(CTimeSpan timeSpan) const; + CTime operator+(CTimeSpan timeSpan) const; + const CTime& operator+=(CTimeSpan timeSpan); + const CTime& operator-=(CTimeSpan timeSpan); + BOOL operator==(CTime time) const; + BOOL operator!=(CTime time) const; + BOOL operator<(CTime time) const; + BOOL operator>(CTime time) const; + BOOL operator<=(CTime time) const; + BOOL operator>=(CTime time) const; + + // formatting using "C" strftime + CString Format(LPCSTR pFormat) const; + CString FormatGmt(LPCSTR pFormat) const; + // Note: for _UNICODE variant, pFormat is still 'char' + + // serialization +#ifdef _DEBUG + friend CDumpContext& AFXAPI operator<<(CDumpContext& dc, CTime time); +#endif + friend CArchive& AFXAPI operator<<(CArchive& ar, CTime time); + friend CArchive& AFXAPI operator>>(CArchive& ar, CTime& rtime); + +private: + time_t m_time; +}; + +///////////////////////////////////////////////////////////////////////////// +// File status + +struct CFileStatus +{ + CTime m_ctime; // creation date/time of file + CTime m_mtime; // last modification date/time of file + CTime m_atime; // last access date/time of file + LONG m_size; // logical size of file in bytes + BYTE m_attribute; // logical OR of CFile::Attribute enum values + BYTE _m_padding; // pad the structure to a WORD + TCHAR m_szFullName[_MAX_PATH]; // absolute path name + +#ifdef _DEBUG + void Dump(CDumpContext& dc) const; +#endif +}; + +///////////////////////////////////////////////////////////////////////////// +// Diagnostic memory management routines + +// Low level sanity checks for memory blocks +BOOL AFXAPI AfxIsValidAddress(const void* lp, + UINT nBytes, BOOL bReadWrite = TRUE); +BOOL AFXAPI AfxIsValidString(LPCWSTR lpsz, int nLength = -1); +BOOL AFXAPI AfxIsValidString(LPCSTR lpsz, int nLength = -1); + +#ifdef _DEBUG +// Memory tracking allocation +void* AFX_CDECL operator new(size_t nSize, LPCSTR lpszFileName, int nLine); +#define DEBUG_NEW new(THIS_FILE, __LINE__) + +void* AfxAllocMemoryDebug(size_t nSize, BOOL bIsObject, + LPCSTR lpszFileName, int nLine); +void AfxFreeMemoryDebug(void* pbData, BOOL bIsObject); + +// Dump any memory leaks since program started +BOOL AFXAPI AfxDumpMemoryLeaks(); + +// Return TRUE if valid memory block of nBytes +BOOL AFXAPI AfxIsMemoryBlock(const void* p, UINT nBytes, + LONG* plRequestNumber = NULL); + +// Return TRUE if memory is sane or print out what is wrong +BOOL AFXAPI AfxCheckMemory(); + +// Options for tuning the allocation diagnostics +#if defined(_WINDLL) || defined(_AFXDLL) +#define afxMemDF AfxGetAllocState()->m_nMemDF +#else +extern AFX_DATA int afxMemDF; +#endif + +enum AfxMemDF // memory debug/diagnostic flags +{ + allocMemDF = 0x01, // turn on debugging allocator + delayFreeMemDF = 0x02, // delay freeing memory + checkAlwaysMemDF = 0x04 // AfxCheckMemory on every alloc/free +}; + +// Advanced initialization: for overriding default diagnostics +BOOL AFXAPI AfxDiagnosticInit(void); + +// turn on/off tracking for a short while +BOOL AFXAPI AfxEnableMemoryTracking(BOOL bTrack); + +// Memory allocator failure simulation and control (_DEBUG only) + +// A failure hook returns whether to permit allocation +typedef BOOL (AFXAPI* AFX_ALLOC_HOOK)(size_t nSize, BOOL bObject, LONG lRequestNumber); + +// Set new hook, return old (never NULL) +AFX_ALLOC_HOOK AFXAPI AfxSetAllocHook(AFX_ALLOC_HOOK pfnAllocHook); + +// Debugger hook on specified allocation request - Obsolete +void AFXAPI AfxSetAllocStop(LONG lRequestNumber); + +struct CBlockHeader; + +// Memory state for snapshots/leak detection +struct CMemoryState +{ +// Attributes + enum blockUsage + { + freeBlock, // memory not used + objectBlock, // contains a CObject derived class object + bitBlock, // contains ::operator new data + nBlockUseMax // total number of usages + }; + + CBlockHeader* m_pBlockHeader; + LONG m_lCounts[nBlockUseMax]; + LONG m_lSizes[nBlockUseMax]; + LONG m_lHighWaterCount; + LONG m_lTotalCount; + + CMemoryState(); + +// Operations + void Checkpoint(); // fill with current state + BOOL Difference(const CMemoryState& oldState, + const CMemoryState& newState); // fill with difference + + // Output to afxDump + void DumpStatistics() const; + void DumpAllObjectsSince() const; +}; + +// Enumerate allocated objects or runtime classes +void AFXAPI AfxDoForAllObjects(void (*pfn)(CObject* pObject, void* pContext), + void* pContext); +void AFXAPI AfxDoForAllClasses(void (*pfn)(const CRuntimeClass* pClass, + void* pContext), void* pContext); + +#else + +// non-_DEBUG version that assume everything is OK +#define DEBUG_NEW new +#define AfxCheckMemory() TRUE +#define AfxIsMemoryBlock(p, nBytes) TRUE +#define AfxEnableMemoryTracking(bTrack) FALSE + +#endif // _DEBUG + +///////////////////////////////////////////////////////////////////////////// +// Archives for serializing CObject data + +// needed for implementation +class CPtrArray; +class CMapPtrToPtr; +class CDocument; + +class CArchive +{ +public: +// Flag values + enum Mode { store = 0, load = 1, bNoFlushOnDelete = 2, bNoByteSwap = 4 }; + + CArchive(CFile* pFile, UINT nMode, int nBufSize = 512, void* lpBuf = NULL); + ~CArchive(); + +// Attributes + BOOL IsLoading() const; + BOOL IsStoring() const; + BOOL IsBufferEmpty() const; + CFile* GetFile() const; + UINT GetObjectSchema(); // only valid when reading a CObject* + + CDocument* m_pDocument; + // pointer to document being serialized -- must set to serialize + // COleClientItems in a document! + +// Operations + UINT Read(void* lpBuf, UINT nMax); + void Write(const void* lpBuf, UINT nMax); + void Flush(); + void Close(); + +public: + // Object I/O is pointer based to avoid added construction overhead. + // Use the Serialize member function directly for embedded objects. + friend CArchive& AFXAPI operator<<(CArchive& ar, const CObject* pOb); + + friend CArchive& AFXAPI operator>>(CArchive& ar, CObject*& pOb); + friend CArchive& AFXAPI operator>>(CArchive& ar, const CObject*& pOb); + + // insertion operations + // NOTE: operators available only for fixed size types for portability + CArchive& operator<<(BYTE by); + CArchive& operator<<(WORD w); + CArchive& operator<<(LONG l); + CArchive& operator<<(DWORD dw); + CArchive& operator<<(float f); + CArchive& operator<<(double d); + + // extraction operations + // NOTE: operators available only for fixed size types for portability + CArchive& operator>>(BYTE& by); + CArchive& operator>>(WORD& w); + CArchive& operator>>(DWORD& dw); + CArchive& operator>>(LONG& l); + CArchive& operator>>(float& f); + CArchive& operator>>(double& d); + + CObject* ReadObject(const CRuntimeClass* pClass); + void WriteObject(const CObject* pOb); + +// Implementation +public: + BOOL m_bForceFlat; // for COleClientItem implementation (default TRUE) + BOOL m_bDirectBuffer; // TRUE if m_pFile supports direct buffering + void FillBuffer(UINT nBytesNeeded); + void Abort(); // close and completely shutdown + +protected: + // archive objects cannot be copied or assigned + CArchive(const CArchive& arSrc); + void operator=(const CArchive& arSrc); + + BOOL m_nMode; + BOOL m_bUserBuf; + int m_nBufSize; + CFile* m_pFile; + BYTE* m_lpBufCur; + BYTE* m_lpBufMax; + BYTE* m_lpBufStart; + + UINT m_nObjectSchema; + + UINT m_nMapCount; // count and map used when storing + union + { + CPtrArray* m_pLoadArray; + CMapPtrToPtr* m_pStoreMap; + }; +}; + +///////////////////////////////////////////////////////////////////////////// +// Diagnostic dumping + +class CDumpContext +{ +public: + CDumpContext(CFile* pFile); + +// Attributes + int GetDepth() const; // 0 => this object, 1 => children objects + void SetDepth(int nNewDepth); + +// Operations + CDumpContext& operator<<(LPCTSTR lpsz); +#ifdef _UNICODE + CDumpContext& operator<<(LPCSTR lpsz); // automatically widened +#else + CDumpContext& operator<<(LPCWSTR lpsz); // automatically thinned +#endif + CDumpContext& operator<<(const void* lp); + CDumpContext& operator<<(const CObject* pOb); + CDumpContext& operator<<(const CObject& ob); + CDumpContext& operator<<(BYTE by); + CDumpContext& operator<<(WORD w); + CDumpContext& operator<<(UINT u); + CDumpContext& operator<<(LONG l); + CDumpContext& operator<<(DWORD dw); + CDumpContext& operator<<(float f); + CDumpContext& operator<<(double d); + CDumpContext& operator<<(int n); + void HexDump(LPCTSTR lpszLine, BYTE* pby, int nBytes, int nWidth); + void Flush(); + +// Implementation +protected: + // dump context objects cannot be copied or assigned + CDumpContext(const CDumpContext& dcSrc); + void operator=(const CDumpContext& dcSrc); + void OutputString(LPCTSTR lpsz); + + int m_nDepth; + +public: + CFile* m_pFile; +}; + +#ifdef _DEBUG +#define afxDump AfxGetAllocState()->m_afxDump +#define afxTraceEnabled AfxGetAllocState()->m_bTraceEnabled +#endif + +///////////////////////////////////////////////////////////////////////////// +// Special include for Win32s compatibility + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +#ifndef __AFXCOLL_H__ + #include <afxcoll.h> + #ifndef __AFXSTATE_H__ + #include <afxstat_.h> // for AFX_APP_STATE and AFX_THREAD_STATE + #endif +#endif + +///////////////////////////////////////////////////////////////////////////// +// Inline function declarations + +#ifdef _AFX_ENABLE_INLINES +#define _AFX_INLINE inline +#include <afx.inl> +#endif + +#undef AFX_DATA +#define AFX_DATA + +#endif // __AFX_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afx.inl b/public/sdk/inc/mfc30/afx.inl new file mode 100644 index 000000000..133a14d90 --- /dev/null +++ b/public/sdk/inc/mfc30/afx.inl @@ -0,0 +1,368 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// Inlines for AFX.H + +#ifdef _AFX_INLINE + +///////////////////////////////////////////////////////////////////////////// + +// CObject +_AFX_INLINE CObject::CObject() + { } +_AFX_INLINE CObject::~CObject() + { } +_AFX_INLINE void CObject::Serialize(CArchive&) + { /* CObject does not serialize anything by default */ } +_AFX_INLINE void* CObject::operator new(size_t, void* p) + { return p; } +#ifndef _DEBUG +// _DEBUG versions in memory.cpp +_AFX_INLINE void CObject::operator delete(void* p) + { ::operator delete(p); } +_AFX_INLINE void* CObject::operator new(size_t nSize) + { return ::operator new(nSize); } +// _DEBUG versions in objcore.cpp +_AFX_INLINE void CObject::AssertValid() const + { /* no asserts in release builds */ } +_AFX_INLINE void CObject::Dump(CDumpContext&) const + { /* no dumping in release builds */ } +#endif + + +// exceptions +_AFX_INLINE CException::~CException() + { } +_AFX_INLINE CMemoryException::CMemoryException() + { } +_AFX_INLINE CMemoryException::CMemoryException(BOOL bAutoDelete) + : CException(bAutoDelete) { } +_AFX_INLINE CMemoryException::~CMemoryException() + { } +_AFX_INLINE CNotSupportedException::CNotSupportedException() + { } +_AFX_INLINE CNotSupportedException::CNotSupportedException(BOOL bAutoDelete) + : CException(bAutoDelete) { } +_AFX_INLINE CNotSupportedException::~CNotSupportedException() + { } +_AFX_INLINE CArchiveException::CArchiveException(int cause) + { m_cause = cause; } +_AFX_INLINE CArchiveException::~CArchiveException() + { } +_AFX_INLINE CFileException::CFileException(int cause, LONG lOsError) + { m_cause = cause; m_lOsError = lOsError; } +_AFX_INLINE CFileException::~CFileException() + { } +#ifndef _DEBUG +// Note: _DEBUG version in except.cpp +_AFX_INLINE void AFX_CDECL CException::operator delete(void* pbData) + { CObject::operator delete(pbData); } +#endif + +// CFile +_AFX_INLINE DWORD CFile::ReadHuge(void* lpBuffer, DWORD dwCount) + { return (DWORD)Read(lpBuffer, (UINT)dwCount); } +_AFX_INLINE void CFile::WriteHuge(const void* lpBuffer, DWORD dwCount) + { Write(lpBuffer, (UINT)dwCount); } + +_AFX_INLINE DWORD CFile::SeekToEnd() + { return Seek(0, CFile::end); } +_AFX_INLINE void CFile::SeekToBegin() + { Seek(0, CFile::begin); } + +// CString +_AFX_INLINE CString::CString(const unsigned char* lpsz) + { Init(); *this = (LPCSTR)lpsz; } +_AFX_INLINE const CString& CString::operator=(const unsigned char* lpsz) + { *this = (LPCSTR)lpsz; return *this; } +#ifdef _UNICODE +_AFX_INLINE const CString& CString::operator+=(char ch) + { *this += (TCHAR)ch; return *this; } +_AFX_INLINE const CString& CString::operator=(char ch) + { *this = (TCHAR)ch; return *this; } +_AFX_INLINE CString AFXAPI operator+(const CString& string, char ch) + { return string + (TCHAR)ch; } +_AFX_INLINE CString AFXAPI operator+(char ch, const CString& string) + { return (TCHAR)ch + string; } +#endif + +_AFX_INLINE int CString::GetLength() const + { return m_nDataLength; } +_AFX_INLINE int CString::GetAllocLength() const + { return m_nAllocLength; } +_AFX_INLINE BOOL CString::IsEmpty() const + { return m_nDataLength == 0; } +_AFX_INLINE CString::operator LPCTSTR() const + { return (LPCTSTR)m_pchData; } +_AFX_INLINE int CString::SafeStrlen(LPCTSTR lpsz) + { return (lpsz == NULL) ? NULL : _tcslen(lpsz); } + +// CString support (windows specific) +_AFX_INLINE int CString::Compare(LPCTSTR lpsz) const + { return _tcscmp(m_pchData, lpsz); } // MBCS/Unicode aware +_AFX_INLINE int CString::CompareNoCase(LPCTSTR lpsz) const + { return _tcsicmp(m_pchData, lpsz); } // MBCS/Unicode aware +// CString::Collate is often slower than Compare but is MBSC/Unicode +// aware as well as locale-sensitive with respect to sort order. +_AFX_INLINE int CString::Collate(LPCTSTR lpsz) const + { return _tcscoll(m_pchData, lpsz); } // locale sensitive +_AFX_INLINE void CString::MakeUpper() + { ::CharUpper(m_pchData); } +_AFX_INLINE void CString::MakeLower() + { ::CharLower(m_pchData); } + +_AFX_INLINE void CString::MakeReverse() + { _tcsrev(m_pchData); } +_AFX_INLINE TCHAR CString::GetAt(int nIndex) const + { + ASSERT(nIndex >= 0); + ASSERT(nIndex < m_nDataLength); + + return m_pchData[nIndex]; + } +_AFX_INLINE TCHAR CString::operator[](int nIndex) const + { + // same as GetAt + + ASSERT(nIndex >= 0); + ASSERT(nIndex < m_nDataLength); + + return m_pchData[nIndex]; + } +_AFX_INLINE void CString::SetAt(int nIndex, TCHAR ch) + { + ASSERT(nIndex >= 0); + ASSERT(nIndex < m_nDataLength); + ASSERT(ch != 0); + + m_pchData[nIndex] = ch; + } +_AFX_INLINE BOOL AFXAPI operator==(const CString& s1, const CString& s2) + { return s1.Compare(s2) == 0; } +_AFX_INLINE BOOL AFXAPI operator==(const CString& s1, LPCTSTR s2) + { return s1.Compare(s2) == 0; } +_AFX_INLINE BOOL AFXAPI operator==(LPCTSTR s1, const CString& s2) + { return s2.Compare(s1) == 0; } +_AFX_INLINE BOOL AFXAPI operator!=(const CString& s1, const CString& s2) + { return s1.Compare(s2) != 0; } +_AFX_INLINE BOOL AFXAPI operator!=(const CString& s1, LPCTSTR s2) + { return s1.Compare(s2) != 0; } +_AFX_INLINE BOOL AFXAPI operator!=(LPCTSTR s1, const CString& s2) + { return s2.Compare(s1) != 0; } +_AFX_INLINE BOOL AFXAPI operator<(const CString& s1, const CString& s2) + { return s1.Compare(s2) < 0; } +_AFX_INLINE BOOL AFXAPI operator<(const CString& s1, LPCTSTR s2) + { return s1.Compare(s2) < 0; } +_AFX_INLINE BOOL AFXAPI operator<(LPCTSTR s1, const CString& s2) + { return s2.Compare(s1) > 0; } +_AFX_INLINE BOOL AFXAPI operator>(const CString& s1, const CString& s2) + { return s1.Compare(s2) > 0; } +_AFX_INLINE BOOL AFXAPI operator>(const CString& s1, LPCTSTR s2) + { return s1.Compare(s2) > 0; } +_AFX_INLINE BOOL AFXAPI operator>(LPCTSTR s1, const CString& s2) + { return s2.Compare(s1) < 0; } +_AFX_INLINE BOOL AFXAPI operator<=(const CString& s1, const CString& s2) + { return s1.Compare(s2) <= 0; } +_AFX_INLINE BOOL AFXAPI operator<=(const CString& s1, LPCTSTR s2) + { return s1.Compare(s2) <= 0; } +_AFX_INLINE BOOL AFXAPI operator<=(LPCTSTR s1, const CString& s2) + { return s2.Compare(s1) >= 0; } +_AFX_INLINE BOOL AFXAPI operator>=(const CString& s1, const CString& s2) + { return s1.Compare(s2) >= 0; } +_AFX_INLINE BOOL AFXAPI operator>=(const CString& s1, LPCTSTR s2) + { return s1.Compare(s2) >= 0; } +_AFX_INLINE BOOL AFXAPI operator>=(LPCTSTR s1, const CString& s2) + { return s2.Compare(s1) <= 0; } + +#ifndef _UNICODE +_AFX_INLINE void CString::AnsiToOem() + { ::AnsiToOem(m_pchData, m_pchData); } +_AFX_INLINE void CString::OemToAnsi() + { ::OemToAnsi(m_pchData, m_pchData); } +#endif + +// CTime and CTimeSpan +_AFX_INLINE CTimeSpan::CTimeSpan() + { } +_AFX_INLINE CTimeSpan::CTimeSpan(time_t time) + { m_timeSpan = time; } +_AFX_INLINE CTimeSpan::CTimeSpan(LONG lDays, int nHours, int nMins, int nSecs) + { m_timeSpan = nSecs + 60* (nMins + 60* (nHours + 24* lDays)); } +_AFX_INLINE CTimeSpan::CTimeSpan(const CTimeSpan& timeSpanSrc) + { m_timeSpan = timeSpanSrc.m_timeSpan; } +_AFX_INLINE const CTimeSpan& CTimeSpan::operator=(const CTimeSpan& timeSpanSrc) + { m_timeSpan = timeSpanSrc.m_timeSpan; return *this; } +_AFX_INLINE LONG CTimeSpan::GetDays() const + { return m_timeSpan / (24*3600L); } +_AFX_INLINE LONG CTimeSpan::GetTotalHours() const + { return m_timeSpan/3600; } +_AFX_INLINE int CTimeSpan::GetHours() const + { return (int)(GetTotalHours() - GetDays()*24); } +_AFX_INLINE LONG CTimeSpan::GetTotalMinutes() const + { return m_timeSpan/60; } +_AFX_INLINE int CTimeSpan::GetMinutes() const + { return (int)(GetTotalMinutes() - GetTotalHours()*60); } +_AFX_INLINE LONG CTimeSpan::GetTotalSeconds() const + { return m_timeSpan; } +_AFX_INLINE int CTimeSpan::GetSeconds() const + { return (int)(GetTotalSeconds() - GetTotalMinutes()*60); } +_AFX_INLINE CTimeSpan CTimeSpan::operator-(CTimeSpan timeSpan) const + { return CTimeSpan(m_timeSpan - timeSpan.m_timeSpan); } +_AFX_INLINE CTimeSpan CTimeSpan::operator+(CTimeSpan timeSpan) const + { return CTimeSpan(m_timeSpan + timeSpan.m_timeSpan); } +_AFX_INLINE const CTimeSpan& CTimeSpan::operator+=(CTimeSpan timeSpan) + { m_timeSpan += timeSpan.m_timeSpan; return *this; } +_AFX_INLINE const CTimeSpan& CTimeSpan::operator-=(CTimeSpan timeSpan) + { m_timeSpan -= timeSpan.m_timeSpan; return *this; } +_AFX_INLINE BOOL CTimeSpan::operator==(CTimeSpan timeSpan) const + { return m_timeSpan == timeSpan.m_timeSpan; } +_AFX_INLINE BOOL CTimeSpan::operator!=(CTimeSpan timeSpan) const + { return m_timeSpan != timeSpan.m_timeSpan; } +_AFX_INLINE BOOL CTimeSpan::operator<(CTimeSpan timeSpan) const + { return m_timeSpan < timeSpan.m_timeSpan; } +_AFX_INLINE BOOL CTimeSpan::operator>(CTimeSpan timeSpan) const + { return m_timeSpan > timeSpan.m_timeSpan; } +_AFX_INLINE BOOL CTimeSpan::operator<=(CTimeSpan timeSpan) const + { return m_timeSpan <= timeSpan.m_timeSpan; } +_AFX_INLINE BOOL CTimeSpan::operator>=(CTimeSpan timeSpan) const + { return m_timeSpan >= timeSpan.m_timeSpan; } + + +_AFX_INLINE CTime::CTime() + { } +_AFX_INLINE CTime::CTime(time_t time) + { m_time = time; } +_AFX_INLINE CTime::CTime(const CTime& timeSrc) + { m_time = timeSrc.m_time; } +_AFX_INLINE const CTime& CTime::operator=(const CTime& timeSrc) + { m_time = timeSrc.m_time; return *this; } +_AFX_INLINE const CTime& CTime::operator=(time_t t) + { m_time = t; return *this; } +_AFX_INLINE time_t CTime::GetTime() const + { return m_time; } +_AFX_INLINE int CTime::GetYear() const + { return (GetLocalTm(NULL)->tm_year) + 1900; } +_AFX_INLINE int CTime::GetMonth() const + { return GetLocalTm(NULL)->tm_mon + 1; } +_AFX_INLINE int CTime::GetDay() const + { return GetLocalTm(NULL)->tm_mday; } +_AFX_INLINE int CTime::GetHour() const + { return GetLocalTm(NULL)->tm_hour; } +_AFX_INLINE int CTime::GetMinute() const + { return GetLocalTm(NULL)->tm_min; } +_AFX_INLINE int CTime::GetSecond() const + { return GetLocalTm(NULL)->tm_sec; } +_AFX_INLINE int CTime::GetDayOfWeek() const + { return GetLocalTm(NULL)->tm_wday + 1; } +_AFX_INLINE CTimeSpan CTime::operator-(CTime time) const + { return CTimeSpan(m_time - time.m_time); } +_AFX_INLINE CTime CTime::operator-(CTimeSpan timeSpan) const + { return CTime(m_time - timeSpan.m_timeSpan); } +_AFX_INLINE CTime CTime::operator+(CTimeSpan timeSpan) const + { return CTime(m_time + timeSpan.m_timeSpan); } +_AFX_INLINE const CTime& CTime::operator+=(CTimeSpan timeSpan) + { m_time += timeSpan.m_timeSpan; return *this; } +_AFX_INLINE const CTime& CTime::operator-=(CTimeSpan timeSpan) + { m_time -= timeSpan.m_timeSpan; return *this; } +_AFX_INLINE BOOL CTime::operator==(CTime time) const + { return m_time == time.m_time; } +_AFX_INLINE BOOL CTime::operator!=(CTime time) const + { return m_time != time.m_time; } +_AFX_INLINE BOOL CTime::operator<(CTime time) const + { return m_time < time.m_time; } +_AFX_INLINE BOOL CTime::operator>(CTime time) const + { return m_time > time.m_time; } +_AFX_INLINE BOOL CTime::operator<=(CTime time) const + { return m_time <= time.m_time; } +_AFX_INLINE BOOL CTime::operator>=(CTime time) const + { return m_time >= time.m_time; } + + +// CArchive +_AFX_INLINE BOOL CArchive::IsLoading() const + { return (m_nMode & CArchive::load) != 0; } +_AFX_INLINE BOOL CArchive::IsStoring() const + { return (m_nMode & CArchive::load) == 0; } +_AFX_INLINE BOOL CArchive::IsBufferEmpty() const + { return m_lpBufCur == m_lpBufMax; } +_AFX_INLINE CFile* CArchive::GetFile() const + { return m_pFile; } +_AFX_INLINE CArchive& CArchive::operator<<(BYTE by) + { if (m_lpBufCur + sizeof(BYTE) > m_lpBufMax) Flush(); + *(UNALIGNED BYTE*)m_lpBufCur = by; m_lpBufCur += sizeof(BYTE); return *this; } +#ifndef _MAC +_AFX_INLINE CArchive& CArchive::operator<<(WORD w) + { if (m_lpBufCur + sizeof(WORD) > m_lpBufMax) Flush(); + *(UNALIGNED WORD*)m_lpBufCur = w; m_lpBufCur += sizeof(WORD); return *this; } +_AFX_INLINE CArchive& CArchive::operator<<(LONG l) + { if (m_lpBufCur + sizeof(LONG) > m_lpBufMax) Flush(); + *(UNALIGNED LONG*)m_lpBufCur = l; m_lpBufCur += sizeof(LONG); return *this; } +_AFX_INLINE CArchive& CArchive::operator<<(DWORD dw) + { if (m_lpBufCur + sizeof(DWORD) > m_lpBufMax) Flush(); + *(UNALIGNED DWORD*)m_lpBufCur = dw; m_lpBufCur += sizeof(DWORD); return *this; } +_AFX_INLINE CArchive& CArchive::operator<<(float f) + { if (m_lpBufCur + sizeof(float) > m_lpBufMax) Flush(); + *(UNALIGNED _AFX_FLOAT*)m_lpBufCur = *(_AFX_FLOAT*)&f; m_lpBufCur += sizeof(float); return *this; + } +_AFX_INLINE CArchive& CArchive::operator<<(double d) + { if (m_lpBufCur + sizeof(double) > m_lpBufMax) Flush(); + *(UNALIGNED _AFX_DOUBLE*)m_lpBufCur = *(_AFX_DOUBLE*)&d; m_lpBufCur += sizeof(double); return *this; } +#endif +_AFX_INLINE CArchive& CArchive::operator>>(BYTE& by) + { if (m_lpBufCur + sizeof(BYTE) > m_lpBufMax) + FillBuffer(sizeof(BYTE) - (UINT)(m_lpBufMax - m_lpBufCur)); + by = *(UNALIGNED BYTE*)m_lpBufCur; m_lpBufCur += sizeof(BYTE); return *this; } +#ifndef _MAC +_AFX_INLINE CArchive& CArchive::operator>>(WORD& w) + { if (m_lpBufCur + sizeof(WORD) > m_lpBufMax) + FillBuffer(sizeof(WORD) - (UINT)(m_lpBufMax - m_lpBufCur)); + w = *(UNALIGNED WORD*)m_lpBufCur; m_lpBufCur += sizeof(WORD); return *this; } +_AFX_INLINE CArchive& CArchive::operator>>(DWORD& dw) + { if (m_lpBufCur + sizeof(DWORD) > m_lpBufMax) + FillBuffer(sizeof(DWORD) - (UINT)(m_lpBufMax - m_lpBufCur)); + dw = *(UNALIGNED DWORD*)m_lpBufCur; m_lpBufCur += sizeof(DWORD); return *this; } +_AFX_INLINE CArchive& CArchive::operator>>(float& f) + { if (m_lpBufCur + sizeof(float) > m_lpBufMax) + FillBuffer(sizeof(float) - (UINT)(m_lpBufMax - m_lpBufCur)); + *(_AFX_FLOAT*)&f = *(UNALIGNED _AFX_FLOAT*)m_lpBufCur; m_lpBufCur += sizeof(float); return *this; } +_AFX_INLINE CArchive& CArchive::operator>>(double& d) + { if (m_lpBufCur + sizeof(double) > m_lpBufMax) + FillBuffer(sizeof(double) - (UINT)(m_lpBufMax - m_lpBufCur)); + *(_AFX_DOUBLE*)&d = *(UNALIGNED _AFX_DOUBLE*)m_lpBufCur; m_lpBufCur += sizeof(double); return *this; } +_AFX_INLINE CArchive& CArchive::operator>>(LONG& l) + { if (m_lpBufCur + sizeof(LONG) > m_lpBufMax) + FillBuffer(sizeof(LONG) - (UINT)(m_lpBufMax - m_lpBufCur)); + l = *(UNALIGNED LONG*)m_lpBufCur; m_lpBufCur += sizeof(LONG); return *this; } +#endif +_AFX_INLINE CArchive::CArchive(const CArchive& /* arSrc */) + { } +_AFX_INLINE void CArchive::operator=(const CArchive& /* arSrc */) + { } +_AFX_INLINE CArchive& AFXAPI operator<<(CArchive& ar, const CObject* pOb) + { ar.WriteObject(pOb); return ar; } +_AFX_INLINE CArchive& AFXAPI operator>>(CArchive& ar, CObject*& pOb) + { pOb = ar.ReadObject(NULL); return ar; } +_AFX_INLINE CArchive& AFXAPI operator>>(CArchive& ar, const CObject*& pOb) + { pOb = ar.ReadObject(NULL); return ar; } + + +// CDumpContext +_AFX_INLINE int CDumpContext::GetDepth() const + { return m_nDepth; } +_AFX_INLINE void CDumpContext::SetDepth(int nNewDepth) + { m_nDepth = nNewDepth; } +_AFX_INLINE CDumpContext::CDumpContext(const CDumpContext& /* dcSrc */) + { } +_AFX_INLINE void CDumpContext::operator=(const CDumpContext& /* dcSrc */) + { } + +///////////////////////////////////////////////////////////////////////////// + +#endif //_AFX_INLINE diff --git a/public/sdk/inc/mfc30/afxaete.r b/public/sdk/inc/mfc30/afxaete.r new file mode 100644 index 000000000..158ab13a9 --- /dev/null +++ b/public/sdk/inc/mfc30/afxaete.r @@ -0,0 +1,92 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1994 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXAETE_R__ +#define __AFXAETE_R__ + +#include "mrc\Types.r" +#include "mrc\SysTypes.r" +#include "mrc\AppleEve.r" +#include "mrc\AERegist.r" +#include "mrc\AEUserTe.r" + + +resource 'aete' (0) +{ + 1, + 0, + langEnglish, + smRoman, + { + "Required Suite", + "Terms that every application should support", + kAERequiredSuite, + 1, + 1, + {}, {}, {}, {}, + + "MFC Suite", + "Terms supported by MFC applications", + '****', + 1, + 1, + { + "quit", + "Quit an application program", + kAERequiredSuite, + kAEQuitApplication, + noReply, + "", + replyOptional, + singleItem, + notEnumerated, + reserved, reserved, reserved, reserved, reserved, + reserved, reserved, reserved, reserved, + verbEvent, + reserved, reserved, reserved, + noParams, + "", + directParamOptional, + singleItem, + notEnumerated, + changesState, + reserved, reserved, reserved, reserved, reserved, + reserved, reserved, reserved, reserved, reserved, + reserved, reserved, + { + "saving", + keyAESaveOptions, + enumSaveOptions, + "specifies whether to save currently open documents", + optional, + singleItem, + enumerated, + reserved, reserved, reserved, reserved, reserved, + reserved, reserved, reserved, reserved, + prepositionParam, + notFeminine, + notMasculine, + singular + }, + }, + {}, {}, + { + enumSaveOptions, + { + "yes", kAEYes, "Save objects now", + "no", kAENo, "Do not save objects", + "ask", kAEAsk, "Ask the user whether to save" + }, + } + } +}; + + +#endif diff --git a/public/sdk/inc/mfc30/afxcmn.h b/public/sdk/inc/mfc30/afxcmn.h new file mode 100644 index 000000000..ee2e7149d --- /dev/null +++ b/public/sdk/inc/mfc30/afxcmn.h @@ -0,0 +1,709 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXCMN_H__ +#define __AFXCMN_H__ + +#ifndef __AFXWIN_H__ + #include <afxwin.h> +#endif +#ifndef _INC_COMMCTRL + #include <commctrl.h> +#endif + +#ifndef IMAGE_BITMAP +#define IMAGE_BITMAP 0 +#endif + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +#ifndef _AFX_NOFORCE_LIBS +#ifndef _MAC + +///////////////////////////////////////////////////////////////////////////// +// Win32 libraries + +#ifdef _AFXDLL + #ifdef _UNICODE + #ifdef _DEBUG + #pragma comment(lib, "eafxccud.lib") + #else + #pragma comment(lib, "eafxccu.lib") + #endif + #else + #ifdef _DEBUG + #pragma comment(lib, "eafxccd.lib") + #else + #pragma comment(lib, "eafxcc.lib") + #endif + #endif +#else + #ifdef _UNICODE + #ifdef _DEBUG + #pragma comment(lib, "nafxccud.lib") + #else + #pragma comment(lib, "nafxccu.lib") + #endif + #else + #ifdef _DEBUG + #pragma comment(lib, "nafxccd.lib") + #else + #pragma comment(lib, "nafxcc.lib") + #endif + #endif +#endif + +#pragma comment(lib, "comctl32.lib") + +#else //!_MAC + +///////////////////////////////////////////////////////////////////////////// +// Mac libraries + +#endif //_MAC +#endif //!_AFX_NOFORCE_LIBS + +///////////////////////////////////////////////////////////////////////////// +// AFXCMN - MFC COMCTL32 Control Classes + +// Classes declared in this file + +//CObject + class CImageList; + //CCmdTarget; + //CWnd + class CListCtrl; + class CTreeCtrl; + class CSpinButtonCtrl; + class CHeaderCtrl; + class CSliderCtrl; + class CProgressCtrl; + class CHotKeyCtrl; + class CToolTipCtrl; + class CTabCtrl; + class CAnimateCtrl; + class CToolBarCtrl; + class CStatusBarCtrl; + +#undef AFX_DATA +#define AFX_DATA AFX_CORE_DATA + +///////////////////////////////////////////////////////////////////////////// +// CStatusBarCtrl + +class CStatusBarCtrl : public CWnd +{ + DECLARE_DYNAMIC(CStatusBarCtrl) + +// Constructors +public: + CStatusBarCtrl(); + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Attributes + BOOL SetText(LPCTSTR lpszText, int nPane, int nType); + int GetText(LPCTSTR lpszText, int nPane, int* pType = NULL); + int GetTextLength(int nPane, int* pType = NULL); + BOOL SetParts(int nParts, int* pWidths); + BOOL SetBorders(int* pBorders); + BOOL SetBorders(int nHorz, int nVert, int nSpacing); + int GetParts(int nParts, int* pParts); + BOOL GetBorders(int* pBorders); + BOOL GetBorders(int& nHorz, int& nVert, int& nSpacing); + void SetMinHeight(int nMin); + BOOL SetSimple(BOOL bSimple = TRUE); + BOOL GetRect(int nPane, LPRECT lpRect); + +// Overridables + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + +// Implementation +public: + virtual ~CStatusBarCtrl(); +protected: + virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*); +}; + +///////////////////////////////////////////////////////////////////////////// +// CListCtrl + +class CListCtrl : public CWnd +{ + DECLARE_DYNAMIC(CListCtrl) + +// Constructors +public: + CListCtrl(); + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Attributes + COLORREF GetBkColor(); + BOOL SetBkColor(COLORREF cr); + CImageList* GetImageList(int nImageList); + CImageList* SetImageList(CImageList* pImageList, int nImageList); + int GetItemCount(); + BOOL GetItem(LV_ITEM* pItem); + BOOL SetItem(const LV_ITEM* pItem); + UINT GetCallbackMask(); + BOOL SetCallbackMask(UINT nMask); + int GetNextItem(int nItem, int nFlags); + BOOL GetItemRect(int nItem, LPRECT lpRect, UINT nCode); + BOOL SetItemPosition(int nItem, POINT pt); + BOOL GetItemPosition(int nItem, LPPOINT lpPoint); + int GetStringWidth(LPCTSTR lpsz); + CEdit* GetEditControl(); + BOOL GetColumn(int nCol, LV_COLUMN* pColumn); + BOOL SetColumn(int nCol, const LV_COLUMN* pColumn); + int GetColumnWidth(int nCol); + BOOL SetColumnWidth(int nCol, int cx); + BOOL GetViewRect(LPRECT lpRect); + COLORREF GetTextColor(); + BOOL SetTextColor(COLORREF cr); + COLORREF GetTextBkColor(); + BOOL SetTextBkColor(COLORREF cr); + int GetTopIndex(); + int GetCountPerPage(); + BOOL GetOrigin(LPPOINT lpPoint); + BOOL SetItemState(int nItem, LV_ITEM* pItem); + BOOL SetItemState(int nItem, UINT nState, UINT nMask); + UINT GetItemState(int nItem, UINT nMask); + int GetItemText(int nItem, int nSubItem, LPTSTR lpszText, int nLen); + BOOL SetItemText(int nItem, int nSubItem, LPTSTR lpszText); + void SetItemCount(int nItems); + UINT GetSelectedCount(); + +// Operations + int InsertItem(const LV_ITEM* pItem); + BOOL DeleteItem(int nItem); + BOOL DeleteAllItems(); + int FindItem(int nStart, LV_FINDINFO* pFindInfo); + int HitTest(LV_HITTESTINFO* pHitTestInfo); + int HitTest(CPoint pt, UINT* pFlags); + BOOL EnsureVisible(int nItem, BOOL bPartialOK); + BOOL Scroll(CSize size); + BOOL RedrawItems(int nFirst, int nLast); + BOOL Arrange(UINT nCode); + CEdit* EditLabel(int nItem); + int InsertColumn(int nCol, const LV_COLUMN* pColumn); + BOOL DeleteColumn(int nCol); + CImageList* CreateDragImage(int nItem, LPPOINT lpPoint); + BOOL Update(int nItem); + BOOL SortItems(PFNLVCOMPARE pfnCompare, DWORD dwData); + +// Overridables + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + +// Implementation +public: + virtual ~CListCtrl(); +protected: + void RemoveImageList(int nImageList); + virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*); +protected: + //{{AFX_MSG(CListCtrl) + afx_msg void OnDestroy(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// CTreeCtrl + +class CTreeCtrl : public CWnd +{ + DECLARE_DYNAMIC(CTreeCtrl) + +// Constructors +public: + CTreeCtrl(); + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Attributes + BOOL GetItemRect(HTREEITEM hItem, LPRECT lpRect, BOOL bTextOnly); + UINT GetCount(); + UINT GetIndent(); + BOOL SetIndent(UINT nIndent); + CImageList* GetImageList(UINT nImage); + CImageList* SetImageList(UINT nImage, CImageList* pImageList); + HTREEITEM GetNextItem(HTREEITEM hItem, UINT nCode); + HTREEITEM GetChildItem(HTREEITEM hItem); + HTREEITEM GetNextSiblingItem(HTREEITEM hItem); + HTREEITEM GetPrevSiblingItem(HTREEITEM hItem); + HTREEITEM GetParentItem(HTREEITEM hItem); + HTREEITEM GetFirstVisibleItem(); + HTREEITEM GetNextVisibleItem(HTREEITEM hItem); + HTREEITEM GetPrevVisibleItem(HTREEITEM hItem); + HTREEITEM GetSelectedItem(); + HTREEITEM GetDropHilightItem(); + HTREEITEM GetRootItem(); + BOOL GetItem(TV_ITEM* pItem); + BOOL SetItem(TV_ITEM* pItem); + CEdit* GetEditControl(); + UINT GetVisibleCount(); + +// Operations + HTREEITEM InsertItem(LPTV_INSERTSTRUCT lpInsertStruct); + BOOL DeleteItem(HTREEITEM hItem); + BOOL DeleteAllItems(); + BOOL Expand(HTREEITEM hItem, UINT nCode); + HTREEITEM Select(HTREEITEM hItem, UINT nCode); + HTREEITEM SelectItem(HTREEITEM hItem); + HTREEITEM SelectDropTarget(HTREEITEM hItem); + CEdit* EditLabel(HTREEITEM hItem); + HTREEITEM HitTest(CPoint pt, UINT* pFlags); + HTREEITEM HitTest(TV_HITTESTINFO* pHitTestInfo); + CImageList* CreateDragImage(HTREEITEM hItem); + BOOL SortChildren(HTREEITEM hItem, BOOL bRecurse); + BOOL EnsureVisible(HTREEITEM hItem); + BOOL SortChildrenCB(LPTV_SORTCB pSort, BOOL bRecurse); + +// Implementation +protected: + void RemoveImageList(int nImageList); +public: + virtual ~CTreeCtrl(); + //{{AFX_MSG(CTreeCtrl) + afx_msg void OnDestroy(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// CSpinButtonCtrl + +class CSpinButtonCtrl : public CWnd +{ + DECLARE_DYNAMIC(CSpinButtonCtrl) + +// Constructors +public: + CSpinButtonCtrl(); + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Attributes + BOOL SetAccel(int nAccel, UDACCEL* pAccel); + UINT GetAccel(int nAccel, UDACCEL* pAccel); + int SetBase(int nBase); + UINT GetBase(); + CWnd* SetBuddy(CWnd* pWndBuddy); + CWnd* GetBuddy(); + int SetPos(int nPos); + int GetPos(); + void SetRange(int nLower, int nUpper); + DWORD GetRange(); + void GetRange(int &lower, int& upper); + +// Implementation +public: + virtual ~CSpinButtonCtrl(); +}; + +///////////////////////////////////////////////////////////////////////////// +// CSliderCtrl + +class CSliderCtrl : public CWnd +{ + DECLARE_DYNAMIC(CSliderCtrl) + +// Constructors +public: + CSliderCtrl(); + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Attributes + int GetLineSize(); + int SetLineSize(int nSize); + int GetPageSize(); + int SetPageSize(int nSize); + int GetRangeMax(); + int GetRangeMin(); + void GetRange(int& nMin, int& nMax); + void SetRangeMin(int nMin, BOOL bRedraw = FALSE); + void SetRangeMax(int nMax, BOOL bRedraw = FALSE); + void SetRange(int nMin, int nMax, BOOL bRedraw = FALSE); + void GetSelection(int& nMin, int& nMax); + void SetSelection(int nMin, int nMax); + void GetChannelRect(LPRECT lprc); + void GetThumbRect(LPRECT lprc); + int GetPos(); + void SetPos(int nPos); + UINT GetNumTics(); + DWORD* GetTicArray(); + int GetTic(int nTic); + int GetTicPos(int nTic); + BOOL SetTic(int nTic); + void SetTicFreq(int nFreq); + +// Operations + void ClearSel(BOOL bRedraw = FALSE); + void VerifyPos(); + void ClearTics(BOOL bRedraw = FALSE); + +// Implementation +public: + virtual ~CSliderCtrl(); +}; + +///////////////////////////////////////////////////////////////////////////// +// CProgressCtrl + +class CProgressCtrl : public CWnd +{ + DECLARE_DYNAMIC(CProgressCtrl) + +// Constructors +public: + CProgressCtrl(); + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Attributes + void SetRange(int nLower, int nUpper); + int SetPos(int nPos); + int OffsetPos(int nPos); + int SetStep(int nStep); + +// Operations + int StepIt(); + +// Implementation +public: + virtual ~CProgressCtrl(); +}; + +///////////////////////////////////////////////////////////////////////////// +// CHeaderCtrl + +class CHeaderCtrl : public CWnd +{ + DECLARE_DYNAMIC(CHeaderCtrl) + +// Constructors +public: + CHeaderCtrl(); + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Attributes + int GetItemCount(); + BOOL GetItem(int nPos, HD_ITEM* pHeaderItem); + BOOL SetItem(int nPos, HD_ITEM* pHeaderItem); + +// Operations + int InsertItem(int nPos, HD_ITEM* phdi); + BOOL DeleteItem(int nPos); + BOOL Layout(HD_LAYOUT* pHeaderLayout); + +// Overridables + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + +// Implementation +public: + virtual ~CHeaderCtrl(); +protected: + virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*); + +}; + +///////////////////////////////////////////////////////////////////////////// +// CHotKeyCtrl + +class CHotKeyCtrl : public CWnd +{ + DECLARE_DYNAMIC(CHotKeyCtrl) + +// Constructors +public: + CHotKeyCtrl(); + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Attributes + void SetHotKey(WORD wVirtualKeyCode, WORD wModifiers); + DWORD GetHotKey(); + void GetHotKey(WORD &wVirtualKeyCode, WORD &wModifiers); + +// Operations + void SetRules(WORD wInvalidComb, WORD wModifiers); + +// Implementation +public: + virtual ~CHotKeyCtrl(); +}; + +///////////////////////////////////////////////////////////////////////////// +// CToolTipCtrl + +class CToolTipCtrl : public CWnd +{ + DECLARE_DYNAMIC(CToolTipCtrl) + +// Constructors +public: + CToolTipCtrl(); + BOOL Create(CWnd* pParentWnd); + +// Attributes + void GetText(CString& str, CWnd* pWnd, UINT nIDTool = 0); + BOOL GetToolInfo(LPTOOLINFO lpToolInfo, CWnd* pWnd, UINT nIDTool = 0); + void SetToolInfo(LPTOOLINFO lpToolInfo); + void SetToolRect(CWnd* pWnd, UINT nIDTool, LPCRECT lpRect); + int GetToolCount(); + +// Operations + void Activate(BOOL bActivate); + + BOOL AddTool(CWnd* pWnd, UINT nIDText, LPCRECT lpRectTool = NULL, + UINT nIDTool = 0); + BOOL AddTool(CWnd* pWnd, LPCTSTR lpszText = LPSTR_TEXTCALLBACK, + LPCRECT lpRectTool = NULL, UINT nIDTool = 0); + + void DelTool(CWnd* pWnd, UINT nIDTool = 0); + + BOOL HitTest(CWnd* pWnd, CPoint pt, LPTOOLINFO lpToolInfo); + void RelayEvent(LPMSG lpMsg); + void SetDelayTime(UINT nDelay); + void UpdateTipText(LPCTSTR lpszText, CWnd* pWnd, UINT nIDTool = 0); + void UpdateTipText(UINT nIDText, CWnd* pWnd, UINT nIDTool = 0); + +// Implementation +public: + void FillInToolInfo(TOOLINFO& ti, CWnd* pWnd, UINT nIDTool); + virtual ~CToolTipCtrl(); +}; + +///////////////////////////////////////////////////////////////////////////// +// CTabCtrl + +class CTabCtrl : public CWnd +{ + DECLARE_DYNAMIC(CTabCtrl) + +// Constructors +public: + CTabCtrl(); + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Attributes + COLORREF GetBkColor(); + BOOL SetBkColor(COLORREF cr); + CImageList* GetImageList(); + CImageList* SetImageList(CImageList* pImageList); + int GetItemCount(); + BOOL GetItem(int nItem, TC_ITEM* pTabCtrlItem); + BOOL SetItem(int nItem, TC_ITEM* pTabCtrlItem); + BOOL GetItemRect(int nItem, LPRECT lpRect); + int GetCurSel(); + int SetCurSel(int nItem); + CSize SetItemSize(CSize size); + void SetPadding(CSize size); + int GetRowCount(); + CToolTipCtrl* GetTooltips(); + void SetTooltips(CToolTipCtrl* pWndTip); + int GetCurFocus(); + +// Operations + BOOL InsertItem(int nItem, TC_ITEM* pTabCtrlItem); + BOOL DeleteItem(int nItem); + BOOL DeleteAllItems(); + void AdjustRect(BOOL bLarger, LPRECT lpRect); + void RemoveImage(int nImage); + int HitTest(TC_HITTESTINFO* pHitTestInfo); + +// Overridables + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + +// Implementation +public: + virtual ~CTabCtrl(); +protected: + virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*); + //{{AFX_MSG(CTabCtrl) + afx_msg void OnDestroy(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// CAnimateCtrl + +class CAnimateCtrl : public CWnd +{ + DECLARE_DYNAMIC(CAnimateCtrl) + +// Constructors +public: + CAnimateCtrl(); + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Operations + BOOL Open(LPCTSTR lpszFileName); + BOOL Open(UINT nID); + BOOL Play(UINT nFrom, UINT nTo, UINT nRep); + BOOL Stop(); + BOOL Close(); + BOOL Seek(UINT nTo); + +// Implementation +public: + virtual ~CAnimateCtrl(); +}; + +///////////////////////////////////////////////////////////////////////////// +// CImageList + +class CImageList : public CObject +{ + DECLARE_DYNCREATE(CImageList) + +// Constructors +public: + CImageList(); + BOOL Create(int cx, int cy, BOOL bMask, int nInitial, int nGrow); + BOOL Create(UINT nBitmapID, int cx, int nGrow, COLORREF crMask); + BOOL Create(LPCTSTR lpszBitmapID, int cx, int nGrow, COLORREF crMask); + BOOL Create(CImageList& imagelist1, int nImage1, CImageList& imagelist2, + int nImage2, int dx, int dy); + +// Attributes + HIMAGELIST m_hImageList; // must be first data member + HIMAGELIST GetSafeHandle() const; + + static CImageList* PASCAL FromHandle(HIMAGELIST hImageList); + static CImageList* PASCAL FromHandlePermanent(HIMAGELIST hImageList); + static void PASCAL DeleteTempMap(); + BOOL Attach(HIMAGELIST hImageList); + HIMAGELIST Detach(); + + int GetImageCount(); + COLORREF SetBkColor(COLORREF cr); + COLORREF GetBkColor(); + BOOL GetImageInfo(int nImage, IMAGEINFO* pImageInfo); + +// Operations + BOOL DeleteImageList(); + + int Add(CBitmap* pbmImage, CBitmap* pbmMask); + int Add(CBitmap* pbmImage, COLORREF crMask); + BOOL Remove(int nImage); + BOOL Replace(int nImage, CBitmap* pbmImage, CBitmap* pbmMask); + int Add(HICON hIcon); + int Replace(int nImage, HICON hIcon); + HICON ExtractIcon(int nImage); + BOOL Draw(CDC* pDC, int nImage, POINT pt, UINT nStyle); + BOOL SetOverlayImage(int nImage, int nOverlay); + + BOOL Read(CArchive* pArchive); + BOOL Write(CArchive* pArchive); + +// Drag APIs + BOOL BeginDrag(int nImage, CPoint ptHotSpot); + static void EndDrag(); + static BOOL DragMove(CPoint pt); + BOOL SetDragCursorImage(int nDrag, CPoint ptHotSpot); + static BOOL DragShowNolock(BOOL bShow); + static CImageList* GetDragImage(LPPOINT lpPoint, LPPOINT lpPointHotSpot); + static BOOL DragEnter(CWnd* pWndLock, CPoint point); + static BOOL DragLeave(CWnd* pWndLock); + +// Implementation +public: + virtual ~CImageList(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; + virtual void AssertValid() const; +#endif +}; + +///////////////////////////////////////////////////////////////////////////// +// CToolBarCtrl + +class CToolBarCtrl : public CWnd +{ + DECLARE_DYNAMIC(CToolBarCtrl) +// Construction +public: + CToolBarCtrl(); + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Attributes +public: + BOOL IsButtonEnabled(int nID); + BOOL IsButtonChecked(int nID); + BOOL IsButtonPressed(int nID); + BOOL IsButtonHidden(int nID); + BOOL IsButtonIndeterminate(int nID); + BOOL SetState(int nID, UINT nState); + int GetState(int nID); + BOOL GetButton(int nIndex, LPTBBUTTON lpButton); + int GetButtonCount(); + BOOL GetItemRect(int nIndex, LPRECT lpRect); + void SetButtonStructSize(int nSize); + BOOL SetButtonSize(CSize size); + BOOL SetBitmapSize(CSize size); + CToolTipCtrl* GetToolTips(); + void SetToolTips(CToolTipCtrl* pTip); + void SetOwner(CWnd* pWnd); + void SetRows(int nRows, BOOL bLarger, LPRECT lpRect); + int GetRows(); + BOOL SetCmdID(int nIndex, UINT nID); + UINT GetBitmapFlags(); + +// Operations +public: + BOOL EnableButton(int nID, BOOL bEnable = TRUE); + BOOL CheckButton(int nID, BOOL bCheck = TRUE); + BOOL PressButton(int nID, BOOL bPress = TRUE); + BOOL HideButton(int nID, BOOL bHide = TRUE); + BOOL Indeterminate(int nID, BOOL bIndeterminate = TRUE); + int AddBitmap(int nNumButtons, UINT nBitmapID); + int AddBitmap(int nNumButtons, CBitmap* pBitmap); + BOOL AddButtons(int nNumButtons, LPTBBUTTON lpButtons); + BOOL InsertButton(int nIndex, LPTBBUTTON lpButton); + BOOL DeleteButton(int nIndex); + UINT CommandToIndex(UINT nID); + void SaveState(HKEY hKeyRoot, LPCTSTR lpszSubKey, + LPCTSTR lpszValueName); + void RestoreState(HKEY hKeyRoot, LPCTSTR lpszSubKey, + LPCTSTR lpszValueName); + + void Customize(); + int AddString(UINT nStringID); + int AddStrings(LPCTSTR lpszStrings); + void AutoSize(); + +// Implementation +public: + virtual ~CToolBarCtrl(); + +protected: + //{{AFX_MSG(CToolBarCtrl) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// Inline function declarations + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +#ifdef _AFX_ENABLE_INLINES +#define _AFXCMN_INLINE inline +#include <afxcmn.inl> +#endif + +#undef AFX_DATA +#define AFX_DATA + +#endif //__AFXCMN_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxcmn.inl b/public/sdk/inc/mfc30/afxcmn.inl new file mode 100644 index 000000000..a5bd0ea17 --- /dev/null +++ b/public/sdk/inc/mfc30/afxcmn.inl @@ -0,0 +1,524 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// Inlines for AFXCMN.H + +///////////////////////////////////////////////////////////////////////////// +// main inlines + +#ifdef _AFXCMN_INLINE + +///////////////////////////////////////////////////////////////////////////// + +_AFXCMN_INLINE CToolBarCtrl::CToolBarCtrl() + { } +_AFXCMN_INLINE BOOL CToolBarCtrl::EnableButton(int nID, BOOL bEnable) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ENABLEBUTTON, nID, MAKELPARAM(bEnable, 0)); } +_AFXCMN_INLINE BOOL CToolBarCtrl::CheckButton(int nID, BOOL bCheck) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_CHECKBUTTON, nID, MAKELPARAM(bCheck, 0)); } +_AFXCMN_INLINE BOOL CToolBarCtrl::PressButton(int nID, BOOL bPress) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_PRESSBUTTON, nID, MAKELPARAM(bPress, 0)); } +_AFXCMN_INLINE BOOL CToolBarCtrl::HideButton(int nID, BOOL bHide) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_HIDEBUTTON, nID, MAKELPARAM(bHide, 0)); } +_AFXCMN_INLINE BOOL CToolBarCtrl::Indeterminate(int nID, BOOL bIndeterminate) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_INDETERMINATE, nID, MAKELPARAM(bIndeterminate, 0)); } +_AFXCMN_INLINE BOOL CToolBarCtrl::IsButtonEnabled(int nID) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONENABLED, nID, 0); } +_AFXCMN_INLINE BOOL CToolBarCtrl::IsButtonChecked(int nID) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONCHECKED, nID, 0); } +_AFXCMN_INLINE BOOL CToolBarCtrl::IsButtonPressed(int nID) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONPRESSED, nID, 0); } +_AFXCMN_INLINE BOOL CToolBarCtrl::IsButtonHidden(int nID) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONHIDDEN, nID, 0); } +_AFXCMN_INLINE BOOL CToolBarCtrl::IsButtonIndeterminate(int nID) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ISBUTTONINDETERMINATE, nID, 0); } +_AFXCMN_INLINE BOOL CToolBarCtrl::SetState(int nID, UINT nState) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETSTATE, nID, MAKELPARAM(nState, 0)); } +_AFXCMN_INLINE int CToolBarCtrl::GetState(int nID) + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_GETSTATE, nID, 0L); } +_AFXCMN_INLINE BOOL CToolBarCtrl::AddButtons(int nNumButtons, LPTBBUTTON lpButtons) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_ADDBUTTONS, nNumButtons, (LPARAM)lpButtons); } +_AFXCMN_INLINE BOOL CToolBarCtrl::InsertButton(int nIndex, LPTBBUTTON lpButton) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_INSERTBUTTON, nIndex, (LPARAM)lpButton); } +_AFXCMN_INLINE BOOL CToolBarCtrl::DeleteButton(int nIndex) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_DELETEBUTTON, nIndex, 0); } +_AFXCMN_INLINE BOOL CToolBarCtrl::GetButton(int nIndex, LPTBBUTTON lpButton) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_GETBUTTON, nIndex, (LPARAM)lpButton); } +_AFXCMN_INLINE int CToolBarCtrl::GetButtonCount() + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_BUTTONCOUNT, 0, 0L); } +_AFXCMN_INLINE UINT CToolBarCtrl::CommandToIndex(UINT nID) + { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, TB_COMMANDTOINDEX, nID, 0L); } +_AFXCMN_INLINE void CToolBarCtrl::Customize() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_CUSTOMIZE, 0, 0L); } +// lpszStrings are separated by zeroes, last one is marked by two zeroes +_AFXCMN_INLINE int CToolBarCtrl::AddStrings(LPCTSTR lpszStrings) + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_ADDSTRING, 0, (LPARAM)lpszStrings); } +_AFXCMN_INLINE BOOL CToolBarCtrl::GetItemRect(int nIndex, LPRECT lpRect) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_GETITEMRECT, nIndex, (LPARAM)lpRect); } +_AFXCMN_INLINE void CToolBarCtrl::SetButtonStructSize(int nSize) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_BUTTONSTRUCTSIZE, nSize, 0L); } +_AFXCMN_INLINE BOOL CToolBarCtrl::SetButtonSize(CSize size) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETBUTTONSIZE, 0, MAKELPARAM(size.cx, size.cy)); } +_AFXCMN_INLINE BOOL CToolBarCtrl::SetBitmapSize(CSize size) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETBITMAPSIZE, 0, MAKELPARAM(size.cx, size.cy)); } +_AFXCMN_INLINE void CToolBarCtrl::AutoSize() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_AUTOSIZE, 0, 0L); } +_AFXCMN_INLINE CToolTipCtrl* CToolBarCtrl::GetToolTips() + { ASSERT(::IsWindow(m_hWnd)); return (CToolTipCtrl*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, TB_GETTOOLTIPS, 0, 0L)); } +_AFXCMN_INLINE void CToolBarCtrl::SetToolTips(CToolTipCtrl* pTip) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETTOOLTIPS, (WPARAM)pTip->m_hWnd, 0L); } +_AFXCMN_INLINE void CToolBarCtrl::SetOwner(CWnd* pWnd) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETPARENT, (WPARAM)pWnd->m_hWnd, 0L); } +_AFXCMN_INLINE void CToolBarCtrl::SetRows(int nRows, BOOL bLarger, LPRECT lpRect) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TB_SETROWS, MAKELPARAM(nRows, bLarger), (LPARAM)lpRect); } +_AFXCMN_INLINE int CToolBarCtrl::GetRows() + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TB_GETROWS, 0, 0L); } +_AFXCMN_INLINE BOOL CToolBarCtrl::SetCmdID(int nIndex, UINT nID) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, TB_SETCMDID, nIndex, nID); } +_AFXCMN_INLINE UINT CToolBarCtrl::GetBitmapFlags() + { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, TB_GETBITMAPFLAGS, 0, 0L); } + +///////////////////////////////////////////////////////////////////////////// + +_AFXCMN_INLINE CStatusBarCtrl::CStatusBarCtrl() + { } +_AFXCMN_INLINE BOOL CStatusBarCtrl::SetText(LPCTSTR lpszText, int nPane, int nType) + { ASSERT(::IsWindow(m_hWnd)); ASSERT(nPane < 256); return (BOOL) ::SendMessage(m_hWnd, SB_SETTEXT, (nPane|nType), (LPARAM)lpszText); } +_AFXCMN_INLINE BOOL CStatusBarCtrl::SetParts(int nParts, int* pWidths) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, SB_SETPARTS, nParts, (LPARAM)pWidths); } +_AFXCMN_INLINE BOOL CStatusBarCtrl::SetBorders(int* pBorders) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, SB_SETPARTS, 0, (LPARAM)pBorders); } +_AFXCMN_INLINE int CStatusBarCtrl::GetParts(int nParts, int* pParts) + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, SB_GETPARTS, nParts, (LPARAM)pParts); } +_AFXCMN_INLINE BOOL CStatusBarCtrl::GetBorders(int* pBorders) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, SB_GETBORDERS, 0, (LPARAM)pBorders); } +_AFXCMN_INLINE void CStatusBarCtrl::SetMinHeight(int nMin) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, SB_SETMINHEIGHT, nMin, 0L); } +_AFXCMN_INLINE BOOL CStatusBarCtrl::SetSimple(BOOL bSimple) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, SB_SIMPLE, bSimple, 0L); } +_AFXCMN_INLINE BOOL CStatusBarCtrl::GetRect(int nPane, LPRECT lpRect) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, SB_GETRECT, nPane, (LPARAM)lpRect); } + +///////////////////////////////////////////////////////////////////////////// + +_AFXCMN_INLINE CListCtrl::CListCtrl() + { } +_AFXCMN_INLINE COLORREF CListCtrl::GetBkColor() + { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, LVM_GETBKCOLOR, 0, 0L); } +_AFXCMN_INLINE BOOL CListCtrl::SetBkColor(COLORREF cr) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETBKCOLOR, 0, cr); } +_AFXCMN_INLINE CImageList* CListCtrl::GetImageList(int nImageList) + { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, LVM_GETIMAGELIST, nImageList, 0L)); } +_AFXCMN_INLINE CImageList* CListCtrl::SetImageList(CImageList* pImageList, int nImageList) + { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, LVM_SETIMAGELIST, nImageList, (LPARAM)pImageList->GetSafeHandle())); } +_AFXCMN_INLINE int CListCtrl::GetItemCount() + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_GETITEMCOUNT, 0, 0L); } +_AFXCMN_INLINE BOOL CListCtrl::GetItem(LV_ITEM* pItem) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_GETITEM, 0, (LPARAM)pItem); } +_AFXCMN_INLINE BOOL CListCtrl::SetItem(const LV_ITEM* pItem) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETITEM, 0, (LPARAM)pItem); } +_AFXCMN_INLINE int CListCtrl::InsertItem(const LV_ITEM* pItem) + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_INSERTITEM, 0, (LPARAM)pItem); } +_AFXCMN_INLINE BOOL CListCtrl::DeleteItem(int nItem) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_DELETEITEM, nItem, 0L); } +_AFXCMN_INLINE BOOL CListCtrl::DeleteAllItems() + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_DELETEALLITEMS, 0, 0L); } +_AFXCMN_INLINE UINT CListCtrl::GetCallbackMask() + { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, LVM_GETCALLBACKMASK, 0, 0); } +_AFXCMN_INLINE BOOL CListCtrl::SetCallbackMask(UINT nMask) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETCALLBACKMASK, nMask, 0); } +_AFXCMN_INLINE int CListCtrl::GetNextItem(int nItem, int nFlags) + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_GETNEXTITEM, nItem, MAKELPARAM(nFlags, 0)); } +_AFXCMN_INLINE int CListCtrl::FindItem(int nStart, LV_FINDINFO* pFindInfo) + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_FINDITEM, nStart, (LPARAM)pFindInfo); } +_AFXCMN_INLINE int CListCtrl::HitTest(LV_HITTESTINFO* pHitTestInfo) + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_HITTEST, 0, (LPARAM)pHitTestInfo); } +_AFXCMN_INLINE BOOL CListCtrl::SetItemPosition(int nItem, POINT pt) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETITEMPOSITION32, nItem, (LPARAM)&pt); } +_AFXCMN_INLINE BOOL CListCtrl::GetItemPosition(int nItem, LPPOINT lpPoint) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_GETITEMPOSITION, nItem, (LPARAM)lpPoint); } +_AFXCMN_INLINE int CListCtrl::GetStringWidth(LPCTSTR lpsz) + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_GETSTRINGWIDTH, 0, (LPARAM)lpsz); } +_AFXCMN_INLINE BOOL CListCtrl::EnsureVisible(int nItem, BOOL bPartialOK) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_ENSUREVISIBLE, nItem, MAKELPARAM(bPartialOK, 0)); } +_AFXCMN_INLINE BOOL CListCtrl::Scroll(CSize size) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SCROLL, 0, MAKELPARAM(size.cx, size.cy)); } +_AFXCMN_INLINE BOOL CListCtrl::RedrawItems(int nFirst, int nLast) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_REDRAWITEMS, 0, MAKELPARAM(nFirst, nLast)); } +_AFXCMN_INLINE BOOL CListCtrl::Arrange(UINT nCode) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_ARRANGE, nCode, 0L); } +_AFXCMN_INLINE CEdit* CListCtrl::EditLabel(int nItem) + { ASSERT(::IsWindow(m_hWnd)); return (CEdit*)CWnd::FromHandle( (HWND)::SendMessage(m_hWnd, LVM_EDITLABEL, nItem, 0L)); } +_AFXCMN_INLINE CEdit* CListCtrl::GetEditControl() + { ASSERT(::IsWindow(m_hWnd)); return (CEdit*)CWnd::FromHandle( (HWND)::SendMessage(m_hWnd, LVM_GETEDITCONTROL, 0, 0L)); } +_AFXCMN_INLINE BOOL CListCtrl::GetColumn(int nCol, LV_COLUMN* pColumn) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_GETCOLUMN, nCol, (LPARAM)pColumn); } +_AFXCMN_INLINE BOOL CListCtrl::SetColumn(int nCol, const LV_COLUMN* pColumn) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETCOLUMN, nCol, (LPARAM)pColumn); } +_AFXCMN_INLINE int CListCtrl::InsertColumn(int nCol, const LV_COLUMN* pColumn) + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_INSERTCOLUMN, nCol, (LPARAM)pColumn); } +_AFXCMN_INLINE BOOL CListCtrl::DeleteColumn(int nCol) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_DELETECOLUMN, nCol, 0); } +_AFXCMN_INLINE int CListCtrl::GetColumnWidth(int nCol) + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_GETCOLUMNWIDTH, nCol, 0); } +_AFXCMN_INLINE BOOL CListCtrl::SetColumnWidth(int nCol, int cx) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETCOLUMNWIDTH, nCol, MAKELPARAM(cx, 0)); } +_AFXCMN_INLINE CImageList* CListCtrl::CreateDragImage(int nItem, LPPOINT lpPoint) + { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST) ::SendMessage(m_hWnd, LVM_CREATEDRAGIMAGE, nItem, (LPARAM)lpPoint)); } +_AFXCMN_INLINE BOOL CListCtrl::GetViewRect(LPRECT lpRect) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_GETVIEWRECT, 0, (LPARAM)lpRect); } +_AFXCMN_INLINE COLORREF CListCtrl::GetTextColor() + { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, LVM_GETTEXTCOLOR, 0, 0L); } +_AFXCMN_INLINE BOOL CListCtrl::SetTextColor(COLORREF cr) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETTEXTCOLOR, 0, cr); } +_AFXCMN_INLINE COLORREF CListCtrl::GetTextBkColor() + { ASSERT(::IsWindow(m_hWnd)); return (COLORREF) ::SendMessage(m_hWnd, LVM_GETTEXTBKCOLOR, 0, 0L); } +_AFXCMN_INLINE BOOL CListCtrl::SetTextBkColor(COLORREF cr) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETTEXTBKCOLOR, 0, cr); } +_AFXCMN_INLINE int CListCtrl::GetTopIndex() + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_GETTOPINDEX, 0, 0); } +_AFXCMN_INLINE int CListCtrl::GetCountPerPage() + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_GETCOUNTPERPAGE, 0, 0); } +_AFXCMN_INLINE BOOL CListCtrl::GetOrigin(LPPOINT lpPoint) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_GETORIGIN, 0, (LPARAM)lpPoint); } +_AFXCMN_INLINE BOOL CListCtrl::Update(int nItem) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_UPDATE, nItem, 0L); } +_AFXCMN_INLINE BOOL CListCtrl::SetItemState(int nItem, LV_ITEM* pItem) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETITEMSTATE, nItem, (LPARAM)pItem); } +_AFXCMN_INLINE UINT CListCtrl::GetItemState(int nItem, UINT nMask) + { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, LVM_GETITEMSTATE, nItem, nMask); } +_AFXCMN_INLINE void CListCtrl::SetItemCount(int nItems) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, LVM_SETITEMCOUNT, nItems, 0); } +_AFXCMN_INLINE BOOL CListCtrl::SortItems(PFNLVCOMPARE pfnCompare, DWORD dwData) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SORTITEMS, dwData, (LPARAM)pfnCompare); } +_AFXCMN_INLINE UINT CListCtrl::GetSelectedCount() + { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, LVM_GETSELECTEDCOUNT, 0, 0L); } + +///////////////////////////////////////////////////////////////////////////// + +_AFXCMN_INLINE CTreeCtrl::CTreeCtrl() + { } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::InsertItem(LPTV_INSERTSTRUCT lpInsertStruct) + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_INSERTITEM, 0, (LPARAM)lpInsertStruct); } +_AFXCMN_INLINE BOOL CTreeCtrl::DeleteItem(HTREEITEM hItem) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_DELETEITEM, 0, (LPARAM)hItem); } +#pragma warning(disable: 4310) +_AFXCMN_INLINE BOOL CTreeCtrl::DeleteAllItems() + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT); } +#pragma warning(default: 4310) +_AFXCMN_INLINE BOOL CTreeCtrl::Expand(HTREEITEM hItem, UINT nCode) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_EXPAND, nCode, (LPARAM)hItem); } +_AFXCMN_INLINE UINT CTreeCtrl::GetCount() + { ASSERT(::IsWindow(m_hWnd)); return (UINT)::SendMessage(m_hWnd, TVM_GETCOUNT, 0, 0); } +_AFXCMN_INLINE UINT CTreeCtrl::GetIndent() + { ASSERT(::IsWindow(m_hWnd)); return (UINT)::SendMessage(m_hWnd, TVM_GETINDENT, 0, 0); } +_AFXCMN_INLINE BOOL CTreeCtrl::SetIndent(UINT nIndent) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_SETINDENT, nIndent, 0); } +_AFXCMN_INLINE CImageList* CTreeCtrl::GetImageList(UINT nImage) + { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST)::SendMessage(m_hWnd, TVM_GETIMAGELIST, (UINT)nImage, 0)); } +_AFXCMN_INLINE CImageList* CTreeCtrl::SetImageList(UINT nImage, CImageList* pImageList) + { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST)::SendMessage(m_hWnd, TVM_SETIMAGELIST, (UINT)nImage, (LPARAM)pImageList->GetSafeHandle())); } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::GetNextItem(HTREEITEM hItem, UINT nCode) + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, nCode, (LPARAM)hItem); } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::GetChildItem(HTREEITEM hItem) + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)hItem); } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::GetNextSiblingItem(HTREEITEM hItem) + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)hItem); } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::GetPrevSiblingItem(HTREEITEM hItem) + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUS, (LPARAM)hItem); } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::GetParentItem(HTREEITEM hItem) + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)hItem); } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::GetFirstVisibleItem() + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_FIRSTVISIBLE, 0); } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::GetNextVisibleItem(HTREEITEM hItem) + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_NEXTVISIBLE, (LPARAM)hItem); } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::GetPrevVisibleItem(HTREEITEM hItem) + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_PREVIOUSVISIBLE, (LPARAM)hItem); } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::GetSelectedItem() + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_CARET, 0); } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::GetDropHilightItem() + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_DROPHILITE, 0); } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::GetRootItem() + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_GETNEXTITEM, TVGN_ROOT, 0); } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::Select(HTREEITEM hItem, UINT nCode) + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_SELECTITEM, nCode, (LPARAM)hItem); } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::SelectItem(HTREEITEM hItem) + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hItem); } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::SelectDropTarget(HTREEITEM hItem) + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_SELECTITEM, TVGN_DROPHILITE, (LPARAM)hItem); } +_AFXCMN_INLINE BOOL CTreeCtrl::GetItem(TV_ITEM* pItem) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_GETITEM, 0, (LPARAM)pItem); } +_AFXCMN_INLINE BOOL CTreeCtrl::SetItem(TV_ITEM* pItem) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_SETITEM, 0, (LPARAM)pItem); } +_AFXCMN_INLINE CEdit* CTreeCtrl::EditLabel(HTREEITEM hItem) + { ASSERT(::IsWindow(m_hWnd)); return (CEdit*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, TVM_EDITLABEL, 0, (LPARAM)hItem)); } +_AFXCMN_INLINE HTREEITEM CTreeCtrl::HitTest(TV_HITTESTINFO* pHitTestInfo) + { ASSERT(::IsWindow(m_hWnd)); return (HTREEITEM)::SendMessage(m_hWnd, TVM_HITTEST, 0, (LPARAM)pHitTestInfo); } +_AFXCMN_INLINE CEdit* CTreeCtrl::GetEditControl() + { ASSERT(::IsWindow(m_hWnd)); return (CEdit*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, TVM_GETEDITCONTROL, 0, 0)); } +_AFXCMN_INLINE UINT CTreeCtrl::GetVisibleCount() + { ASSERT(::IsWindow(m_hWnd)); return (UINT)::SendMessage(m_hWnd, TVM_GETVISIBLECOUNT, 0, 0); } +_AFXCMN_INLINE CImageList* CTreeCtrl::CreateDragImage(HTREEITEM hItem) + { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST)::SendMessage(m_hWnd, TVM_CREATEDRAGIMAGE, 0, (LPARAM)hItem)); } +_AFXCMN_INLINE BOOL CTreeCtrl::SortChildren(HTREEITEM hItem, BOOL bRecurse) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_SORTCHILDREN, bRecurse, (LPARAM)hItem); } +_AFXCMN_INLINE BOOL CTreeCtrl::EnsureVisible(HTREEITEM hItem) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_ENSUREVISIBLE, 0, (LPARAM)hItem); } +_AFXCMN_INLINE BOOL CTreeCtrl::SortChildrenCB(LPTV_SORTCB pSort, BOOL bRecurse) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TVM_SORTCHILDRENCB, bRecurse, (LPARAM)pSort); } + +///////////////////////////////////////////////////////////////////////////// + +_AFXCMN_INLINE CHotKeyCtrl::CHotKeyCtrl() + { } +_AFXCMN_INLINE void CHotKeyCtrl::SetHotKey(WORD wVirtualKeyCode, WORD wModifiers) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, HKM_SETHOTKEY, MAKEWPARAM(wVirtualKeyCode, wModifiers), 0L); } +_AFXCMN_INLINE DWORD CHotKeyCtrl::GetHotKey() + { ASSERT(::IsWindow(m_hWnd)); return ::SendMessage(m_hWnd, HKM_GETHOTKEY, 0, 0L); } +_AFXCMN_INLINE void CHotKeyCtrl::SetRules(WORD wInvalidComb, WORD wModifiers) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, HKM_SETRULES, wInvalidComb, MAKELPARAM(wModifiers, 0)); } + +///////////////////////////////////////////////////////////////////////////// + +_AFXCMN_INLINE CToolTipCtrl::CToolTipCtrl() + { } +_AFXCMN_INLINE void CToolTipCtrl::Activate(BOOL bActivate) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TTM_ACTIVATE, bActivate, 0L); } +_AFXCMN_INLINE void CToolTipCtrl::SetToolInfo(LPTOOLINFO lpToolInfo) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TTM_SETTOOLINFO, 0, (LPARAM)lpToolInfo); } +_AFXCMN_INLINE void CToolTipCtrl::RelayEvent(LPMSG lpMsg) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TTM_RELAYEVENT, 0, (LPARAM)lpMsg); } +_AFXCMN_INLINE void CToolTipCtrl::SetDelayTime(UINT nDelay) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TTM_SETDELAYTIME, 0, nDelay); } +_AFXCMN_INLINE int CToolTipCtrl::GetToolCount() + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TTM_GETTOOLCOUNT, 0, 0L); } + +///////////////////////////////////////////////////////////////////////////// + +_AFXCMN_INLINE CSpinButtonCtrl::CSpinButtonCtrl() + { } +_AFXCMN_INLINE UINT CSpinButtonCtrl::GetAccel(int nAccel, UDACCEL* pAccel) + { ASSERT(::IsWindow(m_hWnd)); return (UINT) LOWORD(::SendMessage(m_hWnd, UDM_GETACCEL, nAccel, (LPARAM)pAccel)); } +_AFXCMN_INLINE UINT CSpinButtonCtrl::GetBase() + { ASSERT(::IsWindow(m_hWnd)); return (UINT) LOWORD(::SendMessage(m_hWnd, UDM_GETBASE, 0, 0l)); } +_AFXCMN_INLINE CWnd* CSpinButtonCtrl::GetBuddy() + { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle((HWND) ::SendMessage(m_hWnd, UDM_GETBUDDY, 0, 0l)); } +_AFXCMN_INLINE int CSpinButtonCtrl::GetPos() + { ASSERT(::IsWindow(m_hWnd)); return (int) LOWORD(::SendMessage(m_hWnd, UDM_GETPOS, 0, 0l)); } +_AFXCMN_INLINE DWORD CSpinButtonCtrl::GetRange() + { ASSERT(::IsWindow(m_hWnd)); return (DWORD) ::SendMessage(m_hWnd, UDM_GETRANGE, 0, 0l); } +_AFXCMN_INLINE BOOL CSpinButtonCtrl::SetAccel(int nAccel, UDACCEL* pAccel) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL) LOWORD(::SendMessage(m_hWnd, UDM_SETACCEL, nAccel, (LPARAM)pAccel)); } +_AFXCMN_INLINE int CSpinButtonCtrl::SetBase(int nBase) + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, UDM_SETBASE, nBase, 0L); } +_AFXCMN_INLINE CWnd* CSpinButtonCtrl::SetBuddy(CWnd* pWndBuddy) + { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle((HWND) ::SendMessage(m_hWnd, UDM_SETBUDDY, (WPARAM)pWndBuddy->m_hWnd, 0L)); } +_AFXCMN_INLINE int CSpinButtonCtrl::SetPos(int nPos) + { ASSERT(::IsWindow(m_hWnd)); return (int) (short) LOWORD(::SendMessage(m_hWnd, UDM_SETPOS, 0, MAKELPARAM(nPos, 0))); } +_AFXCMN_INLINE void CSpinButtonCtrl::SetRange(int nLower, int nUpper) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, UDM_SETRANGE, 0, MAKELPARAM(nUpper, nLower)); } + +///////////////////////////////////////////////////////////////////////////// + +_AFXCMN_INLINE CSliderCtrl::CSliderCtrl() + { } +_AFXCMN_INLINE int CSliderCtrl::GetLineSize() + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_GETLINESIZE, 0, 0l); } +_AFXCMN_INLINE int CSliderCtrl::SetLineSize(int nSize) + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_SETLINESIZE, 0, nSize); } +_AFXCMN_INLINE int CSliderCtrl::GetPageSize() + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_GETPAGESIZE, 0, 0l); } +_AFXCMN_INLINE int CSliderCtrl::SetPageSize(int nSize) + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_SETPAGESIZE, 0, nSize); } +_AFXCMN_INLINE int CSliderCtrl::GetRangeMax() + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_GETRANGEMAX, 0, 0l); } +_AFXCMN_INLINE int CSliderCtrl::GetRangeMin() + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_GETRANGEMIN, 0, 0l); } +_AFXCMN_INLINE void CSliderCtrl::SetRangeMin(int nMin, BOOL bRedraw) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_SETRANGEMIN, bRedraw, nMin); } +_AFXCMN_INLINE void CSliderCtrl::SetRangeMax(int nMax, BOOL bRedraw) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_SETRANGEMAX, bRedraw, nMax); } +_AFXCMN_INLINE void CSliderCtrl::ClearSel(BOOL bRedraw) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_CLEARSEL, bRedraw, 0l); } +_AFXCMN_INLINE void CSliderCtrl::GetChannelRect(LPRECT lprc) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_GETCHANNELRECT, 0, (LPARAM)lprc); } +_AFXCMN_INLINE void CSliderCtrl::GetThumbRect(LPRECT lprc) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_GETTHUMBRECT, 0, (LPARAM)lprc); } +_AFXCMN_INLINE int CSliderCtrl::GetPos() + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_GETPOS, 0, 0l); } +_AFXCMN_INLINE void CSliderCtrl::SetPos(int nPos) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_SETPOS, TRUE, nPos); } +_AFXCMN_INLINE void CSliderCtrl::VerifyPos() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_SETPOS, FALSE, 0L); } +_AFXCMN_INLINE void CSliderCtrl::ClearTics(BOOL bRedraw) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_CLEARTICS, bRedraw, 0l); } +_AFXCMN_INLINE UINT CSliderCtrl::GetNumTics() + { ASSERT(::IsWindow(m_hWnd)); return (UINT) ::SendMessage(m_hWnd, TBM_GETNUMTICS, 0, 0l); } +_AFXCMN_INLINE DWORD* CSliderCtrl::GetTicArray() + { ASSERT(::IsWindow(m_hWnd)); return (DWORD*) ::SendMessage(m_hWnd, TBM_GETPTICS, 0, 0l); } +_AFXCMN_INLINE int CSliderCtrl::GetTic(int nTic) + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_GETTIC, nTic, 0L); } +_AFXCMN_INLINE int CSliderCtrl::GetTicPos(int nTic) + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, TBM_GETTICPOS, nTic, 0L); } +_AFXCMN_INLINE BOOL CSliderCtrl::SetTic(int nTic) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TBM_SETTIC, 0, nTic); } +_AFXCMN_INLINE void CSliderCtrl::SetTicFreq(int nFreq) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TBM_SETTICFREQ, nFreq, 0L); } + +///////////////////////////////////////////////////////////////////////////// + +_AFXCMN_INLINE CProgressCtrl::CProgressCtrl() + { } +_AFXCMN_INLINE void CProgressCtrl::SetRange(int nLower, int nUpper) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, PBM_SETRANGE, 0, MAKELPARAM(nLower, nUpper)); } +_AFXCMN_INLINE int CProgressCtrl::SetPos(int nPos) + { ASSERT(::IsWindow(m_hWnd)); return (int) LOWORD(::SendMessage(m_hWnd, PBM_SETPOS, nPos, 0L)); } +_AFXCMN_INLINE int CProgressCtrl::OffsetPos(int nPos) + { ASSERT(::IsWindow(m_hWnd)); return (int) LOWORD(::SendMessage(m_hWnd, PBM_DELTAPOS, nPos, 0L)); } +_AFXCMN_INLINE int CProgressCtrl::SetStep(int nStep) + { ASSERT(::IsWindow(m_hWnd)); return (int) LOWORD(::SendMessage(m_hWnd, PBM_SETSTEP, nStep, 0L)); } +_AFXCMN_INLINE int CProgressCtrl::StepIt() + { ASSERT(::IsWindow(m_hWnd)); return (int) LOWORD(::SendMessage(m_hWnd, PBM_STEPIT, 0, 0L)); } + +///////////////////////////////////////////////////////////////////////////// + +_AFXCMN_INLINE CHeaderCtrl::CHeaderCtrl() + { } +_AFXCMN_INLINE int CHeaderCtrl::GetItemCount() + { ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, HDM_GETITEMCOUNT, 0, 0L); } +_AFXCMN_INLINE int CHeaderCtrl::InsertItem(int nPos, HD_ITEM* phdi) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, HDM_INSERTITEM, nPos, (LPARAM)phdi); } +_AFXCMN_INLINE BOOL CHeaderCtrl::DeleteItem(int nPos) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, HDM_DELETEITEM, nPos, 0L); } +_AFXCMN_INLINE BOOL CHeaderCtrl::GetItem(int nPos, HD_ITEM* pHeaderItem) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, HDM_GETITEM, nPos, (LPARAM)pHeaderItem); } +_AFXCMN_INLINE BOOL CHeaderCtrl::SetItem(int nPos, HD_ITEM* pHeaderItem) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, HDM_SETITEM, nPos, (LPARAM)pHeaderItem); } +_AFXCMN_INLINE BOOL CHeaderCtrl::Layout(HD_LAYOUT* pHeaderLayout) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, HDM_LAYOUT, 0, (LPARAM)pHeaderLayout); } + +///////////////////////////////////////////////////////////////////////////// + +_AFXCMN_INLINE HIMAGELIST CImageList::GetSafeHandle() const + { return (this == NULL) ? NULL : m_hImageList; } +_AFXCMN_INLINE int CImageList::GetImageCount() + { ASSERT(m_hImageList != NULL); return ImageList_GetImageCount(m_hImageList); } +_AFXCMN_INLINE int CImageList::Add(CBitmap* pbmImage, CBitmap* pbmMask) + { ASSERT(m_hImageList != NULL); return ImageList_Add(m_hImageList, (HBITMAP)pbmImage->GetSafeHandle(), (HBITMAP)pbmMask->GetSafeHandle()); } +_AFXCMN_INLINE int CImageList::Add(CBitmap* pbmImage, COLORREF crMask) + { ASSERT(m_hImageList != NULL); return ImageList_AddMasked(m_hImageList, (HBITMAP)pbmImage->GetSafeHandle(), crMask); } +_AFXCMN_INLINE BOOL CImageList::Remove(int nImage) + { ASSERT(m_hImageList != NULL); return ImageList_Remove(m_hImageList, nImage); } +_AFXCMN_INLINE BOOL CImageList::Replace(int nImage, CBitmap* pbmImage, CBitmap* pbmMask) + { ASSERT(m_hImageList != NULL); return ImageList_Replace(m_hImageList, nImage, (HBITMAP)pbmImage->GetSafeHandle(), (HBITMAP)pbmMask->GetSafeHandle()); } +_AFXCMN_INLINE int CImageList::Add(HICON hIcon) + { ASSERT(m_hImageList != NULL); return ImageList_AddIcon(m_hImageList, hIcon); } +_AFXCMN_INLINE int CImageList::Replace(int nImage, HICON hIcon) + { ASSERT(m_hImageList != NULL); return ImageList_ReplaceIcon(m_hImageList, nImage, hIcon); } +_AFXCMN_INLINE HICON CImageList::ExtractIcon(int nImage) + { ASSERT(m_hImageList != NULL); return ImageList_ExtractIcon(NULL, m_hImageList, nImage); } +_AFXCMN_INLINE BOOL CImageList::Draw(CDC* pDC, int nImage, POINT pt, UINT nStyle) + { ASSERT(m_hImageList != NULL); ASSERT(pDC != NULL); return ImageList_Draw(m_hImageList, nImage, pDC->GetSafeHdc(), pt.x, pt.y, nStyle); } +_AFXCMN_INLINE COLORREF CImageList::SetBkColor(COLORREF cr) + { ASSERT(m_hImageList != NULL); return ImageList_SetBkColor(m_hImageList, cr); } +_AFXCMN_INLINE COLORREF CImageList::GetBkColor() + { ASSERT(m_hImageList != NULL); return ImageList_GetBkColor(m_hImageList); } +_AFXCMN_INLINE BOOL CImageList::SetOverlayImage(int nImage, int nOverlay) + { ASSERT(m_hImageList != NULL); return ImageList_SetOverlayImage(m_hImageList, nImage, nOverlay); } +_AFXCMN_INLINE BOOL CImageList::GetImageInfo(int nImage, IMAGEINFO* pImageInfo) + { ASSERT(m_hImageList != NULL); return ImageList_GetImageInfo(m_hImageList, nImage, pImageInfo); } +_AFXCMN_INLINE BOOL CImageList::BeginDrag(int nImage, CPoint ptHotSpot) + { ASSERT(m_hImageList != NULL); return ImageList_BeginDrag(m_hImageList, nImage, ptHotSpot.x, ptHotSpot.y); } +_AFXCMN_INLINE void CImageList::EndDrag() + { ImageList_EndDrag(); } +_AFXCMN_INLINE BOOL CImageList::DragMove(CPoint pt) + { return ImageList_DragMove(pt.x, pt.y); } +_AFXCMN_INLINE BOOL CImageList::SetDragCursorImage(int nDrag, CPoint ptHotSpot) + { ASSERT(m_hImageList != NULL); return ImageList_SetDragCursorImage(m_hImageList, nDrag, ptHotSpot.x, ptHotSpot.y); } +_AFXCMN_INLINE BOOL CImageList::DragShowNolock(BOOL bShow) + {return ImageList_DragShowNolock(bShow);} +_AFXCMN_INLINE CImageList* CImageList::GetDragImage(LPPOINT lpPoint, LPPOINT lpPointHotSpot) + {return CImageList::FromHandle(ImageList_GetDragImage(lpPoint, lpPointHotSpot));} +_AFXCMN_INLINE BOOL CImageList::DragEnter(CWnd* pWndLock, CPoint point) + { return ImageList_DragEnter(pWndLock->m_hWnd, point.x, point.y); } +_AFXCMN_INLINE BOOL CImageList::DragLeave(CWnd* pWndLock) + { return ImageList_DragLeave(pWndLock->m_hWnd); } + +///////////////////////////////////////////////////////////////////////////// + +_AFXCMN_INLINE CTabCtrl::CTabCtrl() + { } +_AFXCMN_INLINE COLORREF CTabCtrl::GetBkColor() + { ASSERT(::IsWindow(m_hWnd)); return (COLORREF)::SendMessage(m_hWnd, TCM_GETBKCOLOR, 0, 0L); } +_AFXCMN_INLINE BOOL CTabCtrl::SetBkColor(COLORREF cr) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_SETBKCOLOR, 0, cr); } +_AFXCMN_INLINE CImageList* CTabCtrl::GetImageList() + { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST)::SendMessage(m_hWnd, TCM_GETIMAGELIST, 0, 0L)); } +_AFXCMN_INLINE CImageList* CTabCtrl::SetImageList(CImageList* pImageList) + { ASSERT(::IsWindow(m_hWnd)); return CImageList::FromHandle((HIMAGELIST)::SendMessage(m_hWnd, TCM_SETIMAGELIST, 0, (LPARAM)pImageList->GetSafeHandle())); } +_AFXCMN_INLINE int CTabCtrl::GetItemCount() + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TCM_GETITEMCOUNT, 0, 0L); } +_AFXCMN_INLINE BOOL CTabCtrl::GetItem(int nItem, TC_ITEM* pTabCtrlItem) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_GETITEM, nItem, (LPARAM)pTabCtrlItem); } +_AFXCMN_INLINE BOOL CTabCtrl::SetItem(int nItem, TC_ITEM* pTabCtrlItem) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_SETITEM, nItem, (LPARAM)pTabCtrlItem); } +_AFXCMN_INLINE BOOL CTabCtrl::InsertItem(int nItem, TC_ITEM* pTabCtrlItem) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_INSERTITEM, nItem, (LPARAM)pTabCtrlItem); } +_AFXCMN_INLINE BOOL CTabCtrl::DeleteItem(int nItem) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_DELETEITEM, nItem, 0L); } +_AFXCMN_INLINE BOOL CTabCtrl::DeleteAllItems() + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_DELETEALLITEMS, 0, 0L); } +_AFXCMN_INLINE BOOL CTabCtrl::GetItemRect(int nItem, LPRECT lpRect) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, TCM_GETITEMRECT, nItem, (LPARAM)lpRect); } +_AFXCMN_INLINE int CTabCtrl::GetCurSel() + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TCM_GETCURSEL, 0, 0L); } +_AFXCMN_INLINE int CTabCtrl::SetCurSel(int nItem) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TCM_SETCURSEL, nItem, 0L); } +_AFXCMN_INLINE int CTabCtrl::HitTest(TC_HITTESTINFO* pHitTestInfo) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TCM_HITTEST, 0, (LPARAM) pHitTestInfo); } +_AFXCMN_INLINE void CTabCtrl::AdjustRect(BOOL bLarger, LPRECT lpRect) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TCM_ADJUSTRECT, bLarger, (LPARAM)lpRect); } +_AFXCMN_INLINE CSize CTabCtrl::SetItemSize(CSize size) + { ASSERT(::IsWindow(m_hWnd)); return (CSize)::SendMessage(m_hWnd, TCM_SETITEMSIZE, 0, MAKELPARAM(size.cx,size.cy)); } +_AFXCMN_INLINE void CTabCtrl::RemoveImage(int nImage) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TCM_REMOVEIMAGE, nImage, 0L); } +_AFXCMN_INLINE void CTabCtrl::SetPadding(CSize size) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TCM_SETPADDING, 0, MAKELPARAM(size.cx, size.cy)); } +_AFXCMN_INLINE int CTabCtrl::GetRowCount() + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TCM_GETROWCOUNT, 0, 0L); } +_AFXCMN_INLINE CToolTipCtrl* CTabCtrl::GetTooltips() + { ASSERT(::IsWindow(m_hWnd)); return (CToolTipCtrl*)CWnd::FromHandle((HWND)::SendMessage(m_hWnd, TCM_GETTOOLTIPS, 0, 0L)); } +_AFXCMN_INLINE void CTabCtrl::SetTooltips(CToolTipCtrl* pWndTip) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, TCM_SETTOOLTIPS, (WPARAM)pWndTip->m_hWnd, 0L); } +_AFXCMN_INLINE int CTabCtrl::GetCurFocus() + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, TCM_GETCURFOCUS, 0, 0L); } + +///////////////////////////////////////////////////////////////////////////// + +_AFXCMN_INLINE CAnimateCtrl::CAnimateCtrl() + { } +_AFXCMN_INLINE BOOL CAnimateCtrl::Open(LPCTSTR lpszName) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, ACM_OPEN, 0, (LPARAM)lpszName); } +_AFXCMN_INLINE BOOL CAnimateCtrl::Open(UINT nID) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, ACM_OPEN, 0, nID); } +_AFXCMN_INLINE BOOL CAnimateCtrl::Play(UINT nFrom, UINT nTo, UINT nRep) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, ACM_PLAY, nRep, MAKELPARAM(nFrom, nTo)); } +_AFXCMN_INLINE BOOL CAnimateCtrl::Stop() + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, ACM_STOP, 0, 0L); } +_AFXCMN_INLINE BOOL CAnimateCtrl::Close() + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, ACM_OPEN, 0, 0L); } +_AFXCMN_INLINE BOOL CAnimateCtrl::Seek(UINT nTo) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, ACM_PLAY, 0, MAKELPARAM(nTo, nTo)); } + +///////////////////////////////////////////////////////////////////////////// + +#endif //_AFXCMN_INLINE + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxcoll.h b/public/sdk/inc/mfc30/afxcoll.h new file mode 100644 index 000000000..e426d5051 --- /dev/null +++ b/public/sdk/inc/mfc30/afxcoll.h @@ -0,0 +1,1370 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992-1993 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXCOLL_H__ +#define __AFXCOLL_H__ + +#ifndef __AFX_H__ + #include <afx.h> +#endif + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +///////////////////////////////////////////////////////////////////////////// +// Classes declared in this file + +//CObject + // Arrays + class CByteArray; // array of BYTE + class CWordArray; // array of WORD + class CDWordArray; // array of DWORD + class CUIntArray; // array of UINT + class CPtrArray; // array of void* + class CObArray; // array of CObject* + + // Lists + class CPtrList; // list of void* + class CObList; // list of CObject* + + // Maps (aka Dictionaries) + class CMapWordToOb; // map from WORD to CObject* + class CMapWordToPtr; // map from WORD to void* + class CMapPtrToWord; // map from void* to WORD + class CMapPtrToPtr; // map from void* to void* + + // Special String variants + class CStringArray; // array of CStrings + class CStringList; // list of CStrings + class CMapStringToPtr; // map from CString to void* + class CMapStringToOb; // map from CString to CObject* + class CMapStringToString; // map from CString to CString + +///////////////////////////////////////////////////////////////////////////// + +#undef AFX_DATA +#define AFX_DATA AFX_CORE_DATA + +//////////////////////////////////////////////////////////////////////////// + +class CByteArray : public CObject +{ + + DECLARE_SERIAL(CByteArray) +public: + +// Construction + CByteArray(); + +// Attributes + int GetSize() const; + int GetUpperBound() const; + void SetSize(int nNewSize, int nGrowBy = -1); + +// Operations + // Clean up + void FreeExtra(); + void RemoveAll(); + + // Accessing elements + BYTE GetAt(int nIndex) const; + void SetAt(int nIndex, BYTE newElement); + BYTE& ElementAt(int nIndex); + + // Potentially growing the array + void SetAtGrow(int nIndex, BYTE newElement); + int Add(BYTE newElement); + + // overloaded operator helpers + BYTE operator[](int nIndex) const; + BYTE& operator[](int nIndex); + + // Operations that move elements around + void InsertAt(int nIndex, BYTE newElement, int nCount = 1); + void RemoveAt(int nIndex, int nCount = 1); + void InsertAt(int nStartIndex, CByteArray* pNewArray); + +// Implementation +protected: + BYTE* m_pData; // the actual array of data + int m_nSize; // # of elements (upperBound - 1) + int m_nMaxSize; // max allocated + int m_nGrowBy; // grow amount + +public: + ~CByteArray(); + + void Serialize(CArchive&); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + +protected: + // local typedefs for class templates + typedef BYTE BASE_TYPE; + typedef BYTE BASE_ARG_TYPE; +}; + + +//////////////////////////////////////////////////////////////////////////// + +class CWordArray : public CObject +{ + + DECLARE_SERIAL(CWordArray) +public: + +// Construction + CWordArray(); + +// Attributes + int GetSize() const; + int GetUpperBound() const; + void SetSize(int nNewSize, int nGrowBy = -1); + +// Operations + // Clean up + void FreeExtra(); + void RemoveAll(); + + // Accessing elements + WORD GetAt(int nIndex) const; + void SetAt(int nIndex, WORD newElement); + WORD& ElementAt(int nIndex); + + // Potentially growing the array + void SetAtGrow(int nIndex, WORD newElement); + int Add(WORD newElement); + + // overloaded operator helpers + WORD operator[](int nIndex) const; + WORD& operator[](int nIndex); + + // Operations that move elements around + void InsertAt(int nIndex, WORD newElement, int nCount = 1); + void RemoveAt(int nIndex, int nCount = 1); + void InsertAt(int nStartIndex, CWordArray* pNewArray); + +// Implementation +protected: + WORD* m_pData; // the actual array of data + int m_nSize; // # of elements (upperBound - 1) + int m_nMaxSize; // max allocated + int m_nGrowBy; // grow amount + +public: + ~CWordArray(); + + void Serialize(CArchive&); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + +protected: + // local typedefs for class templates + typedef WORD BASE_TYPE; + typedef WORD BASE_ARG_TYPE; +}; + + +//////////////////////////////////////////////////////////////////////////// + +class CDWordArray : public CObject +{ + + DECLARE_SERIAL(CDWordArray) +public: + +// Construction + CDWordArray(); + +// Attributes + int GetSize() const; + int GetUpperBound() const; + void SetSize(int nNewSize, int nGrowBy = -1); + +// Operations + // Clean up + void FreeExtra(); + void RemoveAll(); + + // Accessing elements + DWORD GetAt(int nIndex) const; + void SetAt(int nIndex, DWORD newElement); + DWORD& ElementAt(int nIndex); + + // Potentially growing the array + void SetAtGrow(int nIndex, DWORD newElement); + int Add(DWORD newElement); + + // overloaded operator helpers + DWORD operator[](int nIndex) const; + DWORD& operator[](int nIndex); + + // Operations that move elements around + void InsertAt(int nIndex, DWORD newElement, int nCount = 1); + void RemoveAt(int nIndex, int nCount = 1); + void InsertAt(int nStartIndex, CDWordArray* pNewArray); + +// Implementation +protected: + DWORD* m_pData; // the actual array of data + int m_nSize; // # of elements (upperBound - 1) + int m_nMaxSize; // max allocated + int m_nGrowBy; // grow amount + +public: + ~CDWordArray(); + + void Serialize(CArchive&); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + +protected: + // local typedefs for class templates + typedef DWORD BASE_TYPE; + typedef DWORD BASE_ARG_TYPE; +}; + + +//////////////////////////////////////////////////////////////////////////// + +class CUIntArray : public CObject +{ + + DECLARE_DYNAMIC(CUIntArray) +public: + +// Construction + CUIntArray(); + +// Attributes + int GetSize() const; + int GetUpperBound() const; + void SetSize(int nNewSize, int nGrowBy = -1); + +// Operations + // Clean up + void FreeExtra(); + void RemoveAll(); + + // Accessing elements + UINT GetAt(int nIndex) const; + void SetAt(int nIndex, UINT newElement); + UINT& ElementAt(int nIndex); + + // Potentially growing the array + void SetAtGrow(int nIndex, UINT newElement); + int Add(UINT newElement); + + // overloaded operator helpers + UINT operator[](int nIndex) const; + UINT& operator[](int nIndex); + + // Operations that move elements around + void InsertAt(int nIndex, UINT newElement, int nCount = 1); + void RemoveAt(int nIndex, int nCount = 1); + void InsertAt(int nStartIndex, CUIntArray* pNewArray); + +// Implementation +protected: + UINT* m_pData; // the actual array of data + int m_nSize; // # of elements (upperBound - 1) + int m_nMaxSize; // max allocated + int m_nGrowBy; // grow amount + +public: + ~CUIntArray(); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + +protected: + // local typedefs for class templates + typedef UINT BASE_TYPE; + typedef UINT BASE_ARG_TYPE; +}; + + +//////////////////////////////////////////////////////////////////////////// + +class CPtrArray : public CObject +{ + + DECLARE_DYNAMIC(CPtrArray) +public: + +// Construction + CPtrArray(); + +// Attributes + int GetSize() const; + int GetUpperBound() const; + void SetSize(int nNewSize, int nGrowBy = -1); + +// Operations + // Clean up + void FreeExtra(); + void RemoveAll(); + + // Accessing elements + void* GetAt(int nIndex) const; + void SetAt(int nIndex, void* newElement); + void*& ElementAt(int nIndex); + + // Potentially growing the array + void SetAtGrow(int nIndex, void* newElement); + int Add(void* newElement); + + // overloaded operator helpers + void* operator[](int nIndex) const; + void*& operator[](int nIndex); + + // Operations that move elements around + void InsertAt(int nIndex, void* newElement, int nCount = 1); + void RemoveAt(int nIndex, int nCount = 1); + void InsertAt(int nStartIndex, CPtrArray* pNewArray); + +// Implementation +protected: + void** m_pData; // the actual array of data + int m_nSize; // # of elements (upperBound - 1) + int m_nMaxSize; // max allocated + int m_nGrowBy; // grow amount + +public: + ~CPtrArray(); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + +protected: + // local typedefs for class templates + typedef void* BASE_TYPE; + typedef void* BASE_ARG_TYPE; +}; + + +//////////////////////////////////////////////////////////////////////////// + +class CObArray : public CObject +{ + + DECLARE_SERIAL(CObArray) +public: + +// Construction + CObArray(); + +// Attributes + int GetSize() const; + int GetUpperBound() const; + void SetSize(int nNewSize, int nGrowBy = -1); + +// Operations + // Clean up + void FreeExtra(); + void RemoveAll(); + + // Accessing elements + CObject* GetAt(int nIndex) const; + void SetAt(int nIndex, CObject* newElement); + CObject*& ElementAt(int nIndex); + + // Potentially growing the array + void SetAtGrow(int nIndex, CObject* newElement); + int Add(CObject* newElement); + + // overloaded operator helpers + CObject* operator[](int nIndex) const; + CObject*& operator[](int nIndex); + + // Operations that move elements around + void InsertAt(int nIndex, CObject* newElement, int nCount = 1); + void RemoveAt(int nIndex, int nCount = 1); + void InsertAt(int nStartIndex, CObArray* pNewArray); + +// Implementation +protected: + CObject** m_pData; // the actual array of data + int m_nSize; // # of elements (upperBound - 1) + int m_nMaxSize; // max allocated + int m_nGrowBy; // grow amount + +public: + ~CObArray(); + + void Serialize(CArchive&); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + +protected: + // local typedefs for class templates + typedef CObject* BASE_TYPE; + typedef CObject* BASE_ARG_TYPE; +}; + + +//////////////////////////////////////////////////////////////////////////// + +class CStringArray : public CObject +{ + + DECLARE_SERIAL(CStringArray) +public: + +// Construction + CStringArray(); + +// Attributes + int GetSize() const; + int GetUpperBound() const; + void SetSize(int nNewSize, int nGrowBy = -1); + +// Operations + // Clean up + void FreeExtra(); + void RemoveAll(); + + // Accessing elements + CString GetAt(int nIndex) const; + void SetAt(int nIndex, LPCTSTR newElement); + CString& ElementAt(int nIndex); + + // Potentially growing the array + void SetAtGrow(int nIndex, LPCTSTR newElement); + int Add(LPCTSTR newElement); + + // overloaded operator helpers + CString operator[](int nIndex) const; + CString& operator[](int nIndex); + + // Operations that move elements around + void InsertAt(int nIndex, LPCTSTR newElement, int nCount = 1); + void RemoveAt(int nIndex, int nCount = 1); + void InsertAt(int nStartIndex, CStringArray* pNewArray); + +// Implementation +protected: + CString* m_pData; // the actual array of data + int m_nSize; // # of elements (upperBound - 1) + int m_nMaxSize; // max allocated + int m_nGrowBy; // grow amount + +public: + ~CStringArray(); + + void Serialize(CArchive&); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + +protected: + // local typedefs for class templates + typedef CString BASE_TYPE; + typedef LPCTSTR BASE_ARG_TYPE; +}; + + +///////////////////////////////////////////////////////////////////////////// + +class CPtrList : public CObject +{ + + DECLARE_DYNAMIC(CPtrList) + +protected: + struct CNode + { + CNode* pNext; + CNode* pPrev; + void* data; + }; +public: + +// Construction + CPtrList(int nBlockSize = 10); + +// Attributes (head and tail) + // count of elements + int GetCount() const; + BOOL IsEmpty() const; + + // peek at head or tail + void*& GetHead(); + void* GetHead() const; + void*& GetTail(); + void* GetTail() const; + +// Operations + // get head or tail (and remove it) - don't call on empty list! + void* RemoveHead(); + void* RemoveTail(); + + // add before head or after tail + POSITION AddHead(void* newElement); + POSITION AddTail(void* newElement); + + // add another list of elements before head or after tail + void AddHead(CPtrList* pNewList); + void AddTail(CPtrList* pNewList); + + // remove all elements + void RemoveAll(); + + // iteration + POSITION GetHeadPosition() const; + POSITION GetTailPosition() const; + void*& GetNext(POSITION& rPosition); // return *Position++ + void* GetNext(POSITION& rPosition) const; // return *Position++ + void*& GetPrev(POSITION& rPosition); // return *Position-- + void* GetPrev(POSITION& rPosition) const; // return *Position-- + + // getting/modifying an element at a given position + void*& GetAt(POSITION position); + void* GetAt(POSITION position) const; + void SetAt(POSITION pos, void* newElement); + void RemoveAt(POSITION position); + + // inserting before or after a given position + POSITION InsertBefore(POSITION position, void* newElement); + POSITION InsertAfter(POSITION position, void* newElement); + + // helper functions (note: O(n) speed) + POSITION Find(void* searchValue, POSITION startAfter = NULL) const; + // defaults to starting at the HEAD + // return NULL if not found + POSITION FindIndex(int nIndex) const; + // get the 'nIndex'th element (may return NULL) + +// Implementation +protected: + CNode* m_pNodeHead; + CNode* m_pNodeTail; + int m_nCount; + CNode* m_pNodeFree; + struct CPlex* m_pBlocks; + int m_nBlockSize; + + CNode* NewNode(CNode*, CNode*); + void FreeNode(CNode*); + +public: + ~CPtrList(); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + // local typedefs for class templates + typedef void* BASE_TYPE; + typedef void* BASE_ARG_TYPE; +}; + + +///////////////////////////////////////////////////////////////////////////// + +class CObList : public CObject +{ + + DECLARE_SERIAL(CObList) + +protected: + struct CNode + { + CNode* pNext; + CNode* pPrev; + CObject* data; + }; +public: + +// Construction + CObList(int nBlockSize = 10); + +// Attributes (head and tail) + // count of elements + int GetCount() const; + BOOL IsEmpty() const; + + // peek at head or tail + CObject*& GetHead(); + CObject* GetHead() const; + CObject*& GetTail(); + CObject* GetTail() const; + +// Operations + // get head or tail (and remove it) - don't call on empty list! + CObject* RemoveHead(); + CObject* RemoveTail(); + + // add before head or after tail + POSITION AddHead(CObject* newElement); + POSITION AddTail(CObject* newElement); + + // add another list of elements before head or after tail + void AddHead(CObList* pNewList); + void AddTail(CObList* pNewList); + + // remove all elements + void RemoveAll(); + + // iteration + POSITION GetHeadPosition() const; + POSITION GetTailPosition() const; + CObject*& GetNext(POSITION& rPosition); // return *Position++ + CObject* GetNext(POSITION& rPosition) const; // return *Position++ + CObject*& GetPrev(POSITION& rPosition); // return *Position-- + CObject* GetPrev(POSITION& rPosition) const; // return *Position-- + + // getting/modifying an element at a given position + CObject*& GetAt(POSITION position); + CObject* GetAt(POSITION position) const; + void SetAt(POSITION pos, CObject* newElement); + void RemoveAt(POSITION position); + + // inserting before or after a given position + POSITION InsertBefore(POSITION position, CObject* newElement); + POSITION InsertAfter(POSITION position, CObject* newElement); + + // helper functions (note: O(n) speed) + POSITION Find(CObject* searchValue, POSITION startAfter = NULL) const; + // defaults to starting at the HEAD + // return NULL if not found + POSITION FindIndex(int nIndex) const; + // get the 'nIndex'th element (may return NULL) + +// Implementation +protected: + CNode* m_pNodeHead; + CNode* m_pNodeTail; + int m_nCount; + CNode* m_pNodeFree; + struct CPlex* m_pBlocks; + int m_nBlockSize; + + CNode* NewNode(CNode*, CNode*); + void FreeNode(CNode*); + +public: + ~CObList(); + + void Serialize(CArchive&); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + // local typedefs for class templates + typedef CObject* BASE_TYPE; + typedef CObject* BASE_ARG_TYPE; +}; + + +///////////////////////////////////////////////////////////////////////////// + +class CStringList : public CObject +{ + + DECLARE_SERIAL(CStringList) + +protected: + struct CNode + { + CNode* pNext; + CNode* pPrev; + CString data; + }; +public: + +// Construction + CStringList(int nBlockSize = 10); + +// Attributes (head and tail) + // count of elements + int GetCount() const; + BOOL IsEmpty() const; + + // peek at head or tail + CString& GetHead(); + CString GetHead() const; + CString& GetTail(); + CString GetTail() const; + +// Operations + // get head or tail (and remove it) - don't call on empty list! + CString RemoveHead(); + CString RemoveTail(); + + // add before head or after tail + POSITION AddHead(LPCTSTR newElement); + POSITION AddTail(LPCTSTR newElement); + + // add another list of elements before head or after tail + void AddHead(CStringList* pNewList); + void AddTail(CStringList* pNewList); + + // remove all elements + void RemoveAll(); + + // iteration + POSITION GetHeadPosition() const; + POSITION GetTailPosition() const; + CString& GetNext(POSITION& rPosition); // return *Position++ + CString GetNext(POSITION& rPosition) const; // return *Position++ + CString& GetPrev(POSITION& rPosition); // return *Position-- + CString GetPrev(POSITION& rPosition) const; // return *Position-- + + // getting/modifying an element at a given position + CString& GetAt(POSITION position); + CString GetAt(POSITION position) const; + void SetAt(POSITION pos, LPCTSTR newElement); + void RemoveAt(POSITION position); + + // inserting before or after a given position + POSITION InsertBefore(POSITION position, LPCTSTR newElement); + POSITION InsertAfter(POSITION position, LPCTSTR newElement); + + // helper functions (note: O(n) speed) + POSITION Find(LPCTSTR searchValue, POSITION startAfter = NULL) const; + // defaults to starting at the HEAD + // return NULL if not found + POSITION FindIndex(int nIndex) const; + // get the 'nIndex'th element (may return NULL) + +// Implementation +protected: + CNode* m_pNodeHead; + CNode* m_pNodeTail; + int m_nCount; + CNode* m_pNodeFree; + struct CPlex* m_pBlocks; + int m_nBlockSize; + + CNode* NewNode(CNode*, CNode*); + void FreeNode(CNode*); + +public: + ~CStringList(); + + void Serialize(CArchive&); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + // local typedefs for class templates + typedef CString BASE_TYPE; + typedef LPCTSTR BASE_ARG_TYPE; +}; + + +///////////////////////////////////////////////////////////////////////////// + +class CMapWordToPtr : public CObject +{ + + DECLARE_DYNAMIC(CMapWordToPtr) +protected: + // Association + struct CAssoc + { + CAssoc* pNext; + UINT nHashValue; // needed for efficient iteration + WORD key; + void* value; + }; + +public: + +// Construction + CMapWordToPtr(int nBlockSize = 10); + +// Attributes + // number of elements + int GetCount() const; + BOOL IsEmpty() const; + + // Lookup + BOOL Lookup(WORD key, void*& rValue) const; + +// Operations + // Lookup and add if not there + void*& operator[](WORD key); + + // add a new (key, value) pair + void SetAt(WORD key, void* newValue); + + // removing existing (key, ?) pair + BOOL RemoveKey(WORD key); + void RemoveAll(); + + // iterating all (key, value) pairs + POSITION GetStartPosition() const; + void GetNextAssoc(POSITION& rNextPosition, WORD& rKey, void*& rValue) const; + + // advanced features for derived classes + UINT GetHashTableSize() const; + void InitHashTable(UINT hashSize, BOOL bAllocNow = TRUE); + +// Overridables: special non-virtual (see map implementation for details) + // Routine used to user-provided hash keys + UINT HashKey(WORD key) const; + +// Implementation +protected: + CAssoc** m_pHashTable; + UINT m_nHashTableSize; + int m_nCount; + CAssoc* m_pFreeList; + struct CPlex* m_pBlocks; + int m_nBlockSize; + + CAssoc* NewAssoc(); + void FreeAssoc(CAssoc*); + CAssoc* GetAssocAt(WORD, UINT&) const; + +public: + ~CMapWordToPtr(); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + +protected: + // local typedefs for CTypedPtrMap class template + typedef WORD BASE_KEY; + typedef WORD BASE_ARG_KEY; + typedef void* BASE_VALUE; + typedef void* BASE_ARG_VALUE; +}; + + +///////////////////////////////////////////////////////////////////////////// + +class CMapPtrToWord : public CObject +{ + + DECLARE_DYNAMIC(CMapPtrToWord) +protected: + // Association + struct CAssoc + { + CAssoc* pNext; + UINT nHashValue; // needed for efficient iteration + void* key; + WORD value; + }; + +public: + +// Construction + CMapPtrToWord(int nBlockSize = 10); + +// Attributes + // number of elements + int GetCount() const; + BOOL IsEmpty() const; + + // Lookup + BOOL Lookup(void* key, WORD& rValue) const; + +// Operations + // Lookup and add if not there + WORD& operator[](void* key); + + // add a new (key, value) pair + void SetAt(void* key, WORD newValue); + + // removing existing (key, ?) pair + BOOL RemoveKey(void* key); + void RemoveAll(); + + // iterating all (key, value) pairs + POSITION GetStartPosition() const; + void GetNextAssoc(POSITION& rNextPosition, void*& rKey, WORD& rValue) const; + + // advanced features for derived classes + UINT GetHashTableSize() const; + void InitHashTable(UINT hashSize, BOOL bAllocNow = TRUE); + +// Overridables: special non-virtual (see map implementation for details) + // Routine used to user-provided hash keys + UINT HashKey(void* key) const; + +// Implementation +protected: + CAssoc** m_pHashTable; + UINT m_nHashTableSize; + int m_nCount; + CAssoc* m_pFreeList; + struct CPlex* m_pBlocks; + int m_nBlockSize; + + CAssoc* NewAssoc(); + void FreeAssoc(CAssoc*); + CAssoc* GetAssocAt(void*, UINT&) const; + +public: + ~CMapPtrToWord(); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + +protected: + // local typedefs for CTypedPtrMap class template + typedef void* BASE_KEY; + typedef void* BASE_ARG_KEY; + typedef WORD BASE_VALUE; + typedef WORD BASE_ARG_VALUE; +}; + + +///////////////////////////////////////////////////////////////////////////// + +class CMapPtrToPtr : public CObject +{ + + DECLARE_DYNAMIC(CMapPtrToPtr) +protected: + // Association + struct CAssoc + { + CAssoc* pNext; + UINT nHashValue; // needed for efficient iteration + void* key; + void* value; + }; + +public: + +// Construction + CMapPtrToPtr(int nBlockSize = 10); + +// Attributes + // number of elements + int GetCount() const; + BOOL IsEmpty() const; + + // Lookup + BOOL Lookup(void* key, void*& rValue) const; + +// Operations + // Lookup and add if not there + void*& operator[](void* key); + + // add a new (key, value) pair + void SetAt(void* key, void* newValue); + + // removing existing (key, ?) pair + BOOL RemoveKey(void* key); + void RemoveAll(); + + // iterating all (key, value) pairs + POSITION GetStartPosition() const; + void GetNextAssoc(POSITION& rNextPosition, void*& rKey, void*& rValue) const; + + // advanced features for derived classes + UINT GetHashTableSize() const; + void InitHashTable(UINT hashSize, BOOL bAllocNow = TRUE); + +// Overridables: special non-virtual (see map implementation for details) + // Routine used to user-provided hash keys + UINT HashKey(void* key) const; + +// Implementation +protected: + CAssoc** m_pHashTable; + UINT m_nHashTableSize; + int m_nCount; + CAssoc* m_pFreeList; + struct CPlex* m_pBlocks; + int m_nBlockSize; + + CAssoc* NewAssoc(); + void FreeAssoc(CAssoc*); + CAssoc* GetAssocAt(void*, UINT&) const; + +public: + ~CMapPtrToPtr(); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + +protected: + // local typedefs for CTypedPtrMap class template + typedef void* BASE_KEY; + typedef void* BASE_ARG_KEY; + typedef void* BASE_VALUE; + typedef void* BASE_ARG_VALUE; +}; + + +///////////////////////////////////////////////////////////////////////////// + +class CMapWordToOb : public CObject +{ + + DECLARE_SERIAL(CMapWordToOb) +protected: + // Association + struct CAssoc + { + CAssoc* pNext; + UINT nHashValue; // needed for efficient iteration + WORD key; + CObject* value; + }; + +public: + +// Construction + CMapWordToOb(int nBlockSize = 10); + +// Attributes + // number of elements + int GetCount() const; + BOOL IsEmpty() const; + + // Lookup + BOOL Lookup(WORD key, CObject*& rValue) const; + +// Operations + // Lookup and add if not there + CObject*& operator[](WORD key); + + // add a new (key, value) pair + void SetAt(WORD key, CObject* newValue); + + // removing existing (key, ?) pair + BOOL RemoveKey(WORD key); + void RemoveAll(); + + // iterating all (key, value) pairs + POSITION GetStartPosition() const; + void GetNextAssoc(POSITION& rNextPosition, WORD& rKey, CObject*& rValue) const; + + // advanced features for derived classes + UINT GetHashTableSize() const; + void InitHashTable(UINT hashSize, BOOL bAllocNow = TRUE); + +// Overridables: special non-virtual (see map implementation for details) + // Routine used to user-provided hash keys + UINT HashKey(WORD key) const; + +// Implementation +protected: + CAssoc** m_pHashTable; + UINT m_nHashTableSize; + int m_nCount; + CAssoc* m_pFreeList; + struct CPlex* m_pBlocks; + int m_nBlockSize; + + CAssoc* NewAssoc(); + void FreeAssoc(CAssoc*); + CAssoc* GetAssocAt(WORD, UINT&) const; + +public: + ~CMapWordToOb(); + + void Serialize(CArchive&); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + +protected: + // local typedefs for CTypedPtrMap class template + typedef WORD BASE_KEY; + typedef WORD BASE_ARG_KEY; + typedef CObject* BASE_VALUE; + typedef CObject* BASE_ARG_VALUE; +}; + + +///////////////////////////////////////////////////////////////////////////// + +class CMapStringToPtr : public CObject +{ + + DECLARE_DYNAMIC(CMapStringToPtr) +protected: + // Association + struct CAssoc + { + CAssoc* pNext; + UINT nHashValue; // needed for efficient iteration + CString key; + void* value; + }; + +public: + +// Construction + CMapStringToPtr(int nBlockSize = 10); + +// Attributes + // number of elements + int GetCount() const; + BOOL IsEmpty() const; + + // Lookup + BOOL Lookup(LPCTSTR key, void*& rValue) const; + +// Operations + // Lookup and add if not there + void*& operator[](LPCTSTR key); + + // add a new (key, value) pair + void SetAt(LPCTSTR key, void* newValue); + + // removing existing (key, ?) pair + BOOL RemoveKey(LPCTSTR key); + void RemoveAll(); + + // iterating all (key, value) pairs + POSITION GetStartPosition() const; + void GetNextAssoc(POSITION& rNextPosition, CString& rKey, void*& rValue) const; + + // advanced features for derived classes + UINT GetHashTableSize() const; + void InitHashTable(UINT hashSize, BOOL bAllocNow = TRUE); + +// Overridables: special non-virtual (see map implementation for details) + // Routine used to user-provided hash keys + UINT HashKey(LPCTSTR key) const; + +// Implementation +protected: + CAssoc** m_pHashTable; + UINT m_nHashTableSize; + int m_nCount; + CAssoc* m_pFreeList; + struct CPlex* m_pBlocks; + int m_nBlockSize; + + CAssoc* NewAssoc(); + void FreeAssoc(CAssoc*); + CAssoc* GetAssocAt(LPCTSTR, UINT&) const; + +public: + ~CMapStringToPtr(); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + +protected: + // local typedefs for CTypedPtrMap class template + typedef CString BASE_KEY; + typedef LPCTSTR BASE_ARG_KEY; + typedef void* BASE_VALUE; + typedef void* BASE_ARG_VALUE; +}; + + +///////////////////////////////////////////////////////////////////////////// + +class CMapStringToOb : public CObject +{ + + DECLARE_SERIAL(CMapStringToOb) +protected: + // Association + struct CAssoc + { + CAssoc* pNext; + UINT nHashValue; // needed for efficient iteration + CString key; + CObject* value; + }; + +public: + +// Construction + CMapStringToOb(int nBlockSize = 10); + +// Attributes + // number of elements + int GetCount() const; + BOOL IsEmpty() const; + + // Lookup + BOOL Lookup(LPCTSTR key, CObject*& rValue) const; + +// Operations + // Lookup and add if not there + CObject*& operator[](LPCTSTR key); + + // add a new (key, value) pair + void SetAt(LPCTSTR key, CObject* newValue); + + // removing existing (key, ?) pair + BOOL RemoveKey(LPCTSTR key); + void RemoveAll(); + + // iterating all (key, value) pairs + POSITION GetStartPosition() const; + void GetNextAssoc(POSITION& rNextPosition, CString& rKey, CObject*& rValue) const; + + // advanced features for derived classes + UINT GetHashTableSize() const; + void InitHashTable(UINT hashSize, BOOL bAllocNow = TRUE); + +// Overridables: special non-virtual (see map implementation for details) + // Routine used to user-provided hash keys + UINT HashKey(LPCTSTR key) const; + +// Implementation +protected: + CAssoc** m_pHashTable; + UINT m_nHashTableSize; + int m_nCount; + CAssoc* m_pFreeList; + struct CPlex* m_pBlocks; + int m_nBlockSize; + + CAssoc* NewAssoc(); + void FreeAssoc(CAssoc*); + CAssoc* GetAssocAt(LPCTSTR, UINT&) const; + +public: + ~CMapStringToOb(); + + void Serialize(CArchive&); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + +protected: + // local typedefs for CTypedPtrMap class template + typedef CString BASE_KEY; + typedef LPCTSTR BASE_ARG_KEY; + typedef CObject* BASE_VALUE; + typedef CObject* BASE_ARG_VALUE; +}; + + +///////////////////////////////////////////////////////////////////////////// + +class CMapStringToString : public CObject +{ + + DECLARE_SERIAL(CMapStringToString) +protected: + // Association + struct CAssoc + { + CAssoc* pNext; + UINT nHashValue; // needed for efficient iteration + CString key; + CString value; + }; + +public: + +// Construction + CMapStringToString(int nBlockSize = 10); + +// Attributes + // number of elements + int GetCount() const; + BOOL IsEmpty() const; + + // Lookup + BOOL Lookup(LPCTSTR key, CString& rValue) const; + +// Operations + // Lookup and add if not there + CString& operator[](LPCTSTR key); + + // add a new (key, value) pair + void SetAt(LPCTSTR key, LPCTSTR newValue); + + // removing existing (key, ?) pair + BOOL RemoveKey(LPCTSTR key); + void RemoveAll(); + + // iterating all (key, value) pairs + POSITION GetStartPosition() const; + void GetNextAssoc(POSITION& rNextPosition, CString& rKey, CString& rValue) const; + + // advanced features for derived classes + UINT GetHashTableSize() const; + void InitHashTable(UINT hashSize, BOOL bAllocNow = TRUE); + +// Overridables: special non-virtual (see map implementation for details) + // Routine used to user-provided hash keys + UINT HashKey(LPCTSTR key) const; + +// Implementation +protected: + CAssoc** m_pHashTable; + UINT m_nHashTableSize; + int m_nCount; + CAssoc* m_pFreeList; + struct CPlex* m_pBlocks; + int m_nBlockSize; + + CAssoc* NewAssoc(); + void FreeAssoc(CAssoc*); + CAssoc* GetAssocAt(LPCTSTR, UINT&) const; + +public: + ~CMapStringToString(); + + void Serialize(CArchive&); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif + +protected: + // local typedefs for CTypedPtrMap class template + typedef CString BASE_KEY; + typedef LPCTSTR BASE_ARG_KEY; + typedef CString BASE_VALUE; + typedef LPCTSTR BASE_ARG_VALUE; +}; + +///////////////////////////////////////////////////////////////////////////// +// Special include for Win32s compatibility + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +#ifndef __AFXSTATE_H__ + #include <afxstat_.h> // for AFX_APP_STATE and AFX_THREAD_STATE +#endif + +///////////////////////////////////////////////////////////////////////////// +// Inline function declarations + +#ifdef _AFX_ENABLE_INLINES +#define _AFXCOLL_INLINE inline +#include <afxcoll.inl> +#endif + +#undef AFX_DATA +#define AFX_DATA +#endif //!__AFXCOLL_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxcoll.inl b/public/sdk/inc/mfc30/afxcoll.inl new file mode 100644 index 000000000..7995dc563 --- /dev/null +++ b/public/sdk/inc/mfc30/afxcoll.inl @@ -0,0 +1,468 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// Inlines for AFXCOLL.H + +#ifdef _AFXCOLL_INLINE + +//////////////////////////////////////////////////////////////////////////// + +_AFXCOLL_INLINE int CByteArray::GetSize() const + { return m_nSize; } +_AFXCOLL_INLINE int CByteArray::GetUpperBound() const + { return m_nSize-1; } +_AFXCOLL_INLINE void CByteArray::RemoveAll() + { SetSize(0); } +_AFXCOLL_INLINE BYTE CByteArray::GetAt(int nIndex) const + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +_AFXCOLL_INLINE void CByteArray::SetAt(int nIndex, BYTE newElement) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + m_pData[nIndex] = newElement; } +_AFXCOLL_INLINE BYTE& CByteArray::ElementAt(int nIndex) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +_AFXCOLL_INLINE int CByteArray::Add(BYTE newElement) + { int nIndex = m_nSize; + SetAtGrow(nIndex, newElement); + return nIndex; } +_AFXCOLL_INLINE BYTE CByteArray::operator[](int nIndex) const + { return GetAt(nIndex); } +_AFXCOLL_INLINE BYTE& CByteArray::operator[](int nIndex) + { return ElementAt(nIndex); } + + +//////////////////////////////////////////////////////////////////////////// + +_AFXCOLL_INLINE int CWordArray::GetSize() const + { return m_nSize; } +_AFXCOLL_INLINE int CWordArray::GetUpperBound() const + { return m_nSize-1; } +_AFXCOLL_INLINE void CWordArray::RemoveAll() + { SetSize(0); } +_AFXCOLL_INLINE WORD CWordArray::GetAt(int nIndex) const + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +_AFXCOLL_INLINE void CWordArray::SetAt(int nIndex, WORD newElement) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + m_pData[nIndex] = newElement; } +_AFXCOLL_INLINE WORD& CWordArray::ElementAt(int nIndex) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +_AFXCOLL_INLINE int CWordArray::Add(WORD newElement) + { int nIndex = m_nSize; + SetAtGrow(nIndex, newElement); + return nIndex; } +_AFXCOLL_INLINE WORD CWordArray::operator[](int nIndex) const + { return GetAt(nIndex); } +_AFXCOLL_INLINE WORD& CWordArray::operator[](int nIndex) + { return ElementAt(nIndex); } + + +//////////////////////////////////////////////////////////////////////////// + +_AFXCOLL_INLINE int CDWordArray::GetSize() const + { return m_nSize; } +_AFXCOLL_INLINE int CDWordArray::GetUpperBound() const + { return m_nSize-1; } +_AFXCOLL_INLINE void CDWordArray::RemoveAll() + { SetSize(0); } +_AFXCOLL_INLINE DWORD CDWordArray::GetAt(int nIndex) const + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +_AFXCOLL_INLINE void CDWordArray::SetAt(int nIndex, DWORD newElement) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + m_pData[nIndex] = newElement; } +_AFXCOLL_INLINE DWORD& CDWordArray::ElementAt(int nIndex) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +_AFXCOLL_INLINE int CDWordArray::Add(DWORD newElement) + { int nIndex = m_nSize; + SetAtGrow(nIndex, newElement); + return nIndex; } +_AFXCOLL_INLINE DWORD CDWordArray::operator[](int nIndex) const + { return GetAt(nIndex); } +_AFXCOLL_INLINE DWORD& CDWordArray::operator[](int nIndex) + { return ElementAt(nIndex); } + + +//////////////////////////////////////////////////////////////////////////// + +_AFXCOLL_INLINE int CUIntArray::GetSize() const + { return m_nSize; } +_AFXCOLL_INLINE int CUIntArray::GetUpperBound() const + { return m_nSize-1; } +_AFXCOLL_INLINE void CUIntArray::RemoveAll() + { SetSize(0); } +_AFXCOLL_INLINE UINT CUIntArray::GetAt(int nIndex) const + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +_AFXCOLL_INLINE void CUIntArray::SetAt(int nIndex, UINT newElement) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + m_pData[nIndex] = newElement; } +_AFXCOLL_INLINE UINT& CUIntArray::ElementAt(int nIndex) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +_AFXCOLL_INLINE int CUIntArray::Add(UINT newElement) + { int nIndex = m_nSize; + SetAtGrow(nIndex, newElement); + return nIndex; } +_AFXCOLL_INLINE UINT CUIntArray::operator[](int nIndex) const + { return GetAt(nIndex); } +_AFXCOLL_INLINE UINT& CUIntArray::operator[](int nIndex) + { return ElementAt(nIndex); } + + +//////////////////////////////////////////////////////////////////////////// + +_AFXCOLL_INLINE int CPtrArray::GetSize() const + { return m_nSize; } +_AFXCOLL_INLINE int CPtrArray::GetUpperBound() const + { return m_nSize-1; } +_AFXCOLL_INLINE void CPtrArray::RemoveAll() + { SetSize(0); } +_AFXCOLL_INLINE void* CPtrArray::GetAt(int nIndex) const + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +_AFXCOLL_INLINE void CPtrArray::SetAt(int nIndex, void* newElement) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + m_pData[nIndex] = newElement; } +_AFXCOLL_INLINE void*& CPtrArray::ElementAt(int nIndex) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +_AFXCOLL_INLINE int CPtrArray::Add(void* newElement) + { int nIndex = m_nSize; + SetAtGrow(nIndex, newElement); + return nIndex; } +_AFXCOLL_INLINE void* CPtrArray::operator[](int nIndex) const + { return GetAt(nIndex); } +_AFXCOLL_INLINE void*& CPtrArray::operator[](int nIndex) + { return ElementAt(nIndex); } + + +//////////////////////////////////////////////////////////////////////////// + +_AFXCOLL_INLINE int CObArray::GetSize() const + { return m_nSize; } +_AFXCOLL_INLINE int CObArray::GetUpperBound() const + { return m_nSize-1; } +_AFXCOLL_INLINE void CObArray::RemoveAll() + { SetSize(0); } +_AFXCOLL_INLINE CObject* CObArray::GetAt(int nIndex) const + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +_AFXCOLL_INLINE void CObArray::SetAt(int nIndex, CObject* newElement) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + m_pData[nIndex] = newElement; } +_AFXCOLL_INLINE CObject*& CObArray::ElementAt(int nIndex) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +_AFXCOLL_INLINE int CObArray::Add(CObject* newElement) + { int nIndex = m_nSize; + SetAtGrow(nIndex, newElement); + return nIndex; } +_AFXCOLL_INLINE CObject* CObArray::operator[](int nIndex) const + { return GetAt(nIndex); } +_AFXCOLL_INLINE CObject*& CObArray::operator[](int nIndex) + { return ElementAt(nIndex); } + + +//////////////////////////////////////////////////////////////////////////// + +_AFXCOLL_INLINE int CStringArray::GetSize() const + { return m_nSize; } +_AFXCOLL_INLINE int CStringArray::GetUpperBound() const + { return m_nSize-1; } +_AFXCOLL_INLINE void CStringArray::RemoveAll() + { SetSize(0); } +_AFXCOLL_INLINE CString CStringArray::GetAt(int nIndex) const + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +_AFXCOLL_INLINE void CStringArray::SetAt(int nIndex, LPCTSTR newElement) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + m_pData[nIndex] = newElement; } +_AFXCOLL_INLINE CString& CStringArray::ElementAt(int nIndex) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +_AFXCOLL_INLINE int CStringArray::Add(LPCTSTR newElement) + { int nIndex = m_nSize; + SetAtGrow(nIndex, newElement); + return nIndex; } +_AFXCOLL_INLINE CString CStringArray::operator[](int nIndex) const + { return GetAt(nIndex); } +_AFXCOLL_INLINE CString& CStringArray::operator[](int nIndex) + { return ElementAt(nIndex); } + + +//////////////////////////////////////////////////////////////////////////// + +_AFXCOLL_INLINE int CPtrList::GetCount() const + { return m_nCount; } +_AFXCOLL_INLINE BOOL CPtrList::IsEmpty() const + { return m_nCount == 0; } +_AFXCOLL_INLINE void*& CPtrList::GetHead() + { ASSERT(m_pNodeHead != NULL); + return m_pNodeHead->data; } +_AFXCOLL_INLINE void* CPtrList::GetHead() const + { ASSERT(m_pNodeHead != NULL); + return m_pNodeHead->data; } +_AFXCOLL_INLINE void*& CPtrList::GetTail() + { ASSERT(m_pNodeTail != NULL); + return m_pNodeTail->data; } +_AFXCOLL_INLINE void* CPtrList::GetTail() const + { ASSERT(m_pNodeTail != NULL); + return m_pNodeTail->data; } +_AFXCOLL_INLINE POSITION CPtrList::GetHeadPosition() const + { return (POSITION) m_pNodeHead; } +_AFXCOLL_INLINE POSITION CPtrList::GetTailPosition() const + { return (POSITION) m_pNodeTail; } +_AFXCOLL_INLINE void*& CPtrList::GetNext(POSITION& rPosition) // return *Position++ + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pNext; + return pNode->data; } +_AFXCOLL_INLINE void* CPtrList::GetNext(POSITION& rPosition) const // return *Position++ + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pNext; + return pNode->data; } +_AFXCOLL_INLINE void*& CPtrList::GetPrev(POSITION& rPosition) // return *Position-- + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pPrev; + return pNode->data; } +_AFXCOLL_INLINE void* CPtrList::GetPrev(POSITION& rPosition) const // return *Position-- + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pPrev; + return pNode->data; } +_AFXCOLL_INLINE void*& CPtrList::GetAt(POSITION position) + { CNode* pNode = (CNode*) position; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + return pNode->data; } +_AFXCOLL_INLINE void* CPtrList::GetAt(POSITION position) const + { CNode* pNode = (CNode*) position; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + return pNode->data; } +_AFXCOLL_INLINE void CPtrList::SetAt(POSITION pos, void* newElement) + { CNode* pNode = (CNode*) pos; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + pNode->data = newElement; } + + +//////////////////////////////////////////////////////////////////////////// + +_AFXCOLL_INLINE int CObList::GetCount() const + { return m_nCount; } +_AFXCOLL_INLINE BOOL CObList::IsEmpty() const + { return m_nCount == 0; } +_AFXCOLL_INLINE CObject*& CObList::GetHead() + { ASSERT(m_pNodeHead != NULL); + return m_pNodeHead->data; } +_AFXCOLL_INLINE CObject* CObList::GetHead() const + { ASSERT(m_pNodeHead != NULL); + return m_pNodeHead->data; } +_AFXCOLL_INLINE CObject*& CObList::GetTail() + { ASSERT(m_pNodeTail != NULL); + return m_pNodeTail->data; } +_AFXCOLL_INLINE CObject* CObList::GetTail() const + { ASSERT(m_pNodeTail != NULL); + return m_pNodeTail->data; } +_AFXCOLL_INLINE POSITION CObList::GetHeadPosition() const + { return (POSITION) m_pNodeHead; } +_AFXCOLL_INLINE POSITION CObList::GetTailPosition() const + { return (POSITION) m_pNodeTail; } +_AFXCOLL_INLINE CObject*& CObList::GetNext(POSITION& rPosition) // return *Position++ + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pNext; + return pNode->data; } +_AFXCOLL_INLINE CObject* CObList::GetNext(POSITION& rPosition) const // return *Position++ + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pNext; + return pNode->data; } +_AFXCOLL_INLINE CObject*& CObList::GetPrev(POSITION& rPosition) // return *Position-- + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pPrev; + return pNode->data; } +_AFXCOLL_INLINE CObject* CObList::GetPrev(POSITION& rPosition) const // return *Position-- + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pPrev; + return pNode->data; } +_AFXCOLL_INLINE CObject*& CObList::GetAt(POSITION position) + { CNode* pNode = (CNode*) position; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + return pNode->data; } +_AFXCOLL_INLINE CObject* CObList::GetAt(POSITION position) const + { CNode* pNode = (CNode*) position; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + return pNode->data; } +_AFXCOLL_INLINE void CObList::SetAt(POSITION pos, CObject* newElement) + { CNode* pNode = (CNode*) pos; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + pNode->data = newElement; } + + +//////////////////////////////////////////////////////////////////////////// + +_AFXCOLL_INLINE int CStringList::GetCount() const + { return m_nCount; } +_AFXCOLL_INLINE BOOL CStringList::IsEmpty() const + { return m_nCount == 0; } +_AFXCOLL_INLINE CString& CStringList::GetHead() + { ASSERT(m_pNodeHead != NULL); + return m_pNodeHead->data; } +_AFXCOLL_INLINE CString CStringList::GetHead() const + { ASSERT(m_pNodeHead != NULL); + return m_pNodeHead->data; } +_AFXCOLL_INLINE CString& CStringList::GetTail() + { ASSERT(m_pNodeTail != NULL); + return m_pNodeTail->data; } +_AFXCOLL_INLINE CString CStringList::GetTail() const + { ASSERT(m_pNodeTail != NULL); + return m_pNodeTail->data; } +_AFXCOLL_INLINE POSITION CStringList::GetHeadPosition() const + { return (POSITION) m_pNodeHead; } +_AFXCOLL_INLINE POSITION CStringList::GetTailPosition() const + { return (POSITION) m_pNodeTail; } +_AFXCOLL_INLINE CString& CStringList::GetNext(POSITION& rPosition) // return *Position++ + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pNext; + return pNode->data; } +_AFXCOLL_INLINE CString CStringList::GetNext(POSITION& rPosition) const // return *Position++ + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pNext; + return pNode->data; } +_AFXCOLL_INLINE CString& CStringList::GetPrev(POSITION& rPosition) // return *Position-- + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pPrev; + return pNode->data; } +_AFXCOLL_INLINE CString CStringList::GetPrev(POSITION& rPosition) const // return *Position-- + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pPrev; + return pNode->data; } +_AFXCOLL_INLINE CString& CStringList::GetAt(POSITION position) + { CNode* pNode = (CNode*) position; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + return pNode->data; } +_AFXCOLL_INLINE CString CStringList::GetAt(POSITION position) const + { CNode* pNode = (CNode*) position; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + return pNode->data; } +_AFXCOLL_INLINE void CStringList::SetAt(POSITION pos, LPCTSTR newElement) + { CNode* pNode = (CNode*) pos; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + pNode->data = newElement; } + + +//////////////////////////////////////////////////////////////////////////// + +_AFXCOLL_INLINE int CMapWordToPtr::GetCount() const + { return m_nCount; } +_AFXCOLL_INLINE BOOL CMapWordToPtr::IsEmpty() const + { return m_nCount == 0; } +_AFXCOLL_INLINE void CMapWordToPtr::SetAt(WORD key, void* newValue) + { (*this)[key] = newValue; } +_AFXCOLL_INLINE POSITION CMapWordToPtr::GetStartPosition() const + { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; } +_AFXCOLL_INLINE UINT CMapWordToPtr::GetHashTableSize() const + { return m_nHashTableSize; } + + +//////////////////////////////////////////////////////////////////////////// + +_AFXCOLL_INLINE int CMapPtrToWord::GetCount() const + { return m_nCount; } +_AFXCOLL_INLINE BOOL CMapPtrToWord::IsEmpty() const + { return m_nCount == 0; } +_AFXCOLL_INLINE void CMapPtrToWord::SetAt(void* key, WORD newValue) + { (*this)[key] = newValue; } +_AFXCOLL_INLINE POSITION CMapPtrToWord::GetStartPosition() const + { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; } +_AFXCOLL_INLINE UINT CMapPtrToWord::GetHashTableSize() const + { return m_nHashTableSize; } + + +//////////////////////////////////////////////////////////////////////////// + +_AFXCOLL_INLINE int CMapPtrToPtr::GetCount() const + { return m_nCount; } +_AFXCOLL_INLINE BOOL CMapPtrToPtr::IsEmpty() const + { return m_nCount == 0; } +_AFXCOLL_INLINE void CMapPtrToPtr::SetAt(void* key, void* newValue) + { (*this)[key] = newValue; } +_AFXCOLL_INLINE POSITION CMapPtrToPtr::GetStartPosition() const + { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; } +_AFXCOLL_INLINE UINT CMapPtrToPtr::GetHashTableSize() const + { return m_nHashTableSize; } + + +//////////////////////////////////////////////////////////////////////////// + +_AFXCOLL_INLINE int CMapWordToOb::GetCount() const + { return m_nCount; } +_AFXCOLL_INLINE BOOL CMapWordToOb::IsEmpty() const + { return m_nCount == 0; } +_AFXCOLL_INLINE void CMapWordToOb::SetAt(WORD key, CObject* newValue) + { (*this)[key] = newValue; } +_AFXCOLL_INLINE POSITION CMapWordToOb::GetStartPosition() const + { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; } +_AFXCOLL_INLINE UINT CMapWordToOb::GetHashTableSize() const + { return m_nHashTableSize; } + + +//////////////////////////////////////////////////////////////////////////// +_AFXCOLL_INLINE int CMapStringToPtr::GetCount() const + { return m_nCount; } +_AFXCOLL_INLINE BOOL CMapStringToPtr::IsEmpty() const + { return m_nCount == 0; } +_AFXCOLL_INLINE void CMapStringToPtr::SetAt(LPCTSTR key, void* newValue) + { (*this)[key] = newValue; } +_AFXCOLL_INLINE POSITION CMapStringToPtr::GetStartPosition() const + { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; } +_AFXCOLL_INLINE UINT CMapStringToPtr::GetHashTableSize() const + { return m_nHashTableSize; } + + +//////////////////////////////////////////////////////////////////////////// +_AFXCOLL_INLINE int CMapStringToOb::GetCount() const + { return m_nCount; } +_AFXCOLL_INLINE BOOL CMapStringToOb::IsEmpty() const + { return m_nCount == 0; } +_AFXCOLL_INLINE void CMapStringToOb::SetAt(LPCTSTR key, CObject* newValue) + { (*this)[key] = newValue; } +_AFXCOLL_INLINE POSITION CMapStringToOb::GetStartPosition() const + { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; } +_AFXCOLL_INLINE UINT CMapStringToOb::GetHashTableSize() const + { return m_nHashTableSize; } + + +//////////////////////////////////////////////////////////////////////////// +_AFXCOLL_INLINE int CMapStringToString::GetCount() const + { return m_nCount; } +_AFXCOLL_INLINE BOOL CMapStringToString::IsEmpty() const + { return m_nCount == 0; } +_AFXCOLL_INLINE void CMapStringToString::SetAt(LPCTSTR key, LPCTSTR newValue) + { (*this)[key] = newValue; } +_AFXCOLL_INLINE POSITION CMapStringToString::GetStartPosition() const + { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; } +_AFXCOLL_INLINE UINT CMapStringToString::GetHashTableSize() const + { return m_nHashTableSize; } + +///////////////////////////////////////////////////////////////////////////// + +#endif //_AFXCOLL_INLINE diff --git a/public/sdk/inc/mfc30/afxdb.h b/public/sdk/inc/mfc30/afxdb.h new file mode 100644 index 000000000..0b6107cf8 --- /dev/null +++ b/public/sdk/inc/mfc30/afxdb.h @@ -0,0 +1,817 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1993 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXDB_H__ +#define __AFXDB_H__ + +#ifdef _AFX_NO_DB_SUPPORT + #error Database classes not supported in this library variant. +#endif + +#ifndef __AFXEXT_H__ + #include <afxext.h> +#endif + +// include standard SQL/ODBC "C" APIs +#include <sql.h> // core +#include <sqlext.h> // extensions + +#ifndef _AFX_NOFORCE_LIBS +#ifndef _MAC + +///////////////////////////////////////////////////////////////////////////// +// Win32 libraries + +#ifdef _AFXDLL + #ifdef _AFXCTL + #ifdef _DEBUG + #pragma comment(lib, "ocd30d.lib") + #else + #pragma comment(lib, "ocd30.lib") + #endif + #else + #ifdef _DEBUG + #pragma comment(lib, "mfcd30d.lib") + #else + #pragma comment(lib, "mfcd30.lib") + #endif + #endif +#endif +#pragma comment(lib, "odbc32.lib") +#pragma comment(lib, "odbccp32.lib") + +#else //!_MAC + +///////////////////////////////////////////////////////////////////////////// +// Macintosh libraries + +#endif //_MAC +#endif //!_AFX_NOFORCE_LIBS + +///////////////////////////////////////////////////////////////////////////// + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +///////////////////////////////////////////////////////////////////////////// +// AFXDB - MFC SQL/ODBC/Database support + +// Classes declared in this file + + //CException + class CDBException; // abnormal return value + + //CFieldExchange + class CFieldExchange; // Recordset Field Exchange + + //CObject + class CDatabase; // Connecting to databases + class CRecordset; // Data result sets + +//CObject + //CCmdTarget; + //CWnd + //CView + //CScrollView + //CFormView + class CRecordView; // view records with a form + +// Non CObject classes +struct CRecordsetStatus; +struct CFieldInfo; + +///////////////////////////////////////////////////////////////////////////// + +// ODBC helpers +// return code left in 'nRetCode' +#define AFX_SQL_ASYNC(prs, SQLFunc) \ + do \ + { \ + ASSERT(!CDatabase::InWaitForDataSource()); \ + while ((nRetCode = (SQLFunc)) == SQL_STILL_EXECUTING) \ + prs->OnWaitForDataSource(TRUE); \ + prs->OnWaitForDataSource(FALSE); \ + } while (0) + +#define AFX_SQL_SYNC(SQLFunc) \ + do \ + { \ + ASSERT(!CDatabase::InWaitForDataSource()); \ + nRetCode = SQLFunc; \ + } while (0) + +// Max display length in chars of timestamp (date & time) value +#define TIMESTAMP_PRECISION 23 + +// AFXDLL support +#undef AFX_DATA +#define AFX_DATA AFX_DB_DATA + +// Miscellaneous sizing info +#define MAX_CURRENCY 30 // Max size of Currency($) string +#define MAX_TNAME_LEN 64 // Max size of table names +#define MAX_FNAME_LEN 64 // Max size of field names +#define MAX_DBNAME_LEN 32 // Max size of a database name +#define MAX_DNAME_LEN 256 // Max size of Recordset names +#define MAX_CONNECT_LEN 512 // Max size of Connect string +#define MAX_CURSOR_NAME 18 // Max size of a cursor name + +// Timeout and net wait defaults +#define DEFAULT_LOGIN_TIMEOUT 15 // seconds to before fail on connect +#define DEFAULT_QUERY_TIMEOUT 15 // seconds to before fail waiting for results +#define DEFAULT_MAX_WAIT_FOR_DATASOURCE 250 // milliseconds. Give DATASOURCE 1/4 second to respond +#define DEFAULT_MIN_WAIT_FOR_DATASOURCE 50 // milliseconds. Start value for min wait heuristic + +// Field Flags, used to indicate status of fields +#define AFX_SQL_FIELD_FLAG_DIRTY 0x1 +#define AFX_SQL_FIELD_FLAG_NULL 0x2 + +///////////////////////////////////////////////////////////////////////////// +// CDBException - something gone wrong + +// Dbkit extended error codes +#define AFX_SQL_ERROR 1000 +#define AFX_SQL_ERROR_CONNECT_FAIL AFX_SQL_ERROR+1 +#define AFX_SQL_ERROR_RECORDSET_FORWARD_ONLY AFX_SQL_ERROR+2 +#define AFX_SQL_ERROR_EMPTY_COLUMN_LIST AFX_SQL_ERROR+3 +#define AFX_SQL_ERROR_FIELD_SCHEMA_MISMATCH AFX_SQL_ERROR+4 +#define AFX_SQL_ERROR_ILLEGAL_MODE AFX_SQL_ERROR+5 +#define AFX_SQL_ERROR_MULTIPLE_ROWS_AFFECTED AFX_SQL_ERROR+6 +#define AFX_SQL_ERROR_NO_CURRENT_RECORD AFX_SQL_ERROR+7 +#define AFX_SQL_ERROR_NO_ROWS_AFFECTED AFX_SQL_ERROR+8 +#define AFX_SQL_ERROR_RECORDSET_READONLY AFX_SQL_ERROR+9 +#define AFX_SQL_ERROR_SQL_NO_TOTAL AFX_SQL_ERROR+10 +#define AFX_SQL_ERROR_ODBC_LOAD_FAILED AFX_SQL_ERROR+11 +#define AFX_SQL_ERROR_DYNASET_NOT_SUPPORTED AFX_SQL_ERROR+12 +#define AFX_SQL_ERROR_SNAPSHOT_NOT_SUPPORTED AFX_SQL_ERROR+13 +#define AFX_SQL_ERROR_API_CONFORMANCE AFX_SQL_ERROR+14 +#define AFX_SQL_ERROR_SQL_CONFORMANCE AFX_SQL_ERROR+15 +#define AFX_SQL_ERROR_NO_DATA_FOUND AFX_SQL_ERROR+16 +#define AFX_SQL_ERROR_ROW_UPDATE_NOT_SUPPORTED AFX_SQL_ERROR+17 +#define AFX_SQL_ERROR_ODBC_V2_REQUIRED AFX_SQL_ERROR+18 +#define AFX_SQL_ERROR_NO_POSITIONED_UPDATES AFX_SQL_ERROR+19 +#define AFX_SQL_ERROR_LOCK_MODE_NOT_SUPPORTED AFX_SQL_ERROR+20 +#define AFX_SQL_ERROR_DATA_TRUNCATED AFX_SQL_ERROR+21 +#define AFX_SQL_ERROR_ROW_FETCH AFX_SQL_ERROR+22 +#define AFX_SQL_ERROR_INCORRECT_ODBC AFX_SQL_ERROR+23 +#define AFX_SQL_ERROR_UPDATE_DELETE_FAILED AFX_SQL_ERROR+24 +#define AFX_SQL_ERROR_MAX AFX_SQL_ERROR+25 + +class CDBException : public CException +{ + DECLARE_DYNAMIC(CDBException) + +// Attributes +public: + RETCODE m_nRetCode; + CString m_strError; + CString m_strStateNativeOrigin; + +// Implementation (use AfxThrowDBException to create) +public: + CDBException(RETCODE nRetCode = SQL_SUCCESS); + + void BuildErrorString(CDatabase* pdb, HSTMT hstmt, BOOL bTrace = TRUE); + void Empty(); + virtual ~CDBException(); +#ifdef _DEBUG + void TraceErrorMessage(LPCTSTR szTrace) const; +#endif // DEBUG + +}; + +void AFXAPI AfxThrowDBException(RETCODE nRetCode, CDatabase* pdb, HSTMT hstmt); + +////////////////////////////////////////////////////////////////////////////// +// CLongBinary - a Long (generally > 32k in length) Binary object + +#define AFX_SQL_DEFAULT_LONGBINARY_SIZE 1024 + +class CLongBinary : public CObject +{ + DECLARE_DYNAMIC(CLongBinary) + +// Constructors +public: + CLongBinary(); + +// Attributes + HGLOBAL m_hData; + DWORD m_dwDataLength; + +// Implementation +public: + virtual ~CLongBinary(); + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif //_DEBUG +}; + +////////////////////////////////////////////////////////////////////////////// +// CDatabase - a SQL Database + +class CDatabase : public CObject +{ + DECLARE_DYNAMIC(CDatabase) + +// Constructors +public: + CDatabase(); + + virtual BOOL Open(LPCSTR lpszDSN, BOOL bExclusive = FALSE, + BOOL bReadonly = FALSE, LPCSTR lpszConnect = "ODBC;", + BOOL bUseCursorLib = TRUE); + virtual void Close(); + +// Attributes +public: + HDBC m_hdbc; + + BOOL IsOpen() const; // Database successfully opened? + BOOL CanUpdate() const; + BOOL CanTransact() const; // Are Transactions supported? + + CString GetDatabaseName() const; + const CString& GetConnect() const; + + // global state - if waiting for datasource => not normal operations + static BOOL PASCAL InWaitForDataSource(); + +// Operations +public: + void SetLoginTimeout(DWORD dwSeconds); + void SetQueryTimeout(DWORD dwSeconds); + void SetSynchronousMode(BOOL bSynchronous); + + // transaction control + BOOL BeginTrans(); + BOOL CommitTrans(); + BOOL Rollback(); + + // direct sql execution + void ExecuteSQL(LPCSTR lpszSQL); + + // Cancel asynchronous operation + void Cancel(); + +// Overridables +public: + // set special options + virtual void OnSetOptions(HSTMT hstmt); + + // Give user chance to cancel long operation + virtual void OnWaitForDataSource(BOOL bStillExecuting); + +// Implementation +public: + virtual ~CDatabase(); + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; + + BOOL m_bTransactionPending; +#endif //_DEBUG + + // general error check + virtual BOOL Check(RETCODE nRetCode) const; + + void ReplaceBrackets(LPTSTR lpchSQL); + BOOL m_bStripTrailingSpaces; + BOOL m_bIncRecordCountOnAdd; + +protected: + CString m_strConnect; + + CPtrList m_listRecordsets; // maintain list to ensure CRecordsets all closed + + int nRefCount; + BOOL m_bUpdatable; + + BOOL m_bTransactions; + SWORD m_nTransactionCapable; + SWORD m_nCursorCommitBehavior; + SWORD m_nCursorRollbackBehavior; + UDWORD m_dwGetDataExtensions; + + DWORD m_dwLoginTimeout; + HSTMT m_hstmt; + DWORD m_dwWait; + + DWORD m_dwQueryTimeout; + DWORD m_dwMinWaitForDataSource; + DWORD m_dwMaxWaitForDataSource; + BOOL m_bAsync; + char m_chIDQuoteChar; + char m_reserved1[3]; // pad to even 4 bytes + + void ThrowDBException(RETCODE nRetCode); + void AllocConnect(); + void Free(); + + // friend classes that call protected CDatabase overridables + friend class CRecordset; + friend class CFieldExchange; + friend class CDBException; +}; + +////////////////////////////////////////////////////////////////////////////// +// Recordset Field exchanged (RFX_) + +#define AFX_RFX_INT_PSEUDO_NULL (0x7EE4) +#define AFX_RFX_LONG_PSEUDO_NULL (0x4a4d4120L) +#define AFX_RFX_BYTE_PSEUDO_NULL 255 +#define AFX_RFX_SINGLE_PSEUDO_NULL (-9.123e19f) +#define AFX_RFX_DOUBLE_PSEUDO_NULL (-9.123e19) +#define AFX_RFX_BOOL_PSEUDO_NULL 2 +#define AFX_RFX_DATE_PSEUDO_NULL CTime(0) +#define AFX_RFX_TIMESTAMP_PSEUDO_NULL 99 + +#define AFX_RFX_BOOL 1 +#define AFX_RFX_BYTE 2 +#define AFX_RFX_INT 3 +#define AFX_RFX_LONG 4 +#define AFX_RFX_SINGLE 6 +#define AFX_RFX_DOUBLE 7 +#define AFX_RFX_DATE 8 +#define AFX_RFX_BINARY 9 +#define AFX_RFX_TEXT 10 +#define AFX_RFX_LONGBINARY 11 + +// CFieldExchange - for field exchange +class CFieldExchange +{ +// Attributes +public: + enum RFX_Operation + { + BindParam, // register users parameters with ODBC SQLBindParameter + RebindDateParam, // migrate date param values to proxy array before Requery + BindFieldToColumn, // register users fields with ODBC SQLBindCol + BindFieldForUpdate, // temporarily bind columns before update (via SQLSetPos) + UnbindFieldForUpdate, // unbind columns after update (via SQLSetPos) + Fixup, // Set string lengths, clear status bits + MarkForAddNew, + MarkForUpdate, // Prepare fields and flags for update operation + Name, // append dirty field name + NameValue, // append dirty name=value + Value, // append dirty value or parameter marker + SetFieldDirty, // Set status bit for changed status + SetFieldNull, // Set status bit for null value + IsFieldDirty,// return TRUE if field is dirty + IsFieldNull,// return TRUE if field is marked NULL + IsFieldNullable,// return TRUE if field can hold NULL values + StoreField, // archive values of current record + LoadField, // reload archived values into current record + GetFieldInfoValue, // general info on a field via pv for field + GetFieldInfoOrdinal, // general info on a field via field ordinal +#ifdef _DEBUG + DumpField, // dump bound field name and value +#endif + }; + UINT m_nOperation; // Type of exchange operation + CRecordset* m_prs; // recordset handle + +// Operations + enum FieldType + { + noFieldType, + outputColumn, + param, + }; + +// Operations (for implementors of RFX procs) + BOOL IsFieldType(UINT* pnField); + + // Indicate purpose of subsequent RFX calls + void SetFieldType(UINT nFieldType); + +// Implementation + CFieldExchange(UINT nOperation, CRecordset* prs, void* pvField = NULL); + + void Default(const char* szName, + void* pv, LONG* plLength, int nCType, UINT cbValue, UINT cbPrecision); + + int GetColumnType(int nColumn, UINT* pcbLength = NULL, + int* pnScale = NULL, int* pnNullable = NULL); + + // Current type of field + UINT m_nFieldType; + + // For GetFieldInfo + CFieldInfo* m_pfi; // GetFieldInfo return struct + BOOL m_bFieldFound; // GetFieldInfo search successful + + // For returning status info for a field + BOOL m_bNull; // return result of IsFieldNull(able)/Dirty operation + BOOL m_bDirty; // return result of IsFieldNull(able)/Dirty operation + + CString* m_pstr; // Field name or destination for building various SQL clauses + BOOL m_bField; // Value to set for SetField operation + void* m_pvField; // For indicating an operation on a specific field + CArchive* m_par; // For storing/loading copy buffer + LPCSTR m_lpszSeparator; // append after field names + UINT m_nFields; // count of fields for various operations + UINT m_nParams; // count of fields for various operations + UINT m_nParamFields; // count of fields for various operations + HSTMT m_hstmt; // For SQLBindParameter on update statement + +#ifdef _DEBUG + CDumpContext* m_pdcDump; +#endif //_DEBUG + +}; + +///////////////////////////////////////////////////////////////////////////// +// Standard RecordSet Field Exchange routines + +// text data +void AFXAPI RFX_Text(CFieldExchange* pFX, const char* szName, CString& value, + // Default max length for char and varchar, default datasource type + int nMaxLength = 255, int nColumnType = SQL_VARCHAR); + +// boolean data +void AFXAPI RFX_Bool(CFieldExchange* pFX, const char* szName, BOOL& value); + +// integer data +void AFXAPI RFX_Long(CFieldExchange* pFX, const char* szName, long& value); +void AFXAPI RFX_Int(CFieldExchange* pFX, const char* szName, int& value); +void AFXAPI RFX_Single(CFieldExchange* pFX, const char* szName, float& value); +void AFXAPI RFX_Double(CFieldExchange* pFX, const char* szName, double& value); + +// date and time +void AFXAPI RFX_Date(CFieldExchange* pFX, const char* szName, CTime& value); +void AFXAPI RFX_Date(CFieldExchange* pFX, const char* szName, TIMESTAMP_STRUCT& value); + +// Binary data +void AFXAPI RFX_Binary(CFieldExchange* pFX, const char* szName, CByteArray& value, + // Default max length is for binary and varbinary + int nMaxLength = 255); +void AFXAPI RFX_Byte(CFieldExchange* pFX, const char* szName, BYTE& value); +void AFXAPI RFX_LongBinary(CFieldExchange* pFX, const char* szName, CLongBinary& value); + +///////////////////////////////////////////////////////////////////////////// +// Database Dialog Data Exchange cover routines +// Cover routines provide database semantics on top of DDX routines + +// simple text operations +void AFXAPI DDX_FieldText(CDataExchange* pDX, int nIDC, BYTE& value, CRecordset* pRecordset); +void AFXAPI DDX_FieldText(CDataExchange* pDX, int nIDC, int& value, CRecordset* pRecordset); +void AFXAPI DDX_FieldText(CDataExchange* pDX, int nIDC, UINT& value, CRecordset* pRecordset); +void AFXAPI DDX_FieldText(CDataExchange* pDX, int nIDC, long& value, CRecordset* pRecordset); +void AFXAPI DDX_FieldText(CDataExchange* pDX, int nIDC, DWORD& value, CRecordset* pRecordset); +void AFXAPI DDX_FieldText(CDataExchange* pDX, int nIDC, CString& value, CRecordset* pRecordset); +void AFXAPI DDX_FieldText(CDataExchange* pDX, int nIDC, double& value, CRecordset* pRecordset); +void AFXAPI DDX_FieldText(CDataExchange* pDX, int nIDC, float& value, CRecordset* pRecordset); + +// special control types +void AFXAPI DDX_FieldCheck(CDataExchange* pDX, int nIDC, int& value, CRecordset* pRecordset); +void AFXAPI DDX_FieldRadio(CDataExchange* pDX, int nIDC, int& value, CRecordset* pRecordset); +void AFXAPI DDX_FieldLBString(CDataExchange* pDX, int nIDC, CString& value, CRecordset* pRecordset); +void AFXAPI DDX_FieldCBString(CDataExchange* pDX, int nIDC, CString& value, CRecordset* pRecordset); +void AFXAPI DDX_FieldLBStringExact(CDataExchange* pDX, int nIDC, CString& value, CRecordset* pRecordset); +void AFXAPI DDX_FieldCBStringExact(CDataExchange* pDX, int nIDC, CString& value, CRecordset* pRecordset); + +////////////////////////////////////////////////////////////////////////////// +// CRecordset - the result of a SQL Statement + +#define AFX_MOVE_FIRST 0x80000000L +#define AFX_MOVE_PREVIOUS (-1L) +#define AFX_MOVE_REFRESH 0L +#define AFX_MOVE_NEXT (+1L) +#define AFX_MOVE_LAST 0x7fffffffL + +#define AFX_RECORDSET_STATUS_OPEN (+1L) +#define AFX_RECORDSET_STATUS_CLOSED 0L +#define AFX_RECORDSET_STATUS_UNKNOWN (-1L) + +class CRecordset : public CObject +{ + DECLARE_DYNAMIC(CRecordset) + +// Constructor +protected: + CRecordset(CDatabase* pDatabase = NULL); + +public: + virtual ~CRecordset(); + + enum OpenType + { + dynaset, + snapshot, + forwardOnly + }; + + enum OpenOptions + { + none = 0x0, + readOnly = 0x0004, + appendOnly = 0x0008, + optimizeBulkAdd = 0x4000, // Use prepared HSTMT for multiple AddNews, dirty fields must not change. + firstBulkAdd = 0x8000, // INTERNAL to MFC, don't specify on Open. + }; + virtual BOOL Open(UINT nOpenType = snapshot, LPCSTR lpszSQL = NULL, DWORD dwOptions = none); + virtual void Close(); + +// Attributes +public: + HSTMT m_hstmt; // Source statement for this resultset + CDatabase* m_pDatabase; // Source database for this resultset + + CString m_strFilter; // Where clause + CString m_strSort; // Order By Clause + + BOOL CanAppend() const; // Can AddNew be called? + BOOL CanRestart() const; // Can Requery be called to restart a query? + BOOL CanScroll() const; // Can MovePrev and MoveFirst be called? + BOOL CanTransact() const; // Are Transactions supported? + BOOL CanUpdate() const; // Can Edit/AddNew/Delete be called? + + const CString& GetSQL() const; // SQL executed for this recordset + const CString& GetTableName() const; // Table name + + BOOL IsOpen() const; // Recordset successfully opened? + BOOL IsBOF() const; // Beginning Of File + BOOL IsEOF() const; // End Of File + BOOL IsDeleted() const; // On a deleted record + + BOOL IsFieldDirty(void *pv); // has field been updated? + BOOL IsFieldNull(void *pv); // is field NULL valued? + BOOL IsFieldNullable(void *pv); // can field be set to a NULL value + + long GetRecordCount() const; // Records seen so far or -1 if unknown + void GetStatus(CRecordsetStatus& rStatus) const; + +// Operations +public: + // cursor operations + void MoveNext(); + void MovePrev(); + void MoveFirst(); + void MoveLast(); + virtual void Move(long lRows); + + // edit buffer operations + virtual void AddNew(); // add new record at the end + virtual void Edit(); // start editing + virtual BOOL Update(); // update it + virtual void Delete(); // delete the current record + + // field operations + void SetFieldDirty(void *pv, BOOL bDirty = TRUE); + void SetFieldNull(void *pv, BOOL bNull = TRUE); + + // locking control during Edit + enum LockMode + { + optimistic, + pessimistic, + }; + void SetLockingMode(UINT nMode); + + // Recordset operations + virtual BOOL Requery(); // Re-execute query based on new params + + // Cancel asynchronous operation + void Cancel(); + +// Overridables +public: + // Get default connect string + virtual CString GetDefaultConnect(); + + // Get SQL to execute + virtual CString GetDefaultSQL() = 0; + + // set special options + virtual void OnSetOptions(HSTMT hstmt); + + // Give user chance to cancel long operation + virtual void OnWaitForDataSource(BOOL bStillExecuting); + + // for recordset field exchange + virtual void DoFieldExchange(CFieldExchange* pFX) = 0; + +// Implementation +public: +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif //_DEBUG + + virtual BOOL Check(RETCODE nRetCode) const; // general error check + void InitRecord(); + virtual void PreBindFields(); // called before data fields are bound + UINT m_nFields; // number of RFX fields + UINT m_nParams; // number of RFX params + BOOL m_bDateParams; // date parameter existence flag + BOOL m_bLongBinaryColumns; // long binary column existence flag + BOOL m_bUseUpdateSQL; // uses SQL-based updates (or SQLSetPos) + UDWORD m_dwDriverPositionedStatements; + + BOOL IsSQLUpdatable(LPCTSTR lpszSQL); + BOOL IsSelectQueryUpdatable(LPCTSTR lpszSQL); + static BOOL PASCAL IsJoin(LPCTSTR lpszJoinClause); + static LPCTSTR PASCAL FindSQLToken(LPCTSTR lpszSQL, LPCTSTR lpszSQLToken); + + // RFX Operations on fields of CRecordset + UINT BindParams(HSTMT hstmt); + void RebindDateParams(HSTMT hstmt); + UINT BindFieldsToColumns(); + void BindFieldsForUpdate(); + void UnbindFieldsForUpdate(); + void Fixups(); + UINT AppendNames(CString* pstr, LPCSTR szSeparator); + UINT AppendValues(HSTMT hstmt, CString* pstr, LPCSTR szSeparator); + UINT AppendNamesValues(HSTMT hstmt, CString* pstr, LPCSTR szSeparator); + void StoreFields(); + void LoadFields(); + void MarkForAddNew(); + void MarkForUpdate(); + BOOL GetFieldInfo(void* pv, CFieldInfo* pfi); + BOOL GetFieldInfo(UINT nField, CFieldInfo* pfi); +#ifdef _DEBUG + void DumpFields(CDumpContext& dc) const; +#endif //_DEBUG + + // RFX operation helper functions + BOOL UnboundFieldInfo(UINT nField, CFieldInfo* pfi); + + void ThrowDBException(RETCODE nRetCode, HSTMT hstmt = SQL_NULL_HSTMT); + + CMemFile* m_pmemfile; // For saving copy buffer + CArchive* m_par; // For saving copy buffer + + void AllocFlags(); + BYTE GetFieldFlags(UINT nField, UINT nFieldType = CFieldExchange::outputColumn); + void SetFieldFlags(UINT nField, BYTE bFlags, UINT nFieldType = CFieldExchange::outputColumn); + void ClearFieldFlags(UINT nField, BYTE bFlags, UINT nFieldType = CFieldExchange::outputColumn); + LONG* GetFieldLength(CFieldExchange* pFX); + BOOL IsFieldFlagNull(UINT nField, UINT nFieldType); + BOOL IsFieldFlagDirty(UINT nField, UINT nFieldType); + void** m_pvFieldProxy; + void** m_pvParamProxy; + UINT m_nProxyFields; + UINT m_nProxyParams; + +protected: + UINT m_nOpenType; + enum EditMode + { + noMode, + edit, + addnew + }; + long m_lOpen; + UINT m_nEditMode; + BOOL m_bEOFSeen; + long m_lRecordCount; + long m_lCurrentRecord; + CString m_strCursorName; + // Perform operation based on m_nEditMode + BOOL UpdateInsertDelete(); + void ReleaseCopyBuffer(); + BOOL m_nLockMode; // Control concurrency for Edit() + UDWORD m_dwDriverConcurrency; // driver supported concurrency types + UDWORD m_dwConcurrency; // requested concurrency type + UWORD m_wRowStatus; // row status used by SQLExtendedFetch and SQLSetPos + HSTMT m_hstmtUpdate; + BOOL m_bRecordsetDb; + BOOL m_bBOF; + BOOL m_bEOF; + BOOL m_bUpdatable; // Is recordset updatable? + BOOL m_bAppendable; + CString m_strSQL; // SQL statement for recordset + CString m_strUpdateSQL; // SQL statement for updates + CString m_strTableName; // source table of recordset + BOOL m_bScrollable; // supports MovePrev + BOOL m_bDeleted; + DWORD m_dwWait; + UINT m_nFieldsBound; + BYTE* m_pbFieldFlags; + LONG* m_plFieldLength; // Pointer to field length bound in SQLBindCol + BYTE* m_pbParamFlags; + LONG* m_plParamLength; + BOOL m_bExtendedFetch; +public: + DWORD m_dwOptions; // archive dwOptions on Open +protected: + CString m_strRequerySQL; // archive SQL string for use in Requery() + CString m_strRequeryFilter; // archive filter string for use in Requery() + CString m_strRequerySort; // archive sort string for use in Requery() + void BuildSelectSQL(); + void AppendFilterAndSortSQL(); + BOOL IsRecordsetUpdatable(); + void ExecuteSetPosUpdate(); + void PrepareUpdateHstmt(); + void BuildUpdateSQL(); + void ExecuteUpdateSQL(); + void SendLongBinaryData(HSTMT hstmt); + + friend class CFieldExchange; + friend class CRecordView; +}; + +#define AFX_CURRENT_RECORD_UNDEFINED (-2) +#define AFX_CURRENT_RECORD_BOF (-1) + +// For returning status for a recordset +struct CRecordsetStatus +{ + long m_lCurrentRecord; // -2=Unknown,-1=BOF,0=1st record. . . + BOOL m_bRecordCountFinal;// Have we counted all records? +}; + +// For returning field info on RFX fields +struct CFieldInfo +{ + // For ID'ing field + UINT nField; // Field number + CString strName; // Field name + void* pv; // Address of value for field + + // Return info GetFieldInfo + UINT nDataType; // data type of field (BOOL, BYTE, etc) + DWORD dwSize; // Max size for field data +}; + +///////////////////////////////////////////////////////////////////////////// +// CRecordView - form for viewing data records + +class CRecordView : public CFormView +{ + DECLARE_DYNAMIC(CRecordView) + +// Construction +protected: // must derive your own class + CRecordView(LPCSTR lpszTemplateName); + CRecordView(UINT nIDTemplate); + +// Attributes +public: + virtual CRecordset* OnGetRecordset() = 0; + + BOOL IsOnLastRecord(); + BOOL IsOnFirstRecord(); + +// Operations +public: + virtual BOOL OnMove(UINT nIDMoveCommand); + +// Implementation +public: + virtual ~CRecordView(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + virtual void OnInitialUpdate(); + +protected: + BOOL m_bOnFirstRecord; + BOOL m_bOnLastRecord; + + //{{AFX_MSG(CRecordView) + afx_msg void OnUpdateRecordFirst(CCmdUI* pCmdUI); + afx_msg void OnUpdateRecordPrev(CCmdUI* pCmdUI); + afx_msg void OnUpdateRecordNext(CCmdUI* pCmdUI); + afx_msg void OnUpdateRecordLast(CCmdUI* pCmdUI); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// Inline function declarations + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +#ifdef _AFX_ENABLE_INLINES +#define _AFXDBCORE_INLINE inline +#define _AFXDBRFX_INLINE inline +#define _AFXDBVIEW_INLINE inline +#include <afxdb.inl> +#undef _AFXDBVIEW_INLINE +#undef _AFXDBCORE_INLINE +#undef _AFXDBRFX_INLINE +#endif + +#undef AFX_DATA +#define AFX_DATA + +#endif //__AFXDB_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxdb.inl b/public/sdk/inc/mfc30/afxdb.inl new file mode 100644 index 000000000..d65243902 --- /dev/null +++ b/public/sdk/inc/mfc30/afxdb.inl @@ -0,0 +1,92 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1993 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// Inlines for AFXDB.H + +///////////////////////////////////////////////////////////////////////////// +// General database inlines + +#ifdef _AFXDBCORE_INLINE + +// CDatabase inlines +_AFXDBCORE_INLINE BOOL CDatabase::IsOpen() const + { ASSERT_VALID(this); return m_hdbc != SQL_NULL_HDBC; } +_AFXDBCORE_INLINE BOOL CDatabase::CanUpdate() const + { ASSERT(IsOpen()); return m_bUpdatable; } +_AFXDBCORE_INLINE BOOL CDatabase::CanTransact() const + { ASSERT(IsOpen()); return m_bTransactions; } +_AFXDBCORE_INLINE void CDatabase::SetLoginTimeout(DWORD dwSeconds) + { ASSERT_VALID(this); m_dwLoginTimeout = dwSeconds; } +_AFXDBCORE_INLINE void CDatabase::SetQueryTimeout(DWORD dwSeconds) + { ASSERT_VALID(this); m_dwQueryTimeout = dwSeconds; } +_AFXDBCORE_INLINE void CDatabase::SetSynchronousMode(BOOL bSynchronous) + { ASSERT_VALID(this); m_bAsync = !bSynchronous; } +_AFXDBCORE_INLINE const CString& CDatabase::GetConnect() const + { ASSERT_VALID(this); return m_strConnect; } +_AFXDBCORE_INLINE void CDatabase::ThrowDBException(RETCODE nRetCode) + { ASSERT_VALID(this); AfxThrowDBException(nRetCode, this, m_hstmt); } + +// CRecordset inlines +_AFXDBCORE_INLINE const CString& CRecordset::GetSQL() const + { ASSERT(IsOpen()); return m_strSQL; } +_AFXDBCORE_INLINE const CString& CRecordset::GetTableName() const + { ASSERT(IsOpen()); return m_strTableName; } +_AFXDBCORE_INLINE BOOL CRecordset::IsBOF() const + { ASSERT(IsOpen()); return m_bBOF; } +_AFXDBCORE_INLINE BOOL CRecordset::IsEOF() const + { ASSERT(IsOpen()); return m_bEOF; } +_AFXDBCORE_INLINE BOOL CRecordset::IsDeleted() const + { ASSERT(IsOpen()); return m_bDeleted; } +_AFXDBCORE_INLINE BOOL CRecordset::CanUpdate() const + { ASSERT(IsOpen()); return m_bUpdatable; } +_AFXDBCORE_INLINE BOOL CRecordset::CanScroll() const + { ASSERT(IsOpen()); return m_bScrollable; } +_AFXDBCORE_INLINE BOOL CRecordset::CanAppend() const + { ASSERT(IsOpen()); return m_bAppendable; } +_AFXDBCORE_INLINE BOOL CRecordset::CanRestart() const + { ASSERT(IsOpen()); return TRUE; } +_AFXDBCORE_INLINE BOOL CRecordset::CanTransact() const + { ASSERT(IsOpen());return m_pDatabase->m_bTransactions; } +_AFXDBCORE_INLINE long CRecordset::GetRecordCount() const + { ASSERT(IsOpen()); return m_lRecordCount; } +_AFXDBCORE_INLINE void CRecordset::GetStatus(CRecordsetStatus& rStatus) const + { ASSERT(IsOpen()); + rStatus.m_lCurrentRecord = m_lCurrentRecord; + rStatus.m_bRecordCountFinal = m_bEOFSeen; } +_AFXDBCORE_INLINE void CRecordset::ThrowDBException(RETCODE nRetCode, HSTMT hstmt) + { ASSERT_VALID(this); AfxThrowDBException(nRetCode, m_pDatabase, + (hstmt == SQL_NULL_HSTMT)? m_hstmt : hstmt); } +_AFXDBCORE_INLINE void CRecordset::MoveNext() + { ASSERT(IsOpen()); Move(AFX_MOVE_NEXT); } +_AFXDBCORE_INLINE void CRecordset::MovePrev() + { ASSERT(IsOpen()); Move(AFX_MOVE_PREVIOUS); } +_AFXDBCORE_INLINE void CRecordset::MoveFirst() + { ASSERT(IsOpen()); Move(AFX_MOVE_FIRST); } +_AFXDBCORE_INLINE void CRecordset::MoveLast() + { ASSERT(IsOpen()); Move(AFX_MOVE_LAST); } +_AFXDBCORE_INLINE BOOL CRecordset::IsFieldFlagNull(UINT nColumn, UINT nFieldType) + { ASSERT_VALID(this); + return (GetFieldFlags(nColumn, nFieldType) & AFX_SQL_FIELD_FLAG_NULL) != 0; } +_AFXDBCORE_INLINE BOOL CRecordset::IsFieldFlagDirty(UINT nColumn, UINT nFieldType) + { ASSERT_VALID(this); + return (GetFieldFlags(nColumn, nFieldType) & AFX_SQL_FIELD_FLAG_DIRTY) != 0; } + +#endif //_AFXDBCORE_INLINE + + +#ifdef _AFXDBRFX_INLINE + +_AFXDBRFX_INLINE void CFieldExchange::SetFieldType(UINT nFieldType) + { ASSERT(nFieldType == outputColumn || nFieldType == param); + m_nFieldType = nFieldType; } + +#endif //_AFXDBRFX_INLINE + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxdb.rc b/public/sdk/inc/mfc30/afxdb.rc new file mode 100644 index 000000000..31e21b3ce --- /dev/null +++ b/public/sdk/inc/mfc30/afxdb.rc @@ -0,0 +1,83 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992-1993 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXDB_RC__ +#define __AFXDB_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< Cannot change standard MFC resources! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// Database Resources + +// Database strings +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDP_SQL_CONNECT_FAIL + "Attempt to connect to datasource failed" + AFX_IDP_SQL_RECORDSET_FORWARD_ONLY + "Recordset supports forward movement only." + AFX_IDP_SQL_EMPTY_COLUMN_LIST + "Attempt to open a table failed - there were no columns to retrieve were specified." + AFX_IDP_SQL_FIELD_SCHEMA_MISMATCH + "Unexpected column data types were returned from query." + AFX_IDP_SQL_ILLEGAL_MODE "Attempt to Update or Delete failed." + AFX_IDP_SQL_MULTIPLE_ROWS_AFFECTED "Multiple rows were updated." + AFX_IDP_SQL_NO_CURRENT_RECORD "Operation failed, no current record." + AFX_IDP_SQL_NO_ROWS_AFFECTED + "No rows were affected by the update or delete operation." + AFX_IDP_SQL_RECORDSET_READONLY "Recordset is read-only" + AFX_IDP_SQL_SQL_NO_TOTAL + "ODBC driver doesn't support MFC LongBinary data model." + AFX_IDP_SQL_ODBC_LOAD_FAILED + "Attempt to load required component ODBC32.DLL failed." + AFX_IDP_SQL_DYNASET_NOT_SUPPORTED + "ODBC driver does not support dynasets." + AFX_IDP_SQL_SNAPSHOT_NOT_SUPPORTED + "ODBC static cursors required for snapshot support." + AFX_IDP_SQL_API_CONFORMANCE + "ODBC driver incompatible with MFC database classes (API_CONFORMANCE >= SQL_OAC_LEVEL1 required)." + AFX_IDP_SQL_SQL_CONFORMANCE + "ODBC driver incompatible with MFC database classes (SQL_CONFORMANCE >= SQL_OSC_MINIMUM required)." + AFX_IDP_SQL_NO_DATA_FOUND + "Attempt to scroll past end or before beginning of data." + AFX_IDP_SQL_ROW_UPDATE_NOT_SUPPORTED + "Dynasets not supported by ODBC driver." + AFX_IDP_SQL_ODBC_V2_REQUIRED + "ODBC Level 2 compliant driver required." + AFX_IDP_SQL_NO_POSITIONED_UPDATES + "Positioned updates not supported by ODBC driver." + AFX_IDP_SQL_LOCK_MODE_NOT_SUPPORTED + "Requested lock mode is not supported." + AFX_IDP_SQL_DATA_TRUNCATED + "Data truncated." + AFX_IDP_SQL_ROW_FETCH + "Error retrieving record." + AFX_IDP_SQL_INCORRECT_ODBC + "A required ODBC entry point was not found. Make sure ODBC is installed correctly." + AFX_IDP_SQL_UPDATE_DELETE_FAILED + "Update or Delete failed." +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXDB_RC__ diff --git a/public/sdk/inc/mfc30/afxdd_.h b/public/sdk/inc/mfc30/afxdd_.h new file mode 100644 index 000000000..6981eb770 --- /dev/null +++ b/public/sdk/inc/mfc30/afxdd_.h @@ -0,0 +1,57 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992-1993 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// Do not include this file directly (included by AFXWIN.H) + +///////////////////////////////////////////////////////////////////////////// +// Standard Dialog Data Exchange routines + +// simple text operations +void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, BYTE& value); +void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, int& value); +void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, UINT& value); +void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, long& value); +void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, DWORD& value); +void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, CString& value); +void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, float& value); +void AFXAPI DDX_Text(CDataExchange* pDX, int nIDC, double& value); + +// special control types +void AFXAPI DDX_Check(CDataExchange* pDX, int nIDC, int& value); +void AFXAPI DDX_Radio(CDataExchange* pDX, int nIDC, int& value); +void AFXAPI DDX_LBString(CDataExchange* pDX, int nIDC, CString& value); +void AFXAPI DDX_CBString(CDataExchange* pDX, int nIDC, CString& value); +void AFXAPI DDX_LBIndex(CDataExchange* pDX, int nIDC, int& index); +void AFXAPI DDX_CBIndex(CDataExchange* pDX, int nIDC, int& index); +void AFXAPI DDX_LBStringExact(CDataExchange* pDX, int nIDC, CString& value); +void AFXAPI DDX_CBStringExact(CDataExchange* pDX, int nIDC, CString& value); +void AFXAPI DDX_Scroll(CDataExchange* pDX, int nIDC, int& value); + +// for getting access to the actual controls +void AFXAPI DDX_Control(CDataExchange* pDX, int nIDC, CWnd& rControl); + +///////////////////////////////////////////////////////////////////////////// +// Standard Dialog Data Validation routines + +// range - value must be >= minVal and <= maxVal +// NOTE: you will require casts for 'minVal' and 'maxVal' to use the +// UINT, DWORD or float types +void AFXAPI DDV_MinMaxByte(CDataExchange* pDX, BYTE value, BYTE minVal, BYTE maxVal); +void AFXAPI DDV_MinMaxInt(CDataExchange* pDX, int value, int minVal, int maxVal); +void AFXAPI DDV_MinMaxLong(CDataExchange* pDX, long value, long minVal, long maxVal); +void AFXAPI DDV_MinMaxUInt(CDataExchange* pDX, UINT value, UINT minVal, UINT maxVal); +void AFXAPI DDV_MinMaxDWord(CDataExchange* pDX, DWORD value, DWORD minVal, DWORD maxVal); +void AFXAPI DDV_MinMaxFloat(CDataExchange* pDX, float const& value, float minVal, float maxVal); +void AFXAPI DDV_MinMaxDouble(CDataExchange* pDX, double const& value, double minVal, double maxVal); + +// number of characters +void AFXAPI DDV_MaxChars(CDataExchange* pDX, CString const& value, int nChars); + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxdisp.h b/public/sdk/inc/mfc30/afxdisp.h new file mode 100644 index 000000000..d1df382c0 --- /dev/null +++ b/public/sdk/inc/mfc30/afxdisp.h @@ -0,0 +1,590 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1993 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXDISP_H__ +#define __AFXDISP_H__ + +#ifdef _AFX_NO_OLE_SUPPORT + #error OLE classes not supported in this library variant. +#endif + +#ifndef __AFXWIN_H__ + #include <afxwin.h> +#endif + +// include necessary OLE 2.0 headers +#ifndef _UNICODE + #define OLE2ANSI +#endif +#include <objbase.h> +#include <objerror.h> +#include <scode.h> +#include <oleauto.h> + +#include <stddef.h> // for offsetof() + +#ifndef _AFX_NOFORCE_LIBS +#ifndef _MAC + +///////////////////////////////////////////////////////////////////////////// +// Win32 libraries + +#ifndef _AFXCTL +#ifdef _AFXDLL + #ifndef _UNICODE + #ifdef _DEBUG + #pragma comment(lib, "cfmo30d.lib") + #else + #pragma comment(lib, "cfmo30.lib") + #endif + #else + #ifdef _DEBUG + #pragma comment(lib, "cfmo30ud.lib") + #else + #pragma comment(lib, "cfmo30u.lib") + #endif + #endif +#endif + +#ifndef _UNICODE + #pragma comment(lib, "mfcans32.lib") + #pragma comment(lib, "mfcuia32.lib") +#else + #pragma comment(lib, "mfcuiw32.lib") +#endif + +#endif // !_AFXCTL + +#pragma comment(lib, "ole32.lib") +#pragma comment(lib, "oleaut32.lib") +#pragma comment(lib, "uuid.lib") + +#else //!_MAC + +///////////////////////////////////////////////////////////////////////////// +// Mac libraries + +#endif //_MAC +#endif //!_AFX_NOFORCE_LIBS + +///////////////////////////////////////////////////////////////////////////// + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +// This will cause an error if BSTR is not defined correctly. This can +// happen if you include the OLE headers directly, without defining +// OLE2ANSI for non-UNICODE apps. +// +// Better to catch the error at compile time, rather than link time. + +typedef LPTSTR BSTR; + +///////////////////////////////////////////////////////////////////////////// +// AFXDISP - MFC IDispatch & ClassFactory support + +// Classes declared in this file + +//CException + class COleException; // caught by client or server + class COleDispatchException; // special exception for IDispatch calls + +//CCmdTarget + class COleObjectFactory; // glue for IClassFactory -> runtime class + class COleTemplateServer; // server documents using CDocTemplate + +class COleDispatchDriver; // helper class to call IDispatch + +///////////////////////////////////////////////////////////////////////////// + +// AFXDLL support +#undef AFX_DATA +#define AFX_DATA AFX_OLE_DATA + +///////////////////////////////////////////////////////////////////////////// +// OLE 2.0 COM (Component Object Model) implementation infrastructure +// - data driven QueryInterface +// - standard implementation of aggregate AddRef and Release +// (see CCmdTarget in AFXWIN.H for more information) + +#define METHOD_PROLOGUE(theClass, localClass) \ + theClass* pThis = \ + ((theClass*)((BYTE*)this - offsetof(theClass, m_x##localClass))); \ + +#ifndef _AFX_NO_NESTED_DERIVATION +#define METHOD_PROLOGUE_EX(theClass, localClass) \ + theClass* pThis = ((theClass*)((BYTE*)this - m_nOffset)); \ + +#else +#define METHOD_PROLOGUE_EX(theClass, localClass) \ + METHOD_PROLOGUE(theClass, localClass) \ + +#endif + +#define BEGIN_INTERFACE_PART(localClass, baseClass) \ + class X##localClass : public baseClass \ + { \ + public: \ + STDMETHOD_(ULONG, AddRef)(); \ + STDMETHOD_(ULONG, Release)(); \ + STDMETHOD(QueryInterface)(REFIID iid, LPVOID* ppvObj); \ + +#ifndef _AFX_NO_NESTED_DERIVATION +#define BEGIN_INTERFACE_PART_DERIVE(localClass, baseClass) \ + class X##localClass : public baseClass \ + { \ + public: \ + +#else +#define BEGIN_INTERFACE_PART_DERIVE(localClass, baseClass) \ + BEGIN_INTERFACE_PART(localClass, baseClass) \ + +#endif + +#ifndef _AFX_NO_NESTED_DERIVATION +#define INIT_INTERFACE_PART(theClass, localClass) \ + size_t m_nOffset; \ + INIT_INTERFACE_PART_DERIVE(theClass, localClass) \ + +#define INIT_INTERFACE_PART_DERIVE(theClass, localClass) \ + X##localClass() \ + { m_nOffset = offsetof(theClass, m_x##localClass); } \ + +#else +#define INIT_INTERFACE_PART(theClass, localClass) +#define INIT_INTERFACE_PART_DERIVE(theClass, localClass) + +#endif + +// Note: Inserts the rest of OLE functionality between these two macros, +// depending upon the interface that is being implemented. It is not +// necessary to include AddRef, Release, and QueryInterface since those +// member functions are declared by the macro. + +#define END_INTERFACE_PART(localClass) \ + } m_x##localClass; \ + friend class X##localClass; \ + +#ifdef _AFXDLL +#define BEGIN_INTERFACE_MAP(theClass, theBase) \ + const AFX_INTERFACEMAP* PASCAL theClass::_GetBaseInterfaceMap() \ + { return &theBase::interfaceMap; } \ + const AFX_INTERFACEMAP* theClass::GetInterfaceMap() const \ + { return &theClass::interfaceMap; } \ + const AFX_DATADEF AFX_INTERFACEMAP theClass::interfaceMap = \ + { &theClass::_GetBaseInterfaceMap, &theClass::_interfaceEntries[0], }; \ + const AFX_DATADEF AFX_INTERFACEMAP_ENTRY theClass::_interfaceEntries[] = \ + { \ + +#else +#define BEGIN_INTERFACE_MAP(theClass, theBase) \ + const AFX_INTERFACEMAP* theClass::GetInterfaceMap() const \ + { return &theClass::interfaceMap; } \ + const AFX_DATADEF AFX_INTERFACEMAP theClass::interfaceMap = \ + { &theBase::interfaceMap, &theClass::_interfaceEntries[0], }; \ + const AFX_DATADEF AFX_INTERFACEMAP_ENTRY theClass::_interfaceEntries[] = \ + { \ + +#endif + +#define INTERFACE_PART(theClass, iid, localClass) \ + { &iid, offsetof(theClass, m_x##localClass) }, \ + +#define INTERFACE_AGGREGATE(theClass, theAggr) \ + { NULL, offsetof(theClass, theAggr) }, \ + +#define END_INTERFACE_MAP() \ + { NULL, (size_t)-1 } \ + }; \ + +///////////////////////////////////////////////////////////////////////////// +// COleException - unexpected or rare OLE error returned + +class COleException : public CException +{ + DECLARE_DYNAMIC(COleException) + +public: + SCODE m_sc; + static SCODE PASCAL Process(const CException* pAnyException); + +// Implementation (use AfxThrowOleException to create) + COleException(); + virtual ~COleException(); +}; + +void AFXAPI AfxThrowOleException(SCODE sc); + +///////////////////////////////////////////////////////////////////////////// +// IDispatch specific exception + +class COleDispatchException : public CException +{ + DECLARE_DYNAMIC(COleDispatchException) + +public: +// Attributes + WORD m_wCode; // error code (specific to IDispatch implementation) + CString m_strDescription; // human readable description of the error + DWORD m_dwHelpContext; // help context for error + + // usually empty in application which creates it (eg. servers) + CString m_strHelpFile; // help file to use with m_dwHelpContext + CString m_strSource; // source of the error (name of server) + +// Implementation +public: + COleDispatchException(LPCTSTR lpszDescription, UINT nHelpID, WORD wCode); + virtual ~COleDispatchException(); + static void PASCAL Process( + EXCEPINFO* pInfo, const CException* pAnyException); + + SCODE m_scError; // SCODE describing the error +}; + +void AFXAPI AfxThrowOleDispatchException(WORD wCode, LPCTSTR lpszDescription, + UINT nHelpID = 0); +void AFXAPI AfxThrowOleDispatchException(WORD wCode, UINT nDescriptionID, + UINT nHelpID = (UINT)-1); + +///////////////////////////////////////////////////////////////////////////// +// Macros for CCmdTarget IDispatchable classes + +#ifdef _AFXDLL +#define BEGIN_DISPATCH_MAP(theClass, baseClass) \ + const AFX_DISPMAP* PASCAL theClass::_GetBaseDispatchMap() \ + { return &baseClass::dispatchMap; } \ + const AFX_DISPMAP* theClass::GetDispatchMap() const \ + { return &theClass::dispatchMap; } \ + const AFX_DISPMAP theClass::dispatchMap = \ + { &theClass::_GetBaseDispatchMap, &theClass::_dispatchEntries[0], \ + &theClass::_dispatchEntryCount }; \ + UINT theClass::_dispatchEntryCount = (UINT)-1; \ + const AFX_DISPMAP_ENTRY theClass::_dispatchEntries[] = \ + { \ + +#else +#define BEGIN_DISPATCH_MAP(theClass, baseClass) \ + const AFX_DISPMAP* theClass::GetDispatchMap() const \ + { return &theClass::dispatchMap; } \ + const AFX_DISPMAP theClass::dispatchMap = \ + { &baseClass::dispatchMap, &theClass::_dispatchEntries[0], \ + &theClass::_dispatchEntryCount }; \ + UINT theClass::_dispatchEntryCount = (UINT)-1; \ + const AFX_DISPMAP_ENTRY theClass::_dispatchEntries[] = \ + { \ + +#endif + +#define END_DISPATCH_MAP() \ + { VTS_NONE, DISPID_UNKNOWN, VTS_NONE, VT_VOID, \ + (AFX_PMSG)NULL, (AFX_PMSG)NULL, (size_t)-1 } }; \ + +// parameter types: by value VTs +#define VTS_I2 "\x02" // a 'short' +#define VTS_I4 "\x03" // a 'long' +#define VTS_R4 "\x04" // a 'float' +#define VTS_R8 "\x05" // a 'double' +#define VTS_CY "\x06" // a 'CY' or 'CY*' +#define VTS_DATE "\x07" // a 'DATE' +#define VTS_BSTR "\x08" // an 'LPCTSTR' +#define VTS_DISPATCH "\x09" // an 'IDispatch*' +#define VTS_SCODE "\x0A" // an 'SCODE' +#define VTS_BOOL "\x0B" // a 'BOOL' +#define VTS_VARIANT "\x0C" // a 'const VARIANT&' or 'VARIANT*' +#define VTS_UNKNOWN "\x0D" // an 'IUnknown*' + +// parameter types: by reference VTs +#define VTS_PI2 "\x42" // a 'short*' +#define VTS_PI4 "\x43" // a 'long*' +#define VTS_PR4 "\x44" // a 'float*' +#define VTS_PR8 "\x45" // a 'double*' +#define VTS_PCY "\x46" // a 'CY*' +#define VTS_PDATE "\x47" // a 'DATE*' +#define VTS_PBSTR "\x48" // a 'BSTR*' +#define VTS_PDISPATCH "\x49" // an 'IDispatch**' +#define VTS_PSCODE "\x4A" // an 'SCODE*' +#define VTS_PBOOL "\x4B" // a 'VARIANT_BOOL*' +#define VTS_PVARIANT "\x4C" // a 'VARIANT*' +#define VTS_PUNKNOWN "\x4D" // an 'IUnknown**' + +// special VT_ and VTS_ values +#define VTS_NONE NULL // used for members with 0 params +#define VT_MFCVALUE 0xFFF // special value for DISPID_VALUE +#define VT_MFCBYREF 0x40 // indicates VT_BYREF type +#define VT_MFCMARKER 0xFF // delimits named parameters (INTERNAL USE) + +// these DISP_ macros cause the framework to generate the DISPID +#define DISP_FUNCTION(theClass, szExternalName, pfnMember, vtRetVal, vtsParams) \ + { _T(szExternalName), DISPID_UNKNOWN, vtsParams, vtRetVal, \ + (AFX_PMSG)(void (theClass::*)(void))pfnMember, (AFX_PMSG)0, 0 }, \ + +#define DISP_PROPERTY(theClass, szExternalName, memberName, vtPropType) \ + { _T(szExternalName), DISPID_UNKNOWN, NULL, vtPropType, (AFX_PMSG)0, (AFX_PMSG)0, \ + offsetof(theClass, memberName) }, \ + +#define DISP_PROPERTY_NOTIFY(theClass, szExternalName, memberName, pfnAfterSet, vtPropType) \ + { _T(szExternalName), DISPID_UNKNOWN, NULL, vtPropType, (AFX_PMSG)0, \ + (AFX_PMSG)(void (theClass::*)(void))pfnAfterSet, \ + offsetof(theClass, memberName) }, \ + +#define DISP_PROPERTY_EX(theClass, szExternalName, pfnGet, pfnSet, vtPropType) \ + { _T(szExternalName), DISPID_UNKNOWN, NULL, vtPropType, \ + (AFX_PMSG)(void (theClass::*)(void))pfnGet, \ + (AFX_PMSG)(void (theClass::*)(void))pfnSet, 0 }, \ + +#define DISP_PROPERTY_PARAM(theClass, szExternalName, pfnGet, pfnSet, vtPropType, vtsParams) \ + { _T(szExternalName), DISPID_UNKNOWN, vtsParams, vtPropType, \ + (AFX_PMSG)(void (theClass::*)(void))pfnGet, \ + (AFX_PMSG)(void (theClass::*)(void))pfnSet, 0 }, \ + +// these DISP_ macros allow the app to determine the DISPID +#define DISP_FUNCTION_ID(theClass, szExternalName, dispid, pfnMember, vtRetVal, vtsParams) \ + { _T(szExternalName), dispid, vtsParams, vtRetVal, \ + (AFX_PMSG)(void (theClass::*)(void))pfnMember, (AFX_PMSG)0, 0 }, \ + +#define DISP_PROPERTY_ID(theClass, szExternalName, dispid, memberName, vtPropType) \ + { _T(szExternalName), dispid, NULL, vtPropType, (AFX_PMSG)0, (AFX_PMSG)0, \ + offsetof(theClass, memberName) }, \ + +#define DISP_PROPERTY_NOTIFY_ID(theClass, szExternalName, dispid, memberName, pfnAfterSet, vtPropType) \ + { _T(szExternalName), dispid, NULL, vtPropType, (AFX_PMSG)0, \ + (AFX_PMSG)(void (theClass::*)(void))pfnAfterSet, \ + offsetof(theClass, memberName) }, \ + +#define DISP_PROPERTY_EX_ID(theClass, szExternalName, dispid, pfnGet, pfnSet, vtPropType) \ + { _T(szExternalName), dispid, NULL, vtPropType, \ + (AFX_PMSG)(void (theClass::*)(void))pfnGet, \ + (AFX_PMSG)(void (theClass::*)(void))pfnSet, 0 }, \ + +#define DISP_PROPERTY_PARAM_ID(theClass, szExternalName, dispid, pfnGet, pfnSet, vtPropType, vtsParams) \ + { _T(szExternalName), dispid, vtsParams, vtPropType, \ + (AFX_PMSG)(void (theClass::*)(void))pfnGet, \ + (AFX_PMSG)(void (theClass::*)(void))pfnSet, 0 }, \ + +// the DISP_DEFVALUE is a special case macro that creates an alias for DISPID_VALUE +#define DISP_DEFVALUE(theClass, szExternalName) \ + { _T(szExternalName), DISPID_UNKNOWN, NULL, VT_MFCVALUE, \ + (AFX_PMSG)0, (AFX_PMSG)0, 0 }, \ + +#define DISP_DEFVALUE_ID(theClass, dispid) \ + { NULL, dispid, NULL, VT_MFCVALUE, (AFX_PMSG)0, (AFX_PMSG)0, 0 }, \ + +///////////////////////////////////////////////////////////////////////////// +// Macros for creating "creatable" automation classes. + +#define DECLARE_OLECREATE(class_name) \ +protected: \ + static AFX_DATA COleObjectFactory factory; \ + static AFX_DATA const GUID guid; \ + +#define IMPLEMENT_OLECREATE(class_name, external_name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ + AFX_DATADEF COleObjectFactory class_name::factory(class_name::guid, \ + RUNTIME_CLASS(class_name), FALSE, _T(external_name)); \ + const AFX_DATADEF GUID class_name::guid = \ + { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }; \ + +///////////////////////////////////////////////////////////////////////////// +// Helper class for driving IDispatch + +class COleDispatchDriver +{ +// Constructors +public: + COleDispatchDriver(); + +// Operations + BOOL CreateDispatch(REFCLSID clsid, COleException* pError = NULL); + BOOL CreateDispatch(LPCTSTR lpszProgID, COleException* pError = NULL); + + void AttachDispatch(LPDISPATCH lpDispatch, BOOL bAutoRelease = TRUE); + LPDISPATCH DetachDispatch(); + // detach and get ownership of m_lpDispatch + void ReleaseDispatch(); + + // helpers for IDispatch::Invoke + void InvokeHelper(DISPID dwDispID, WORD wFlags, + VARTYPE vtRet, void* pvRet, const BYTE* pbParamInfo, ...); + void SetProperty(DISPID dwDispID, VARTYPE vtProp, ...); + void GetProperty(DISPID dwDispID, VARTYPE vtProp, void* pvProp) const; + +// Implementation +public: + LPDISPATCH m_lpDispatch; + + ~COleDispatchDriver(); + void InvokeHelperV(DISPID dwDispID, WORD wFlags, VARTYPE vtRet, + void* pvRet, const BYTE* pbParamInfo, va_list argList); + +protected: + BOOL m_bAutoRelease; // TRUE if destructor should call Release + +private: + // Disable the copy constructor and assignment by default so you will get + // compiler errors instead of unexpected behaviour if you pass objects + // by value or assign objects. + COleDispatchDriver(const COleDispatchDriver&); // no implementation + void operator=(const COleDispatchDriver&); // no implementation +}; + +///////////////////////////////////////////////////////////////////////////// +// Class Factory implementation (binds OLE class factory -> runtime class) +// (all specific class factories derive from this class factory) + +class COleObjectFactory : public CCmdTarget +{ + DECLARE_DYNAMIC(COleObjectFactory) + +// Construction +public: + COleObjectFactory(REFCLSID clsid, CRuntimeClass* pRuntimeClass, + BOOL bMultiInstance, LPCTSTR lpszProgID); + +// Attributes + BOOL IsRegistered() const; + REFCLSID GetClassID() const; + +// Operations + BOOL Register(); + void Revoke(); + void UpdateRegistry(LPCTSTR lpszProgID = NULL); + // default uses m_lpszProgID if not NULL + + static BOOL PASCAL RegisterAll(); + static void PASCAL RevokeAll(); + static void PASCAL UpdateRegistryAll(); + +// Overridables +protected: + virtual CCmdTarget* OnCreateObject(); + +// Implementation +public: + virtual ~COleObjectFactory(); +#ifdef _DEBUG + void AssertValid() const; + void Dump(CDumpContext& dc) const; +#endif + +public: + COleObjectFactory* m_pNextFactory; // list of factories maintained + +protected: + DWORD m_dwRegister; // registry identifier + CLSID m_clsid; // registered class ID + CRuntimeClass* m_pRuntimeClass; // runtime class of CCmdTarget derivative + BOOL m_bMultiInstance; // multiple instance? + LPCTSTR m_lpszProgID; // human readable class ID + +// Interface Maps +public: + BEGIN_INTERFACE_PART(ClassFactory, IClassFactory) + INIT_INTERFACE_PART(COleObjectFactory, ClassFactory) + STDMETHOD(CreateInstance)(LPUNKNOWN, REFIID, LPVOID*); + STDMETHOD(LockServer)(BOOL); + END_INTERFACE_PART(ClassFactory) + + DECLARE_INTERFACE_MAP() + + friend SCODE AFXAPI AfxDllGetClassObject(REFCLSID, REFIID, LPVOID FAR*); + friend SCODE STDAPICALLTYPE DllGetClassObject(REFCLSID, REFIID, LPVOID*); +}; + +////////////////////////////////////////////////////////////////////////////// +// COleTemplateServer - COleObjectFactory using CDocTemplates + +// This enumeration is used in AfxOleRegisterServerClass to pick the +// correct registration entries given the application type. +enum OLE_APPTYPE +{ + OAT_INPLACE_SERVER = 0, // server has full server user-interface + OAT_SERVER = 1, // server supports only embedding + OAT_CONTAINER = 2, // container supports links to embeddings + OAT_DISPATCH_OBJECT = 3, // IDispatch capable object +}; + +class COleTemplateServer : public COleObjectFactory +{ +// Constructors +public: + COleTemplateServer(); + +// Operations + void ConnectTemplate(REFCLSID clsid, CDocTemplate* pDocTemplate, + BOOL bMultiInstance); + // set doc template after creating it in InitInstance + void UpdateRegistry(OLE_APPTYPE nAppType = OAT_INPLACE_SERVER, + LPCTSTR* rglpszRegister = NULL, LPCTSTR* rglpszOverwrite = NULL); + // may want to UpdateRegistry if not run with /Embedded + +// Implementation +protected: + virtual CCmdTarget* OnCreateObject(); + CDocTemplate* m_pDocTemplate; + +private: + void UpdateRegistry(LPCTSTR lpszProgID); + // hide base class version of UpdateRegistry +}; + +///////////////////////////////////////////////////////////////////////////// +// System registry helpers + +// Helper to register server in case of no .REG file loaded +BOOL AFXAPI AfxOleRegisterServerClass( + REFCLSID clsid, LPCTSTR lpszClassName, + LPCTSTR lpszShortTypeName, LPCTSTR lpszLongTypeName, + OLE_APPTYPE nAppType = OAT_SERVER, + LPCTSTR* rglpszRegister = NULL, LPCTSTR* rglpszOverwrite = NULL); + +// AfxOleRegisterHelper is a worker function used by AfxOleRegisterServerClass +// (available for advanced registry work) +BOOL AFXAPI AfxOleRegisterHelper(LPCTSTR* rglpszRegister, + LPCTSTR* rglpszSymbols, int nSymbols, BOOL bReplace); + +///////////////////////////////////////////////////////////////////////////// +// Init & Term helpers + +BOOL AFXAPI AfxOleInit(); +void CALLBACK AfxOleTerm(BOOL bJustRevoke = FALSE); + +///////////////////////////////////////////////////////////////////////////// +// Memory management helpers (for OLE task allocator memory) + +void* AFXAPI AfxAllocTaskMem(size_t nSize); +void AFXAPI AfxFreeTaskMem(void* p); +LPTSTR AFXAPI AfxAllocTaskString(LPCTSTR lpszString); + +///////////////////////////////////////////////////////////////////////////// +// Special in-proc server APIs + +SCODE AFXAPI AfxDllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv); +SCODE AFXAPI AfxDllCanUnloadNow(void); + +///////////////////////////////////////////////////////////////////////////// +// Inline function declarations + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +#ifdef _AFX_ENABLE_INLINES +#define _AFXDISP_INLINE inline +#include <afxole.inl> +#undef _AFXDISP_INLINE +#endif + +#undef AFX_DATA +#define AFX_DATA + +#endif //__AFXDISP_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxdlgs.h b/public/sdk/inc/mfc30/afxdlgs.h new file mode 100644 index 000000000..0deca1044 --- /dev/null +++ b/public/sdk/inc/mfc30/afxdlgs.h @@ -0,0 +1,604 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXDLGS_H__ +#define __AFXDLGS_H__ + +#ifndef __AFXWIN_H__ + #include <afxwin.h> +#endif + +#include <commdlg.h> // common dialog APIs + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +///////////////////////////////////////////////////////////////////////////// +// AFXDLGS - MFC Standard dialogs + +// Classes declared in this file + + // CDialog + class CCommonDialog; // implementation base class + + // modeless dialogs + class CFindReplaceDialog; // Find/FindReplace dialog + + // modal dialogs + class CFileDialog; // FileOpen/FileSaveAs dialogs + class CColorDialog; // Color picker dialog + class CFontDialog; // Font chooser dialog + class CPrintDialog; // Print/PrintSetup dialogs + + + // CWnd + class CPropertySheet; // implements tabbed dialogs + + // CDialog + class CPropertyPage; // Used with CPropertySheet for tabbed dialogs + +///////////////////////////////////////////////////////////////////////////// + +#undef AFX_DATA +#define AFX_DATA AFX_CORE_DATA + +///////////////////////////////////////////////////////////////////////////// +// CCommonDialog - base class for all common dialogs + +class CCommonDialog : public CDialog +{ +public: + CCommonDialog(CWnd* pParentWnd); + +// Implementation +protected: + virtual void OnOK(); + virtual void OnCancel(); +}; + +///////////////////////////////////////////////////////////////////////////// +// CFileDialog - used for FileOpen... or FileSaveAs... + +class CFileDialog : public CCommonDialog +{ + DECLARE_DYNAMIC(CFileDialog) + +public: +// Attributes + OPENFILENAME m_ofn; // open file parameter block + +// Constructors + CFileDialog(BOOL bOpenFileDialog, // TRUE for FileOpen, FALSE for FileSaveAs + LPCTSTR lpszDefExt = NULL, + LPCTSTR lpszFileName = NULL, + DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, + LPCTSTR lpszFilter = NULL, + CWnd* pParentWnd = NULL); + +// Operations + virtual int DoModal(); + + // Helpers for parsing file name after successful return + CString GetPathName() const; // return full path name + CString GetFileName() const; // return only filename + CString GetFileExt() const; // return only ext + CString GetFileTitle() const; // return file title + BOOL GetReadOnlyPref() const; // return TRUE if readonly checked + +// Overridable callbacks +protected: + friend UINT CALLBACK _AfxCommDlgProc(HWND, UINT, WPARAM, LPARAM); + virtual UINT OnShareViolation(LPCTSTR lpszPathName); + virtual BOOL OnFileNameOK(); + virtual void OnLBSelChangedNotify(UINT nIDBox, UINT iCurSel, UINT nCode); + +// Implementation +#ifdef _DEBUG +public: + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + BOOL m_bOpenFileDialog; // TRUE for file open, FALSE for file save + CString m_strFilter; // filter string + // separate fields with '|', terminate with '||\0' + TCHAR m_szFileTitle[64]; // contains file title after return + TCHAR m_szFileName[_MAX_PATH]; // contains full path name after return +}; + +///////////////////////////////////////////////////////////////////////////// +// CFontDialog - used to select a font + +class CFontDialog : public CCommonDialog +{ + DECLARE_DYNAMIC(CFontDialog) + +public: +// Attributes + // font choosing parameter block + CHOOSEFONT m_cf; + +// Constructors + CFontDialog(LPLOGFONT lplfInitial = NULL, + DWORD dwFlags = CF_EFFECTS | CF_SCREENFONTS, + CDC* pdcPrinter = NULL, + CWnd* pParentWnd = NULL); + +// Operations + virtual int DoModal(); + + // Retrieve the currently selected font while dialog is displayed + void GetCurrentFont(LPLOGFONT lplf); + + // Helpers for parsing information after successful return + CString GetFaceName() const; // return the face name of the font + CString GetStyleName() const; // return the style name of the font + int GetSize() const; // return the pt size of the font + COLORREF GetColor() const; // return the color of the font + int GetWeight() const; // return the chosen font weight + BOOL IsStrikeOut() const; // return TRUE if strikeout + BOOL IsUnderline() const; // return TRUE if underline + BOOL IsBold() const; // return TRUE if bold font + BOOL IsItalic() const; // return TRUE if italic font + +// Implementation + LOGFONT m_lf; // default LOGFONT to store the info + +#ifdef _DEBUG +public: + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + TCHAR m_szStyleName[64]; // contains style name after return +}; + +///////////////////////////////////////////////////////////////////////////// +// CColorDialog - used to select a color + +class CColorDialog : public CCommonDialog +{ + DECLARE_DYNAMIC(CColorDialog) + +public: +// Attributes + // color chooser parameter block + CHOOSECOLOR m_cc; + +// Constructors + CColorDialog(COLORREF clrInit = 0, DWORD dwFlags = 0, + CWnd* pParentWnd = NULL); + +// Operations + virtual int DoModal(); + + // Set the current color while dialog is displayed + void SetCurrentColor(COLORREF clr); + + // Helpers for parsing information after successful return + COLORREF GetColor() const; + static COLORREF* PASCAL GetSavedCustomColors(); + +// Overridable callbacks +protected: + friend UINT CALLBACK _AfxCommDlgProc(HWND, UINT, WPARAM, LPARAM); + virtual BOOL OnColorOK(); // validate color + +// Implementation + +#ifdef _DEBUG +public: + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + //{{AFX_MSG(CColorDialog) + afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +// for backward compatibility clrSavedCustom is defined as GetSavedCustomColors +#define clrSavedCustom GetSavedCustomColors() + +///////////////////////////////////////////////////////////////////////////// +// CPrintDialog - used for Print... and PrintSetup... + +class CPrintDialog : public CCommonDialog +{ + DECLARE_DYNAMIC(CPrintDialog) + +public: +// Attributes + // print dialog parameter block (note this is a reference) + PRINTDLG& m_pd; + +// Constructors + CPrintDialog(BOOL bPrintSetupOnly, + // TRUE for Print Setup, FALSE for Print Dialog + DWORD dwFlags = PD_ALLPAGES | PD_USEDEVMODECOPIES | PD_NOPAGENUMS + | PD_HIDEPRINTTOFILE | PD_NOSELECTION, + CWnd* pParentWnd = NULL); + +// Operations + virtual int DoModal(); + + // GetDefaults will not display a dialog but will get + // device defaults + BOOL GetDefaults(); + + // Helpers for parsing information after successful return + int GetCopies() const; // num. copies requested + BOOL PrintCollate() const; // TRUE if collate checked + BOOL PrintSelection() const; // TRUE if printing selection + BOOL PrintAll() const; // TRUE if printing all pages + BOOL PrintRange() const; // TRUE if printing page range + int GetFromPage() const; // starting page if valid + int GetToPage() const; // starting page if valid + LPDEVMODE GetDevMode() const; // return DEVMODE + CString GetDriverName() const; // return driver name + CString GetDeviceName() const; // return device name + CString GetPortName() const; // return output port name + HDC GetPrinterDC() const; // return HDC (caller must delete) + + // This helper creates a DC based on the DEVNAMES and DEVMODE structures. + // This DC is returned, but also stored in m_pd.hDC as though it had been + // returned by CommDlg. It is assumed that any previously obtained DC + // has been/will be deleted by the user. This may be + // used without ever invoking the print/print setup dialogs. + + HDC CreatePrinterDC(); + +// Implementation + +#ifdef _DEBUG +public: + virtual void Dump(CDumpContext& dc) const; +#endif + +private: + PRINTDLG m_pdActual; // the Print/Print Setup need to share this +protected: + // The following handle the case of print setup... from the print dialog + CPrintDialog(PRINTDLG& pdInit); + virtual CPrintDialog* AttachOnSetup(); + + //{{AFX_MSG(CPrintDialog) + afx_msg void OnPrintSetup(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// Find/FindReplace modeless dialogs + +class CFindReplaceDialog : public CCommonDialog +{ + DECLARE_DYNAMIC(CFindReplaceDialog) + +public: +// Attributes + FINDREPLACE m_fr; + +// Constructors + CFindReplaceDialog(); + // Note: you must allocate these on the heap. + // If you do not, you must derive and override PostNcDestroy() + + BOOL Create(BOOL bFindDialogOnly, // TRUE for Find, FALSE for FindReplace + LPCTSTR lpszFindWhat, + LPCTSTR lpszReplaceWith = NULL, + DWORD dwFlags = FR_DOWN, + CWnd* pParentWnd = NULL); + + // find/replace parameter block + static CFindReplaceDialog* PASCAL GetNotifier(LPARAM lParam); + +// Operations + // Helpers for parsing information after successful return + CString GetReplaceString() const;// get replacement string + CString GetFindString() const; // get find string + BOOL SearchDown() const; // TRUE if search down, FALSE is up + BOOL FindNext() const; // TRUE if command is find next + BOOL MatchCase() const; // TRUE if matching case + BOOL MatchWholeWord() const; // TRUE if matching whole words only + BOOL ReplaceCurrent() const; // TRUE if replacing current string + BOOL ReplaceAll() const; // TRUE if replacing all occurrences + BOOL IsTerminating() const; // TRUE if terminating dialog + +// Implementation +protected: + virtual void PostNcDestroy(); + +#ifdef _DEBUG +public: + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + TCHAR m_szFindWhat[128]; + TCHAR m_szReplaceWith[128]; +}; + +//////////////////////////////////////////////////////////////////////////// +// CPropertyPage -- one page of a tabbed dialog + +class CPropertyPage : public CDialog +{ + DECLARE_DYNAMIC(CPropertyPage) + +// Construction +public: + CPropertyPage(UINT nIDTemplate, UINT nIDCaption = 0); + CPropertyPage(LPCTSTR lpszTemplateName, UINT nIDCaption = 0); + +// Operations +public: + void CancelToClose(); // called when the property sheet should display close instead of cancel + // lets the property sheet activate the apply now button + void SetModified(BOOL bChanged = TRUE); + +// Overridables +public: + virtual BOOL OnSetActive(); // called when this page gets the focus + virtual BOOL OnKillActive(); // perform validation here + virtual void OnOK(); // ok or apply now pressed -- KillActive is called first + virtual void OnCancel(); // cancel pressed + +// Implementation +public: + virtual ~CPropertyPage(); + virtual BOOL PreTranslateMessage(MSG* pMsg); // handle tab, enter, and escape keys +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; + // EndDialog is provided to generate an assert if it is called + void EndDialog(int nEndID); +#endif + +protected: + CString m_strCaption; + BOOL m_bChanged; + + void CommonConstruct(LPCTSTR lpszTemplateName, UINT nIDCaption); + // loads the resource indicated by CDialog::m_lpDialogTemplate + BOOL PreTranslateKeyDown(MSG* pMsg); + BOOL ProcessTab(MSG* pMsg); // handles tab key from PreTranslateMessage + BOOL CreatePage(); // called from CPropertySheet to create the dialog + // by loading the dialog resource into memory and + // turning off WS_CAPTION before creating + void LoadCaption(); + // gets the caption of the dialog from the resource and puts it in m_strCaption + + // Generated message map functions + //{{AFX_MSG(CPropertyPage) + afx_msg BOOL OnNcCreate(LPCREATESTRUCT lpcs); + afx_msg int OnCreate(LPCREATESTRUCT lpcs); + afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); + afx_msg void OnClose(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + + friend class CPropertySheet; +}; + +//////////////////////////////////////////////////////////////////////////// +// CTabControl -- internal use only +// Implementation for a generic row of tabs along the top of dialog +// Future versions of MFC may or may not include this exact class. + +class CTabItem; // private to CTabControl implementation + +// TCN_ messages are tab control notifications +#define TCN_TABCHANGING 1 +#define TCN_TABCHANGED 2 + +class CTabControl : public CWnd +{ + DECLARE_DYNAMIC(CTabControl) + +public: +// Construction + CTabControl(); + +// Attributes + BOOL m_bInSize; + int m_nHeight; + BOOL SetCurSel(int nTab); + int GetCurSel() const; + int GetItemCount() const; + +// Operations + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + void AddTab(LPCTSTR lpszCaption); + void RemoveTab(int nTab); + +// Implementation +public: + virtual ~CTabControl(); + BOOL NextTab(BOOL bNext); + +protected: + void Scroll(int nDirection); + void ScrollIntoView(int nTab); + void DrawFocusRect(CDC* pDC = NULL); + void InvalidateTab(int nTab, BOOL bInflate = TRUE); + int TabFromPoint(CPoint pt); + void Capture(int nDirection); + void LayoutTabsStacked(int nTab); + void LayoutTabsSingle(int nTab); + + enum + { + SCROLL_LEFT = -5, // all the SCROLL_ items must be less + SCROLL_RIGHT = -6, // than -1 to avoid ID conflict + SCROLL_NULL = -7, + TIMER_ID = 15, // timer constants + TIMER_DELAY = 500 + }; + + void DrawScrollers(CDC* pDC); + + BOOL CanScroll(); + void SetFirstTab(int nTab); + CTabItem* GetTabItem(int nTab) const; + BOOL IsTabVisible(int nTab, BOOL bComplete = FALSE) const; + + // Member variables + HFONT m_hBoldFont; + HFONT m_hThinFont; + CRect m_rectScroll; // location of scroll buttons + int m_nCurTab; // index of current selected tab + int m_nFirstTab; // index of leftmost visible tab + int m_nScrollState; // shows whether left or right scroll btn is down + BOOL m_bScrollPause;// if we have capture, has the mouse wandered off btn? + + CPtrArray m_tabs; // list of CTabItems, in order + + // Generated message map functions + //{{AFX_MSG(CTabControl) + afx_msg void OnPaint(); + afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg UINT OnGetDlgCode(); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnSetFocus(CWnd* pOldWnd); + afx_msg void OnKillFocus(CWnd* pNewWnd); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//////////////////////////////////////////////////////////////////////////// +// CPropertySheet -- a tabbed "dialog" (really a popup-window) + +class CPropertySheet : public CWnd +{ + DECLARE_DYNAMIC(CPropertySheet) + +// Construction +public: + CPropertySheet(UINT nIDCaption, CWnd* pParentWnd = NULL, + UINT iSelectPage = 0); + CPropertySheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, + UINT iSelectPage = 0); + + // for modeless creation + BOOL Create(CWnd* pParentWnd = NULL, DWORD dwStyle = + WS_SYSMENU | WS_POPUP | WS_CAPTION | DS_MODALFRAME | WS_VISIBLE, + DWORD dwExStyle = WS_EX_DLGMODALFRAME); + +// Attributes +public: + int GetPageCount() const; + CPropertyPage* GetPage(int nPage) const; + +// Operations +public: + int DoModal(); + void AddPage(CPropertyPage* pPage); + void RemovePage(CPropertyPage* pPage); + void RemovePage(int nPage); + void EndDialog(int nEndID); // used to terminate a modal dialog + +// Implementation +public: + virtual ~CPropertySheet(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + void EnableStackedTabs(BOOL bStacked); + virtual BOOL PreTranslateMessage(MSG* pMsg); + virtual BOOL DestroyWindow(); + BOOL SetActivePage(int nPage); + +protected: + HWND FindNextControl(HWND hWnd, TCHAR ch); + void GotoControl(HWND hWnd, TCHAR ch); + BOOL ProcessChars(MSG* pMsg); + BOOL ProcessTab(MSG* pMsg); + BOOL CreateStandardButtons(); + BOOL PumpMessage(); + void PageChanged(); + void CancelToClose(); + void CommonConstruct(CWnd* pParent, UINT iSelectPage); + void RecalcLayout(); + CPropertyPage* GetActivePage() const; + void CheckDefaultButton(HWND hFocusBefore, HWND hFocusAfter); + void CheckFocusChange(); + + // implementation data members + HFONT m_hFont; // sizes below dependent on this font + CSize m_sizeButton; + CSize m_sizeTabMargin; + int m_cxButtonGap; + BOOL m_bModeless; + BOOL m_bStacked; + + int m_nCurPage; + int m_nID; // ID passed to EndDialog and returned from DoModal + + CPtrArray m_pages; // array of CPropertyPage pointers + HWND m_hWndDefault; // current default push button if there is one + HWND m_hFocusWnd; // focus when we lost activation + HWND m_hLastFocus; // tracks last window with focus + CWnd* m_pParentWnd; // owner of the tabbed dialog + CString m_strCaption; // caption of the pseudo-dialog + CTabControl m_tabRow; // entire row of tabs at top of dialog + BOOL m_bParentDisabled; // TRUE if parent was disabled by DoModal + + // Generated message map functions + //{{AFX_MSG(CPropertySheet) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnPaint(); + afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); + afx_msg void OnClose(); + afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); + afx_msg void OnSetFocus(CWnd* pOldWnd); + afx_msg void OnOK(); + afx_msg void OnCancel(); + afx_msg void OnApply(); + afx_msg void OnTabChanged(NMHDR*, LRESULT*); + afx_msg void OnTabChanging(NMHDR*, LRESULT*); + afx_msg LRESULT OnGetFont(WPARAM, LPARAM); + afx_msg LRESULT OnCommandHelp(WPARAM, LPARAM); + //}}AFX_MSG +#ifdef _MAC + afx_msg LRESULT OnMacintosh(WPARAM wParam, LPARAM lParam); +#endif + DECLARE_MESSAGE_MAP() + + friend class CPropertyPage; // for tab handler +}; + +///////////////////////////////////////////////////////////////////////////// +// Inline function declarations + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +#ifdef _AFX_ENABLE_INLINES +#define _AFXDLGS_INLINE inline +#include <afxdlgs.inl> +#endif + +#undef AFX_DATA +#define AFX_DATA + +#endif //__AFXDLGS_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxdlgs.inl b/public/sdk/inc/mfc30/afxdlgs.inl new file mode 100644 index 000000000..87e9bd6b0 --- /dev/null +++ b/public/sdk/inc/mfc30/afxdlgs.inl @@ -0,0 +1,110 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// Inlines for AFXDLGS.H + +#ifdef _AFXDLGS_INLINE + +///////////////////////////////////////////////////////////////////////////// + +_AFXDLGS_INLINE CCommonDialog::CCommonDialog(CWnd* pParentWnd) + : CDialog((UINT)0, pParentWnd) { } + +_AFXDLGS_INLINE CString CFileDialog::GetPathName() const + { return m_ofn.lpstrFile; } +_AFXDLGS_INLINE CString CFileDialog::GetFileExt() const + { if (m_ofn.nFileExtension == 0) return (TCHAR)'\0'; + else return m_ofn.lpstrFile + m_ofn.nFileExtension; } +_AFXDLGS_INLINE CString CFileDialog::GetFileTitle() const + { return m_ofn.lpstrFileTitle; } +_AFXDLGS_INLINE BOOL CFileDialog::GetReadOnlyPref() const + { return m_ofn.Flags & OFN_READONLY ? TRUE : FALSE; } +_AFXDLGS_INLINE void CFontDialog::GetCurrentFont(LPLOGFONT lplf) + { ASSERT(m_hWnd != NULL); SendMessage(WM_CHOOSEFONT_GETLOGFONT, + 0, (DWORD)(LPVOID)lplf); } +_AFXDLGS_INLINE CString CFontDialog::GetFaceName() const + { return (LPCTSTR)m_cf.lpLogFont->lfFaceName; } +_AFXDLGS_INLINE CString CFontDialog::GetStyleName() const + { return m_cf.lpszStyle; } +_AFXDLGS_INLINE int CFontDialog::GetSize() const + { return m_cf.iPointSize; } +_AFXDLGS_INLINE int CFontDialog::GetWeight() const + { return (int)m_cf.lpLogFont->lfWeight; } +_AFXDLGS_INLINE BOOL CFontDialog::IsItalic() const + { return m_cf.lpLogFont->lfItalic ? TRUE : FALSE; } +_AFXDLGS_INLINE BOOL CFontDialog::IsStrikeOut() const + { return m_cf.lpLogFont->lfStrikeOut ? TRUE : FALSE; } +_AFXDLGS_INLINE BOOL CFontDialog::IsBold() const + { return m_cf.lpLogFont->lfWeight == FW_BOLD ? TRUE : FALSE; } +_AFXDLGS_INLINE BOOL CFontDialog::IsUnderline() const + { return m_cf.lpLogFont->lfUnderline ? TRUE : FALSE; } +_AFXDLGS_INLINE COLORREF CFontDialog::GetColor() const + { return m_cf.rgbColors; } +_AFXDLGS_INLINE COLORREF CColorDialog::GetColor() const + { return m_cc.rgbResult; } +_AFXDLGS_INLINE COLORREF* PASCAL CColorDialog::GetSavedCustomColors() + { return &AfxGetWinState()->m_crSavedCustom[0]; } +_AFXDLGS_INLINE BOOL CPrintDialog::GetDefaults() + { m_pd.Flags |= PD_RETURNDEFAULT; + return ::PrintDlg(&m_pd); } +_AFXDLGS_INLINE BOOL CPrintDialog::PrintSelection() const + { return m_pd.Flags & PD_SELECTION ? TRUE : FALSE; } +_AFXDLGS_INLINE BOOL CPrintDialog::PrintRange() const + { return m_pd.Flags & PD_PAGENUMS ? TRUE : FALSE; } +_AFXDLGS_INLINE BOOL CPrintDialog::PrintAll() const + { return !PrintRange() && !PrintSelection() ? TRUE : FALSE; } +_AFXDLGS_INLINE BOOL CPrintDialog::PrintCollate() const + { return m_pd.Flags & PD_COLLATE ? TRUE : FALSE; } +_AFXDLGS_INLINE int CPrintDialog::GetFromPage() const + { return (PrintRange() ? m_pd.nFromPage :-1); } +_AFXDLGS_INLINE int CPrintDialog::GetToPage() const + { return (PrintRange() ? m_pd.nToPage :-1); } +_AFXDLGS_INLINE HDC CPrintDialog::GetPrinterDC() const + { ASSERT_VALID(this); + ASSERT(m_pd.Flags & PD_RETURNDC); + return m_pd.hDC; } +_AFXDLGS_INLINE BOOL CFindReplaceDialog::IsTerminating() const + { return m_fr.Flags & FR_DIALOGTERM ? TRUE : FALSE ; } +_AFXDLGS_INLINE CString CFindReplaceDialog::GetReplaceString() const + { return m_fr.lpstrReplaceWith; } +_AFXDLGS_INLINE CString CFindReplaceDialog::GetFindString() const + { return m_fr.lpstrFindWhat; } +_AFXDLGS_INLINE BOOL CFindReplaceDialog::SearchDown() const + { return m_fr.Flags & FR_DOWN ? TRUE : FALSE; } +_AFXDLGS_INLINE BOOL CFindReplaceDialog::FindNext() const + { return m_fr.Flags & FR_FINDNEXT ? TRUE : FALSE; } +_AFXDLGS_INLINE BOOL CFindReplaceDialog::MatchCase() const + { return m_fr.Flags & FR_MATCHCASE ? TRUE : FALSE; } +_AFXDLGS_INLINE BOOL CFindReplaceDialog::MatchWholeWord() const + { return m_fr.Flags & FR_WHOLEWORD ? TRUE : FALSE; } +_AFXDLGS_INLINE BOOL CFindReplaceDialog::ReplaceCurrent() const + { return m_fr. Flags & FR_REPLACE ? TRUE : FALSE; } +_AFXDLGS_INLINE BOOL CFindReplaceDialog::ReplaceAll() const + { return m_fr.Flags & FR_REPLACEALL ? TRUE : FALSE; } + +// CPropertySheet/CPropertyPage/CTabControl inlines +_AFXDLGS_INLINE int CTabControl::GetCurSel() const + { return m_nCurTab; } +_AFXDLGS_INLINE CTabItem* CTabControl::GetTabItem(int nTab) const + { return (CTabItem*)m_tabs[nTab]; } +_AFXDLGS_INLINE int CTabControl::GetItemCount() const + { return m_tabs.GetSize(); } +_AFXDLGS_INLINE void CPropertySheet::EnableStackedTabs(BOOL bStacked) + { m_bStacked = bStacked; } +_AFXDLGS_INLINE int CPropertySheet::GetPageCount() const + { return m_pages.GetSize(); } +_AFXDLGS_INLINE CPropertyPage* CPropertySheet::GetPage(int nPage) const + { return (CPropertyPage*)m_pages[nPage]; } +_AFXDLGS_INLINE CPropertyPage* CPropertySheet::GetActivePage() const + {return GetPage(m_nCurPage);} + +///////////////////////////////////////////////////////////////////////////// + +#endif //_AFXDLGS_INLINE diff --git a/public/sdk/inc/mfc30/afxdll_.h b/public/sdk/inc/mfc30/afxdll_.h new file mode 100644 index 000000000..f1734498d --- /dev/null +++ b/public/sdk/inc/mfc30/afxdll_.h @@ -0,0 +1,90 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// afxdll_.h - extensions to AFXWIN.H used for the 'AFXDLL' version +// This file contains MFC library implementation details as well +// as APIs for writing MFC Extension DLLs. +// Please refer to Technical Note 033 (TN033) for more details. + +///////////////////////////////////////////////////////////////////////////// + +#ifndef _AFXDLL + #error file must be compiled with _AFXDLL +#endif + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +#undef AFX_DATA +#define AFX_DATA AFX_CORE_DATA + +///////////////////////////////////////////////////////////////////////////// + +// AFX_EXTENSION_MODULE - special struct used during DLL initialization + +struct AFX_EXTENSION_MODULE +{ + BOOL bInitialized; + HMODULE hModule; + HMODULE hResource; + CRuntimeClass* pFirstSharedClass; + COleObjectFactory* pFirstSharedFactory; +}; + +///////////////////////////////////////////////////////////////////////////// +// CDynLinkLibrary - for implementation of MFC Extension DLLs + +class COleObjectFactory; + +class CDynLinkLibrary : public CCmdTarget +{ + DECLARE_DYNAMIC(CDynLinkLibrary) +public: + +// Constructor + CDynLinkLibrary(AFX_EXTENSION_MODULE& state); + +// Attributes + HMODULE m_hModule; + HMODULE m_hResource; // for shared resources + CRuntimeClass* m_pFirstSharedClass; + COleObjectFactory* m_pFirstSharedFactory; + BOOL m_bSystem; // TRUE only for MFC DLLs + +// Implementation +public: + CDynLinkLibrary* m_pNextDLL; // simple singly linked list + virtual ~CDynLinkLibrary(); + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif //_DEBUG +}; + +// get best fitting resource +HINSTANCE AFXAPI AfxFindResourceHandle(LPCTSTR lpszName, LPCTSTR lpszType); + +// Call in DLL's LibMain +BOOL AFXAPI AfxInitExtensionModule(AFX_EXTENSION_MODULE& state, HMODULE hMod); + +// Optional: call on final process detach in your DLL +// (not necessary unless clients can dynamically load/unload your DLL) +void AFXAPI AfxTermExtensionModule(AFX_EXTENSION_MODULE& state); + +#undef AFX_DATA +#define AFX_DATA + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxdllx.h b/public/sdk/inc/mfc30/afxdllx.h new file mode 100644 index 000000000..08ffd1427 --- /dev/null +++ b/public/sdk/inc/mfc30/afxdllx.h @@ -0,0 +1,20 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +///////////////////////////////////////////////////////////////////////////// +// AFXDLLX.H: Extra header for building an MFC Extension DLL +// This file is really a source file that you should include in the +// main source file of your DLL. +///////////////////////////////////////////////////////////////////////////// + +// Note: this file is not required with the Win32 version of MFC, but it +// is provided for backward compatibility with existing extension DLLs. + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxext.h b/public/sdk/inc/mfc30/afxext.h new file mode 100644 index 000000000..52e5c6f93 --- /dev/null +++ b/public/sdk/inc/mfc30/afxext.h @@ -0,0 +1,992 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXEXT_H__ +#define __AFXEXT_H__ + +#ifndef __AFXWIN_H__ + #include <afxwin.h> +#endif +#ifndef __AFXDLGS_H__ + #include <afxdlgs.h> +#endif + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +///////////////////////////////////////////////////////////////////////////// +// AFXEXT - MFC Advanced Extensions and Advanced Customizable classes + +// Classes declared in this file + +//CObject + //CCmdTarget; + //CWnd + //CButton + class CBitmapButton; // Bitmap button (self-draw) + + class CControlBar; // control bar + class CStatusBar; // status bar + class CToolBar; // toolbar + class CDialogBar; // dialog as control bar + + class CSplitterWnd; // splitter manager + + //CView + //CScrollView + class CFormView; // view with a dialog template + class CEditView; // simple text editor view + + //CDC + class CMetaFileDC; // a metafile with proxy + +class CRectTracker; // tracker for rectangle objects + +// information structures +struct CPrintInfo; // Printing context +struct CPrintPreviewState; // Print Preview context/state +struct CCreateContext; // Creation context + +#undef AFX_DATA +#define AFX_DATA AFX_CORE_DATA + +///////////////////////////////////////////////////////////////////////////// +// Simple bitmap button + +// CBitmapButton - push-button with 1->4 bitmap images +class CBitmapButton : public CButton +{ + DECLARE_DYNAMIC(CBitmapButton) +public: +// Construction + CBitmapButton(); + + BOOL LoadBitmaps(LPCTSTR lpszBitmapResource, + LPCTSTR lpszBitmapResourceSel = NULL, + LPCTSTR lpszBitmapResourceFocus = NULL, + LPCTSTR lpszBitmapResourceDisabled = NULL); + BOOL LoadBitmaps(UINT nIDBitmapResource, + UINT nIDBitmapResourceSel = 0, + UINT nIDBitmapResourceFocus = 0, + UINT nIDBitmapResourceDisabled = 0); + BOOL AutoLoad(UINT nID, CWnd* pParent); + +// Operations + void SizeToContent(); + +// Implementation: +public: +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif +protected: + // all bitmaps must be the same size + CBitmap m_bitmap; // normal image (REQUIRED) + CBitmap m_bitmapSel; // selected image (OPTIONAL) + CBitmap m_bitmapFocus; // focused but not selected (OPTIONAL) + CBitmap m_bitmapDisabled; // disabled bitmap (OPTIONAL) + + virtual void DrawItem(LPDRAWITEMSTRUCT lpDIS); +}; + +///////////////////////////////////////////////////////////////////////////// +// Control Bars + +// forward declarations (internal to implementation) +class CDockBar; +class CDockContext; +class _AFX_BARINFO; +struct AFX_SIZEPARENTPARAMS; + +class CControlBar : public CWnd +{ + DECLARE_DYNAMIC(CControlBar) +// Construction +protected: + CControlBar(); + +// Attributes +public: + int GetCount() const; + + // for styles specific to CControlBar + DWORD GetBarStyle(); + void SetBarStyle(DWORD dwStyle); + + BOOL m_bAutoDelete; + +// Operations + void EnableDocking(DWORD dwDockStyle); + +// Implementation +public: + virtual ~CControlBar(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + virtual void DelayShow(BOOL bShow); + // allows hiding or showing on idle time + virtual BOOL IsVisible() const; + // works even if DelayShow or DelayHide is pending! + virtual DWORD RecalcDelayShow(AFX_SIZEPARENTPARAMS* lpLayout); + // commits any pending DelayShow calls + + virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz); + virtual BOOL IsDockBar() const; + CFrameWnd* GetDockingFrame() const; + + // info about bar (for status bar and toolbar) + int m_cxLeftBorder, m_cxRightBorder; + int m_cyTopBorder, m_cyBottomBorder; + int m_cxDefaultGap; // default gap value +#ifdef _MAC + BOOL m_bMonochrome; // whether to draw in monochrome or color +#endif + + // array of elements + int m_nCount; + void* m_pData; // m_nCount elements - type depends on derived class + + // support for delayed hide/show + enum StateFlags + { delayHide = 1, delayShow = 2, tempHide = 4 }; + UINT m_nStateFlags; + + // support for docking + DWORD m_dwStyle; // creation style (used for layout) + DWORD m_dwDockStyle;// indicates how bar can be docked + CFrameWnd* m_pDockSite; // current dock site, if dockable + CDockBar* m_pDockBar; // current dock bar, if dockable + CDockContext* m_pDockContext; // used during dragging + BOOL IsFloating() const; + + void GetBarInfo(_AFX_BARINFO* pInfo); + void SetBarInfo(_AFX_BARINFO* pInfo, CFrameWnd* pFrameWnd); + + virtual BOOL PreTranslateMessage(MSG* pMsg); + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler) = 0; + virtual void PostNcDestroy(); + + virtual void DoPaint(CDC* pDC); + void DrawBorders(CDC* pDC, const CRect& rectArg); + + // tooltip support (global state) + static BOOL m_bStatusSet; // set to TRUE when status bar has been set + static BOOL m_bDelayDone; // set to TRUE when delay for has expired + static CWnd* m_pToolTip; // current tooltip window (if not NULL) + static CPoint m_pointLastMove; // last mouse move (relative to screen) + static UINT m_nHitLast; // last hit test code + static CControlBar* m_pBarLast; // last CControlBar tooltip displayed for + + virtual CWnd* CreateToolTip(); + virtual UINT OnCmdHitTest(CPoint point, CPoint* pCenter); + void ShowToolTip(CPoint point, UINT nHit); + virtual void DestroyToolTip(BOOL bIdleStatus, BOOL bResetTimer); + int HitTestToolTip(CPoint point, UINT* pHit); + void FilterToolTipMsg(UINT message, CPoint point); + static void CancelToolTips(); + + // implementation helpers + BOOL AllocElements(int nElements, int cbElement); // one time only + LRESULT WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam); + void CalcInsideRect(CRect& rect, BOOL bHorz) const; // adjusts borders etc +#ifdef _MAC + void OnReposition(); + BOOL CheckMonochrome(); +#endif + + //{{AFX_MSG(CControlBar) + afx_msg int OnCreate(LPCREATESTRUCT lpcs); + afx_msg void OnDestroy(); + afx_msg void OnPaint(); + afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); + afx_msg void OnWindowPosChanging(LPWINDOWPOS lpWndPos); + afx_msg LRESULT OnSizeParent(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnHelpHitTest(WPARAM wParam, LPARAM lParam); + afx_msg void OnInitialUpdate(); + afx_msg LRESULT OnIdleUpdateCmdUI(WPARAM wParam, LPARAM lParam); + afx_msg void OnLButtonDown(UINT nFlags, CPoint pt ); + afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); + afx_msg void OnCancelMode(); + afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT nMsg); + //}}AFX_MSG +#ifdef _MAC + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg LRESULT OnMacintosh(WPARAM wParam, LPARAM lParam); + afx_msg void OnSysColorChange(); + afx_msg void OnMove(int x, int y); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); +#endif + DECLARE_MESSAGE_MAP() + + friend class CFrameWnd; + friend class CDockBar; +}; + +//////////////////////////////////////////// +// CStatusBar control + +struct AFX_STATUSPANE; // private to implementation + +class CStatusBar : public CControlBar +{ + DECLARE_DYNAMIC(CStatusBar) +// Construction +public: + CStatusBar(); + BOOL Create(CWnd* pParentWnd, + DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM, + UINT nID = AFX_IDW_STATUS_BAR); + BOOL SetIndicators(const UINT* lpIDArray, int nIDCount); + +// Attributes +public: // standard control bar things + int CommandToIndex(UINT nIDFind) const; + UINT GetItemID(int nIndex) const; + void GetItemRect(int nIndex, LPRECT lpRect) const; +public: + void GetPaneText(int nIndex, CString& s) const; + BOOL SetPaneText(int nIndex, LPCTSTR lpszNewText, BOOL bUpdate = TRUE); + void GetPaneInfo(int nIndex, UINT& nID, UINT& nStyle, int& cxWidth) const; + void SetPaneInfo(int nIndex, UINT nID, UINT nStyle, int cxWidth); + +// Implementation +public: + virtual ~CStatusBar(); + virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz); + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + inline UINT _GetPaneStyle(int nIndex) const; + void _SetPaneStyle(int nIndex, UINT nStyle); + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; + void EnableDocking(DWORD dwDockStyle); +#endif + +protected: + HFONT m_hFont; + int m_cxSizeBox; // for Win4 style size box in corner + BOOL m_bHideSizeBox; // hide size box if TRUE + + inline AFX_STATUSPANE* _GetPanePtr(int nIndex) const; + void DrawStatusText(CDC* pDC, const CRect& rect, + LPCTSTR lpszText, UINT nStyle); + virtual void DoPaint(CDC* pDC); + virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler); + //{{AFX_MSG(CStatusBar) + afx_msg UINT OnNcHitTest(CPoint point); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg LRESULT OnSetFont(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnGetFont(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnGetText(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnGetTextLength(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnSizeParent(WPARAM wParam, LPARAM lParam); + afx_msg void OnWinIniChange(LPCTSTR lpszSection); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +// Styles for status bar panes +#define SBPS_NORMAL 0x0000 +#define SBPS_NOBORDERS 0x0100 +#define SBPS_POPOUT 0x0200 +#define SBPS_DISABLED 0x0400 +#define SBPS_STRETCH 0x0800 // stretch to fill status bar - 1st pane only + +//////////////////////////////////////////// +// CToolBar control + +struct AFX_TBBUTTON; // private to implementation + +#ifndef _MAC +HBITMAP AFXAPI AfxLoadSysColorBitmap(HINSTANCE hInst, HRSRC hRsrc); +#else +HBITMAP AFXAPI AfxLoadSysColorBitmap(HINSTANCE hInst, HRSRC hRsrc, + HDC hDCGlyphs, BOOL bMonochrome); +#endif + +class CToolBar : public CControlBar +{ + DECLARE_DYNAMIC(CToolBar) + +// Construction +public: + CToolBar(); + BOOL Create(CWnd* pParentWnd, + DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP, + UINT nID = AFX_IDW_TOOLBAR); + + void SetSizes(SIZE sizeButton, SIZE sizeImage); + // button size should be bigger than image + void SetHeight(int cyHeight); + // call after SetSizes, height overrides bitmap size + BOOL LoadBitmap(LPCTSTR lpszResourceName); + BOOL LoadBitmap(UINT nIDResource); + BOOL SetButtons(const UINT* lpIDArray, int nIDCount); + // lpIDArray can be NULL to allocate empty buttons + +// Attributes +public: // standard control bar things + int CommandToIndex(UINT nIDFind) const; + UINT GetItemID(int nIndex) const; + virtual void GetItemRect(int nIndex, LPRECT lpRect) const; + +public: + // for changing button info + void GetButtonInfo(int nIndex, UINT& nID, UINT& nStyle, int& iImage) const; + void SetButtonInfo(int nIndex, UINT nID, UINT nStyle, int iImage); + +// Implementation +public: + virtual ~CToolBar(); + inline UINT _GetButtonStyle(int nIndex) const; + void _SetButtonStyle(int nIndex, UINT nStyle); + virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz); + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + inline AFX_TBBUTTON* _GetButtonPtr(int nIndex) const; + void InvalidateButton(int nIndex); + void UpdateButton(int nIndex); + void CreateMask(int iImage, CPoint offset, + BOOL bHilite, BOOL bHiliteShadow); + + // for custom drawing + struct DrawState + { + HBITMAP hbmMono; + HBITMAP hbmMonoOld; + HBITMAP hbmOldGlyphs; + }; + BOOL PrepareDrawButton(DrawState& ds); + BOOL DrawButton(CDC* pDC, int x, int y, int iImage, UINT nStyle); +#ifdef _MAC + BOOL DrawMonoButton(CDC* pDC, int x, int y, int dx, int dy, + int iImage, UINT nStyle); +#endif + void EndDrawButton(DrawState& ds); + +protected: + CSize m_sizeButton; // size of button + CSize m_sizeImage; // size of glyph + int m_cxSharedBorder; // shared x border between buttons + int m_cySharedBorder; // shared y border between buttons + HBITMAP m_hbmImageWell; // glyphs only + int m_iButtonCapture; // index of button with capture (-1 => none) + HRSRC m_hRsrcImageWell; // handle to loaded resource for image well + HINSTANCE m_hInstImageWell; // instance handle to load image well from + +#ifdef _MAC + // Macintosh toolbars need per-toolbar DCs in order to + // work correctly in multiple-monitor environments + + HDC m_hDCGlyphs; // per-toolbar DC for glyph images + HDC m_hDCMono; // per-toolbar DC for mono glyph masks +#endif + virtual void DoPaint(CDC* pDC); + virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler); + virtual int HitTest(CPoint point); + virtual UINT OnCmdHitTest(CPoint point, CPoint* pCenter); + + //{{AFX_MSG(CToolBar) + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnCancelMode(); + afx_msg void OnSysColorChange(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +// Styles for toolbar buttons +#define TBBS_BUTTON 0x00 // this entry is button +#define TBBS_SEPARATOR 0x01 // this entry is a separator +#define TBBS_CHECKBOX 0x02 // this is an auto check/radio button + +// styles for display states +#define TBBS_CHECKED 0x0100 // button is checked/down +#define TBBS_INDETERMINATE 0x0200 // third state +#define TBBS_DISABLED 0x0400 // element is disabled +#define TBBS_PRESSED 0x0800 // button is being depressed - mouse down + +//////////////////////////////////////////// +// CDialogBar control +// This is a control bar built from a dialog template. It is a modeless +// dialog that delegates all control notifications to the parent window +// of the control bar [the grandparent of the control] + +class CDialogBar : public CControlBar +{ + DECLARE_DYNAMIC(CDialogBar) + +// Construction +public: + CDialogBar(); + BOOL Create(CWnd* pParentWnd, LPCTSTR lpszTemplateName, + UINT nStyle, UINT nID); + BOOL Create(CWnd* pParentWnd, UINT nIDTemplate, + UINT nStyle, UINT nID); + +// Implementation +public: + virtual ~CDialogBar(); + virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz); + CSize m_sizeDefault; + +protected: + virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler); +}; + +///////////////////////////////////////////////////////////////////////////// +// Splitter Window + +#define SPLS_DYNAMIC_SPLIT 0x0001 +#define SPLS_INVERT_TRACKER 0x0002 + +class CSplitterWnd : public CWnd +{ + DECLARE_DYNAMIC(CSplitterWnd) + +// Construction +public: + CSplitterWnd(); + // Create a single view type splitter with multiple splits + BOOL Create(CWnd* pParentWnd, + int nMaxRows, int nMaxCols, SIZE sizeMin, + CCreateContext* pContext, + DWORD dwStyle = WS_CHILD | WS_VISIBLE | + WS_HSCROLL | WS_VSCROLL | SPLS_DYNAMIC_SPLIT, + UINT nID = AFX_IDW_PANE_FIRST); + + // Create a multiple view type splitter with static layout + BOOL CreateStatic(CWnd* pParentWnd, + int nRows, int nCols, + DWORD dwStyle = WS_CHILD | WS_VISIBLE, + UINT nID = AFX_IDW_PANE_FIRST); + + virtual BOOL CreateView(int row, int col, CRuntimeClass* pViewClass, + SIZE sizeInit, CCreateContext* pContext); + +// Attributes +public: + int GetRowCount() const; + int GetColumnCount() const; + + // information about a specific row or column + void GetRowInfo(int row, int& cyCur, int& cyMin) const; + void SetRowInfo(int row, int cyIdeal, int cyMin); + void GetColumnInfo(int col, int& cxCur, int& cxMin) const; + void SetColumnInfo(int col, int cxIdeal, int cxMin); + + // for setting and getting shared scroll bar style + DWORD GetScrollStyle() const; + void SetScrollStyle(DWORD dwStyle); + + // views inside the splitter + CWnd* GetPane(int row, int col) const; + BOOL IsChildPane(CWnd* pWnd, int* pRow, int* pCol); + BOOL IsChildPane(CWnd* pWnd, int& row, int& col); // obsolete + int IdFromRowCol(int row, int col) const; + +// Operations +public: + virtual void RecalcLayout(); // call after changing sizes + +// Implementation Overridables +protected: + // to customize the drawing + enum ESplitType { splitBox, splitBar, splitIntersection, splitBorder }; + virtual void OnDrawSplitter(CDC* pDC, ESplitType nType, const CRect& rect); + virtual void OnInvertTracker(const CRect& rect); + + // for customizing scrollbar regions + virtual BOOL CreateScrollBarCtrl(DWORD dwStyle, UINT nID); + + // for customizing DYNAMIC_SPLIT behavior + virtual void DeleteView(int row, int col); + virtual BOOL SplitRow(int cyBefore); + virtual BOOL SplitColumn(int cxBefore); + virtual void DeleteRow(int rowDelete); + virtual void DeleteColumn(int colDelete); + + // determining active pane from focus or active view in frame + virtual CWnd* GetActivePane(int* pRow = NULL, int* pCol = NULL); + CWnd* GetActivePane(int& row, int& col); // obsolete + virtual void SetActivePane(int row, int col, CWnd* pWnd = NULL); + +// Implementation +public: + virtual ~CSplitterWnd(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + + // high level command operations - called by default view implementation + virtual BOOL CanActivateNext(BOOL bPrev = FALSE); + virtual void ActivateNext(BOOL bPrev = FALSE); + virtual BOOL DoKeyboardSplit(); + + // implementation structure + struct CRowColInfo + { + int nMinSize; // below that try not to show + int nIdealSize; // user set size + // variable depending on the available size layout + int nCurSize; // 0 => invisible, -1 => nonexistant + }; + + // syncronized scrolling + virtual BOOL DoScroll(CView* pViewFrom, UINT nScrollCode, + BOOL bDoScroll = TRUE); + virtual BOOL DoScrollBy(CView* pViewFrom, CSize sizeScroll, + BOOL bDoScroll = TRUE); + +protected: + // customizable implementation attributes (set by constructor or Create) + CRuntimeClass* m_pDynamicViewClass; + int m_nMaxRows, m_nMaxCols; + + // implementation attributes which control layout of the splitter + int m_cxSplitter, m_cySplitter; // size of splitter bar + int m_cxBorderShare, m_cyBorderShare; // space on either side of splitter + int m_cxSplitterGap, m_cySplitterGap; // amount of space between panes + int m_cxBorder, m_cyBorder; // borders in client area + + // current state information + int m_nRows, m_nCols; + BOOL m_bHasHScroll, m_bHasVScroll; + CRowColInfo* m_pColInfo; + CRowColInfo* m_pRowInfo; + + // Tracking info - only valid when 'm_bTracking' is set + BOOL m_bTracking, m_bTracking2; + CPoint m_ptTrackOffset; + CRect m_rectLimit; + CRect m_rectTracker, m_rectTracker2; + int m_htTrack; + + // implementation routines + BOOL CreateCommon(CWnd* pParentWnd, SIZE sizeMin, DWORD dwStyle, UINT nID); + int HitTest(CPoint pt) const; + void GetInsideRect(CRect& rect) const; + void GetHitRect(int ht, CRect& rect); + void TrackRowSize(int y, int row); + void TrackColumnSize(int x, int col); + void DrawAllSplitBars(CDC* pDC, int cxInside, int cyInside); + void SetSplitCursor(int ht); + CWnd* GetSizingParent(); + + // starting and stopping tracking + virtual void StartTracking(int ht); + virtual void StopTracking(BOOL bAccept); + + // special command routing to frame + virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); + virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult); + + //{{AFX_MSG(CSplitterWnd) + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + afx_msg void OnMouseMove(UINT nFlags, CPoint pt); + afx_msg void OnPaint(); + afx_msg void OnLButtonDown(UINT nFlags, CPoint pt); + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint pt); + afx_msg void OnLButtonUp(UINT nFlags, CPoint pt); + afx_msg void OnCancelMode(); + afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg BOOL OnNcCreate(LPCREATESTRUCT lpcs); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + afx_msg void OnDisplayChange(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// CFormView - generic view constructed from a dialog template + +class CFormView : public CScrollView +{ + DECLARE_DYNAMIC(CFormView) + +// Construction +protected: // must derive your own class + CFormView(LPCTSTR lpszTemplateName); + CFormView(UINT nIDTemplate); + +// Implementation +public: +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + virtual void OnInitialUpdate(); + +protected: + LPCTSTR m_lpszTemplateName; + CCreateContext* m_pCreateContext; + HWND m_hWndFocus; // last window to have focus + + virtual void OnDraw(CDC* pDC); // default does nothing + // special case override of child window creation + virtual BOOL Create(LPCTSTR, LPCTSTR, DWORD, + const RECT&, CWnd*, UINT, CCreateContext*); + virtual BOOL PreTranslateMessage(MSG* pMsg); + virtual void OnActivateView(BOOL, CView*, CView*); + virtual void OnActivateFrame(UINT, CFrameWnd*); + BOOL SaveFocusControl(); // updates m_hWndFocus + + //{{AFX_MSG(CFormView) + afx_msg int OnCreate(LPCREATESTRUCT lpcs); + afx_msg void OnSetFocus(CWnd* pOldWnd); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// CEditView - simple text editor view + +class CEditView : public CView +{ + DECLARE_DYNCREATE(CEditView) + +// Construction +public: + CEditView(); + static AFX_DATA const DWORD dwStyleDefault; + +// Attributes +public: + // CEdit control access + CEdit& GetEditCtrl() const; + + // presentation attributes + CFont* GetPrinterFont() const; + void SetPrinterFont(CFont* pFont); +#ifndef _MAC + void SetTabStops(int nTabStops); +#endif + + // other attributes + void GetSelectedText(CString& strResult) const; + +// Operations +public: + BOOL FindText(LPCTSTR lpszFind, BOOL bNext = TRUE, BOOL bCase = TRUE); + void SerializeRaw(CArchive& ar); + UINT PrintInsideRect(CDC* pDC, RECT& rectLayout, UINT nIndexStart, + UINT nIndexStop); + +// Overrideables +protected: + virtual void OnFindNext(LPCTSTR lpszFind, BOOL bNext, BOOL bCase); + virtual void OnReplaceSel(LPCTSTR lpszFind, BOOL bNext, BOOL bCase, + LPCTSTR lpszReplace); + virtual void OnReplaceAll(LPCTSTR lpszFind, LPCTSTR lpszReplace, + BOOL bCase); + virtual void OnTextNotFound(LPCTSTR lpszFind); + +// Implementation +public: + virtual ~CEditView(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + virtual void OnDraw(CDC* pDC); + virtual void Serialize(CArchive& ar); + virtual void DeleteContents(); + void ReadFromArchive(CArchive& ar, UINT nLen); + void WriteToArchive(CArchive& ar); + virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo); + + static AFX_DATA const UINT nMaxSize; + // maximum number of characters supported + +protected: +#ifndef _MAC + int m_nTabStops; // tab stops in dialog units +#endif + LPTSTR m_pShadowBuffer; // special shadow buffer only used in Win32s + UINT m_nShadowSize; + + CUIntArray m_aPageStart; // array of starting pages + HFONT m_hPrinterFont; // if NULL, mirror display font + HFONT m_hMirrorFont; // font object used when mirroring + + // construction + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + + // printing support + virtual BOOL OnPreparePrinting(CPrintInfo* pInfo); + virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo); + virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo); + virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo = NULL); + BOOL PaginateTo(CDC* pDC, CPrintInfo* pInfo); + + // find & replace support + void OnEditFindReplace(BOOL bFindOnly); + BOOL InitializeReplace(); + BOOL SameAsSelected(LPCTSTR lpszCompare, BOOL bCase); + + // buffer access + LPCTSTR LockBuffer() const; + void UnlockBuffer() const; + UINT GetBufferLength() const; + + // special overrides for implementation + virtual void CalcWindowRect(LPRECT lpClientRect, + UINT nAdjustType = adjustBorder); + + //{{AFX_MSG(CEditView) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnPaint(); + afx_msg LRESULT OnSetFont(WPARAM wParam, LPARAM lParam); + afx_msg void OnUpdateNeedSel(CCmdUI* pCmdUI); + afx_msg void OnUpdateNeedClip(CCmdUI* pCmdUI); + afx_msg void OnUpdateNeedText(CCmdUI* pCmdUI); + afx_msg void OnUpdateNeedFind(CCmdUI* pCmdUI); + afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI); + afx_msg void OnEditChange(); + afx_msg void OnEditCut(); + afx_msg void OnEditCopy(); + afx_msg void OnEditPaste(); + afx_msg void OnEditClear(); + afx_msg void OnEditUndo(); + afx_msg void OnEditSelectAll(); + afx_msg void OnEditFind(); + afx_msg void OnEditReplace(); + afx_msg void OnEditRepeat(); + afx_msg LRESULT OnFindReplaceCmd(WPARAM wParam, LPARAM lParam); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// CMetaFileDC + +class CMetaFileDC : public CDC +{ + DECLARE_DYNAMIC(CMetaFileDC) + +// Constructors +public: + CMetaFileDC(); + BOOL Create(LPCTSTR lpszFilename = NULL); +#ifndef _MAC + BOOL CreateEnhanced(CDC* pDCRef, LPCTSTR lpszFileName, + LPCRECT lpBounds, LPCTSTR lpszDescription); +#endif + +// Operations + HMETAFILE Close(); +#ifndef _MAC + HENHMETAFILE CloseEnhanced(); +#endif + +// Implementation +public: + virtual void SetAttribDC(HDC hDC); // Set the Attribute DC + +protected: + virtual void SetOutputDC(HDC hDC); // Set the Output DC -- Not allowed + virtual void ReleaseOutputDC(); // Release the Output DC -- Not allowed + +public: + virtual ~CMetaFileDC(); + +// Clipping Functions (use the Attribute DC's clip region) + virtual int GetClipBox(LPRECT lpRect) const; + virtual BOOL PtVisible(int x, int y) const; + BOOL PtVisible(POINT point) const; + virtual BOOL RectVisible(LPCRECT lpRect) const; + +// Text Functions + virtual BOOL TextOut(int x, int y, LPCTSTR lpszString, int nCount); + BOOL TextOut(int x, int y, const CString& str); + virtual BOOL ExtTextOut(int x, int y, UINT nOptions, LPCRECT lpRect, + LPCTSTR lpszString, UINT nCount, LPINT lpDxWidths); + virtual CSize TabbedTextOut(int x, int y, LPCTSTR lpszString, int nCount, + int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin); + virtual int DrawText(LPCTSTR lpszString, int nCount, LPRECT lpRect, + UINT nFormat); + +// Printer Escape Functions + virtual int Escape(int nEscape, int nCount, LPCSTR lpszInData, LPVOID lpOutData); + +// Viewport Functions + virtual CPoint SetViewportOrg(int x, int y); + CPoint SetViewportOrg(POINT point); + virtual CPoint OffsetViewportOrg(int nWidth, int nHeight); + virtual CSize SetViewportExt(int x, int y); + CSize SetViewportExt(SIZE size); + virtual CSize ScaleViewportExt(int xNum, int xDenom, int yNum, int yDenom); + +protected: + void AdjustCP(int cx); +}; + +///////////////////////////////////////////////////////////////////////////// +// CRectTracker - simple rectangular tracking rectangle w/resize handles + +class CRectTracker +{ +public: +// Constructors + CRectTracker(); + CRectTracker(LPCRECT lpSrcRect, UINT nStyle); + +// Style Flags + enum StyleFlags + { + solidLine = 1, dottedLine = 2, hatchedBorder = 4, + resizeInside = 8, resizeOutside = 16, hatchInside = 32, + }; + +// Hit-Test codes + enum TrackerHit + { + hitNothing = -1, + hitTopLeft = 0, hitTopRight = 1, hitBottomRight = 2, hitBottomLeft = 3, + hitTop = 4, hitRight = 5, hitBottom = 6, hitLeft = 7, hitMiddle = 8 + }; + +// Attributes + UINT m_nStyle; // current state + CRect m_rect; // current position (always in pixels) + CSize m_sizeMin; // minimum X and Y size during track operation + int m_nHandleSize; // size of resize handles (default from WIN.INI) + +// Operations + void Draw(CDC* pDC) const; + void GetTrueRect(LPRECT lpTrueRect) const; + BOOL SetCursor(CWnd* pWnd, UINT nHitTest) const; + BOOL Track(CWnd* pWnd, CPoint point, BOOL bAllowInvert = FALSE, + CWnd* pWndClipTo = NULL); + BOOL TrackRubberBand(CWnd* pWnd, CPoint point, BOOL bAllowInvert = TRUE); + int HitTest(CPoint point) const; + int NormalizeHit(int nHandle) const; + +// Overridables + virtual void DrawTrackerRect(LPCRECT lpRect, CWnd* pWndClipTo, + CDC* pDC, CWnd* pWnd); + virtual void AdjustRect(int nHandle, LPRECT lpRect); + virtual void OnChangedRect(const CRect& rectOld); + +// Implementation +public: + virtual ~CRectTracker(); + +protected: + BOOL m_bAllowInvert; // flag passed to Track or TrackRubberBand + CRect m_rectLast; + CSize m_sizeLast; + BOOL m_bErase; // TRUE if DrawTrackerRect is called for erasing + BOOL m_bFinalErase; // TRUE if DragTrackerRect called for final erase + + // implementation helpers + int HitTestHandles(CPoint point) const; + virtual UINT GetHandleMask() const; + void GetHandleRect(int nHandle, CRect* pHandleRect) const; + void GetModifyPointers(int nHandle, int**ppx, int**ppy, int* px, int*py); + virtual int GetHandleSize(LPCRECT lpRect = NULL) const; + BOOL TrackHandle(int nHandle, CWnd* pWnd, CPoint point, CWnd* pWndClipTo); + void Construct(); +}; + +///////////////////////////////////////////////////////////////////////////// +// Informational data structures + +struct CPrintInfo // Printing information structure +{ + CPrintInfo(); + ~CPrintInfo(); + + CPrintDialog* m_pPD; // pointer to print dialog + + BOOL m_bPreview; // TRUE if in preview mode + BOOL m_bContinuePrinting;// set to FALSE to prematurely end printing + UINT m_nCurPage; // Current page + UINT m_nNumPreviewPages; // Desired number of preview pages + CString m_strPageDesc; // Format string for page number display + LPVOID m_lpUserData; // pointer to user created struct + CRect m_rectDraw; // rectangle defining current usable page area + + void SetMinPage(UINT nMinPage); + void SetMaxPage(UINT nMaxPage); + UINT GetMinPage() const; + UINT GetMaxPage() const; + UINT GetFromPage() const; + UINT GetToPage() const; +}; + +struct CPrintPreviewState // Print Preview context/state +{ + UINT nIDMainPane; // main pane ID to hide + HMENU hMenu; // saved hMenu + DWORD dwStates; // Control Bar Visible states (bit map) + CView* pViewActiveOld; // save old active view during preview + BOOL (CALLBACK* lpfnCloseProc)(CFrameWnd* pFrameWnd); + HACCEL hAccelTable; // saved accelerator table + +// Implementation + CPrintPreviewState(); +}; + +struct CCreateContext // Creation information structure + // All fields are optional and may be NULL +{ + // for creating new views + CRuntimeClass* m_pNewViewClass; // runtime class of view to create or NULL + CDocument* m_pCurrentDoc; + + // for creating MDI children (CMDIChildWnd::LoadFrame) + CDocTemplate* m_pNewDocTemplate; + + // for sharing view/frame state from the original view/frame + CView* m_pLastView; + CFrameWnd* m_pCurrentFrame; + +// Implementation + CCreateContext(); +}; + +///////////////////////////////////////////////////////////////////////////// +// Inline function declarations + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +#ifdef _AFX_ENABLE_INLINES +#define _AFXEXT_INLINE inline +#include <afxext.inl> +#endif + +#undef AFX_DATA +#define AFX_DATA + +#endif //__AFXEXT_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxext.inl b/public/sdk/inc/mfc30/afxext.inl new file mode 100644 index 000000000..388b7ddea --- /dev/null +++ b/public/sdk/inc/mfc30/afxext.inl @@ -0,0 +1,107 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// Inlines for AFXEXT.H + +///////////////////////////////////////////////////////////////////////////// +// main inlines + +#ifdef _AFXEXT_INLINE + +// CCreateContext +_AFXEXT_INLINE CCreateContext::CCreateContext() + { memset(this, 0, sizeof(*this)); } + +// CMetaFileDC +_AFXEXT_INLINE BOOL CMetaFileDC::Create(LPCTSTR lpszFilename) + { return Attach(::CreateMetaFile(lpszFilename)); } +_AFXEXT_INLINE HMETAFILE CMetaFileDC::Close() + { return ::CloseMetaFile(Detach()); } +#ifndef _MAC +_AFXEXT_INLINE BOOL CMetaFileDC::CreateEnhanced(CDC* pDCRef, + LPCTSTR lpszFileName, LPCRECT lpBounds, LPCTSTR lpszDescription) + { return Attach(::CreateEnhMetaFile(pDCRef->m_hDC, + lpszFileName, lpBounds, lpszDescription)); } +_AFXEXT_INLINE HENHMETAFILE CMetaFileDC::CloseEnhanced() + { return ::CloseEnhMetaFile(Detach()); } +_AFXEXT_INLINE CPoint CMetaFileDC::SetViewportOrg(POINT point) + { ASSERT(m_hDC != NULL); return SetViewportOrg(point.x, point.y); } +_AFXEXT_INLINE CSize CMetaFileDC::SetViewportExt(SIZE size) + { ASSERT(m_hDC != NULL); return SetViewportExt(size.cx, size.cy); } +_AFXEXT_INLINE BOOL CMetaFileDC::TextOut(int x, int y, const CString& str) + { ASSERT(m_hDC != NULL); return TextOut(x, y, (LPCTSTR)str, str.GetLength()); } +_AFXEXT_INLINE BOOL CMetaFileDC::PtVisible(POINT point) const + { ASSERT(m_hDC != NULL); return PtVisible(point.x, point.y); } +#endif + +// CSplitterWnd +_AFXEXT_INLINE int CSplitterWnd::GetRowCount() const + { return m_nRows; } +_AFXEXT_INLINE int CSplitterWnd::GetColumnCount() const + { return m_nCols; } +// obsolete functions +_AFXEXT_INLINE BOOL CSplitterWnd::IsChildPane(CWnd* pWnd, int& row, int& col) + { return IsChildPane(pWnd, &row, &col); } +_AFXEXT_INLINE CWnd* CSplitterWnd::GetActivePane(int& row, int& col) + { return GetActivePane(&row, &col); } + +// control bars +_AFXEXT_INLINE int CControlBar::GetCount() const + { return m_nCount; } +_AFXEXT_INLINE void CControlBar::SetBarStyle(DWORD dwStyle) + { m_dwStyle = dwStyle; } +_AFXEXT_INLINE DWORD CControlBar::GetBarStyle() + { return m_dwStyle; } +_AFXEXT_INLINE BOOL CToolBar::LoadBitmap(UINT nIDResource) + { return LoadBitmap(MAKEINTRESOURCE(nIDResource)); } +_AFXEXT_INLINE BOOL CDialogBar::Create(CWnd* pParentWnd, UINT nIDTemplate, + UINT nStyle, UINT nID) + { return Create(pParentWnd, MAKEINTRESOURCE(nIDTemplate), nStyle, nID); } +#ifdef _DEBUG +// status bars do not support docking +_AFXEXT_INLINE void CStatusBar::EnableDocking(DWORD) + { ASSERT(FALSE); } +#endif + +// CRectTracker +_AFXEXT_INLINE CRectTracker::CRectTracker() + { Construct(); } + +// CBitmapButton +_AFXEXT_INLINE CBitmapButton::CBitmapButton() + { } +_AFXEXT_INLINE BOOL CBitmapButton::LoadBitmaps(UINT nIDBitmapResource, + UINT nIDBitmapResourceSel, UINT nIDBitmapResourceFocus, + UINT nIDBitmapResourceDisabled) + { return LoadBitmaps(MAKEINTRESOURCE(nIDBitmapResource), + MAKEINTRESOURCE(nIDBitmapResourceSel), + MAKEINTRESOURCE(nIDBitmapResourceFocus), + MAKEINTRESOURCE(nIDBitmapResourceDisabled)); } + +// CPrintInfo +_AFXEXT_INLINE void CPrintInfo::SetMinPage(UINT nMinPage) + { m_pPD->m_pd.nMinPage = (WORD)nMinPage; } +_AFXEXT_INLINE void CPrintInfo::SetMaxPage(UINT nMaxPage) + { m_pPD->m_pd.nMaxPage = (WORD)nMaxPage; } +_AFXEXT_INLINE UINT CPrintInfo::GetMinPage() const + { return m_pPD->m_pd.nMinPage; } +_AFXEXT_INLINE UINT CPrintInfo::GetMaxPage() const + { return m_pPD->m_pd.nMaxPage; } +_AFXEXT_INLINE UINT CPrintInfo::GetFromPage() const + { return m_pPD->m_pd.nFromPage; } +_AFXEXT_INLINE UINT CPrintInfo::GetToPage() const + { return m_pPD->m_pd.nToPage; } +// CEditView +_AFXEXT_INLINE CEdit& CEditView::GetEditCtrl() const + { return *(CEdit*)this; } + +#endif //_AFXEXT_INLINE + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxhelp.hm b/public/sdk/inc/mfc30/afxhelp.hm new file mode 100644 index 000000000..00f1c36e7 --- /dev/null +++ b/public/sdk/inc/mfc30/afxhelp.hm @@ -0,0 +1,226 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// Non-Client HitTest help IDs +HID_HT_NOWHERE 0x40000 +HID_HT_CAPTION 0x40002 +HID_HT_SIZE 0x40004 +HID_HT_HSCROLL 0x40006 +HID_HT_VSCROLL 0x40007 +HID_HT_MINBUTTON 0x40008 +HID_HT_MAXBUTTON 0x40009 +HID_HT_SIZE 0x4000A // alias: ID_HT_LEFT +HID_HT_SIZE 0x4000B // alias: ID_HT_RIGHT +HID_HT_SIZE 0x4000C // alias: ID_HT_TOP +HID_HT_SIZE 0x4000D // alias: ID_HT_TOPLEFT +HID_HT_SIZE 0x4000E // alias: ID_HT_TOPRIGHT +HID_HT_SIZE 0x4000F // alias: ID_HT_BOTTOM +HID_HT_SIZE 0x40010 // alias: ID_HT_BOTTOMLEFT +HID_HT_SIZE 0x40011 // alias: ID_HT_BOTTOMRIGHT +HID_HT_SIZE 0x40012 // alias: ID_HT_BORDER + +// WM_SYSCOMMAND help IDs +HID_SC_SIZE 0x1EF00 +HID_SC_MOVE 0x1EF01 +HID_SC_MINIMIZE 0x1EF02 +HID_SC_MAXIMIZE 0x1EF03 +HID_SC_NEXTWINDOW 0x1EF04 +HID_SC_PREVWINDOW 0x1EF05 +HID_SC_CLOSE 0x1EF06 +HID_SC_RESTORE 0x1EF12 +HID_SC_TASKLIST 0x1EF13 + +// File MRU and aliases +HID_FILE_MRU_FILE1 0x1E110 +HID_FILE_MRU_FILE1 0x1E111 // aliases: MRU_2 - MRU_16 +HID_FILE_MRU_FILE1 0x1E112 +HID_FILE_MRU_FILE1 0x1E113 +HID_FILE_MRU_FILE1 0x1E114 +HID_FILE_MRU_FILE1 0x1E115 +HID_FILE_MRU_FILE1 0x1E116 +HID_FILE_MRU_FILE1 0x1E117 +HID_FILE_MRU_FILE1 0x1E118 +HID_FILE_MRU_FILE1 0x1E119 +HID_FILE_MRU_FILE1 0x1E11A +HID_FILE_MRU_FILE1 0x1E11B +HID_FILE_MRU_FILE1 0x1E11C +HID_FILE_MRU_FILE1 0x1E11D +HID_FILE_MRU_FILE1 0x1E11E +HID_FILE_MRU_FILE1 0x1E11F + +// Window menu list +HID_WINDOW_ALL 0x1EF1F + +// OLE menu and aliases +HID_OLE_VERB_1 0x1E210 +HID_OLE_VERB_1 0x1E211 // aliases: VERB_2 -> VERB_16 +HID_OLE_VERB_1 0x1E212 +HID_OLE_VERB_1 0x1E213 +HID_OLE_VERB_1 0x1E214 +HID_OLE_VERB_1 0x1E215 +HID_OLE_VERB_1 0x1E216 +HID_OLE_VERB_1 0x1E217 +HID_OLE_VERB_1 0x1E218 +HID_OLE_VERB_1 0x1E219 +HID_OLE_VERB_1 0x1E21A +HID_OLE_VERB_1 0x1E21B +HID_OLE_VERB_1 0x1E21C +HID_OLE_VERB_1 0x1E21D +HID_OLE_VERB_1 0x1E21E +HID_OLE_VERB_1 0x1E21F + +// Commands (HID_*) +HID_FILE_NEW 0x1E100 +HID_FILE_OPEN 0x1E101 +HID_FILE_CLOSE 0x1E102 +HID_FILE_SAVE 0x1E103 +HID_FILE_SAVE_AS 0x1E104 +HID_FILE_PAGE_SETUP 0x1E105 +HID_FILE_PRINT_SETUP 0x1E106 +HID_FILE_PRINT 0x1E107 +HID_FILE_PRINT_PREVIEW 0x1E108 +HID_FILE_UPDATE 0x1E109 +HID_FILE_SAVE_COPY_AS 0x1E10A +HID_FILE_SEND_MAIL 0x1E10B +HID_EDIT_CLEAR 0x1E120 +HID_EDIT_CLEAR_ALL 0x1E121 +HID_EDIT_COPY 0x1E122 +HID_EDIT_CUT 0x1E123 +HID_EDIT_FIND 0x1E124 +HID_EDIT_PASTE 0x1E125 +HID_EDIT_PASTE_LINK 0x1E126 +HID_EDIT_PASTE_SPECIAL 0x1E127 +HID_EDIT_REPEAT 0x1E128 +HID_EDIT_REPLACE 0x1E129 +HID_EDIT_SELECT_ALL 0x1E12A +HID_EDIT_UNDO 0x1E12B +HID_EDIT_REDO 0x1E12C +HID_WINDOW_NEW 0x1E130 +HID_WINDOW_ARRANGE 0x1E131 +HID_WINDOW_CASCADE 0x1E132 +HID_WINDOW_TILE_HORZ 0x1E133 +HID_WINDOW_TILE_VERT 0x1E134 +HID_WINDOW_SPLIT 0x1E135 +HID_APP_ABOUT 0x1E140 +HID_APP_EXIT 0x1E141 +HID_HELP_INDEX 0x1E142 +HID_HELP_USING 0x1E143 +HID_CONTEXT_HELP 0x1E144 +HID_NEXT_PANE 0x1E150 +HID_PREV_PANE 0x1E151 +HID_OLE_INSERT_NEW 0x1E200 +HID_OLE_EDIT_LINKS 0x1E201 +HID_OLE_EDIT_CONVERT 0x1E202 +HID_OLE_EDIT_CHANGE_ICON 0x1E203 +HID_VIEW_TOOLBAR 0x1E800 +HID_VIEW_STATUS_BAR 0x1E801 +HID_RECORD_FIRST 0x1E900 +HID_RECORD_LAST 0x1E901 +HID_RECORD_NEXT 0x1E902 +HID_RECORD_PREV 0x1E903 + +// Dialogs (AFX_HIDD_*) +AFX_HIDD_FILEOPEN 0x27004 +AFX_HIDD_FILESAVE 0x27005 +AFX_HIDD_FONT 0x27006 +AFX_HIDD_COLOR 0x27007 +AFX_HIDD_PRINT 0x27008 +AFX_HIDD_PRINTSETUP 0x27009 +AFX_HIDD_FIND 0x2700A +AFX_HIDD_REPLACE 0x2700B +AFX_HIDD_NEWTYPEDLG 0x27801 +AFX_HIDD_PRINTDLG 0x27802 +AFX_HIDD_PREVIEW_TOOLBAR 0x27803 +AFX_HIDD_PREVIEW_SHORTTOOLBAR 0x2780B +AFX_HIDD_INSERTOBJECT 0x27804 +AFX_HIDD_CHANGEICON 0x27805 +AFX_HIDD_CONVERT 0x27806 +AFX_HIDD_PASTESPECIAL 0x27807 +AFX_HIDD_EDITLINKS 0x27808 +AFX_HIDD_FILEBROWSE 0x27809 +AFX_HIDD_BUSY 0x2780A + +// Prompts/Errors (AFX_HIDP_*) +AFX_HIDP_INVALID_FILENAME 0x3F100 +AFX_HIDP_FAILED_TO_OPEN_DOC 0x3F101 +AFX_HIDP_FAILED_TO_SAVE_DOC 0x3F102 +AFX_HIDP_ASK_TO_SAVE 0x3F103 +AFX_HIDP_FAILED_TO_CREATE_DOC 0x3F104 +AFX_HIDP_FILE_TOO_LARGE 0x3F105 +AFX_HIDP_FAILED_TO_START_PRINT 0x3F106 +AFX_HIDP_FAILED_TO_LAUNCH_HELP 0x3F107 +AFX_HIDP_INTERNAL_FAILURE 0x3F108 +AFX_HIDP_COMMAND_FAILURE 0x3F109 +AFX_HIDP_FAILED_MEMORY_ALLOC 0x3F10A +AFX_HIDP_PARSE_INT 0x3F110 +AFX_HIDP_PARSE_REAL 0x3F111 +AFX_HIDP_PARSE_INT_RANGE 0x3F112 +AFX_HIDP_PARSE_REAL_RANGE 0x3F113 +AFX_HIDP_PARSE_STRING_SIZE 0x3F114 +AFX_HIDP_PARSE_RADIO_BUTTON 0x3F115 +AFX_HIDP_FAILED_INVALID_FORMAT 0x3F120 +AFX_HIDP_FAILED_INVALID_PATH 0x3F121 +AFX_HIDP_FAILED_DISK_FULL 0x3F122 +AFX_HIDP_FAILED_ACCESS_READ 0x3F123 +AFX_HIDP_FAILED_ACCESS_WRITE 0x3F124 +AFX_HIDP_FAILED_IO_ERROR_READ 0x3F125 +AFX_HIDP_FAILED_IO_ERROR_WRITE 0x3F126 +AFX_HIDP_STATIC_OBJECT 0x3F180 +AFX_HIDP_FAILED_TO_CONNECT 0x3F181 +AFX_HIDP_SERVER_BUSY 0x3F182 +AFX_HIDP_BAD_VERB 0x3F183 +AFX_HIDP_FAILED_TO_NOTIFY 0x3F185 +AFX_HIDP_FAILED_TO_LAUNCH 0x3F186 +AFX_HIDP_ASK_TO_UPDATE 0x3F187 +AFX_HIDP_FAILED_TO_UPDATE 0x3F188 +AFX_HIDP_FAILED_TO_REGISTER 0x3F189 +AFX_HIDP_FAILED_TO_AUTO_REGISTER 0x3F18A +AFX_HIDP_FAILED_TO_CONVERT 0x3F18B +AFX_HIDP_GET_NOT_SUPPORTED 0x3F18C +AFX_HIDP_SET_NOT_SUPPORTED 0x3F18D +AFX_HIDP_ASK_TO_DISCARD 0x3F18E +AFX_HIDP_SQL_FIRST 0x3F280 +AFX_HIDP_SQL_CONNECT_FAIL 0x3F281 +AFX_HIDP_SQL_RECORDSET_FORWARD_ONLY 0x3F282 +AFX_HIDP_SQL_EMPTY_COLUMN_LIST 0x3F283 +AFX_HIDP_SQL_FIELD_SCHEMA_MISMATCH 0x3F284 +AFX_HIDP_SQL_ILLEGAL_MODE 0x3F285 +AFX_HIDP_SQL_MULTIPLE_ROWS_AFFECTED 0x3F286 +AFX_HIDP_SQL_NO_CURRENT_RECORD 0x3F287 +AFX_HIDP_SQL_NO_ROWS_AFFECTED 0x3F288 +AFX_HIDP_SQL_RECORDSET_READONLY 0x3F289 +AFX_HIDP_SQL_SQL_NO_TOTAL 0x3F28A +AFX_HIDP_SQL_ODBC_LOAD_FAILED 0x3F28B +AFX_HIDP_SQL_DYNASET_NOT_SUPPORTED 0x3F28C +AFX_HIDP_SQL_SNAPSHOT_NOT_SUPPORTED 0x3F28D +AFX_HIDP_SQL_API_CONFORMANCE 0x3F28E +AFX_HIDP_SQL_SQL_CONFORMANCE 0x3F28F +AFX_HIDP_SQL_NO_DATA_FOUND 0x3F290 +AFX_HIDP_SQL_ROW_UPDATE_NOT_SUPPORTED 0x3F291 +AFX_HIDP_SQL_ODBC_V2_REQUIRED 0x3F292 +AFX_HIDP_SQL_NO_POSITIONED_UPDATES 0x3F293 +AFX_HIDP_SQL_LOCK_MODE_NOT_SUPPORTED 0x3F294 +AFX_HIDP_SQL_DATA_TRUNCATED 0x3F295 +AFX_HIDP_SQL_ROW_FETCH 0x3F296 +AFX_HIDP_SQL_INCORRECT_ODBC 0x3F297 +AFX_HIDP_SQL_UPDATE_DELETE_FAILED 0x3F298 + +// Frame Controls (AFX_HIDW_*) +AFX_HIDW_TOOLBAR 0x5E800 +AFX_HIDW_STATUS_BAR 0x5E801 +AFX_HIDW_PREVIEW_BAR 0x5E802 +AFX_HIDW_RESIZE_BAR 0x5E803 +AFX_HIDW_DOCKBAR_TOP 0x5E81B +AFX_HIDW_DOCKBAR_LEFT 0x5E81C +AFX_HIDW_DOCKBAR_RIGHT 0x5E81D +AFX_HIDW_DOCKBAR_BOTTOM 0x5E81E +AFX_HIDW_DOCKBAR_FLOAT 0x5E81F + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxmsg_.h b/public/sdk/inc/mfc30/afxmsg_.h new file mode 100644 index 000000000..c32e61b16 --- /dev/null +++ b/public/sdk/inc/mfc30/afxmsg_.h @@ -0,0 +1,568 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// Do not include this file directly (included by AFXWIN.H) + +///////////////////////////////////////////////////////////////////////////// + +// Entries in a message map (a 'AFX_MSGMAP_ENTRY') table can be of 9 formats +// +// 1) control notification message (i.e. in response to WM_COMMAND) +// WM_COMMAND, nNotifyCode, nControlID, nControlID, signature type, parameterless member function +// (eg: WM_COMMAND, LBN_SELCHANGE, IDC_LISTBOX, AfxSig_vv, ... ) +// 2) control notification message range (i.e. in response to WM_COMMAND) +// WM_COMMAND, nNotifyCode, nControlIDFirst, nControlIDLast, signature type, parameterless member function +// (eg: WM_COMMAND, LBN_SELCHANGE, IDC_LISTBOX1, IDC_LISTBOX5, AfxSig_vw, ... ) +// 3) WM_NOTIFY notification +// WM_NOTIFY, nNotifyCode, nControlID, nControlID, signature type, ...) +// 3) Update Command UI +// -1, 0, nControlID, 0, signature Unknown, parameterless member function +// 4) Update Command UI Range +// -1, 0, nControlIDFirst, nControlIDLast, signature Unknown, parameterless member function +// 5) menu/accelerator notification message (i.e. special case of first format) +// WM_COMMAND, 0, nID, 0, signature type, parameterless member function +// (eg: WM_COMMAND, 0, IDM_FILESAVE, 0, AfxSig_vv, ... ) +// 6) menu/accelerator notification message range +// WM_COMMAND, 0, nIDFirst, nIDLast, signature type, parameterless member function +// (eg: WM_COMMAND, 0, IDM_FILE_MRU1, IDM_FILE_MRU4, AfxSig_vw, ... ) +// 7) constant windows message +// nMessage, 0, 0, 0, signature type, member function +// (eg: WM_PAINT, 0, ...) +// 8) variable windows message (using RegisterWindowMessage) +// 0xC000, 0, 0, 0, &nMessage, special member function +// +// The end of the message map is marked with a special value +// 0, 0, AfxSig_end, 0 +///////////////////////////////////////////////////////////////////////////// + +enum AfxSig +{ + AfxSig_end = 0, // [marks end of message map] + + AfxSig_bD, // BOOL (CDC*) + AfxSig_bb, // BOOL (BOOL) + AfxSig_bWww, // BOOL (CWnd*, UINT, UINT) + AfxSig_hDWw, // HBRUSH (CDC*, CWnd*, UINT) + AfxSig_iwWw, // int (UINT, CWnd*, UINT) + AfxSig_iWww, // int (CWnd*, UINT, UINT) + AfxSig_is, // int (LPTSTR) + AfxSig_lwl, // LRESULT (WPARAM, LPARAM) + AfxSig_lwwM, // LRESULT (UINT, UINT, CMenu*) + AfxSig_vv, // void (void) + + AfxSig_vw, // void (UINT) + AfxSig_vww, // void (UINT, UINT) + AfxSig_vvii, // void (int, int) // wParam is ignored + AfxSig_vwww, // void (UINT, UINT, UINT) + AfxSig_vwii, // void (UINT, int, int) + AfxSig_vwl, // void (UINT, LPARAM) + AfxSig_vbWW, // void (BOOL, CWnd*, CWnd*) + AfxSig_vD, // void (CDC*) + AfxSig_vM, // void (CMenu*) + AfxSig_vMwb, // void (CMenu*, UINT, BOOL) + + AfxSig_vW, // void (CWnd*) + AfxSig_vWww, // void (CWnd*, UINT, UINT) + AfxSig_vWh, // void (CWnd*, HANDLE) + AfxSig_vwW, // void (UINT, CWnd*) + AfxSig_vwWb, // void (UINT, CWnd*, BOOL) + AfxSig_vwwW, // void (UINT, UINT, CWnd*) + AfxSig_vs, // void (LPTSTR) + AfxSig_vOWNER, // void (int, LPTSTR), force return TRUE + AfxSig_iis, // int (int, LPTSTR) + AfxSig_wp, // UINT (CPoint) + AfxSig_wv, // UINT (void) + AfxSig_vPOS, // void (WINDOWPOS*) + AfxSig_vCALC, // void (NCCALCSIZE_PARAMS*) + AfxSig_vNMHDRpl, // void (NMHDR*, LRESULT*) + AfxSig_vwNMHDRpl, // void (UINT, NMHDR*, LRESULT*) + AfxSig_bwNMHDRpl, // BOOL (UINT, NMHDR*, LRESULT*) + + // signatures specific to CCmdTarget + AfxSig_cmdui, // void (CCmdUI*) + AfxSig_cmduiw, // void (CCmdUI*, UINT) + AfxSig_vpv, // void (void*) + AfxSig_bpv, // BOOL (void*) + + // Other aliases (based on implementation) + AfxSig_vwwh, // void (UINT, UINT, HANDLE) + AfxSig_vwp, // void (UINT, CPoint) + AfxSig_bw = AfxSig_bb, // BOOL (UINT) + AfxSig_bh = AfxSig_bb, // BOOL (HANDLE) + AfxSig_iw = AfxSig_bb, // int (UINT) + AfxSig_ww = AfxSig_bb, // UINT (UINT) + AfxSig_bv = AfxSig_wv, // BOOL (void) + AfxSig_hv = AfxSig_wv, // HANDLE (void) + AfxSig_vb = AfxSig_vw, // void (BOOL) + AfxSig_vbh = AfxSig_vww, // void (BOOL, HANDLE) + AfxSig_vbw = AfxSig_vww, // void (BOOL, UINT) + AfxSig_vhh = AfxSig_vww, // void (HANDLE, HANDLE) + AfxSig_vh = AfxSig_vw, // void (HANDLE) +}; + +///////////////////////////////////////////////////////////////////////////// +// Command notifications for CCmdTarget notifications + +#define CN_COMMAND 0 // void () +#define CN_UPDATE_COMMAND_UI ((UINT)(-1)) // void (CCmdUI*) +// > 0 are control notifications + +#define ON_COMMAND(id, memberFxn) \ + { WM_COMMAND, CN_COMMAND, (WORD)id, (WORD)id, AfxSig_vv, (AFX_PMSG)memberFxn }, + // ON_COMMAND(id, OnFoo) is the same as + // ON_CONTROL(0, id, OnFoo) or ON_BN_CLICKED(0, id, OnFoo) + +#define ON_COMMAND_RANGE(id, idLast, memberFxn) \ + { WM_COMMAND, CN_COMMAND, (WORD)id, (WORD)idLast, AfxSig_vw, \ + (AFX_PMSG)(void (AFX_MSG_CALL CCmdTarget::*)(UINT))memberFxn }, + // ON_COMMAND_RANGE(id, idLast, OnFoo) is the same as + // ON_CONTROL_RANGE(0, id, idLast, OnFoo) + +#define ON_COMMAND_EX(id, memberFxn) \ + { WM_COMMAND, CN_COMMAND, (WORD)id, (WORD)id, AfxSig_bw, \ + (AFX_PMSG)(BOOL (AFX_MSG_CALL CCmdTarget::*)(UINT))memberFxn }, + +#define ON_COMMAND_EX_RANGE(id, idLast, memberFxn) \ + { WM_COMMAND, CN_COMMAND, (WORD)id, (WORD)idLast, AfxSig_bw, \ + (AFX_PMSG)(BOOL (AFX_MSG_CALL CCmdTarget::*)(UINT))memberFxn }, + +// update ui's are listed as WM_COMMAND's so they get routed like commands +#define ON_UPDATE_COMMAND_UI(id, memberFxn) \ + { WM_COMMAND, CN_UPDATE_COMMAND_UI, (WORD)id, (WORD)id, AfxSig_cmdui, \ + (AFX_PMSG)(void (AFX_MSG_CALL CCmdTarget::*)(CCmdUI*))memberFxn }, + +#define ON_UPDATE_COMMAND_UI_RANGE(id, idLast, memberFxn) \ + { WM_COMMAND, CN_UPDATE_COMMAND_UI, (WORD)id, (WORD)idLast, AfxSig_cmdui, \ + (AFX_PMSG)(void (AFX_MSG_CALL CCmdTarget::*)(CCmdUI*))memberFxn }, + +#define ON_NOTIFY(wNotifyCode, id, memberFxn) \ + { WM_NOTIFY, (WORD)(int)wNotifyCode, (WORD)id, (WORD)id, AfxSig_vNMHDRpl, \ + (AFX_PMSG)(void (AFX_MSG_CALL CCmdTarget::*)(NMHDR*, LRESULT*))memberFxn }, + +#define ON_NOTIFY_RANGE(wNotifyCode, id, idLast, memberFxn) \ + { WM_NOTIFY, (WORD)(int)wNotifyCode, (WORD)id, (WORD)idLast, AfxSig_vwNMHDRpl, \ + (AFX_PMSG)(void (AFX_MSG_CALL CCmdTarget::*)(UINT, NMHDR*, LRESULT*))memberFxn }, + +#define ON_NOTIFY_EX(wNotifyCode, id, memberFxn) \ + { WM_NOTIFY, (WORD)(int)wNotifyCode, (WORD)id, (WORD)id, AfxSig_bwNMHDRpl, \ + (AFX_PMSG)(BOOL (AFX_MSG_CALL CCmdTarget::*)(UINT, NMHDR*, LRESULT*))memberFxn }, + +#define ON_NOTIFY_EX_RANGE(wNotifyCode, id, idLast, memberFxn) \ + { WM_NOTIFY, (WORD)(int)wNotifyCode, (WORD)id, (WORD)idLast, AfxSig_bwNMHDRpl, \ + (AFX_PMSG)(BOOL (AFX_MSG_CALL CCmdTarget::*)(UINT, NMHDR*, LRESULT*))memberFxn }, + +// for general controls +#define ON_CONTROL(wNotifyCode, id, memberFxn) \ + { WM_COMMAND, (WORD)wNotifyCode, (WORD)id, (WORD)id, AfxSig_vv, \ + (AFX_PMSG)memberFxn }, + +#define ON_CONTROL_RANGE(wNotifyCode, id, idLast, memberFxn) \ + { WM_COMMAND, (WORD)wNotifyCode, (WORD)id, (WORD)idLast, AfxSig_vw, \ + (AFX_PMSG)(void (AFX_MSG_CALL CCmdTarget::*)(UINT))memberFxn }, + +///////////////////////////////////////////////////////////////////////////// +// Message map tables for Windows messages + +#define ON_WM_CREATE() \ + { WM_CREATE, 0, 0, 0, AfxSig_is, \ + (AFX_PMSG)(AFX_PMSGW)(int (AFX_MSG_CALL CWnd::*)(LPCREATESTRUCT))OnCreate }, +#define ON_WM_DESTROY() \ + { WM_DESTROY, 0, 0, 0, AfxSig_vv, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(void))OnDestroy }, +#define ON_WM_MOVE() \ + { WM_MOVE, 0, 0, 0, AfxSig_vvii, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(int, int))OnMove }, +#define ON_WM_SIZE() \ + { WM_SIZE, 0, 0, 0, AfxSig_vwii, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, int, int))OnSize }, +#define ON_WM_ACTIVATE() \ + { WM_ACTIVATE, 0, 0, 0, AfxSig_vwWb, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CWnd*, BOOL))OnActivate }, +#define ON_WM_SETFOCUS() \ + { WM_SETFOCUS, 0, 0, 0, AfxSig_vW, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(CWnd*))OnSetFocus }, +#define ON_WM_KILLFOCUS() \ + { WM_KILLFOCUS, 0, 0, 0, AfxSig_vW, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(CWnd*))OnKillFocus }, +#define ON_WM_ENABLE() \ + { WM_ENABLE, 0, 0, 0, AfxSig_vb, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(BOOL))OnEnable }, +#define ON_WM_PAINT() \ + { WM_PAINT, 0, 0, 0, AfxSig_vv, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(void))OnPaint }, +#define ON_WM_CLOSE() \ + { WM_CLOSE, 0, 0, 0, AfxSig_vv, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(void))OnClose }, +#define ON_WM_QUERYENDSESSION() \ + { WM_QUERYENDSESSION, 0, 0, 0, AfxSig_bv, \ + (AFX_PMSG)(AFX_PMSGW)(BOOL (AFX_MSG_CALL CWnd::*)(void))OnQueryEndSession }, +#define ON_WM_QUERYOPEN() \ + { WM_QUERYOPEN, 0, 0, 0, AfxSig_bv, \ + (AFX_PMSG)(AFX_PMSGW)(BOOL (AFX_MSG_CALL CWnd::*)(void))OnQueryOpen }, +#define ON_WM_ERASEBKGND() \ + { WM_ERASEBKGND, 0, 0, 0, AfxSig_bD, \ + (AFX_PMSG)(AFX_PMSGW)(BOOL (AFX_MSG_CALL CWnd::*)(CDC*))OnEraseBkgnd }, +#define ON_WM_SYSCOLORCHANGE() \ + { WM_SYSCOLORCHANGE, 0, 0, 0, AfxSig_vv, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(void))OnSysColorChange }, +#define ON_WM_ENDSESSION() \ + { WM_ENDSESSION, 0, 0, 0, AfxSig_vb, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(BOOL))OnEndSession }, +#define ON_WM_SHOWWINDOW() \ + { WM_SHOWWINDOW, 0, 0, 0, AfxSig_vbw, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(BOOL, UINT))OnShowWindow }, +#define ON_WM_CTLCOLOR() \ + { WM_CTLCOLOR, 0, 0, 0, AfxSig_hDWw, \ + (AFX_PMSG)(AFX_PMSGW)(HBRUSH (AFX_MSG_CALL CWnd::*)(CDC*, CWnd*, UINT))OnCtlColor }, +#define ON_WM_WININICHANGE() \ + { WM_WININICHANGE, 0, 0, 0, AfxSig_vs, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(LPCTSTR))OnWinIniChange }, +#define ON_WM_DEVMODECHANGE() \ + { WM_DEVMODECHANGE, 0, 0, 0, AfxSig_vs, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(LPTSTR))OnDevModeChange }, +#define ON_WM_ACTIVATEAPP() \ + { WM_ACTIVATEAPP, 0, 0, 0, AfxSig_vbh, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(BOOL, HTASK))OnActivateApp }, +#define ON_WM_FONTCHANGE() \ + { WM_FONTCHANGE, 0, 0, 0, AfxSig_vv, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(void))OnFontChange }, +#define ON_WM_TIMECHANGE() \ + { WM_TIMECHANGE, 0, 0, 0, AfxSig_vv, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(void))OnTimeChange }, +#define ON_WM_CANCELMODE() \ + { WM_CANCELMODE, 0, 0, 0, AfxSig_vv, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(void))OnCancelMode }, +#define ON_WM_SETCURSOR() \ + { WM_SETCURSOR, 0, 0, 0, AfxSig_bWww, \ + (AFX_PMSG)(AFX_PMSGW)(BOOL (AFX_MSG_CALL CWnd::*)(CWnd*, UINT, UINT))OnSetCursor }, +#define ON_WM_MOUSEACTIVATE() \ + { WM_MOUSEACTIVATE, 0, 0, 0, AfxSig_iWww, \ + (AFX_PMSG)(AFX_PMSGW)(int (AFX_MSG_CALL CWnd::*)(CWnd*, UINT, UINT))OnMouseActivate }, +#define ON_WM_CHILDACTIVATE() \ + { WM_CHILDACTIVATE, 0, 0, 0, AfxSig_vv, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(void))OnChildActivate }, +#define ON_WM_GETMINMAXINFO() \ + { WM_GETMINMAXINFO, 0, 0, 0, AfxSig_vs, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(MINMAXINFO*))OnGetMinMaxInfo }, +#define ON_WM_ICONERASEBKGND() \ + { WM_ICONERASEBKGND, 0, 0, 0, AfxSig_vD, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(CDC*))OnIconEraseBkgnd }, +#define ON_WM_SPOOLERSTATUS() \ + { WM_SPOOLERSTATUS, 0, 0, 0, AfxSig_vww, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, UINT))OnSpoolerStatus }, +#define ON_WM_DRAWITEM() \ + { WM_DRAWITEM, 0, 0, 0, AfxSig_vOWNER, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(int, LPDRAWITEMSTRUCT))OnDrawItem }, +#define ON_WM_MEASUREITEM() \ + { WM_MEASUREITEM, 0, 0, 0, AfxSig_vOWNER, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(int, LPMEASUREITEMSTRUCT))OnMeasureItem }, +#define ON_WM_DELETEITEM() \ + { WM_DELETEITEM, 0, 0, 0, AfxSig_vOWNER, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(int, LPDELETEITEMSTRUCT))OnDeleteItem }, +#define ON_WM_CHARTOITEM() \ + { WM_CHARTOITEM, 0, 0, 0, AfxSig_iwWw, \ + (AFX_PMSG)(AFX_PMSGW)(int (AFX_MSG_CALL CWnd::*)(UINT, CListBox*, UINT))OnCharToItem }, +#define ON_WM_VKEYTOITEM() \ + { WM_VKEYTOITEM, 0, 0, 0, AfxSig_iwWw, \ + (AFX_PMSG)(AFX_PMSGW)(int (AFX_MSG_CALL CWnd::*)(UINT, CListBox*, UINT))OnVKeyToItem }, +#define ON_WM_QUERYDRAGICON() \ + { WM_QUERYDRAGICON, 0, 0, 0, AfxSig_hv, \ + (AFX_PMSG)(AFX_PMSGW)(HCURSOR (AFX_MSG_CALL CWnd::*)())OnQueryDragIcon }, +#define ON_WM_COMPAREITEM() \ + { WM_COMPAREITEM, 0, 0, 0, AfxSig_iis, \ + (AFX_PMSG)(AFX_PMSGW)(int (AFX_MSG_CALL CWnd::*)(int, LPCOMPAREITEMSTRUCT))OnCompareItem }, +#define ON_WM_COMPACTING() \ + { WM_COMPACTING, 0, 0, 0, AfxSig_vw, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT))OnCompacting }, +#define ON_WM_NCCREATE() \ + { WM_NCCREATE, 0, 0, 0, AfxSig_is, \ + (AFX_PMSG)(AFX_PMSGW)(BOOL (AFX_MSG_CALL CWnd::*)(LPCREATESTRUCT))OnNcCreate }, +#define ON_WM_NCDESTROY() \ + { WM_NCDESTROY, 0, 0, 0, AfxSig_vv, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(void))OnNcDestroy }, +#define ON_WM_NCCALCSIZE() \ + { WM_NCCALCSIZE, 0, 0, 0, AfxSig_vCALC, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(BOOL, NCCALCSIZE_PARAMS*))OnNcCalcSize }, +#define ON_WM_NCHITTEST() \ + { WM_NCHITTEST, 0, 0, 0, AfxSig_wp, \ + (AFX_PMSG)(AFX_PMSGW)(UINT (AFX_MSG_CALL CWnd::*)(CPoint))OnNcHitTest }, +#define ON_WM_NCPAINT() \ + { WM_NCPAINT, 0, 0, 0, AfxSig_vv, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(void))OnNcPaint }, +#define ON_WM_NCACTIVATE() \ + { WM_NCACTIVATE, 0, 0, 0, AfxSig_bb, \ + (AFX_PMSG)(AFX_PMSGW)(BOOL (AFX_MSG_CALL CWnd::*)(BOOL))OnNcActivate }, +#define ON_WM_GETDLGCODE() \ + { WM_GETDLGCODE, 0, 0, 0, AfxSig_wv, \ + (AFX_PMSG)(AFX_PMSGW)(UINT (AFX_MSG_CALL CWnd::*)(void))OnGetDlgCode }, +#define ON_WM_NCMOUSEMOVE() \ + { WM_NCMOUSEMOVE, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnNcMouseMove }, +#define ON_WM_NCLBUTTONDOWN() \ + { WM_NCLBUTTONDOWN, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnNcLButtonDown }, +#define ON_WM_NCLBUTTONUP() \ + { WM_NCLBUTTONUP, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnNcLButtonUp }, +#define ON_WM_NCLBUTTONDBLCLK() \ + { WM_NCLBUTTONDBLCLK, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnNcLButtonDblClk }, +#define ON_WM_NCRBUTTONDOWN() \ + { WM_NCRBUTTONDOWN, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnNcRButtonDown }, +#define ON_WM_NCRBUTTONUP() \ + { WM_NCRBUTTONUP, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnNcRButtonUp }, +#define ON_WM_NCRBUTTONDBLCLK() \ + { WM_NCRBUTTONDBLCLK, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnNcRButtonDblClk }, +#define ON_WM_NCMBUTTONDOWN() \ + { WM_NCMBUTTONDOWN, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnNcMButtonDown }, +#define ON_WM_NCMBUTTONUP() \ + { WM_NCMBUTTONUP, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnNcMButtonUp }, +#define ON_WM_NCMBUTTONDBLCLK() \ + { WM_NCMBUTTONDBLCLK, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnNcMButtonDblClk }, +#define ON_WM_KEYDOWN() \ + { WM_KEYDOWN, 0, 0, 0, AfxSig_vwww, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, UINT, UINT))OnKeyDown }, +#define ON_WM_KEYUP() \ + { WM_KEYUP, 0, 0, 0, AfxSig_vwww, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, UINT, UINT))OnKeyUp }, +#define ON_WM_CHAR() \ + { WM_CHAR, 0, 0, 0, AfxSig_vwww, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, UINT, UINT))OnChar }, +#define ON_WM_DEADCHAR() \ + { WM_DEADCHAR, 0, 0, 0, AfxSig_vwww, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, UINT, UINT))OnDeadChar }, +#define ON_WM_SYSKEYDOWN() \ + { WM_SYSKEYDOWN, 0, 0, 0, AfxSig_vwww, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, UINT, UINT))OnSysKeyDown }, +#define ON_WM_SYSKEYUP() \ + { WM_SYSKEYUP, 0, 0, 0, AfxSig_vwww, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, UINT, UINT))OnSysKeyUp }, +#define ON_WM_SYSCHAR() \ + { WM_SYSCHAR, 0, 0, 0, AfxSig_vwww, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, UINT, UINT))OnSysChar }, +#define ON_WM_SYSDEADCHAR() \ + { WM_SYSDEADCHAR, 0, 0, 0, AfxSig_vwww, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, UINT, UINT))OnSysDeadChar }, +#define ON_WM_SYSCOMMAND() \ + { WM_SYSCOMMAND, 0, 0, 0, AfxSig_vwl, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, LPARAM))OnSysCommand }, +#define ON_WM_TIMER() \ + { WM_TIMER, 0, 0, 0, AfxSig_vw, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT))OnTimer }, +#define ON_WM_HSCROLL() \ + { WM_HSCROLL, 0, 0, 0, AfxSig_vwwW, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, UINT, CScrollBar*))OnHScroll }, +#define ON_WM_VSCROLL() \ + { WM_VSCROLL, 0, 0, 0, AfxSig_vwwW, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, UINT, CScrollBar*))OnVScroll }, +#define ON_WM_INITMENU() \ + { WM_INITMENU, 0, 0, 0, AfxSig_vM, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(CMenu*))OnInitMenu }, +#define ON_WM_INITMENUPOPUP() \ + { WM_INITMENUPOPUP, 0, 0, 0, AfxSig_vMwb, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(CMenu*, UINT, BOOL))OnInitMenuPopup }, +#define ON_WM_MENUSELECT() \ + { WM_MENUSELECT, 0, 0, 0, AfxSig_vwwh, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, UINT, HMENU))OnMenuSelect }, +#define ON_WM_MENUCHAR() \ + { WM_MENUCHAR, 0, 0, 0, AfxSig_lwwM, \ + (AFX_PMSG)(AFX_PMSGW)(LRESULT (AFX_MSG_CALL CWnd::*)(UINT, UINT, CMenu*))OnMenuChar }, +#define ON_WM_ENTERIDLE() \ + { WM_ENTERIDLE, 0, 0, 0, AfxSig_vwW, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CWnd*))OnEnterIdle }, +#define ON_WM_MOUSEMOVE() \ + { WM_MOUSEMOVE, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnMouseMove }, +#define ON_WM_LBUTTONDOWN() \ + { WM_LBUTTONDOWN, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnLButtonDown }, +#define ON_WM_LBUTTONUP() \ + { WM_LBUTTONUP, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnLButtonUp }, +#define ON_WM_LBUTTONDBLCLK() \ + { WM_LBUTTONDBLCLK, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnLButtonDblClk }, +#define ON_WM_RBUTTONDOWN() \ + { WM_RBUTTONDOWN, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnRButtonDown }, +#define ON_WM_RBUTTONUP() \ + { WM_RBUTTONUP, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnRButtonUp }, +#define ON_WM_RBUTTONDBLCLK() \ + { WM_RBUTTONDBLCLK, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnRButtonDblClk }, +#define ON_WM_MBUTTONDOWN() \ + { WM_MBUTTONDOWN, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnMButtonDown }, +#define ON_WM_MBUTTONUP() \ + { WM_MBUTTONUP, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnMButtonUp }, +#define ON_WM_MBUTTONDBLCLK() \ + { WM_MBUTTONDBLCLK, 0, 0, 0, AfxSig_vwp, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, CPoint))OnMButtonDblClk }, +#define ON_WM_PARENTNOTIFY() \ + { WM_PARENTNOTIFY, 0, 0, 0, AfxSig_vwl, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, LPARAM))OnParentNotify }, +#define ON_WM_MDIACTIVATE() \ + { WM_MDIACTIVATE, 0, 0, 0, AfxSig_vbWW, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(BOOL, CWnd*, CWnd*))OnMDIActivate }, +#define ON_WM_RENDERFORMAT() \ + { WM_RENDERFORMAT, 0, 0, 0, AfxSig_vw, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT))OnRenderFormat }, +#define ON_WM_RENDERALLFORMATS() \ + { WM_RENDERALLFORMATS, 0, 0, 0, AfxSig_vv, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(void))OnRenderAllFormats }, +#define ON_WM_DESTROYCLIPBOARD() \ + { WM_DESTROYCLIPBOARD, 0, 0, 0, AfxSig_vv, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(void))OnDestroyClipboard }, +#define ON_WM_DRAWCLIPBOARD() \ + { WM_DRAWCLIPBOARD, 0, 0, 0, AfxSig_vv, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(void))OnDrawClipboard }, +#define ON_WM_PAINTCLIPBOARD() \ + { WM_PAINTCLIPBOARD, 0, 0, 0, AfxSig_vWh, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(CWnd*, HGLOBAL))OnPaintClipboard }, +#define ON_WM_VSCROLLCLIPBOARD() \ + { WM_VSCROLLCLIPBOARD, 0, 0, 0, AfxSig_vWww, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(CWnd*, UINT, UINT))OnVScrollClipboard }, +#define ON_WM_SIZECLIPBOARD() \ + { WM_SIZECLIPBOARD, 0, 0, 0, AfxSig_vWh, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(CWnd*, HGLOBAL))OnSizeClipboard }, +#define ON_WM_ASKCBFORMATNAME() \ + { WM_ASKCBFORMATNAME, 0, 0, 0, AfxSig_vwl, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(UINT, LPTSTR))OnAskCbFormatName }, +#define ON_WM_CHANGECBCHAIN() \ + { WM_CHANGECBCHAIN, 0, 0, 0, AfxSig_vhh, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(HWND, HWND))OnChangeCbChain }, +#define ON_WM_HSCROLLCLIPBOARD() \ + { WM_HSCROLLCLIPBOARD, 0, 0, 0, AfxSig_vWww, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(CWnd*, UINT, UINT))OnHScrollClipboard }, +#define ON_WM_QUERYNEWPALETTE() \ + { WM_QUERYNEWPALETTE, 0, 0, 0, AfxSig_bv, \ + (AFX_PMSG)(AFX_PMSGW)(BOOL (AFX_MSG_CALL CWnd::*)(void))OnQueryNewPalette }, +#define ON_WM_PALETTECHANGED() \ + { WM_PALETTECHANGED, 0, 0, 0, AfxSig_vW, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(CWnd*))OnPaletteChanged }, + +#define ON_WM_PALETTEISCHANGING() \ + { WM_PALETTEISCHANGING, 0, 0, 0, AfxSig_vW, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(CWnd*))OnPaletteIsChanging }, +#define ON_WM_DROPFILES() \ + { WM_DROPFILES, 0, 0, 0, AfxSig_vh, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(HDROP))OnDropFiles }, +#define ON_WM_WINDOWPOSCHANGING() \ + { WM_WINDOWPOSCHANGING, 0, 0, 0, AfxSig_vPOS, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(WINDOWPOS*))OnWindowPosChanging }, +#define ON_WM_WINDOWPOSCHANGED() \ + { WM_WINDOWPOSCHANGED, 0, 0, 0, AfxSig_vPOS, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(WINDOWPOS*))OnWindowPosChanged }, + +#define ON_WM_EXITMENULOOP() \ + { WM_EXITMENULOOP, 0, 0, 0, AfxSig_vb, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(BOOL))OnExitMenuLoop }, +#define ON_WM_ENTERMENULOOP() \ + { WM_ENTERMENULOOP, 0, 0, 0, AfxSig_vb, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(BOOL))OnEnterMenuLoop }, + +///////////////////////////////////////////////////////////////////////////// +// Message map tables for Control Notification messages + +// Edit Control Notification Codes +#define ON_EN_SETFOCUS(id, memberFxn) \ + ON_CONTROL(EN_SETFOCUS, id, memberFxn) +#define ON_EN_KILLFOCUS(id, memberFxn) \ + ON_CONTROL(EN_KILLFOCUS, id, memberFxn) +#define ON_EN_CHANGE(id, memberFxn) \ + ON_CONTROL(EN_CHANGE, id, memberFxn) +#define ON_EN_UPDATE(id, memberFxn) \ + ON_CONTROL(EN_UPDATE, id, memberFxn) +#define ON_EN_ERRSPACE(id, memberFxn) \ + ON_CONTROL(EN_ERRSPACE, id, memberFxn) +#define ON_EN_MAXTEXT(id, memberFxn) \ + ON_CONTROL(EN_MAXTEXT, id, memberFxn) +#define ON_EN_HSCROLL(id, memberFxn) \ + ON_CONTROL(EN_HSCROLL, id, memberFxn) +#define ON_EN_VSCROLL(id, memberFxn) \ + ON_CONTROL(EN_VSCROLL, id, memberFxn) + +// User Button Notification Codes +#define ON_BN_CLICKED(id, memberFxn) \ + ON_CONTROL(BN_CLICKED, id, memberFxn) +#define ON_BN_DOUBLECLICKED(id, memberFxn) \ + ON_CONTROL(BN_DOUBLECLICKED, id, memberFxn) + +// old BS_USERBUTTON button notifications - obsolete in Win31 +#define ON_BN_PAINT(id, memberFxn) \ + ON_CONTROL(BN_PAINT, id, memberFxn) +#define ON_BN_HILITE(id, memberFxn) \ + ON_CONTROL(BN_HILITE, id, memberFxn) +#define ON_BN_UNHILITE(id, memberFxn) \ + ON_CONTROL(BN_UNHILITE, id, memberFxn) +#define ON_BN_DISABLE(id, memberFxn) \ + ON_CONTROL(BN_DISABLE, id, memberFxn) + +// Listbox Notification Codes +#define ON_LBN_ERRSPACE(id, memberFxn) \ + ON_CONTROL(LBN_ERRSPACE, id, memberFxn) +#define ON_LBN_SELCHANGE(id, memberFxn) \ + ON_CONTROL(LBN_SELCHANGE, id, memberFxn) +#define ON_LBN_DBLCLK(id, memberFxn) \ + ON_CONTROL(LBN_DBLCLK, id, memberFxn) +#define ON_LBN_SELCANCEL(id, memberFxn) \ + ON_CONTROL(LBN_SELCANCEL, id, memberFxn) +#define ON_LBN_SETFOCUS(id, memberFxn) \ + ON_CONTROL(LBN_SETFOCUS, id, memberFxn) +#define ON_LBN_KILLFOCUS(id, memberFxn) \ + ON_CONTROL(LBN_KILLFOCUS, id, memberFxn) + +// Combo Box Notification Codes +#define ON_CBN_ERRSPACE(id, memberFxn) \ + ON_CONTROL(CBN_ERRSPACE, id, memberFxn) +#define ON_CBN_SELCHANGE(id, memberFxn) \ + ON_CONTROL(CBN_SELCHANGE, id, memberFxn) +#define ON_CBN_DBLCLK(id, memberFxn) \ + ON_CONTROL(CBN_DBLCLK, id, memberFxn) +#define ON_CBN_SETFOCUS(id, memberFxn) \ + ON_CONTROL(CBN_SETFOCUS, id, memberFxn) +#define ON_CBN_KILLFOCUS(id, memberFxn) \ + ON_CONTROL(CBN_KILLFOCUS, id, memberFxn) +#define ON_CBN_EDITCHANGE(id, memberFxn) \ + ON_CONTROL(CBN_EDITCHANGE, id, memberFxn) +#define ON_CBN_EDITUPDATE(id, memberFxn) \ + ON_CONTROL(CBN_EDITUPDATE, id, memberFxn) +#define ON_CBN_DROPDOWN(id, memberFxn) \ + ON_CONTROL(CBN_DROPDOWN, id, memberFxn) +#define ON_CBN_CLOSEUP(id, memberFxn) \ + ON_CONTROL(CBN_CLOSEUP, id, memberFxn) +#define ON_CBN_SELENDOK(id, memberFxn) \ + ON_CONTROL(CBN_SELENDOK, id, memberFxn) +#define ON_CBN_SELENDCANCEL(id, memberFxn) \ + ON_CONTROL(CBN_SELENDCANCEL, id, memberFxn) + +///////////////////////////////////////////////////////////////////////////// +// User extensions for message map entries + +// for Windows messages +#define ON_MESSAGE(message, memberFxn) \ + { message, 0, 0, 0, AfxSig_lwl, \ + (AFX_PMSG)(AFX_PMSGW)(LRESULT (AFX_MSG_CALL CWnd::*)(WPARAM, LPARAM))memberFxn }, + +// for Registered Windows messages +#define ON_REGISTERED_MESSAGE(nMessageVariable, memberFxn) \ + { 0xC000, 0, 0, 0, (UINT)(UINT*)(&nMessageVariable), \ + /*implied 'AfxSig_lwl'*/ \ + (AFX_PMSG)(AFX_PMSGW)(LRESULT (AFX_MSG_CALL CWnd::*)(WPARAM, LPARAM))memberFxn }, + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxodlgs.h b/public/sdk/inc/mfc30/afxodlgs.h new file mode 100644 index 000000000..c5eb1a7c7 --- /dev/null +++ b/public/sdk/inc/mfc30/afxodlgs.h @@ -0,0 +1,375 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1993 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXODLGS_H__ +#define __AFXODLGS_H__ + +#ifdef _AFX_NO_OLE_SUPPORT + #error OLE classes not supported in _MAC builds. +#endif + +#ifdef _AFXCTL + #error OLE UI dialogs not supported in _AFXCTL builds. +#endif + +#ifndef __AFXOLE_H__ + #include <afxole.h> +#endif + +#ifndef __AFXDLGS_H__ + #include <afxdlgs.h> +#endif + +// include OLE 2.0 dialog/helper APIs +#include <ole2ui.h> + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +///////////////////////////////////////////////////////////////////////////// +// AFXODLGS.H - MFC OLE dialogs + +// Classes declared in this file + +//CCommonDialog + class COleDialog; // base class for OLE dialog wrappers + class COleInsertDialog; // insert object dialog + class COleConvertDialog; // convert dialog + class COleChangeIconDialog; // change icon dialog + class COlePasteSpecialDialog; // paste special dialog + class COleLinksDialog; // edit links dialog + class COleUpdateDialog; // update links/embeddings dialog + class COleBusyDialog; // used for + +///////////////////////////////////////////////////////////////////////////// + +// AFXDLL support +#undef AFX_DATA +#define AFX_DATA AFX_OLE_DATA + +///////////////////////////////////////////////////////////////////////////// +// Wrappers for OLE UI dialogs + +class COleDialog : public CCommonDialog +{ + DECLARE_DYNAMIC(COleDialog) + +// Attributes +public: + UINT GetLastError() const; + +// Implementation +public: + int MapResult(UINT nResult); + COleDialog(CWnd* pParentWnd); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + UINT m_nLastError; + +protected: + friend UINT CALLBACK AFX_EXPORT _AfxOleHookProc(HWND, UINT, WPARAM, LPARAM); +}; + +///////////////////////////////////////////////////////////////////////////// +// COleInsertDialog + +class COleInsertDialog : public COleDialog +{ + DECLARE_DYNAMIC(COleInsertDialog) + +// Attributes +public: + OLEUIINSERTOBJECT m_io; // structure for OleUIInsertObject + +// Constructors + COleInsertDialog(DWORD dwFlags = IOF_SELECTCREATENEW, + CWnd* pParentWnd = NULL); + +// Operations + virtual int DoModal(); + BOOL CreateItem(COleClientItem* pItem); + // call after DoModal to create item based on dialog data + +// Attributes (after DoModal returns IDOK) + enum Selection { createNewItem, insertFromFile, linkToFile }; + UINT GetSelectionType() const; + // return type of selection made + + CString GetPathName() const; // return full path name + REFCLSID GetClassID() const; // get class ID of new item + + DVASPECT GetDrawAspect() const; + // DVASPECT_CONTENT or DVASPECT_ICON + HGLOBAL GetIconicMetafile() const; + // returns HGLOBAL to METAFILEPICT struct with iconic data + +// Implementation +public: + virtual ~COleInsertDialog(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + TCHAR m_szFileName[_MAX_PATH]; + // contains full path name after return +}; + +///////////////////////////////////////////////////////////////////////////// +// COleConvertDialog + +class COleConvertDialog : public COleDialog +{ + DECLARE_DYNAMIC(COleConvertDialog) + +// Attributes +public: + OLEUICONVERT m_cv; // structure for OleUIConvert + +// Constructors + COleConvertDialog(COleClientItem* pItem, + DWORD dwFlags = CF_SELECTCONVERTTO, CLSID* pClassID = NULL, + CWnd* pParentWnd = NULL); + +// Operations + virtual int DoModal(); + // just display the dialog and collect convert info + BOOL DoConvert(COleClientItem* pItem); + // do the conversion on pItem (after DoModal == IDOK) + +// Attributes (after DoModal returns IDOK) + enum Selection { noConversion, convertItem, activateAs }; + UINT GetSelectionType() const; + + HGLOBAL GetIconicMetafile() const; // will return NULL if same as before + REFCLSID GetClassID() const; // get class ID to convert or activate as + DVASPECT GetDrawAspect() const; // get new draw aspect + +// Implementation +public: + virtual ~COleConvertDialog(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; +#endif +}; + +///////////////////////////////////////////////////////////////////////////// +// COleChangeIconDialog + +class COleChangeIconDialog : public COleDialog +{ + DECLARE_DYNAMIC(COleChangeIconDialog) + +// Attributes +public: + OLEUICHANGEICON m_ci; // structure for OleUIChangeIcon + +// Constructors + COleChangeIconDialog(COleClientItem* pItem, + DWORD dwFlags = CIF_SELECTCURRENT, + CWnd* pParentWnd = NULL); + +// Operations + virtual int DoModal(); + BOOL DoChangeIcon(COleClientItem* pItem); + +// Attributes + HGLOBAL GetIconicMetafile() const; + +// Implementation +public: + virtual ~COleChangeIconDialog(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; +#endif +}; + +///////////////////////////////////////////////////////////////////////////// +// COlePasteSpecialDialog + +class COlePasteSpecialDialog : public COleDialog +{ + DECLARE_DYNAMIC(COlePasteSpecialDialog) + +// Attributes +public: + OLEUIPASTESPECIAL m_ps; // structure for OleUIPasteSpecial + +// Constructors + COlePasteSpecialDialog(DWORD dwFlags = PSF_SELECTPASTE, + COleDataObject* pDataObject = NULL, CWnd *pParentWnd = NULL); + +// Operations + OLEUIPASTEFLAG AddLinkEntry(UINT cf); + void AddFormat(const FORMATETC& formatEtc, LPTSTR lpszFormat, + LPTSTR lpszResult, DWORD flags); + void AddFormat(UINT cf, DWORD tymed, UINT nFormatID, BOOL bEnableIcon, + BOOL bLink); + void AddStandardFormats(BOOL bEnableLink = TRUE); + + virtual int DoModal(); + BOOL CreateItem(COleClientItem *pNewItem); + // creates a standard OLE item from selection data + +// Attributes (after DoModal returns IDOK) + int GetPasteIndex() const; // resulting index to use for paste + + enum Selection { pasteLink = 1, pasteNormal = 2, pasteStatic = 3, pasteOther = 4}; + UINT GetSelectionType() const; + // get selection type (pasteLink, pasteNormal, pasteStatic) + + DVASPECT GetDrawAspect() const; + // DVASPECT_CONTENT or DVASPECT_ICON + HGLOBAL GetIconicMetafile() const; + // returns HGLOBAL to METAFILEPICT struct with iconic data + +// Implementation +public: + virtual ~COlePasteSpecialDialog(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; + virtual void AssertValid() const; +#endif + unsigned int m_arrLinkTypes[8]; + // size limit imposed by MFCUIx32.DLL library +}; + +///////////////////////////////////////////////////////////////////////////// +// COleLinksDialog + +class COleLinksDialog : public COleDialog +{ + DECLARE_DYNAMIC(COleLinksDialog) + +// Attributes +public: + OLEUIEDITLINKS m_el; // structure for OleUIEditLinks + +// Constructors + COleLinksDialog(COleDocument* pDoc, CView* pView, DWORD dwFlags = 0, + CWnd* pParentWnd = NULL); + +// Operations + virtual int DoModal(); // display the dialog and edit links + +// Implementation +public: + virtual ~COleLinksDialog(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; + virtual void AssertValid() const; +#endif + +public: + COleDocument* m_pDocument; // document being manipulated + COleClientItem* m_pSelectedItem; // primary selected item in m_pDocument + POSITION m_pos; // used during link enumeration + BOOL m_bUpdateLinks; // update links? + BOOL m_bUpdateEmbeddings; // update embeddings? + +// Interface Maps + BEGIN_INTERFACE_PART(OleUILinkContainer, IOleUILinkContainer) + INIT_INTERFACE_PART(COleLinksDialog, OleUILinkContainer) + STDMETHOD_(DWORD,GetNextLink)(DWORD); + STDMETHOD(SetLinkUpdateOptions)(DWORD, DWORD); + STDMETHOD(GetLinkUpdateOptions)(DWORD, LPDWORD); + STDMETHOD(SetLinkSource)(DWORD, LPTSTR, ULONG, ULONG*, BOOL); + STDMETHOD(GetLinkSource)(DWORD, LPTSTR*, ULONG*, + LPTSTR*, LPTSTR*, BOOL*, BOOL*); + STDMETHOD(OpenLinkSource)(DWORD); + STDMETHOD(UpdateLink)(DWORD, BOOL, BOOL); + STDMETHOD(CancelLink)(DWORD); + END_INTERFACE_PART(OleUILinkContainer) + + DECLARE_INTERFACE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// COleUpdateDialog + +class COleUpdateDialog : public COleLinksDialog +{ + DECLARE_DYNAMIC(COleUpdateDialog) + +// Constructors +public: + COleUpdateDialog(COleDocument* pDoc, + BOOL bUpdateLinks = TRUE, BOOL bUpdateEmbeddings = FALSE, + CWnd* pParentWnd = NULL); + +// Operations + virtual int DoModal(); + +// Implementation +public: + virtual ~COleUpdateDialog(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + CString m_strCaption; // caption for the dialog +}; + +///////////////////////////////////////////////////////////////////////////// +// COleBusyDialog - useful in managing concurrency + +class COleBusyDialog : public COleDialog +{ + DECLARE_DYNAMIC(COleBusyDialog) + +// Attributes +public: + OLEUIBUSY m_bz; + +// Constructors + COleBusyDialog(HTASK htaskBusy, BOOL bNotResponding = FALSE, + DWORD dwFlags = 0, CWnd* pParentWnd = NULL); + +// Operations + virtual int DoModal(); + + enum Selection { switchTo = 1, retry = 2, callUnblocked = 3 }; + UINT GetSelectionType() const; + +// Implementation +public: + ~COleBusyDialog(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + Selection m_selection; // selection after DoModal returns IDOK +}; + +///////////////////////////////////////////////////////////////////////////// +// Inline function declarations + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +#ifdef _AFX_ENABLE_INLINES +#define _AFXODLGS_INLINE inline +#include <afxole.inl> +#undef _AFXODLGS_INLINE +#endif + +#undef AFX_DATA +#define AFX_DATA + +#endif //__AFXODLGS_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxole.h b/public/sdk/inc/mfc30/afxole.h new file mode 100644 index 000000000..5c865ccdb --- /dev/null +++ b/public/sdk/inc/mfc30/afxole.h @@ -0,0 +1,1630 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1993 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXOLE_H__ +#define __AFXOLE_H__ + +#ifdef _AFX_NO_OLE_SUPPORT + #error OLE classes not supported in this library variant. +#endif + +#ifndef __AFXEXT_H__ + #include <afxext.h> +#endif + +#ifndef __AFXDISP_H__ + #include <afxdisp.h> +#endif + +// include OLE 2.0 Compound Document headers +#ifndef _UNICODE + #define OLE2ANSI +#endif +#include <ole2.h> + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +///////////////////////////////////////////////////////////////////////////// +// AFXOLE.H - MFC OLE support + +// Classes declared in this file + +//CDocument + class COleDocument; // OLE container document + class COleLinkingDoc; // supports links to embeddings + class COleServerDoc; // OLE server document + +//CCmdTarget + class CDocItem; // part of a document + class COleClientItem; // embedded ole object from outside + class COleServerItem; // ole object to export + class COleDataSource; // clipboard data source mechanism + class COleDropSource; // drag/drop source + class COleDropTarget; // drag/drop target + class COleMessageFilter; // concurrency management + +//CFrameWnd + class COleIPFrameWnd; // frame window for in-place servers + +//CControlBar + class COleResizeBar; // implements in-place resizing + +//CFile + class COleStreamFile; // CFile wrapper for IStream interface + +class COleDataObject; // wrapper for IDataObject interface + +///////////////////////////////////////////////////////////////////////////// + +// AFXDLL support +#undef AFX_DATA +#define AFX_DATA AFX_OLE_DATA + +///////////////////////////////////////////////////////////////////////////// +// backward compatibility + +// COleClientDoc is now obsolete -- use COleDocument instead +#define COleClientDoc COleDocument + +// COleServer has been replaced by the more general COleObjectFactory +#define COleServer COleObjectFactory + +///////////////////////////////////////////////////////////////////////////// +// Useful OLE specific types (some from OLE 1.0 headers) + +// Codes for CallBack events +enum OLE_NOTIFICATION +{ + OLE_CHANGED, // representation of a draw aspect has changed + OLE_SAVED, // the item has committed its storage + OLE_CLOSED, // the item has closed + OLE_RENAMED, // the item has changed its moniker + OLE_CHANGED_STATE, // the item state (open, active, etc.) has changed + OLE_CHANGED_ASPECT, // the item draw aspect has changed +}; + +// Object types +enum OLE_OBJTYPE +{ + OT_UNKNOWN = 0, + + // These are OLE 1.0 types and OLE 2.0 types as returned from GetType(). + OT_LINK = 1, + OT_EMBEDDED = 2, + OT_STATIC = 3, + + // All OLE2 objects are written with this tag when serialized. This + // differentiates them from OLE 1.0 objects written with MFC 2.0. + // This value will never be returned from GetType(). + OT_OLE2 = 256, +}; + +///////////////////////////////////////////////////////////////////////////// +// COleDataObject -- simple wrapper for IDataObject + +class COleDataObject +{ +// Constructors +public: + COleDataObject(); + +// Operations + void Attach(LPDATAOBJECT lpDataObject, BOOL bAutoRelease = TRUE); + LPDATAOBJECT Detach(); // detach and get ownership of m_lpDataObject + void Release(); // detach and Release ownership of m_lpDataObject + BOOL AttachClipboard(); // attach to current clipboard object + +// Attributes + void BeginEnumFormats(); + BOOL GetNextFormat(LPFORMATETC lpFormatEtc); + CFile* GetFileData(CLIPFORMAT cfFormat, LPFORMATETC lpFormatEtc = NULL); + HGLOBAL GetGlobalData(CLIPFORMAT cfFormat, LPFORMATETC lpFormatEtc = NULL); + BOOL GetData(CLIPFORMAT cfFormat, LPSTGMEDIUM lpStgMedium, + LPFORMATETC lpFormatEtc = NULL); + BOOL IsDataAvailable(CLIPFORMAT cfFormat, LPFORMATETC lpFormatEtc = NULL); + +// Implementation +public: + LPDATAOBJECT m_lpDataObject; + LPENUMFORMATETC m_lpEnumerator; + ~COleDataObject(); + + // advanced use and implementation + LPDATAOBJECT GetIDataObject(BOOL bAddRef); + void EnsureClipboardObject(); + BOOL m_bClipboard; // TRUE if represents the Win32 clipboard + +protected: + BOOL m_bAutoRelease; // TRUE if destructor should call Release + +private: + // Disable the copy constructor and assignment by default so you will get + // compiler errors instead of unexpected behaviour if you pass objects + // by value or assign objects. + COleDataObject(const COleDataObject&); // no implementation + void operator=(const COleDataObject&); // no implementation +}; + +///////////////////////////////////////////////////////////////////////////// +// COleDataSource -- wrapper for implementing IDataObject +// (works similar to how data is provided on the clipboard) + +struct AFX_DATACACHE_ENTRY; +class COleDropSource; + +class COleDataSource : public CCmdTarget +{ +// Constructors +public: + COleDataSource(); + +// Operations + void Empty(); // empty cache (similar to ::EmptyClipboard) + + // CacheData & DelayRenderData operations similar to ::SetClipboardData + void CacheGlobalData(CLIPFORMAT cfFormat, HGLOBAL hGlobal, + LPFORMATETC lpFormatEtc = NULL); // for HGLOBAL based data + void DelayRenderFileData(CLIPFORMAT cfFormat, + LPFORMATETC lpFormatEtc = NULL); // for CFile* based delayed render + + // Clipboard and Drag/Drop access + DROPEFFECT DoDragDrop( + DWORD dwEffects = DROPEFFECT_COPY|DROPEFFECT_MOVE|DROPEFFECT_LINK, + LPCRECT lpRectStartDrag = NULL, + COleDropSource* pDropSource = NULL); + void SetClipboard(); + static void PASCAL FlushClipboard(); + static COleDataSource* PASCAL GetClipboardOwner(); + + // Advanced: STGMEDIUM based cached data + void CacheData(CLIPFORMAT cfFormat, LPSTGMEDIUM lpStgMedium, + LPFORMATETC lpFormatEtc = NULL); // for LPSTGMEDIUM based data + // Advanced: STGMEDIUM or HGLOBAL based delayed render + void DelayRenderData(CLIPFORMAT cfFormat, LPFORMATETC lpFormatEtc = NULL); + + // Advanced: support for SetData in COleServerItem + // (not generally useful for clipboard or drag/drop operations) + void DelaySetData(CLIPFORMAT cfFormat, LPFORMATETC lpFormatEtc = NULL); + +// Overidables + virtual BOOL OnRenderGlobalData(LPFORMATETC lpFormatEtc, HGLOBAL* phGlobal); + virtual BOOL OnRenderFileData(LPFORMATETC lpFormatEtc, CFile* pFile); + virtual BOOL OnRenderData(LPFORMATETC lpFormatEtc, LPSTGMEDIUM lpStgMedium); + // OnRenderFileData and OnRenderGlobalData are called by + // the default implementation of OnRenderData. + + virtual BOOL OnSetData(LPFORMATETC lpFormatEtc, LPSTGMEDIUM lpStgMedium, + BOOL bRelease); + // used only in COleServerItem implementation + +// Implementation +public: + virtual ~COleDataSource(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + AFX_DATACACHE_ENTRY* m_pDataCache; // data cache itself + UINT m_nMaxSize; // current allocated size + UINT m_nSize; // current size of the cache + UINT m_nGrowBy; // number of cache elements to grow by for new allocs + + AFX_DATACACHE_ENTRY* Lookup( + LPFORMATETC lpFormatEtc, DATADIR nDataDir) const; + AFX_DATACACHE_ENTRY* GetCacheEntry( + LPFORMATETC lpFormatEtc, DATADIR nDataDir); + +// Interface Maps +public: + BEGIN_INTERFACE_PART(DataObject, IDataObject) + INIT_INTERFACE_PART(COleDataSource, DataObject) + STDMETHOD(GetData)(LPFORMATETC, LPSTGMEDIUM); + STDMETHOD(GetDataHere)(LPFORMATETC, LPSTGMEDIUM); + STDMETHOD(QueryGetData)(LPFORMATETC); + STDMETHOD(GetCanonicalFormatEtc)(LPFORMATETC, LPFORMATETC); + STDMETHOD(SetData)(LPFORMATETC, LPSTGMEDIUM, BOOL); + STDMETHOD(EnumFormatEtc)(DWORD, LPENUMFORMATETC*); + STDMETHOD(DAdvise)(LPFORMATETC, DWORD, LPADVISESINK, LPDWORD); + STDMETHOD(DUnadvise)(DWORD); + STDMETHOD(EnumDAdvise)(LPENUMSTATDATA*); + END_INTERFACE_PART(DataObject) + + DECLARE_INTERFACE_MAP() + + friend class COleServerItem; +}; + +////////////////////////////////////////////////////////////////////////////// +// DocItem support + +class CDocItem : public CCmdTarget +{ + DECLARE_SERIAL(CDocItem) + +// Constructors +protected: // abstract class + CDocItem(); + +// Attributes +public: + CDocument* GetDocument() const; // return container document + +// Overridables +public: + // Raw data access (native format) + virtual BOOL IsBlank() const; + +// Implementation +protected: + COleDocument* m_pDocument; + +public: + virtual void Serialize(CArchive& ar); // for Native data + virtual ~CDocItem(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + + friend class COleDocument; // for access to back pointer +}; + +////////////////////////////////////////////////////////////////////////////// +// COleDocument - common OLE container behavior (enables server functionality) + +class COleDocument : public CDocument +{ + DECLARE_DYNAMIC(COleDocument) + +// Constructors +public: + COleDocument(); + +// Attributes + BOOL HasBlankItems() const; // check for BLANK items + COleClientItem* GetInPlaceActiveItem(CWnd* pWnd); + // return in-place active item for this view or NULL if none + +// Operations + // iterating over existing items + virtual POSITION GetStartPosition() const; + virtual CDocItem* GetNextItem(POSITION& pos) const; + + // iterator helpers (helpers use virtual GetNextItem above) + COleClientItem* GetNextClientItem(POSITION& pos) const; + COleServerItem* GetNextServerItem(POSITION& pos) const; + + // adding new items - called from item constructors + virtual void AddItem(CDocItem* pItem); + virtual void RemoveItem(CDocItem* pItem); + + void EnableCompoundFile(BOOL bEnable = TRUE); + // enable compound file support (only call during constructor) + void UpdateModifiedFlag(); + // scan for modified items -- mark document modified + + // printer-device caching/control + BOOL ApplyPrintDevice(const DVTARGETDEVICE* ptd); + BOOL ApplyPrintDevice(const PRINTDLG* ppd); + // these apply the target device to all COleClientItem objects + +// Overridables + virtual COleClientItem* GetPrimarySelectedItem(CView* pView); + // return primary selected item or NULL if none + virtual void OnShowViews(BOOL bVisible); + // called during app-idle when visibility of a document has changed + +// Implementation +public: + CObList m_docItemList; // not owned items + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + CFrameWnd* GetFirstFrame(); + + // document handling overrides + virtual void SetPathName(LPCTSTR lpszPathName, BOOL bAddToMRU = TRUE); + virtual ~COleDocument(); + virtual void DeleteContents(); // delete client items in list + virtual void Serialize(CArchive& ar); // serialize items to file + virtual void PreCloseFrame(CFrameWnd* pFrame); + virtual BOOL SaveModified(); + virtual void OnIdle(); + + // compound file implementation + virtual BOOL OnNewDocument(); + virtual BOOL OnOpenDocument(LPCTSTR lpszPathName); + virtual BOOL OnSaveDocument(LPCTSTR lpszPathName); + virtual void OnCloseDocument(); + void CommitItems(BOOL bSuccess); // called during File.Save & File.Save As + + // minimal linking protocol + virtual LPMONIKER GetMoniker(OLEGETMONIKER nAssign); + virtual LPOLEITEMCONTAINER GetContainer(); + +protected: + // document state implementation + UINT m_dwNextItemNumber;// serial number for next item in this document + BOOL m_bLastVisible; // TRUE if one or more views was last visible + + // 'docfile' support + BOOL m_bCompoundFile; // TRUE if use compound files + LPSTORAGE m_lpRootStg; // root storage for the document + BOOL m_bSameAsLoad; // TRUE = file-save, FALSE = Save [Copy] As + BOOL m_bRemember; // if FALSE, indicates Save Copy As + + DVTARGETDEVICE* m_ptd; // current document target device + + // implementation helpers + virtual void LoadFromStorage(); + virtual void SaveToStorage(CObject* pObject = NULL); + CDocItem* GetNextItemOfKind(POSITION& pos, CRuntimeClass* pClass) const; + + // command handling + virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, + AFX_CMDHANDLERINFO* pHandlerInfo); + + afx_msg void OnUpdatePasteMenu(CCmdUI* pCmdUI); + afx_msg void OnUpdatePasteLinkMenu(CCmdUI* pCmdUI); + afx_msg void OnUpdateEditLinksMenu(CCmdUI* pCmdUI); + afx_msg void OnEditLinks(); + afx_msg void OnEditConvert(); + afx_msg void OnUpdateEditChangeIcon(CCmdUI* pCmdUI); + afx_msg void OnEditChangeIcon(); + afx_msg void OnUpdateObjectVerbMenu(CCmdUI* pCmdUI); + afx_msg void OnFileSendMail(); + + friend class COleClientItem; + friend class COleServerItem; +}; + +///////////////////////////////////////////////////////////////////////////// +// COleClientItem - Supports OLE2 non-inplace editing. +// implements IOleClientSite, IAdviseSink, and IOleInPlaceSite + +class COleFrameHook; // forward reference (see ..\src\oleimpl.h) + +class COleClientItem : public CDocItem +{ + DECLARE_DYNAMIC(COleClientItem) + +// Constructors +public: + COleClientItem(COleDocument* pContainerDoc = NULL); + + // create from the clipboard + BOOL CreateFromClipboard(OLERENDER render = OLERENDER_DRAW, + CLIPFORMAT cfFormat = 0, LPFORMATETC lpFormatEtc = NULL); + BOOL CreateLinkFromClipboard(OLERENDER render = OLERENDER_DRAW, + CLIPFORMAT cfFormat = 0, LPFORMATETC lpFormatEtc = NULL); + BOOL CreateStaticFromClipboard(OLERENDER render = OLERENDER_DRAW, + CLIPFORMAT cfFormat = 0, LPFORMATETC lpFormatEtc = NULL); + + // create from a class ID (Insert New Object dialog) + BOOL CreateNewItem(REFCLSID clsid, OLERENDER render = OLERENDER_DRAW, + CLIPFORMAT cfFormat = 0, LPFORMATETC lpFormatEtc = NULL); + + // create from COleDataObject + BOOL CreateFromData(COleDataObject* pDataObject, + OLERENDER render = OLERENDER_DRAW, + CLIPFORMAT cfFormat = 0, LPFORMATETC lpFormatEtc = NULL); + BOOL CreateLinkFromData(COleDataObject* pDataObject, + OLERENDER render = OLERENDER_DRAW, + CLIPFORMAT cfFormat = 0, LPFORMATETC lpFormatEtc = NULL); + BOOL CreateStaticFromData(COleDataObject* pDataObject, + OLERENDER render = OLERENDER_DRAW, + CLIPFORMAT cfFormat = 0, LPFORMATETC lpFormatEtc = NULL); + + // create from file (package support) + BOOL CreateFromFile(LPCTSTR lpszFileName, REFCLSID clsid = CLSID_NULL, + OLERENDER render = OLERENDER_DRAW, + CLIPFORMAT cfFormat = 0, LPFORMATETC lpFormatEtc = NULL); + BOOL CreateLinkFromFile(LPCTSTR lpszFileName, + OLERENDER render = OLERENDER_DRAW, + CLIPFORMAT cfFormat = 0, LPFORMATETC lpFormatEtc = NULL); + + // create a copy + BOOL CreateCloneFrom(const COleClientItem* pSrcItem); + +// General Attributes +public: + SCODE GetLastStatus() const; + OLE_OBJTYPE GetType() const; // OT_LINK, OT_EMBEDDED, OT_STATIC + void GetClassID(CLSID* pClassID) const; + void GetUserType(USERCLASSTYPE nUserClassType, CString& rString); + BOOL GetExtent(LPSIZE lpSize, DVASPECT nDrawAspect = (DVASPECT)-1); + // will return FALSE if item is BLANK + BOOL GetCachedExtent(LPSIZE lpSize, DVASPECT nDrawAspect = (DVASPECT)-1); + + // getting/setting iconic cache + HGLOBAL GetIconicMetafile(); + BOOL SetIconicMetafile(HGLOBAL hMetaPict); + + // setting/getting default display aspect + DVASPECT GetDrawAspect() const; + void SetDrawAspect(DVASPECT nDrawAspect); + + // for printer presentation cache + BOOL SetPrintDevice(const DVTARGETDEVICE* ptd); + BOOL SetPrintDevice(const PRINTDLG* ppd); + + // Item state + enum ItemState + { emptyState, loadedState, openState, activeState, activeUIState }; + UINT GetItemState() const; + + BOOL IsModified() const; + BOOL IsRunning() const; + BOOL IsInPlaceActive() const; + BOOL IsOpen() const; + CView* GetActiveView() const; + + // Data access + void AttachDataObject(COleDataObject& rDataObject) const; + + // other rare access information + COleDocument* GetDocument() const; // return container + + // helpers for checking clipboard data availability + static BOOL PASCAL CanPaste(); + static BOOL PASCAL CanPasteLink(); + + // helpers for checking COleDataObject, useful in drag drop + static BOOL PASCAL CanCreateFromData(const COleDataObject* pDataObject); + static BOOL PASCAL CanCreateLinkFromData(const COleDataObject* pDataObject); + +// General Operations + virtual void Release(OLECLOSE dwCloseOption = OLECLOSE_NOSAVE); + // cleanup, detach (close if needed) + void Close(OLECLOSE dwCloseOption = OLECLOSE_SAVEIFDIRTY); + // close without releasing the item + void Delete(BOOL bAutoDelete = TRUE); + // logically delete from file -- not part of the document anymore + void Run(); // insure item is in running state + + // Drawing + BOOL Draw(CDC* pDC, LPCRECT lpBounds, + DVASPECT nDrawAspect = (DVASPECT)-1); // defaults to m_nDrawAspect + + // Activation + virtual BOOL DoVerb(LONG nVerb, CView* pView, LPMSG lpMsg = NULL); + void Activate(LONG nVerb, CView* pView, LPMSG lpMsg = NULL); + + // In-place Activation + void Deactivate(); // completely deactivate + void DeactivateUI(); // deactivate the user interface + BOOL ReactivateAndUndo(); // reactivate then perform undo command + BOOL SetItemRects(LPCRECT lpPosRect = NULL, LPCRECT lpClipRect = NULL); + CWnd* GetInPlaceWindow(); + + // Clipboard operations + void CopyToClipboard(BOOL bIncludeLink = FALSE); + DROPEFFECT DoDragDrop(LPCRECT lpItemRect, CPoint ptOffset, + BOOL bIncludeLink = FALSE, + DWORD dwEffects = DROPEFFECT_COPY|DROPEFFECT_MOVE, + LPCRECT lpRectStartDrag = NULL); + void GetClipboardData(COleDataSource* pDataSource, + BOOL bIncludeLink = FALSE, LPPOINT lpOffset = NULL, + LPSIZE lpSize = NULL); + + // called for creating a COleDataSource by CopyToClipboard and DoDragDrop + virtual COleDataSource* OnGetClipboardData(BOOL bIncludeLink, + LPPOINT lpOffset, LPSIZE lpSize); + + // Operations that apply to embedded items only + void SetHostNames(LPCTSTR lpszHost, LPCTSTR lpszHostObj); + void SetExtent(const CSize& size, DVASPECT nDrawAspect = DVASPECT_CONTENT); + + // Operations that apply to linked items only + // (link options are rarely changed, except through Links dialog) + OLEUPDATE GetLinkUpdateOptions(); + void SetLinkUpdateOptions(OLEUPDATE dwUpdateOpt); + + // Link-source update status (also useful for embeddings that contain links) + BOOL UpdateLink(); // make up-to-date + BOOL IsLinkUpToDate() const; // is link up-to-date + + // object conversion + BOOL ConvertTo(REFCLSID clsidNew); + BOOL ActivateAs(LPCTSTR lpszUserType, REFCLSID clsidOld, REFCLSID clsidNew); + BOOL Reload(); // for lazy reload after ActivateAs + +// Overridables (notifications of IAdviseSink, IOleClientSite and IOleInPlaceSite) + // Callbacks/notifications from the server you must/should implement + virtual void OnChange(OLE_NOTIFICATION nCode, DWORD dwParam); + // implement OnChange to invalidate when item changes + +protected: + virtual void OnGetItemPosition(CRect& rPosition); + // implement OnGetItemPosition if you support in-place activation + + // Common overrides for in-place activation + virtual BOOL OnScrollBy(CSize sizeExtent); + + // Common overrides for applications supporting undo + virtual void OnDiscardUndoState(); + virtual void OnDeactivateAndUndo(); + +public: + virtual void OnDeactivateUI(BOOL bUndoable); + +protected: + // Common overrides for applications supporting links to embeddings + virtual void OnShowItem(); + + // Advanced overrides for in-place activation + virtual void OnGetClipRect(CRect& rClipRect); + virtual BOOL CanActivate(); + +public: + virtual void OnActivate(); + virtual void OnActivateUI(); + virtual void OnDeactivate(); + +protected: + virtual BOOL OnGetWindowContext(CFrameWnd** ppMainFrame, + CFrameWnd** ppDocFrame, LPOLEINPLACEFRAMEINFO lpFrameInfo); + virtual BOOL OnChangeItemPosition(const CRect& rectPos); + // default calls SetItemRects and caches the pos rect + +public: + // Advanced overrides for menu/title handling (rarely overridden) + virtual void OnInsertMenus(CMenu* pMenuShared, + LPOLEMENUGROUPWIDTHS lpMenuWidths); + virtual void OnSetMenu(CMenu* pMenuShared, HOLEMENU holemenu, + HWND hwndActiveObject); + virtual void OnRemoveMenus(CMenu* pMenuShared); + virtual void OnUpdateFrameTitle(); + + // Advanced override for control bar handling + virtual BOOL OnShowControlBars(CFrameWnd* pFrameWnd, BOOL bShow); + +// Implementation +public: + // data to support non-inplace activated items + LPOLEOBJECT m_lpObject; // in case you want direct access to the OLE object + LPVIEWOBJECT2 m_lpViewObject;// IViewObject for IOleObject above + DWORD m_dwItemNumber; // serial number for this item in this document + DVASPECT m_nDrawAspect; // current default display aspect + SCODE m_scLast; // last error code encountered + LPSTORAGE m_lpStorage; // provides storage for m_lpObject + LPLOCKBYTES m_lpLockBytes; // part of implementation of m_lpStorage + DWORD m_dwConnection; // advise connection to the m_lpObject + BYTE m_bLinkUnavail; // TRUE if link is currently unavailable + BYTE m_bMoniker; // TRUE if moniker is assigned + BYTE m_bLocked; // TRUE if object has external lock + BYTE m_bNeedCommit; // TRUE if need CommitItem + BYTE m_bClosing; // TRUE if currently doing COleClientItem::Close + BYTE m_bReserved[3]; // (reserved for future use) + + // for compound file support + LPSTORAGE m_lpNewStorage; // used during Save As situations + + // item state & item type + ItemState m_nItemState; // item state (see ItemState enumeration) + OLE_OBJTYPE m_nItemType; // item type (depends on how created) + + // data valid when in-place activated + CView* m_pView; // view when object is in-place activated + DWORD m_dwContainerStyle; // style of the container wnd before activation + COleFrameHook* m_pInPlaceFrame;// frame window when in-place active + COleFrameHook* m_pInPlaceDoc; // doc window when in-place (may be NULL) + HWND m_hWndServer; // HWND of in-place server window + +public: + virtual ~COleClientItem(); + virtual void Serialize(CArchive& ar); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +// Implementation +public: + virtual BOOL ReportError(SCODE sc) const; + virtual BOOL FreezeLink(); // converts to static: for edit links dialog + + DWORD GetNewItemNumber(); // generates new item number + void GetItemName(LPTSTR lpszItemName) const; // gets readable item name + + void UpdateItemType(); // update m_nItemType + +protected: + // clipboard helpers + void GetEmbeddedItemData(LPSTGMEDIUM lpStgMedium); + void AddCachedData(COleDataSource* pDataSource); + BOOL GetLinkSourceData(LPSTGMEDIUM lpStgMedium); + void GetObjectDescriptorData(LPPOINT lpOffset, LPSIZE lpSize, + LPSTGMEDIUM lpStgMedium); + + // interface helpers + virtual LPOLECLIENTSITE GetClientSite(); + + // helpers for printer-cached representation + BOOL GetPrintDeviceInfo(LPOLECACHE* plpOleCache, + DVTARGETDEVICE** pptd, DWORD* pdwConnection); + +// Advanced Overridables for implementation +protected: + virtual BOOL FinishCreate(SCODE sc); + virtual void CheckGeneral(SCODE sc); + + virtual void OnDataChange(LPFORMATETC lpFormatEtc, + LPSTGMEDIUM lpStgMedium); + +public: + // for storage hookability (override to use 'docfiles') + virtual void GetItemStorage(); // allocate storage for new item + virtual void ReadItem(CArchive& ar); // read item from archive + virtual void WriteItem(CArchive& ar); // write item to archive + virtual void CommitItem(BOOL bSuccess); // commit item's storage + + // compound & flat file implementations of above + void GetItemStorageFlat(); + void ReadItemFlat(CArchive& ar); + void WriteItemFlat(CArchive& ar); + void GetItemStorageCompound(); + void ReadItemCompound(CArchive& ar); + void WriteItemCompound(CArchive& ar); + +// Interface Maps +public: + BEGIN_INTERFACE_PART(OleClientSite, IOleClientSite) + INIT_INTERFACE_PART(COleClientItem, OleClientSite) + STDMETHOD(SaveObject)(); + STDMETHOD(GetMoniker)(DWORD, DWORD, LPMONIKER*); + STDMETHOD(GetContainer)(LPOLECONTAINER*); + STDMETHOD(ShowObject)(); + STDMETHOD(OnShowWindow)(BOOL); + STDMETHOD(RequestNewObjectLayout)(); + END_INTERFACE_PART(OleClientSite) + + BEGIN_INTERFACE_PART(AdviseSink, IAdviseSink) + INIT_INTERFACE_PART(COleClientItem, AdviseSink) + STDMETHOD_(void,OnDataChange)(LPFORMATETC, LPSTGMEDIUM); + STDMETHOD_(void,OnViewChange)(DWORD, LONG); + STDMETHOD_(void,OnRename)(LPMONIKER); + STDMETHOD_(void,OnSave)(); + STDMETHOD_(void,OnClose)(); + END_INTERFACE_PART(AdviseSink) + + BEGIN_INTERFACE_PART(OleIPSite, IOleInPlaceSite) + INIT_INTERFACE_PART(COleClientItem, OleIPSite) + STDMETHOD(GetWindow)(HWND*); + STDMETHOD(ContextSensitiveHelp)(BOOL); + STDMETHOD(CanInPlaceActivate)(); + STDMETHOD(OnInPlaceActivate)(); + STDMETHOD(OnUIActivate)(); + STDMETHOD(GetWindowContext)(LPOLEINPLACEFRAME*, + LPOLEINPLACEUIWINDOW*, LPRECT, LPRECT, LPOLEINPLACEFRAMEINFO); + STDMETHOD(Scroll)(SIZE); + STDMETHOD(OnUIDeactivate)(BOOL); + STDMETHOD(OnInPlaceDeactivate)(); + STDMETHOD(DiscardUndoState)(); + STDMETHOD(DeactivateAndUndo)(); + STDMETHOD(OnPosRectChange)(LPCRECT); + END_INTERFACE_PART(OleIPSite) + + DECLARE_INTERFACE_MAP() + +// Friendship declarations (to avoid many public members) + friend class COleUIWindow; + friend class COleFrameWindow; + friend class COleLinkingDoc; +}; + +///////////////////////////////////////////////////////////////////////////// +// COleServerItem - IOleObject & IDataObject OLE component + +class COleServerItem : public CDocItem +{ + DECLARE_DYNAMIC(COleServerItem) +protected: + // NOTE: many members in this class are protected - since everything + // in this class is designed for implementing an OLE server. + // Requests will come from OLE containers through non-C++ mechanisms, + // which will result in virtual functions in this class being called. + +// Constructors + COleServerItem(COleServerDoc* pServerDoc, BOOL bAutoDelete); + // If your COleServerItem is an integral part of your data, + // bAutoDelete should be FALSE. If your COleServerItem can be + // deleted when a link is released, it can be TRUE. + + COleDataSource* GetDataSource(); + // Use this data source to add conversion formats that your + // server should support. Usually such formats are + // added in the item's constructor. + +// Public Attributes +public: + COleServerDoc* GetDocument() const; // return server document + + // naming (for links only) + const CString& GetItemName() const; // get name of linked item + void SetItemName(LPCTSTR lpszItemName); // set name of linked item + + // link state + BOOL IsConnected() const; // returns TRUE if item has a client + BOOL IsLinkedItem() const; // returns TRUE if item is not embedded item + + // extents + CSize m_sizeExtent; + // HIMETRIC size -- the default implementation of OnSetExtent + // updates this member variable. This member tells the server how + // much of the object is visible in the container document. + +// Operations +public: + void NotifyChanged(DVASPECT nDrawAspect = DVASPECT_CONTENT); + // call this after you change item + void CopyToClipboard(BOOL bIncludeLink = FALSE); + // helper for implementing server 'copy to clipboard' + DROPEFFECT DoDragDrop(LPCRECT lpRectItem, CPoint ptOffset, + BOOL bIncludeLink = FALSE, + DWORD dwEffects = DROPEFFECT_COPY|DROPEFFECT_MOVE, + LPCRECT lpRectStartDrag = NULL); + void GetClipboardData(COleDataSource* pDataSource, + BOOL bIncludeLink = FALSE, LPPOINT lpOffset = NULL, + LPSIZE lpSize = NULL); + +// Overridables + // overridables you must implement for yourself + virtual BOOL OnDraw(CDC* pDC, CSize& rSize) = 0; + // drawing for metafile format (return FALSE if not supported or error) + // (called for DVASPECT_CONTENT only) + + // overridables you may want to implement yourself + virtual void OnUpdate(COleServerItem* pSender, + LPARAM lHint, CObject* pHint, DVASPECT nDrawAspect); + // the default implementation always calls NotifyChanged + + virtual BOOL OnDrawEx(CDC* pDC, DVASPECT nDrawAspect, CSize& rSize); + // advanced drawing -- called for DVASPECT other than DVASPECT_CONTENT + virtual BOOL OnSetExtent(DVASPECT nDrawAspect, const CSize& size); + virtual BOOL OnGetExtent(DVASPECT nDrawAspect, CSize& rSize); + // default implementation uses m_sizeExtent + + // overridables you do not have to implement + virtual void OnDoVerb(LONG iVerb); + // default routes to OnShow &/or OnOpen + virtual BOOL OnSetColorScheme(const LOGPALETTE* lpLogPalette); + // default does nothing + virtual COleDataSource* OnGetClipboardData(BOOL bIncludeLink, + LPPOINT lpOffset, LPSIZE lpSize); + // called for access to clipboard data + virtual BOOL OnQueryUpdateItems(); + // called to determine if there are any contained out-of-date links + virtual void OnUpdateItems(); + // called to update any out-of-date links + +protected: + virtual void OnShow(); + // show item in the user interface (may edit in-place) + virtual void OnOpen(); + // show item in the user interface (must open fully) + virtual void OnHide(); + // hide document (and sometimes application) + + // very advanced overridables +public: + virtual BOOL OnInitFromData(COleDataObject* pDataObject, BOOL bCreation); + // initialize object from IDataObject + + // see COleDataSource for a description of these overridables + virtual BOOL OnRenderGlobalData(LPFORMATETC lpFormatEtc, HGLOBAL* phGlobal); + virtual BOOL OnRenderFileData(LPFORMATETC lpFormatEtc, CFile* pFile); + virtual BOOL OnRenderData(LPFORMATETC lpFormatEtc, LPSTGMEDIUM lpStgMedium); + // HGLOBAL version will be called first, then CFile* version + + virtual BOOL OnSetData(LPFORMATETC lpFormatEtc, LPSTGMEDIUM lpStgMedium, + BOOL bRelease); + // Rare -- only if you support SetData (programmatic paste) + + // advanced helpers for CopyToClipboard + void GetEmbedSourceData(LPSTGMEDIUM lpStgMedium); + void AddOtherClipboardData(COleDataSource* pDataSource); + BOOL GetLinkSourceData(LPSTGMEDIUM lpStgMedium); + void GetObjectDescriptorData(LPPOINT lpOffset, LPSIZE lpSize, + LPSTGMEDIUM lpStgMedium); + +// Implementation +public: + BOOL m_bNeedUnlock; // if TRUE need to pDoc->LockExternal(FALSE) + BOOL m_bAutoDelete; // if TRUE will OnRelease will 'delete this' + + // special version of OnFinalRelease to implement document locking + virtual void OnFinalRelease(); + +protected: + CString m_strItemName; // simple item name + +public: + LPOLEADVISEHOLDER m_lpOleAdviseHolder; // may be NULL + LPDATAADVISEHOLDER m_lpDataAdviseHolder; // may be NULL + + virtual ~COleServerItem(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + + // implementation helpers + void NotifyClient(OLE_NOTIFICATION wNotification, DWORD dwParam); + LPDATAOBJECT GetDataObject(); + LPOLEOBJECT GetOleObject(); + LPMONIKER GetMoniker(OLEGETMONIKER nAssign); + +protected: + virtual BOOL GetMetafileData(LPFORMATETC lpFormatEtc, LPSTGMEDIUM pmedium); + // calls OnDraw or OnDrawEx + virtual void OnSaveEmbedding(LPSTORAGE lpStorage); + virtual BOOL IsBlank() const; + + // CItemDataSource implements OnRender reflections to COleServerItem + class CItemDataSource : public COleDataSource + { + protected: + // the GetData and SetData interfaces forward to m_pItem + virtual BOOL OnRenderGlobalData(LPFORMATETC lpFormatEtc, HGLOBAL* phGlobal); + virtual BOOL OnRenderFileData(LPFORMATETC lpFormatEtc, CFile* pFile); + virtual BOOL OnRenderData(LPFORMATETC lpFormatEtc, LPSTGMEDIUM lpStgMedium); + // HGLOBAL version will be called first, then CFile* version + + virtual BOOL OnSetData(LPFORMATETC lpFormatEtc, LPSTGMEDIUM lpStgMedium, + BOOL bRelease); + }; + CItemDataSource m_dataSource; + // data source used to implement IDataObject + +// Interface Maps +// (Note: these interface maps are used just for link implementation) +public: + BEGIN_INTERFACE_PART(OleObject, IOleObject) + INIT_INTERFACE_PART(COleServerItem, OleObject) + STDMETHOD(SetClientSite)(LPOLECLIENTSITE); + STDMETHOD(GetClientSite)(LPOLECLIENTSITE*); + STDMETHOD(SetHostNames)(LPCTSTR, LPCTSTR); + STDMETHOD(Close)(DWORD); + STDMETHOD(SetMoniker)(DWORD, LPMONIKER); + STDMETHOD(GetMoniker)(DWORD, DWORD, LPMONIKER*); + STDMETHOD(InitFromData)(LPDATAOBJECT, BOOL, DWORD); + STDMETHOD(GetClipboardData)(DWORD, LPDATAOBJECT*); + STDMETHOD(DoVerb)(LONG, LPMSG, LPOLECLIENTSITE, LONG, HWND, LPCRECT); + STDMETHOD(EnumVerbs)(LPENUMOLEVERB*); + STDMETHOD(Update)(); + STDMETHOD(IsUpToDate)(); + STDMETHOD(GetUserClassID)(LPCLSID); + STDMETHOD(GetUserType)(DWORD, LPTSTR*); + STDMETHOD(SetExtent)(DWORD, LPSIZEL); + STDMETHOD(GetExtent)(DWORD, LPSIZEL); + STDMETHOD(Advise)(LPADVISESINK, LPDWORD); + STDMETHOD(Unadvise)(DWORD); + STDMETHOD(EnumAdvise)(LPENUMSTATDATA*); + STDMETHOD(GetMiscStatus)(DWORD, LPDWORD); + STDMETHOD(SetColorScheme)(LPLOGPALETTE); + END_INTERFACE_PART(OleObject) + + BEGIN_INTERFACE_PART(DataObject, IDataObject) + INIT_INTERFACE_PART(COleServerItem, DataObject) + STDMETHOD(GetData)(LPFORMATETC, LPSTGMEDIUM); + STDMETHOD(GetDataHere)(LPFORMATETC, LPSTGMEDIUM); + STDMETHOD(QueryGetData)(LPFORMATETC); + STDMETHOD(GetCanonicalFormatEtc)(LPFORMATETC, LPFORMATETC); + STDMETHOD(SetData)(LPFORMATETC, LPSTGMEDIUM, BOOL); + STDMETHOD(EnumFormatEtc)(DWORD, LPENUMFORMATETC*); + STDMETHOD(DAdvise)(LPFORMATETC, DWORD, LPADVISESINK, LPDWORD); + STDMETHOD(DUnadvise)(DWORD); + STDMETHOD(EnumDAdvise)(LPENUMSTATDATA*); + END_INTERFACE_PART(DataObject) + + DECLARE_INTERFACE_MAP() + + friend class CItemDataSource; + friend class COleServerDoc; + friend class COleLinkingDoc; +}; + +///////////////////////////////////////////////////////////////////////////// +// COleLinkingDoc - +// (enables linking to embeddings - beginnings of server fuctionality) + +class COleLinkingDoc : public COleDocument +{ + DECLARE_DYNAMIC(COleLinkingDoc) + +// Constructors +public: + COleLinkingDoc(); + +// Operations + BOOL Register(COleObjectFactory* pFactory, LPCTSTR lpszPathName); + // notify the running object table and connect to pServer + void Revoke(); + // revoke from running object table + +// Overridables +protected: + virtual COleServerItem* OnGetLinkedItem(LPCTSTR lpszItemName); + // return item for the named linked item (for supporting links) + virtual COleClientItem* OnFindEmbeddedItem(LPCTSTR lpszItemName); + // return item for the named embedded item (for links to embeddings) + +// Implementation +public: + COleObjectFactory* m_pFactory; // back-pointer to server + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + virtual ~COleLinkingDoc(); + + // overrides for updating of monikers & running object table registration + virtual BOOL OnNewDocument(); + virtual BOOL OnOpenDocument(LPCTSTR lpszPathName); + virtual BOOL OnSaveDocument(LPCTSTR lpszPathName); + virtual void OnCloseDocument(); + virtual LPOLEITEMCONTAINER GetContainer(); + virtual void OnShowViews(BOOL bVisible); + + // special handling of error messages during save/load + virtual void ReportSaveLoadException(LPCTSTR lpszPathName, + CException* e, BOOL bSaving, UINT nIDPDefault); + void BeginDeferErrors(); + SCODE EndDeferErrors(SCODE sc); + +protected: + BOOL m_bDeferErrors; // TRUE if in non-interactive OLE mode + CException* m_pLastException; + + DWORD m_dwRegister; // file moniker's registration in the ROT + BOOL m_bVisibleLock; // TRUE if user is holding lock on document + + // implementation helpers + virtual BOOL RegisterIfServerAttached(LPCTSTR lpszPathName, BOOL bMessage); + void LockExternal(BOOL bLock, BOOL bRemoveRefs); + void UpdateVisibleLock(BOOL bVisible, BOOL bRemoveRefs); + + virtual void SaveToStorage(CObject* pObject = NULL); + +// Interface Maps +public: + BEGIN_INTERFACE_PART(PersistFile, IPersistFile) + INIT_INTERFACE_PART(COleLinkingDoc, PersistFile) + STDMETHOD(GetClassID)(LPCLSID); + STDMETHOD(IsDirty)(); + STDMETHOD(Load)(LPCTSTR, DWORD); + STDMETHOD(Save)(LPCTSTR, BOOL); + STDMETHOD(SaveCompleted)(LPCTSTR); + STDMETHOD(GetCurFile)(LPTSTR*); + END_INTERFACE_PART(PersistFile) + + BEGIN_INTERFACE_PART(OleItemContainer, IOleItemContainer) + INIT_INTERFACE_PART(COleLinkingDoc, OleItemContainer) + STDMETHOD(ParseDisplayName)(LPBC, LPTSTR, ULONG*, LPMONIKER*); + STDMETHOD(EnumObjects)(DWORD, LPENUMUNKNOWN*); + STDMETHOD(LockContainer)(BOOL); + STDMETHOD(GetObject)(LPTSTR, DWORD, LPBINDCTX, REFIID, LPVOID*); + STDMETHOD(GetObjectStorage)(LPTSTR, LPBINDCTX, REFIID, LPVOID*); + STDMETHOD(IsRunning)(LPTSTR); + END_INTERFACE_PART(OleItemContainer) + + DECLARE_INTERFACE_MAP() + + friend class COleClientItem; + friend class COleClientItem::XOleClientSite; + friend class COleServerItem::XOleObject; +}; + +////////////////////////////////////////////////////////////////////////////// +// COleServerDoc - registered server document containing COleServerItems + +class COleServerDoc : public COleLinkingDoc +{ + DECLARE_DYNAMIC(COleServerDoc) + +// Constructors and Destructors +public: + COleServerDoc(); + +// Attributes + BOOL IsEmbedded() const; // TRUE if document is an embedding + COleServerItem* GetEmbeddedItem(); + // return embedded item for document (will allocate if necessary) + + // attributes specific to in-place activation + BOOL IsInPlaceActive() const; + void GetItemPosition(LPRECT lpPosRect) const; + // get current position rectangle of in-place edit + void GetItemClipRect(LPRECT lpClipRect) const; + // get current clipping rectangle of in-place edit + BOOL GetZoomFactor(LPSIZE lpSizeNum = NULL, LPSIZE lpSizeDenom = NULL, + LPCRECT lpPosRect = NULL) const; + // returns the zoom factor in pixels + +// Operations + void NotifyChanged(); + // call this after you change some global attribute like + // document dimensions + void UpdateAllItems(COleServerItem* pSender, + LPARAM lHint = 0L, CObject* pHint = NULL, + DVASPECT nDrawAspect = DVASPECT_CONTENT); + + // changes to the entire document (automatically notifies clients) + void NotifyRename(LPCTSTR lpszNewName); + void NotifySaved(); + void NotifyClosed(); // call this after you close document + + // specific operations for embedded documents + void SaveEmbedding(); // call this to save embedded (before closing) + + // specific to in-place activation + BOOL ActivateInPlace(); + void RequestPositionChange(LPCRECT lpPosRect); + BOOL ScrollContainerBy(CSize sizeScroll); + BOOL DeactivateAndUndo(); + BOOL DiscardUndoState(); + +public: +// Overridables for standard user interface (full server) + virtual BOOL OnUpdateDocument(); // implementation of embedded update + +protected: +// Overridables you must implement for yourself + virtual COleServerItem* OnGetEmbeddedItem() = 0; + // return item representing entire (embedded) document + +// Overridables you do not have to implement + virtual void OnClose(OLECLOSE dwCloseOption); + virtual void OnSetHostNames(LPCTSTR lpszHost, LPCTSTR lpszHostObj); + +// Advanced overridables + virtual void OnShowDocument(BOOL bShow); + // show first frame for document or hide all frames for document + +// Advanced overridables for in-place activation +public: + virtual void OnDeactivate(); + virtual void OnDeactivateUI(BOOL bUndoable); + +protected: + virtual void OnSetItemRects(LPCRECT lpPosRect, LPCRECT lpClipRect); + virtual BOOL OnReactivateAndUndo(); + + virtual void OnFrameWindowActivate(BOOL bActivate); + virtual void OnDocWindowActivate(BOOL bActivate); + virtual void OnShowControlBars(CFrameWnd* pFrameWnd, BOOL bShow); + virtual COleIPFrameWnd* CreateInPlaceFrame(CWnd* pParentWnd); + virtual void DestroyInPlaceFrame(COleIPFrameWnd* pFrameWnd); +public: + virtual void OnResizeBorder(LPCRECT lpRectBorder, + LPOLEINPLACEUIWINDOW lpUIWindow, BOOL bFrame); + +// Implementation +protected: + LPOLECLIENTSITE m_lpClientSite; // for embedded item + CString m_strHostObj; // name of document in container + BOOL m_bCntrVisible; // TRUE if OnShowWindow(TRUE) called + BOOL m_bClosing; // TRUE if shutting down + COleServerItem* m_pEmbeddedItem; // pointer to embedded item for document + + COleIPFrameWnd* m_pInPlaceFrame; // not NULL if in-place activated + CWnd* m_pOrigParent; // not NULL if existing view used + DWORD m_dwOrigStyle; // original style of in-place view + DWORD m_dwOrigStyleEx; // original extended style + +public: + virtual ~COleServerDoc(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + + // overridables for implementation + virtual BOOL OnSaveDocument(LPCTSTR lpszPathName); + virtual void OnCloseDocument(); + virtual void DeleteContents(); // delete auto-delete server items + virtual LPMONIKER GetMoniker(OLEGETMONIKER nAssign); + virtual COleServerItem* OnGetLinkedItem(LPCTSTR lpszItemName); + // return item for the named linked item (only if supporting links) + virtual BOOL CanCloseFrame(CFrameWnd* pFrame); + +protected: + // overrides to handle server user-interface + virtual BOOL SaveModified(); // return TRUE if ok to continue + virtual HMENU GetDefaultMenu(); // return menu based on doc type + virtual HACCEL GetDefaultAccelerator(); // return accel table based on doc type + virtual BOOL GetFileTypeString(CString& rString); + + // IPersistStorage implementation + virtual void OnNewEmbedding(LPSTORAGE lpStorage); + virtual void OnOpenEmbedding(LPSTORAGE lpStorage); + virtual void OnSaveEmbedding(LPSTORAGE lpStorage); + + // Implementation helpers + void NotifyAllItems(OLE_NOTIFICATION wNotification, DWORD dwParam); + BOOL SaveModifiedPrompt(); + void ConnectView(CWnd* pParentWnd, CView* pView); + void UpdateUsingHostObj(UINT nIDS, CCmdUI* pCmdUI); + +// Message Maps + //{{AFX_MSG(COleServerDoc) + afx_msg void OnFileUpdate(); + afx_msg void OnFileSaveCopyAs(); + afx_msg void OnUpdateFileUpdate(CCmdUI* pCmdUI); + afx_msg void OnUpdateFileExit(CCmdUI* pCmdUI); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +// Interface Maps +public: + BEGIN_INTERFACE_PART(PersistStorage, IPersistStorage) + INIT_INTERFACE_PART(COleServerDoc, PersistStorage) + STDMETHOD(GetClassID)(LPCLSID); + STDMETHOD(IsDirty)(); + STDMETHOD(InitNew)(LPSTORAGE); + STDMETHOD(Load)(LPSTORAGE); + STDMETHOD(Save)(LPSTORAGE, BOOL); + STDMETHOD(SaveCompleted)(LPSTORAGE); + STDMETHOD(HandsOffStorage)(); + END_INTERFACE_PART(PersistStorage) + + BEGIN_INTERFACE_PART(OleObject, IOleObject) + INIT_INTERFACE_PART(COleServerDoc, OleObject) + STDMETHOD(SetClientSite)(LPOLECLIENTSITE); + STDMETHOD(GetClientSite)(LPOLECLIENTSITE*); + STDMETHOD(SetHostNames)(LPCTSTR, LPCTSTR); + STDMETHOD(Close)(DWORD); + STDMETHOD(SetMoniker)(DWORD, LPMONIKER); + STDMETHOD(GetMoniker)(DWORD, DWORD, LPMONIKER*); + STDMETHOD(InitFromData)(LPDATAOBJECT, BOOL, DWORD); + STDMETHOD(GetClipboardData)(DWORD, LPDATAOBJECT*); + STDMETHOD(DoVerb)(LONG, LPMSG, LPOLECLIENTSITE, LONG, HWND, LPCRECT); + STDMETHOD(EnumVerbs)(IEnumOLEVERB**); + STDMETHOD(Update)(); + STDMETHOD(IsUpToDate)(); + STDMETHOD(GetUserClassID)(CLSID*); + STDMETHOD(GetUserType)(DWORD, LPTSTR*); + STDMETHOD(SetExtent)(DWORD, LPSIZEL); + STDMETHOD(GetExtent)(DWORD, LPSIZEL); + STDMETHOD(Advise)(LPADVISESINK, LPDWORD); + STDMETHOD(Unadvise)(DWORD); + STDMETHOD(EnumAdvise)(LPENUMSTATDATA*); + STDMETHOD(GetMiscStatus)(DWORD, LPDWORD); + STDMETHOD(SetColorScheme)(LPLOGPALETTE); + END_INTERFACE_PART(OleObject) + + BEGIN_INTERFACE_PART(DataObject, IDataObject) + INIT_INTERFACE_PART(COleServerDoc, DataObject) + STDMETHOD(GetData)(LPFORMATETC, LPSTGMEDIUM); + STDMETHOD(GetDataHere)(LPFORMATETC, LPSTGMEDIUM); + STDMETHOD(QueryGetData)(LPFORMATETC); + STDMETHOD(GetCanonicalFormatEtc)(LPFORMATETC, LPFORMATETC); + STDMETHOD(SetData)(LPFORMATETC, LPSTGMEDIUM, BOOL); + STDMETHOD(EnumFormatEtc)(DWORD, LPENUMFORMATETC*); + STDMETHOD(DAdvise)(LPFORMATETC, DWORD, LPADVISESINK, LPDWORD); + STDMETHOD(DUnadvise)(DWORD); + STDMETHOD(EnumDAdvise)(LPENUMSTATDATA*); + END_INTERFACE_PART(DataObject) + + BEGIN_INTERFACE_PART(OleInPlaceObject, IOleInPlaceObject) + INIT_INTERFACE_PART(COleServerDoc, OleInPlaceObject) + STDMETHOD(GetWindow)(HWND*); + STDMETHOD(ContextSensitiveHelp)(BOOL); + STDMETHOD(InPlaceDeactivate)(); + STDMETHOD(UIDeactivate)(); + STDMETHOD(SetObjectRects)(LPCRECT, LPCRECT); + STDMETHOD(ReactivateAndUndo)(); + END_INTERFACE_PART(OleInPlaceObject) + + BEGIN_INTERFACE_PART(OleInPlaceActiveObject, IOleInPlaceActiveObject) + INIT_INTERFACE_PART(COleServerDoc, OleInPlaceActiveObject) + STDMETHOD(GetWindow)(HWND*); + STDMETHOD(ContextSensitiveHelp)(BOOL); + STDMETHOD(TranslateAccelerator)(LPMSG); + STDMETHOD(OnFrameWindowActivate)(BOOL); + STDMETHOD(OnDocWindowActivate)(BOOL); + STDMETHOD(ResizeBorder)(LPCRECT, LPOLEINPLACEUIWINDOW, BOOL); + STDMETHOD(EnableModeless)(BOOL); + END_INTERFACE_PART(OleInPlaceActiveObject) + + DECLARE_INTERFACE_MAP() + + friend class COleServer; + friend class COleServerItem; +}; + +////////////////////////////////////////////////////////////////////////////// +// COleIPFrameWnd + +class COleCntrFrameWnd; + +class COleIPFrameWnd : public CFrameWnd +{ + DECLARE_DYNCREATE(COleIPFrameWnd) + +// Constructors +public: + COleIPFrameWnd(); + +// Overridables +public: + virtual BOOL OnCreateControlBars(CWnd* pWndFrame, CWnd* pWndDoc); + // create control bars on container windows (pWndDoc can be NULL) + virtual BOOL OnCreateControlBars(CFrameWnd* pWndFrame, CFrameWnd* pWndDoc); + // create control bars on container windows (pWndDoc can be NULL) + + virtual void RepositionFrame(LPCRECT lpPosRect, LPCRECT lpClipRect); + // Advanced: reposition frame to wrap around new lpPosRect + +// Implementation +public: + BOOL m_bUIActive; // TRUE if currently in uiacitve state + + virtual BOOL LoadFrame(UINT nIDResource, + DWORD dwDefaultStyle = WS_CHILD|WS_BORDER|WS_CLIPSIBLINGS, + CWnd* pParentWnd = NULL, + CCreateContext* pContext = NULL); + virtual void RecalcLayout(BOOL bNotify = TRUE); + virtual BOOL PreTranslateMessage(MSG* pMsg); + virtual LRESULT OnSetMessageString(WPARAM wParam, LPARAM lParam); + virtual ~COleIPFrameWnd(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + // in-place state + OLEINPLACEFRAMEINFO m_frameInfo; + LPOLEINPLACEFRAME m_lpFrame; + LPOLEINPLACEUIWINDOW m_lpDocFrame; + COleCntrFrameWnd* m_pMainFrame; + COleCntrFrameWnd* m_pDocFrame; + + HMENU m_hSharedMenu; + OLEMENUGROUPWIDTHS m_menuWidths; + HOLEMENU m_hOleMenu; + CRect m_rectPos; // client area rect of the item + CRect m_rectClip; // area to which frame should be clipped + BOOL m_bInsideRecalc; + + // Advanced: in-place activation virtual implementation + virtual BOOL BuildSharedMenu(); + virtual void DestroySharedMenu(); + virtual HMENU GetInPlaceMenu(); + + // Advanced: possible override to change in-place sizing behavior + virtual void OnRequestPositionChange(LPCRECT lpRect); + +protected: + //{{AFX_MSG(COleIPFrameWnd) + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg LRESULT OnRecalcParent(WPARAM wParam, LPARAM lParam); + afx_msg void OnIdleUpdateCmdUI(); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnDestroy(); + afx_msg LRESULT OnResizeChild(WPARAM wParam, LPARAM lParam); + afx_msg void OnContextHelp(); + afx_msg void OnUpdateControlBarMenu(CCmdUI* pCmdUI); + afx_msg BOOL OnBarCheck(UINT nID); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + + friend class COleServerDoc; + friend class COleCntrFrameWnd; +}; + +///////////////////////////////////////////////////////////////////////////// +// COleResizeBar - supports in-place resizing in server applications + +class COleResizeBar : public CControlBar +{ + DECLARE_DYNAMIC(COleResizeBar) + +// Constructors +public: + COleResizeBar(); + BOOL Create(CWnd* pParentWnd, DWORD dwStyle = WS_CHILD | WS_VISIBLE, + UINT nID = AFX_IDW_RESIZE_BAR); + +// Implementation +public: + virtual ~COleResizeBar(); + virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler); + +protected: + CRectTracker m_tracker; // implemented with a tracker + +protected: + //{{AFX_MSG(COleResizeBar) + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + afx_msg void OnLButtonDown(UINT, CPoint point); + afx_msg LRESULT OnSizeParent(WPARAM wParam, LPARAM lParam); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// COleStreamFile - implementation of CFile which uses an IStream + +class COleStreamFile : public CFile +{ + DECLARE_DYNAMIC(COleStreamFile) + +// Constructors and Destructors +public: + COleStreamFile(LPSTREAM lpStream = NULL); + +// Operations + // Note: OpenStream and CreateStream can accept eith STGM_ flags or + // CFile::OpenFlags bits since common values are guaranteed to have + // the same semantics. + BOOL OpenStream(LPSTORAGE lpStorage, LPCTSTR lpszStreamName, + DWORD nOpenFlags = modeReadWrite|shareExclusive, + CFileException* pError = NULL); + BOOL CreateStream(LPSTORAGE lpStorage, LPCTSTR lpszStreamName, + DWORD nOpenFlags = modeReadWrite|shareExclusive|modeCreate, + CFileException* pError = NULL); + + BOOL CreateMemoryStream(CFileException* pError = NULL); + + // attach & detach can be used when Open/Create functions aren't adequate + void Attach(LPSTREAM lpStream); + LPSTREAM Detach(); + +// Implementation +public: + LPSTREAM m_lpStream; +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + virtual ~COleStreamFile(); + + // attributes for implementation + BOOL GetStatus(CFileStatus& rStatus) const; + virtual DWORD GetPosition() const; + + // overrides for implementation + virtual CFile* Duplicate() const; + virtual LONG Seek(LONG lOff, UINT nFrom); + virtual void SetLength(DWORD dwNewLen); + virtual DWORD GetLength() const; + virtual UINT Read(void* lpBuf, UINT nCount); + virtual void Write(const void* lpBuf, UINT nCount); + virtual void LockRange(DWORD dwPos, DWORD dwCount); + virtual void UnlockRange(DWORD dwPos, DWORD dwCount); + virtual void Abort(); + virtual void Flush(); + virtual void Close(); +}; + +///////////////////////////////////////////////////////////////////////////// +// COleDropSource (advanced drop source support) + +class COleDropSource : public CCmdTarget +{ +// Constructors +public: + COleDropSource(); + +// Overridables + virtual SCODE QueryContinueDrag(BOOL bEscapePressed, DWORD dwKeyState); + virtual SCODE GiveFeedback(DROPEFFECT dropEffect); + virtual BOOL OnBeginDrag(CWnd* pWnd); + +// Implementation +public: +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; +#endif + +public: + BEGIN_INTERFACE_PART(DropSource, IDropSource) + INIT_INTERFACE_PART(COleDropSource, DropSource) + STDMETHOD(QueryContinueDrag)(BOOL, DWORD); + STDMETHOD(GiveFeedback)(DWORD); + END_INTERFACE_PART(DropSource) + + DECLARE_INTERFACE_MAP() + + CRect m_rectStartDrag; // when mouse leaves this rect, drag drop starts + BOOL m_bDragStarted; // has drag really started yet? + + // metrics for drag start determination + static AFX_DATA UINT nDragMinDist; // min. amount mouse must move for drag + static AFX_DATA UINT nDragDelay; // delay before drag starts + + friend class COleDataSource; +}; + +///////////////////////////////////////////////////////////////////////////// +// COleDropTarget (advanced drop target support) + +class COleDropTarget : public CCmdTarget +{ +// Constructors +public: + COleDropTarget(); + +// Operations + BOOL Register(CWnd* pWnd); + virtual void Revoke(); // virtual for implementation + +// Overridables + virtual DROPEFFECT OnDragEnter(CWnd* pWnd, COleDataObject* pDataObject, + DWORD dwKeyState, CPoint point); + virtual DROPEFFECT OnDragOver(CWnd* pWnd, COleDataObject* pDataObject, + DWORD dwKeyState, CPoint point); + virtual BOOL OnDrop(CWnd* pWnd, COleDataObject* pDataObject, + DROPEFFECT dropEffect, CPoint point); + virtual void OnDragLeave(CWnd* pWnd); + virtual BOOL OnDragScroll(CWnd* pWnd, DWORD dwKeyState, CPoint point); + +// Implementation +public: + virtual ~COleDropTarget(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + HWND m_hWnd; // HWND this IDropTarget is attached to + LPDATAOBJECT m_lpDataObject; // != NULL between OnDragEnter, OnDragLeave + UINT m_nTimerID; // != MAKEWORD(-1, -1) when in scroll area + DWORD m_dwLastTick; // only valid when m_nTimerID valid + UINT m_nScrollDelay; // time to next scroll + + // metrics for drag-scrolling + static AFX_DATA int nScrollInset; + static AFX_DATA UINT nScrollDelay; + static AFX_DATA UINT nScrollInterval; + + // implementation helpers + void SetupTimer(CView* pView, UINT nTimerID); + void CancelTimer(CWnd* pWnd); + +// Interface Maps +public: + BEGIN_INTERFACE_PART(DropTarget, IDropTarget) + INIT_INTERFACE_PART(COleDropTarget, DropTarget) + STDMETHOD(DragEnter)(LPDATAOBJECT, DWORD, POINTL, LPDWORD); + STDMETHOD(DragOver)(DWORD, POINTL, LPDWORD); + STDMETHOD(DragLeave)(); + STDMETHOD(Drop)(LPDATAOBJECT, DWORD, POINTL pt, LPDWORD); + END_INTERFACE_PART(DropTarget) + + DECLARE_INTERFACE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// COleMessageFilter (implements IMessageFilter) + +class COleMessageFilter : public CCmdTarget +{ +// Constructors +public: + COleMessageFilter(); + +// Operations + BOOL Register(); + void Revoke(); + + // for controlling the busy state of the server application (called app) + virtual void BeginBusyState(); + virtual void EndBusyState(); + void SetBusyReply(SERVERCALL nBusyReply); + + // for controlling actions taken against rejected/retried calls + void SetRetryReply(DWORD nRetryReply = 0); + // only used when the "not responding" dialog is disabled + void SetMessagePendingDelay(DWORD nTimeout = 5000); + // used to determine amount of time before significant message + void EnableBusyDialog(BOOL bEnableBusy = TRUE); + void EnableNotRespondingDialog(BOOL bEnableNotResponding = TRUE); + // used to enable/disable the two types of busy dialogs + +// Overridables + virtual BOOL OnMessagePending(const MSG* pMsg); + // return TRUE to eat the message (usually only if processed) + +// Implementation +public: +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + virtual ~COleMessageFilter(); + virtual BOOL IsSignificantMessage(MSG* pMsg); + // determine if any significant messages are present in the queue + virtual int OnBusyDialog(HTASK htaskBusy); + virtual int OnNotRespondingDialog(HTASK htaskBusy); + // these functions display the busy dialog + +protected: + BOOL m_bRegistered; + LONG m_nBusyCount; // for BeginBusyState & EndBusyState + BOOL m_bEnableBusy; + BOOL m_bEnableNotResponding; + BOOL m_bUnblocking; + DWORD m_nRetryReply; // only used if m_bEnableNotResponding == FALSE + DWORD m_nBusyReply; + DWORD m_nTimeout; + +// Interface Maps +public: + BEGIN_INTERFACE_PART(MessageFilter, IMessageFilter) + INIT_INTERFACE_PART(COleMessageFilter, MessageFilter) + STDMETHOD_(DWORD, HandleInComingCall)(DWORD, HTASK, DWORD, + LPINTERFACEINFO); + STDMETHOD_(DWORD, RetryRejectedCall)(HTASK, DWORD, DWORD); + STDMETHOD_(DWORD, MessagePending)(HTASK, DWORD, DWORD); + END_INTERFACE_PART(MessageFilter) + + DECLARE_INTERFACE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// global helpers and debugging + +void AFXAPI AfxOleSetEditMenu(COleClientItem* pClient, CMenu* pMenu, + UINT iMenuItem, UINT nIDVerbMin, UINT nIDVerbMax = 0, UINT nIDConvert = 0); + +#ifdef _DEBUG +// Mapping SCODEs to readable text +LPCTSTR AFXAPI AfxGetFullScodeString(SCODE sc); +LPCTSTR AFXAPI AfxGetScodeString(SCODE sc); +LPCTSTR AFXAPI AfxGetScodeRangeString(SCODE sc); +LPCTSTR AFXAPI AfxGetSeverityString(SCODE sc); +LPCTSTR AFXAPI AfxGetFacilityString(SCODE sc); + +// Mapping IIDs to readable text +LPCTSTR AFXAPI AfxGetIIDString(REFIID iid); +#endif + +///////////////////////////////////////////////////////////////////////////// +// Inline function declarations + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +#ifdef _AFX_ENABLE_INLINES +#ifndef _AFXCTL +#define _AFXOLE_INLINE inline +#define _AFXOLECLI_INLINE inline +#define _AFXOLESVR_INLINE inline +#endif +#define _AFXOLEDOBJ_INLINE inline +#include <afxole.inl> +#undef _AFXOLE_INLINE +#undef _AFXOLECLI_INLINE +#undef _AFXOLEDOBJ_INLINE +#undef _AFXOLESVR_INLINE +#endif + +#undef AFX_DATA +#define AFX_DATA + +#endif //__AFXOLE_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxole.inl b/public/sdk/inc/mfc30/afxole.inl new file mode 100644 index 000000000..e4b273d90 --- /dev/null +++ b/public/sdk/inc/mfc30/afxole.inl @@ -0,0 +1,190 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1993 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// Inlines for AFXOLE.H + + +///////////////////////////////////////////////////////////////////////////// +// General OLE inlines (CDocItem, COleDocument) + +#ifdef _AFXOLE_INLINE + +// CDocItem +_AFXOLE_INLINE CDocument* CDocItem::GetDocument() const + { return m_pDocument; } + +// COleDocument +_AFXOLE_INLINE void COleDocument::EnableCompoundFile(BOOL bEnable) + { m_bCompoundFile = bEnable; } + +// COleMessageFilter +_AFXOLE_INLINE void COleMessageFilter::SetBusyReply(SERVERCALL nBusyReply) + { ASSERT_VALID(this); m_nBusyReply = nBusyReply; } +_AFXOLE_INLINE void COleMessageFilter::SetRetryReply(DWORD nRetryReply) + { ASSERT_VALID(this); m_nRetryReply = nRetryReply; } +_AFXOLE_INLINE void COleMessageFilter::SetMessagePendingDelay(DWORD nTimeout) + { ASSERT_VALID(this); m_nTimeout = nTimeout; } +_AFXOLE_INLINE void COleMessageFilter::EnableBusyDialog(BOOL bEnable) + { ASSERT_VALID(this); m_bEnableBusy = bEnable; } +_AFXOLE_INLINE void COleMessageFilter::EnableNotRespondingDialog(BOOL bEnable) + { ASSERT_VALID(this); m_bEnableNotResponding = bEnable; } + +#endif //_AFXOLE_INLINE + +///////////////////////////////////////////////////////////////////////////// +// OLE automation inlines + +#ifdef _AFXDISP_INLINE + +// COleException +_AFXDISP_INLINE COleException::COleException() + { m_sc = S_OK; } +_AFXDISP_INLINE COleException::~COleException() + { } + +// CCmdTarget +_AFXDISP_INLINE DWORD CCmdTarget::InternalAddRef() + { ASSERT(GetInterfaceMap() != NULL); return ++m_dwRef; } + +// CObjectFactory +_AFXDISP_INLINE BOOL COleObjectFactory::IsRegistered() const + { ASSERT_VALID(this); return m_dwRegister != 0; } +_AFXDISP_INLINE REFCLSID COleObjectFactory::GetClassID() const + { ASSERT_VALID(this); return m_clsid; } + +// COleDispatchDriver +_AFXDISP_INLINE COleDispatchDriver::~COleDispatchDriver() + { ReleaseDispatch(); } + +#endif //_AFXDISP_INLINE + +///////////////////////////////////////////////////////////////////////////// +// OLE Container inlines + +#ifdef _AFXOLECLI_INLINE + +// COleClientItem +_AFXOLECLI_INLINE SCODE COleClientItem::GetLastStatus() const + { ASSERT_VALID(this); return m_scLast; } +_AFXOLECLI_INLINE COleDocument* COleClientItem::GetDocument() const + { ASSERT_VALID(this); return (COleDocument*)m_pDocument; } +_AFXOLECLI_INLINE OLE_OBJTYPE COleClientItem::GetType() const + { ASSERT_VALID(this); return m_nItemType; } +_AFXOLECLI_INLINE DVASPECT COleClientItem::GetDrawAspect() const + { ASSERT_VALID(this); return m_nDrawAspect; } +_AFXOLECLI_INLINE BOOL COleClientItem::IsRunning() const + { ASSERT_VALID(this); + ASSERT(m_lpObject != NULL); + return ::OleIsRunning(m_lpObject); } +_AFXOLECLI_INLINE UINT COleClientItem::GetItemState() const + { ASSERT_VALID(this); return m_nItemState; } +_AFXOLECLI_INLINE BOOL COleClientItem::IsInPlaceActive() const + { ASSERT_VALID(this); + return m_nItemState == activeState || m_nItemState == activeUIState; } +_AFXOLECLI_INLINE BOOL COleClientItem::IsOpen() const + { ASSERT_VALID(this); return m_nItemState == openState; } +_AFXOLECLI_INLINE BOOL COleClientItem::IsLinkUpToDate() const + { ASSERT_VALID(this); + ASSERT(m_lpObject != NULL); + // TRUE if result is S_OK (aka S_TRUE) + return m_lpObject->IsUpToDate() == NOERROR; } +_AFXOLECLI_INLINE CView* COleClientItem::GetActiveView() const + { return m_pView; } + +// COleLinkingDoc +_AFXOLECLI_INLINE void COleLinkingDoc::BeginDeferErrors() + { ASSERT(m_pLastException == NULL); ++m_bDeferErrors; } + +#endif //_AFXOLECLI_INLINE + +#ifdef _AFXOLEDOBJ_INLINE + +// COleDataObject +_AFXOLEDOBJ_INLINE COleDataObject::~COleDataObject() + { Release(); } + +#endif //_AFXOLECTL_INLINE + +///////////////////////////////////////////////////////////////////////////// +// OLE dialog inlines + +#ifdef _AFXODLGS_INLINE + +_AFXODLGS_INLINE UINT COleDialog::GetLastError() const + { return m_nLastError; } +_AFXODLGS_INLINE CString COleInsertDialog::GetPathName() const + { ASSERT_VALID(this); + ASSERT(GetSelectionType() != createNewItem); return m_szFileName; } +_AFXODLGS_INLINE REFCLSID COleInsertDialog::GetClassID() const + { ASSERT_VALID(this); return m_io.clsid; } +_AFXODLGS_INLINE HGLOBAL COleInsertDialog::GetIconicMetafile() const + { ASSERT_VALID(this); return m_io.hMetaPict; } +_AFXODLGS_INLINE DVASPECT COleInsertDialog::GetDrawAspect() const + { ASSERT_VALID(this); return m_io.dwFlags & IOF_CHECKDISPLAYASICON ? + DVASPECT_ICON : DVASPECT_CONTENT; } +_AFXODLGS_INLINE HGLOBAL COleConvertDialog::GetIconicMetafile() const + { ASSERT_VALID(this); return m_cv.hMetaPict; } +_AFXODLGS_INLINE DVASPECT COleConvertDialog::GetDrawAspect() const + { ASSERT_VALID(this); return (DVASPECT)m_cv.dvAspect; } +_AFXODLGS_INLINE REFCLSID COleConvertDialog::GetClassID() const + { ASSERT_VALID(this); return m_cv.clsidNew; } +_AFXODLGS_INLINE HGLOBAL COleChangeIconDialog::GetIconicMetafile() const + { ASSERT_VALID(this); return m_ci.hMetaPict; } +_AFXODLGS_INLINE int COlePasteSpecialDialog::GetPasteIndex() const + { ASSERT_VALID(this); return m_ps.nSelectedIndex; } +_AFXODLGS_INLINE DVASPECT COlePasteSpecialDialog::GetDrawAspect() const + { ASSERT_VALID(this); return m_ps.dwFlags & PSF_CHECKDISPLAYASICON ? + DVASPECT_ICON : DVASPECT_CONTENT; } +_AFXODLGS_INLINE HGLOBAL COlePasteSpecialDialog::GetIconicMetafile() const + { ASSERT_VALID(this); return m_ps.hMetaPict; } +_AFXODLGS_INLINE UINT COleBusyDialog::GetSelectionType() const + { ASSERT_VALID(this); return m_selection; } + +#endif //_AFXODLGS_INLINE + +///////////////////////////////////////////////////////////////////////////// +// OLE Server inlines + +#ifdef _AFXOLESVR_INLINE + +// COleServerItem +_AFXOLESVR_INLINE COleServerDoc* COleServerItem::GetDocument() const + { ASSERT_VALID(this); return (COleServerDoc*)m_pDocument; } +_AFXOLESVR_INLINE void COleServerItem::NotifyChanged(DVASPECT nDrawAspect) + { ASSERT_VALID(this); NotifyClient(OLE_CHANGED, nDrawAspect); } +_AFXOLESVR_INLINE const CString& COleServerItem::GetItemName() const + { ASSERT_VALID(this); return m_strItemName; } +_AFXOLESVR_INLINE void COleServerItem::SetItemName(LPCTSTR lpszItemName) +{ + ASSERT_VALID(this); + ASSERT(lpszItemName != NULL); + ASSERT(AfxIsValidString(lpszItemName)); + m_strItemName = lpszItemName; +} +_AFXOLESVR_INLINE BOOL COleServerItem::IsLinkedItem() const + { ASSERT_VALID(this); return GetDocument()->m_pEmbeddedItem != this; } +_AFXOLESVR_INLINE COleDataSource* COleServerItem::GetDataSource() + { ASSERT_VALID(this); return &m_dataSource; } + +// COleServerDoc +_AFXOLESVR_INLINE void COleServerDoc::NotifyChanged() + { ASSERT_VALID(this); NotifyAllItems(OLE_CHANGED, DVASPECT_CONTENT); } +_AFXOLESVR_INLINE void COleServerDoc::NotifyClosed() + { ASSERT_VALID(this); NotifyAllItems(OLE_CLOSED, 0); } +_AFXOLESVR_INLINE void COleServerDoc::NotifySaved() + { ASSERT_VALID(this); NotifyAllItems(OLE_SAVED, 0); } +_AFXOLESVR_INLINE BOOL COleServerDoc::IsEmbedded() const + { ASSERT_VALID(this); return m_bEmbedded; } +_AFXOLESVR_INLINE BOOL COleServerDoc::IsInPlaceActive() const + { ASSERT_VALID(this); return m_pInPlaceFrame != NULL; } + +#endif //_AFXOLESVR_INLINE + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxolecl.rc b/public/sdk/inc/mfc30/afxolecl.rc new file mode 100644 index 000000000..8a32cd670 --- /dev/null +++ b/public/sdk/inc/mfc30/afxolecl.rc @@ -0,0 +1,60 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXOLECL_RC__ +#define __AFXOLECL_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifndef _INC_DLGS +#include <dlgs.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< Cannot change standard MFC resources! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// OLE Client Resources + +///////////////////////////////////////////////////////////////////////////// +// OLE strings + +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDP_STATIC_OBJECT "Warning: Static object unexpected." + AFX_IDP_FAILED_TO_CONNECT "Failed to connect.\nLink may be broken." + AFX_IDP_SERVER_BUSY "Unable to process command, server busy." + AFX_IDP_BAD_VERB "Failed to perform server operation." + AFX_IDP_FAILED_TO_LAUNCH "Failed to launch server application." + AFX_IDS_APP_TITLE_INPLACE "%1 in %2" + AFX_IDS_UPDATING_ITEMS "Updating OLE objects" + AFX_IDP_FAILED_TO_CONVERT "Failed to convert OLE object." + AFX_IDP_ASK_TO_DISCARD "OLE objects cannot be saved while exiting Windows!\nDiscard all changes to %1?" + + AFX_IDS_METAFILE_FORMAT "Picture (Metafile)\na picture" + AFX_IDS_DIB_FORMAT "Device Independent Bitmap\na device independent bitmap" + AFX_IDS_BITMAP_FORMAT "Bitmap\na bitmap" + AFX_IDS_LINKSOURCE_FORMAT "%s\n%s" + AFX_IDS_EMBED_FORMAT "%s\n%s" +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXOLECL_RC__ diff --git a/public/sdk/inc/mfc30/afxolesv.rc b/public/sdk/inc/mfc30/afxolesv.rc new file mode 100644 index 000000000..cf6df9577 --- /dev/null +++ b/public/sdk/inc/mfc30/afxolesv.rc @@ -0,0 +1,53 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXOLESV_RC__ +#define __AFXOLESV_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< Cannot change standard MFC resources! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// OLE Server Resources + +// OLE strings +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDP_ASK_TO_UPDATE, "Update %1 before proceeding?" + AFX_IDP_FAILED_TO_UPDATE, "Could not update client." + + AFX_IDP_FAILED_TO_REGISTER, "Failed to register. OLE features may not work properly." + AFX_IDP_FAILED_TO_AUTO_REGISTER, "Failed to update the system registry.\nPlease try using REGEDIT." +END + +STRINGTABLE PRELOAD +BEGIN + AFX_IDS_APP_TITLE_EMBEDDING, "%1 in %2" + AFX_IDS_OBJ_TITLE_INPLACE, "%1 - %2" + AFX_IDS_EXIT_MENU, "E&xit && Return to %1" + AFX_IDS_UPDATE_MENU, "&Update %1" + AFX_IDS_SAVEFILECOPY, "Save Copy As" +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXOLESV_RC__ diff --git a/public/sdk/inc/mfc30/afxplex_.h b/public/sdk/inc/mfc30/afxplex_.h new file mode 100644 index 000000000..4d015b1ae --- /dev/null +++ b/public/sdk/inc/mfc30/afxplex_.h @@ -0,0 +1,48 @@ +// This is a part of the Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation +// All rights reserved. +// +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXPLEX_H__ +#define __AFXPLEX_H__ + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +#ifdef AFX_COLL_SEG +#pragma code_seg(AFX_COLL_SEG) +#endif + +struct CPlex // warning variable length structure +{ + CPlex* pNext; + UINT nMax; + UINT nCur; + /* BYTE data[maxNum*elementSize]; */ + + void* data() { return this+1; } + + static CPlex* PASCAL Create(CPlex*& head, UINT nMax, UINT cbElement); + // like 'calloc' but no zero fill + // may throw memory exceptions + + void FreeDataChain(); // free this one and links +}; + +#ifdef AFX_COLL_SEG +#pragma code_seg() +#endif + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +#endif //__AFXPLEX_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxprint.rc b/public/sdk/inc/mfc30/afxprint.rc new file mode 100644 index 000000000..d20638ecd --- /dev/null +++ b/public/sdk/inc/mfc30/afxprint.rc @@ -0,0 +1,130 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXPRINT_RC__ +#define __AFXPRINT_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< Cannot change standard MFC resources! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// Printing Resources + +AFX_IDC_MAGNIFY CURSOR DISCARDABLE "res\\magnify.cur" + +#ifndef _MAC +AFX_IDD_PRINTDLG DIALOG DISCARDABLE 6, 18, 133, 95 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | 0x04 +#else +AFX_IDD_PRINTDLG DIALOG DISCARDABLE 6, 18, 133, 84 +STYLE DS_MODALFRAME | WS_POPUP +#endif +FONT 8, "MS Shell Dlg" +BEGIN + CTEXT "Printing",IDC_STATIC,0,9,133,8 + CTEXT "",AFX_IDC_PRINT_DOCNAME,0,19,133,8 +#ifndef _MAC + CTEXT "on the",IDC_STATIC,0,29,133,8 + CTEXT "",AFX_IDC_PRINT_PRINTERNAME,0,39,133,8 + CTEXT "",AFX_IDC_PRINT_PORTNAME,0,49,133,8 + CTEXT "",AFX_IDC_PRINT_PAGENUM,0,59,133,8 + PUSHBUTTON "Cancel",IDCANCEL,46,74,40,14 +#else + CTEXT "",AFX_IDC_PRINT_PAGENUM,0,30,133,8 + PUSHBUTTON "Cancel",IDCANCEL,46,45,40,15 + CTEXT "Press Cmd-. to cancel.",IDC_STATIC,0,63,133,16 +#endif +END + +// Preview Toolbar Dialog +#ifndef _MAC +AFX_IDD_PREVIEW_TOOLBAR DIALOG PRELOAD DISCARDABLE 0, 0, 330, 16 +STYLE WS_CHILD | 0x04 +FONT 8, "MS Shell Dlg" +BEGIN + PUSHBUTTON "&Print...",AFX_ID_PREVIEW_PRINT,2,2,44,12 + PUSHBUTTON "&Next Page",AFX_ID_PREVIEW_NEXT,48,2,44,12 + PUSHBUTTON "Pre&v Page",AFX_ID_PREVIEW_PREV,94,2,44,12 + PUSHBUTTON "",AFX_ID_PREVIEW_NUMPAGE,140,2,44,12 + PUSHBUTTON "Zoom &In",AFX_ID_PREVIEW_ZOOMIN,186,2,44,12 + PUSHBUTTON "Zoom &Out",AFX_ID_PREVIEW_ZOOMOUT,232,2,44,12 + PUSHBUTTON "&Close",AFX_ID_PREVIEW_CLOSE,278,2,44,12 +END +#else +// standard toolbar for 14" and larger screens +// width *must* be 320 or less so that this is used on 640x480 screens +AFX_IDD_PREVIEW_TOOLBAR DIALOG PRELOAD DISCARDABLE 0, 0, 320, 19 +STYLE WS_CHILD | CBRS_TOP +BEGIN + PUSHBUTTON "&Print...",AFX_ID_PREVIEW_PRINT,1,2,44,15 + PUSHBUTTON "&Next Page",AFX_ID_PREVIEW_NEXT,46,2,44,15 + PUSHBUTTON "Pre&v Page",AFX_ID_PREVIEW_PREV,91,2,44,15 + PUSHBUTTON "",AFX_ID_PREVIEW_NUMPAGE,136,2,44,15 + PUSHBUTTON "Zoom &In",AFX_ID_PREVIEW_ZOOMIN,181,2,44,15 + PUSHBUTTON "Zoom &Out",AFX_ID_PREVIEW_ZOOMOUT,226,2,44,15 + PUSHBUTTON "&Close",AFX_ID_PREVIEW_CLOSE,271,2,44,15 +END + +// short toolbar for 9" and 12" screens +AFX_IDD_PREVIEW_SHORTTOOLBAR DIALOG PRELOAD DISCARDABLE 0, 0, 270, 19 +STYLE WS_CHILD | CBRS_TOP +BEGIN + PUSHBUTTON "&Print...",AFX_ID_PREVIEW_PRINT,1,2,44,15 + PUSHBUTTON "&Next",AFX_ID_PREVIEW_NEXT,46,2,29,15 + PUSHBUTTON "Pre&v",AFX_ID_PREVIEW_PREV,76,2,29,15 + PUSHBUTTON "",AFX_ID_PREVIEW_NUMPAGE,106,2,44,15 + PUSHBUTTON "&In",AFX_ID_PREVIEW_ZOOMIN,151,2,29,15 + PUSHBUTTON "&Out",AFX_ID_PREVIEW_ZOOMOUT,181,2,29,15 + PUSHBUTTON "&Close",AFX_ID_PREVIEW_CLOSE,211,2,44,15 +END +#endif + +// Printing strings +STRINGTABLE DISCARDABLE +BEGIN + // print progress dialog strings + AFX_IDS_PRINTONPORT, "on %1" // for print output + AFX_IDS_ONEPAGE, "&One Page" // for preview button + AFX_IDS_TWOPAGE, "&Two Page" // for preview button + AFX_IDS_PRINTPAGENUM, "Page %u" // for print output + AFX_IDS_PREVIEWPAGEDESC, "Page %u\nPages %u-%u\n" + + // print to file dialog strings + AFX_IDS_PRINTDEFAULTEXT, "prn" // default extension + AFX_IDS_PRINTDEFAULT, "Output.prn" // default file + AFX_IDS_PRINTFILTER, + "Printer Files (*.prn)|*.prn|All Files (*.*)|*.*||" + AFX_IDS_PRINTCAPTION, "Print to File" // caption for browse dlg + AFX_IDS_PRINTTOFILE, "to %1" // to file +END + +// Print Preview Accelerator Table +AFX_IDR_PREVIEW_ACCEL ACCELERATORS LOADONCALL MOVEABLE +BEGIN + VK_NEXT, AFX_ID_PREVIEW_NEXT, VIRTKEY, NOINVERT + VK_PRIOR, AFX_ID_PREVIEW_PREV, VIRTKEY, NOINVERT + VK_ESCAPE, AFX_ID_PREVIEW_CLOSE, VIRTKEY, NOINVERT +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXPRINT_RC__ diff --git a/public/sdk/inc/mfc30/afxpriv.h b/public/sdk/inc/mfc30/afxpriv.h new file mode 100644 index 000000000..646fa1b36 --- /dev/null +++ b/public/sdk/inc/mfc30/afxpriv.h @@ -0,0 +1,680 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXPRIV_H__ +#define __AFXPRIV_H__ + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +///////////////////////////////////////////////////////////////////////////// +// AFXPRIV - MFC Private Classes + +#define AFX_ABBREV_FILENAME_LEN 30 + +// Implementation structures +struct AFX_SIZEPARENTPARAMS; // Control bar implementation +struct AFX_CMDHANDLERINFO; // Command routing implementation + +// Classes declared in this file + +//CObject + //CFile + //CMemFile + class CSharedFile; // Shared memory file + + //CDC + class CPreviewDC; // Virtual DC for print preview + + //CCmdTarget + //CWnd + //CView + class CPreviewView; // Print preview view + //CFrameWnd + class COleCntrFrameWnd; + //CMiniFrameWnd + class CMiniDockFrameWnd; + + class CRecentFileList; // used in CWinApp for MRU list + class CDockState; // state of docking toolbars + +class CDockContext; // for dragging control bars + +///////////////////////////////////////////////////////////////////////////// + +#undef AFX_DATA +#define AFX_DATA AFX_CORE_DATA + +///////////////////////////////////////////////////////////////////////////// +// Global ID ranges (see Technical note TN020 for more details) + +// 8000 -> FFFF command IDs (used for menu items, accelerators and controls) +#define IS_COMMAND_ID(nID) ((nID) & 0x8000) + +// 8000 -> DFFF : user commands +// E000 -> EFFF : AFX commands and other things +// F000 -> FFFF : standard windows commands and other things etc + // E000 -> E7FF standard commands + // E800 -> E8FF control bars (first 32 are special) + // E900 -> EEFF standard window controls/components + // EF00 -> EFFF SC_ menu help + // F000 -> FFFF standard strings +#define ID_COMMAND_FROM_SC(sc) (((sc - 0xF000) >> 4) + AFX_IDS_SCFIRST) + +// 0000 -> 7FFF IDR range +// 0000 -> 6FFF : user resources +// 7000 -> 7FFF : AFX (and standard windows) resources +// IDR ranges (NOTE: IDR_ values must be <32768) +#define ASSERT_VALID_IDR(nIDR) ASSERT((nIDR) != 0 && (nIDR) < 0x8000) + +///////////////////////////////////////////////////////////////////////////// +// Context sensitive help support (see Technical note TN028 for more details) + +// Help ID bases +#define HID_BASE_COMMAND 0x00010000UL // ID and IDM +#define HID_BASE_RESOURCE 0x00020000UL // IDR and IDD +#define HID_BASE_PROMPT 0x00030000UL // IDP +#define HID_BASE_NCAREAS 0x00040000UL +#define HID_BASE_CONTROL 0x00050000UL // IDC +#define HID_BASE_DISPATCH 0x00060000UL // IDispatch help codes + +///////////////////////////////////////////////////////////////////////////// +// Internal AFX Windows messages (see Technical note TN024 for more details) +// (0x0360 - 0x037F are reserved for MFC) + +#define WM_QUERYAFXWNDPROC 0x0360 // lResult = 1 if processed by AfxWndProc +#define WM_SIZEPARENT 0x0361 // lParam = &AFX_SIZEPARENTPARAMS +#define WM_SETMESSAGESTRING 0x0362 // wParam = nIDS (or 0), + // lParam = lpszOther (or NULL) +#define WM_IDLEUPDATECMDUI 0x0363 // wParam == bDisableIfNoHandler +#define WM_INITIALUPDATE 0x0364 // (params unused) - sent to children +#define WM_COMMANDHELP 0x0365 // lResult = TRUE/FALSE, + // lParam = dwContext +#define WM_HELPHITTEST 0x0366 // lResult = dwContext, + // lParam = MAKELONG(x,y) +#define WM_EXITHELPMODE 0x0367 // (params unused) +#define WM_RECALCPARENT 0x0368 // force RecalcLayout on frame window + // (only for inplace frame windows) +#define WM_SIZECHILD 0x0369 // special notify from COleResizeBar + // wParam = ID of child window + // lParam = lpRectNew (new position/size) +#define WM_KICKIDLE 0x036A // (params unused) causes idles to kick in +#define WM_QUERYCENTERWND 0x036B // lParam = HWND to use as centering parent +#define WM_DISABLEMODAL 0x036C // lResult = 0, disable during modal state + // lResult = 1, don't disable +#define WM_FLOATSTATUS 0x036D // wParam combination of FS_* flags below + +// WM_ACTIVATETOPLEVEL is like WM_ACTIVATEAPP but works with hierarchies +// of mixed processes (as is the case with OLE in-place activation) +#define WM_ACTIVATETOPLEVEL 0x036E // wParam = nState (like WM_ACTIVATE) + // lParam = pointer to HWND[2] + // lParam[0] = hWnd getting WM_ACTIVATE + // lParam[1] = hWndOther + +#define WM_QUERY3DCONTROLS 0x036F // lResult != 0 if 3D controls wanted + +// Note: Messages 0x0370, 0x0371, and 0x372 were incorrectly used by +// some versions of Windows. To remain compatible, MFC does not +// use messages in that range. +#define WM_RESERVED_0370 0x0370 +#define WM_RESERVED_0371 0x0371 +#define WM_RESERVED_0372 0x0372 + +// WM_SOCKET_NOTIFY and WM_SOCKET_DEAD are used internally by MFC's +// Windows sockets implementation. For more information, see sockcore.cpp +#define WM_SOCKET_NOTIFY 0x0373 +#define WM_SOCKET_DEAD 0x0374 + +// Note: Messages 0x0375 - 0x37F reserved for future MFC use. +#define WM_RESERVED_0375 0x0375 +#define WM_RESERVED_0376 0x0376 +#define WM_RESERVED_0377 0x0377 +#define WM_RESERVED_0378 0x0378 +#define WM_RESERVED_0379 0x0379 +#define WM_RESERVED_037A 0x037A +#define WM_RESERVED_037B 0x037B +#define WM_RESERVED_037C 0x037C +#define WM_RESERVED_037D 0x037D +#define WM_RESERVED_037E 0x037E +#define WM_RESERVED_037F 0x037F + +// like ON_MESSAGE but no return value +#define ON_MESSAGE_VOID(message, memberFxn) \ + { message, 0, 0, 0, AfxSig_vv, \ + (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(void))memberFxn }, + +// special struct for WM_SIZEPARENT +struct AFX_SIZEPARENTPARAMS +{ + HDWP hDWP; // handle for DeferWindowPos + RECT rect; // parent client rectangle (trim as appropriate) + SIZE sizeTotal; // total size on each side as layout proceeds + BOOL bStretch; // should stretch to fill all space +}; + +// flags for wParam in the WM_FLOATSTATUS message +enum { FS_SHOW = 0x01, FS_HIDE = 0x02, + FS_ACTIVATE = 0x04, FS_DEACTIVATE = 0x08, + FS_ENABLE = 0x10, FS_DISABLE = 0x20, + FS_SYNCACTIVE = 0x40 }; + +void AFXAPI AfxRepositionWindow(AFX_SIZEPARENTPARAMS* lpLayout, + HWND hWnd, LPCRECT lpRect); + +///////////////////////////////////////////////////////////////////////////// +// Implementation of command routing + +struct AFX_CMDHANDLERINFO +{ + CCmdTarget* pTarget; + void (AFX_MSG_CALL CCmdTarget::*pmf)(void); +}; + +///////////////////////////////////////////////////////////////////////////// +// Shared file support + +class CSharedFile : public CMemFile +{ + DECLARE_DYNAMIC(CSharedFile) + +public: +// Constructors + CSharedFile(UINT nAllocFlags = GMEM_DDESHARE|GMEM_MOVEABLE, + UINT nGrowBytes = 4096); + +// Attributes + HGLOBAL Detach(); + void SetHandle(HGLOBAL hGlobalMemory, BOOL bAllowGrow = TRUE); + +// Implementation +public: + virtual ~CSharedFile(); +protected: + virtual BYTE* Alloc(DWORD nBytes); + virtual BYTE* Realloc(BYTE* lpMem, DWORD nBytes); + virtual void Free(BYTE* lpMem); + + UINT m_nAllocFlags; + HGLOBAL m_hGlobalMemory; + BOOL m_bAllowGrow; +}; + +///////////////////////////////////////////////////////////////////////////// +// Implementation of PrintPreview + +class CPreviewDC : public CDC +{ + DECLARE_DYNAMIC(CPreviewDC) + +public: + virtual void SetAttribDC(HDC hDC); // Set the Attribute DC + virtual void SetOutputDC(HDC hDC); + + virtual void ReleaseOutputDC(); + +// Constructors + CPreviewDC(); + +// Implementation +public: + virtual ~CPreviewDC(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + + void SetScaleRatio(int nNumerator, int nDenominator); + void SetTopLeftOffset(CSize TopLeft); + void ClipToPage(); + + // These conversion functions can be used without an output DC + + void PrinterDPtoScreenDP(LPPOINT lpPoint) const; + +// Device-Context Functions + virtual int SaveDC(); + virtual BOOL RestoreDC(int nSavedDC); + +public: + virtual CGdiObject* SelectStockObject(int nIndex); + virtual CFont* SelectObject(CFont* pFont); + +// Drawing-Attribute Functions + virtual COLORREF SetBkColor(COLORREF crColor); + virtual COLORREF SetTextColor(COLORREF crColor); + +// Mapping Functions + virtual int SetMapMode(int nMapMode); + virtual CPoint SetViewportOrg(int x, int y); + virtual CPoint OffsetViewportOrg(int nWidth, int nHeight); + virtual CSize SetViewportExt(int x, int y); + virtual CSize ScaleViewportExt(int xNum, int xDenom, int yNum, int yDenom); + virtual CSize SetWindowExt(int x, int y); + virtual CSize ScaleWindowExt(int xNum, int xDenom, int yNum, int yDenom); + +// Text Functions + virtual BOOL TextOut(int x, int y, LPCTSTR lpszString, int nCount); + virtual BOOL ExtTextOut(int x, int y, UINT nOptions, LPCRECT lpRect, + LPCTSTR lpszString, UINT nCount, LPINT lpDxWidths); + virtual CSize TabbedTextOut(int x, int y, LPCTSTR lpszString, int nCount, + int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin); + virtual int DrawText(LPCTSTR lpszString, int nCount, LPRECT lpRect, + UINT nFormat); + virtual BOOL GrayString(CBrush* pBrush, + BOOL (CALLBACK EXPORT* lpfnOutput)(HDC, LPARAM, int), + LPARAM lpData, int nCount, + int x, int y, int nWidth, int nHeight); + +// Printer Escape Functions + virtual int Escape(int nEscape, int nCount, LPCSTR lpszInData, LPVOID lpOutData); + +// Implementation +protected: + void MirrorMappingMode(BOOL bCompute); + void MirrorViewportOrg(); + void MirrorFont(); + void MirrorAttributes(); + + CSize ComputeDeltas(int& x, LPCTSTR lpszString, UINT& nCount, BOOL bTabbed, + UINT nTabStops, LPINT lpnTabStops, int nTabOrigin, + LPTSTR lpszOutputString, int* pnDxWidths, int& nRightFixup); + +protected: + int m_nScaleNum; // Scale ratio Numerator + int m_nScaleDen; // Scale ratio Denominator + int m_nSaveDCIndex; // DC Save index when Screen DC Attached + int m_nSaveDCDelta; // delta between Attrib and output restore indices + CSize m_sizeTopLeft;// Offset for top left corner of page + HFONT m_hFont; // Font selected into the screen DC (NULL if none) + HFONT m_hPrinterFont; // Font selected into the print DC +#ifdef _MAC + int m_aCharWidthsDraw[256]; // character widths for m_hDC + int m_aCharWidthsAttrib[256]; // character widths for m_hAttribDC +#endif + + CSize m_sizeWinExt; // cached window extents computed for screen + CSize m_sizeVpExt; // cached viewport extents computed for screen +}; + +///////////////////////////////////////////////////////////////////////////// +// CPreviewView + +class CDialogBar; + +class CPreviewView : public CScrollView +{ + DECLARE_DYNCREATE(CPreviewView) + +// Constructors +public: + CPreviewView(); + BOOL SetPrintView(CView* pPrintView); + +// Attributes +protected: + CView* m_pOrigView; + CView* m_pPrintView; + CPreviewDC* m_pPreviewDC; // Output and attrib DCs Set, not created + CDC m_dcPrint; // Actual printer DC + +// Operations + void SetZoomState(UINT nNewState, UINT nPage, CPoint point); + void SetCurrentPage(UINT nPage, BOOL bClearRatios); + + // Returns TRUE if in a page rect. Returns the page index + // in nPage and the point converted to 1:1 screen device coordinates + BOOL FindPageRect(CPoint& point, UINT& nPage); + + +// Overridables + virtual void OnActivateView(BOOL bActivate, + CView* pActivateView, CView* pDeactiveView); + + // Returns .cx/.cy as the numerator/denominator pair for the ratio + // using CSize for convenience + virtual CSize CalcScaleRatio(CSize windowSize, CSize actualSize); + + virtual void PositionPage(UINT nPage); + virtual void OnDisplayPageNumber(UINT nPage, UINT nPagesDisplayed); + +// Implementation +public: + virtual ~CPreviewView(); + virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL); +#ifdef _DEBUG + void AssertValid() const; + void Dump(CDumpContext& dc) const; +#endif +#ifdef _MAC + virtual void CalcWindowRect(LPRECT lpClientRect); +#endif + +protected: + //{{AFX_MSG(CPreviewView) + afx_msg void OnPreviewClose(); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnDraw(CDC* pDC); + afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnNumPageChange(); + afx_msg void OnNextPage(); + afx_msg void OnPrevPage(); + afx_msg void OnPreviewPrint(); + afx_msg void OnZoomIn(); + afx_msg void OnZoomOut(); + + afx_msg void OnUpdateNumPageChange(CCmdUI* pCmdUI); + afx_msg void OnUpdateNextPage(CCmdUI* pCmdUI); + afx_msg void OnUpdatePrevPage(CCmdUI* pCmdUI); + afx_msg void OnUpdateZoomIn(CCmdUI* pCmdUI); + afx_msg void OnUpdateZoomOut(CCmdUI* pCmdUI); + + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + //}}AFX_MSG + + void DoZoom(UINT nPage, CPoint point); + void SetScaledSize(UINT nPage); + CSize CalcPageDisplaySize(); + + CPrintPreviewState* m_pPreviewState; // State to restore + CDialogBar* m_pToolBar; // Toolbar for preview + + struct PAGE_INFO + { + CRect rectScreen; // screen rect (screen device units) + CSize sizeUnscaled; // unscaled screen rect (screen device units) + CSize sizeScaleRatio; // scale ratio (cx/cy) + CSize sizeZoomOutRatio; // scale ratio when zoomed out (cx/cy) + }; + + PAGE_INFO* m_pPageInfo; // Array of page info structures + PAGE_INFO m_pageInfoArray[2]; // Embedded array for the default implementation + + BOOL m_bPageNumDisplayed;// Flags whether or not page number has yet + // been displayed on status line + UINT m_nZoomOutPages; // number of pages when zoomed out + UINT m_nZoomState; + UINT m_nMaxPages; // for sanity checks + UINT m_nCurrentPage; + UINT m_nPages; + int m_nSecondPageOffset; // used to shift second page position + + HCURSOR m_hMagnifyCursor; + + CSize m_sizePrinterPPI; // printer pixels per inch + CPoint m_ptCenterPoint; + CPrintInfo* m_pPreviewInfo; + + DECLARE_MESSAGE_MAP() + + friend class CView; + friend BOOL CALLBACK _AfxPreviewCloseProc(CFrameWnd* pFrameWnd); +}; + +// Zoom States +#define ZOOM_OUT 0 +#define ZOOM_MIDDLE 1 +#define ZOOM_IN 2 + +///////////////////////////////////////////////////////////////////////////// +// CRecentFileList + +class CRecentFileList +{ +// Constructors +public: + CRecentFileList(UINT nStart, LPCTSTR lpszSection, + LPCTSTR lpszEntryFormat, int nSize, + int nMaxDispLen = AFX_ABBREV_FILENAME_LEN); + +// Attributes + int GetSize() const; + CString& operator[](int nIndex); + +// Operations + virtual void Add(LPCTSTR lpszPathName); + BOOL GetDisplayName(CString& strName, int nIndex, + LPCTSTR lpszCurDir, int nCurDir, BOOL bAtLeastName = TRUE) const; + virtual void UpdateMenu(CCmdUI* pCmdUI); + virtual void ReadList(); // reads from registry or ini file + virtual void WriteList(); // writes to registry or ini file + +// Implementation + virtual ~CRecentFileList(); + + int m_nSize; // contents of the MRU list + CString* m_arrNames; + CString m_strSectionName; // for saving + CString m_strEntryFormat; + UINT m_nStart; // for displaying + int m_nMaxDisplayLength; +}; + +inline int CRecentFileList::GetSize() const + { return m_nSize; } +inline CString& CRecentFileList::operator[](int nIndex) + { ASSERT(nIndex < m_nSize); return m_arrNames[nIndex]; } + +///////////////////////////////////////////////////////////////////////////// +// toolbar docking support + +class CDockContext +{ +public: +// Construction + CDockContext(CControlBar* pBar); + +// Attributes + CPoint m_ptLast; // last mouse position during drag + CRect m_rectLast; + CSize m_sizeLast; + BOOL m_bDitherLast; + + CRect m_rectDragHorz; + CRect m_rectDragVert; + CRect m_rectFrameDragHorz; // rectangle used when not over a dock area + CRect m_rectFrameDragVert; + + CControlBar* m_pBar; // the toolbar that created this context + CFrameWnd* m_pDockSite; // the controlling frame of the CControlBar + DWORD m_dwDockStyle; // allowable dock styles for bar + DWORD m_dwOverDockStyle; // style of dock that rect is over + DWORD m_dwStyle; // style of control bar + BOOL m_bFlip; // if shift key is down + BOOL m_bForceFrame; // if ctrl key is down + + CDC* m_pDC; // where to draw during drag + +// Operations + virtual void StartDrag(CPoint pt); + void Move(CPoint pt); // called when mouse has moved + void EndDrag(); // drop + void CancelDrag(); // drag cancelled + void OnKey(int nChar, BOOL bDown); + +// Implementation +public: + ~CDockContext(); + BOOL Track(); + void DrawFocusRect(BOOL bRemoveRect = FALSE); + // draws the correct outline + void UpdateState(BOOL* pFlag, BOOL bNewValue); + DWORD CanDock(); + CDockBar* GetDockBar(); +}; + +class _AFX_BARINFO; // private implementation + +class CDockBar : public CControlBar +{ + DECLARE_DYNAMIC(CDockBar) + +// Construction +public: + CDockBar(BOOL bFloating = FALSE); //true if attached to CMiniDockFrameWnd + BOOL Create(CWnd* pParentWnd, DWORD dwStyle, UINT nID); + +// Attributes + BOOL m_bFloating; + + virtual BOOL IsDockBar() const; + int GetDockedCount() const; + virtual int GetDockedVisibleCount() const; + +// Operations + void DockControlBar(CControlBar* pBar, LPCRECT lpRect = NULL); + void RemoveControlBar(CControlBar*, int nPosExclude = -1); + +// Implementation +public: + virtual ~CDockBar(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz); + virtual void DoPaint(CDC* pDC); + + // public implementation helpers + void GetBarInfo(_AFX_BARINFO* pInfo); + void SetBarInfo(_AFX_BARINFO* pInfo, CFrameWnd* pFrameWnd); + int FindBar(CControlBar* pBar, int nPosExclude = -1); + void ShowAll(BOOL bShow); + +protected: + CPtrArray m_arrBars; // each element is a CControlBar + BOOL m_bLayoutQuery; + + // implementation helpers + int Insert(CControlBar* pBar, CRect rect, CPoint ptMid); + virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler); + + //{{AFX_MSG(CDockBar) + afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp); + afx_msg void OnNcPaint(); + afx_msg void OnWindowPosChanging(LPWINDOWPOS lpWndPos); + afx_msg void OnPaint(); + afx_msg LRESULT OnSizeParent(WPARAM, LPARAM); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + + friend class CMiniDockFrameWnd; +}; + +class CDockState : public CObject +{ + DECLARE_SERIAL(CDockState) + +public: +// Attributes + CPtrArray m_arrBarInfo; + +// Operations + void LoadState(LPCTSTR lpszProfileName); + void SaveState(LPCTSTR lpszProfileName); + void Clear(); //deletes all the barinfo's + +// Implementation +public: + ~CDockState(); + virtual void Serialize(CArchive& ar); +}; + +class CMiniDockFrameWnd : public CMiniFrameWnd +{ + DECLARE_DYNCREATE(CMiniDockFrameWnd) + +public: +// Construction + CMiniDockFrameWnd(); + virtual BOOL Create(CWnd* pParent, DWORD dwBarStyle); + +// Operations + virtual void RecalcLayout(BOOL bNotify = TRUE); + +// Implementation +public: + CDockBar m_wndDockBar; + + //{{AFX_MSG(CMiniFrameWnd) + afx_msg void OnClose(); + afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); + //}}AFX_MSG +#ifdef _MAC + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); +#endif + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// COleCntrFrameWnd + +class COleIPFrameWnd; + +class COleCntrFrameWnd : public CFrameWnd +{ +// Constructor +public: + COleCntrFrameWnd(COleIPFrameWnd* pInPlaceFrame); + +// Implementation +protected: + COleIPFrameWnd* m_pInPlaceFrame; + virtual void PostNcDestroy(); + +public: + virtual ~COleCntrFrameWnd(); + virtual void RecalcLayout(BOOL bNotify = TRUE); + void OnIdleUpdateCmdUI(); +#ifdef _DEBUG + void AssertValid() const; +#endif +}; + +///////////////////////////////////////////////////////////////////////////// +// WM_NOTIFY support + +struct AFX_NOTIFY +{ + LRESULT* pResult; + NMHDR* pNMHDR; +}; + +///////////////////////////////////////////////////////////////////////////// +// Global implementation helpers + +// window creation hooking +void AFXAPI AfxHookWindowCreate(CWnd* pWnd); +BOOL AFXAPI AfxUnhookWindowCreate(); + +// for backward compatibility to previous versions +#define _AfxHookWindowCreate AfxHookWindowCreate +#define _AfxUnhookWindowCreate AfxUnhookWindowCreate + +// string helpers +void AFXAPI AfxSetWindowText(HWND hWndCtrl, LPCTSTR lpszNew); +int AFXAPI AfxLoadString(UINT nIDS, LPTSTR lpszBuf); // 256 TCHAR buffer + +///////////////////////////////////////////////////////////////////////////// + +#undef AFX_DATA +#define AFX_DATA + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +#endif // __AFXPRIV_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxres.aps b/public/sdk/inc/mfc30/afxres.aps Binary files differnew file mode 100644 index 000000000..ef31537f7 --- /dev/null +++ b/public/sdk/inc/mfc30/afxres.aps diff --git a/public/sdk/inc/mfc30/afxres.h b/public/sdk/inc/mfc30/afxres.h new file mode 100644 index 000000000..a13c1cef1 --- /dev/null +++ b/public/sdk/inc/mfc30/afxres.h @@ -0,0 +1,691 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992-1993 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXRES_H__ +#define __AFXRES_H__ + +#ifdef REZ // Mac resource compiler (mrc) defines REZ +#define RC_INVOKED +#endif + +#ifdef RC_INVOKED +#ifndef _INC_WINDOWS +#define _INC_WINDOWS +#include "winres.h" // extract from windows header +#endif +#endif + +#ifdef APSTUDIO_INVOKED +#define APSTUDIO_HIDDEN_SYMBOLS +#endif + +///////////////////////////////////////////////////////////////////////////// +// MFC resource types (see Technical note TN024 for implementation details) + +#ifdef RC_INVOKED +#define DLGINIT 240 +#else +#define RT_DLGINIT MAKEINTRESOURCE(240) +#endif + +///////////////////////////////////////////////////////////////////////////// + +#ifdef APSTUDIO_INVOKED +#undef APSTUDIO_HIDDEN_SYMBOLS +#endif + +///////////////////////////////////////////////////////////////////////////// +// General style bits etc + +// Tab Control styles +#ifndef TCS_MULTILINE // new in later versions of Win32 +#define TCS_MULTILINE 0x0200 +#endif + +// ControlBar styles +#define CBRS_ALIGN_LEFT 0x1000L +#define CBRS_ALIGN_TOP 0x2000L +#define CBRS_ALIGN_RIGHT 0x4000L +#define CBRS_ALIGN_BOTTOM 0x8000L +#define CBRS_ALIGN_ANY 0xF000L + +#define CBRS_BORDER_LEFT 0x0100L +#define CBRS_BORDER_TOP 0x0200L +#define CBRS_BORDER_RIGHT 0x0400L +#define CBRS_BORDER_BOTTOM 0x0800L +#define CBRS_BORDER_ANY 0x0F00L + +#define CBRS_TOOLTIPS 0x0010L +#define CBRS_FLYBY 0x0020L +#define CBRS_FLOAT_MULTI 0x0040L +#define CBRS_BORDER_3D 0x0080L +#define CBRS_HIDE_INPLACE 0x0008L + +#define CBRS_ORIENT_HORZ (CBRS_ALIGN_TOP|CBRS_ALIGN_BOTTOM) +#define CBRS_ORIENT_VERT (CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT) +#define CBRS_ORIENT_ANY (CBRS_ORIENT_HORZ|CBRS_ORIENT_VERT) + + +// the CBRS_ style is made up of an alignment style and a draw border style +// the alignment styles are mutually exclusive +// the draw border styles may be combined +#define CBRS_NOALIGN 0x00000000L +#define CBRS_LEFT (CBRS_ALIGN_LEFT|CBRS_BORDER_RIGHT) +#define CBRS_TOP (CBRS_ALIGN_TOP|CBRS_BORDER_BOTTOM) +#define CBRS_RIGHT (CBRS_ALIGN_RIGHT|CBRS_BORDER_LEFT) +#define CBRS_BOTTOM (CBRS_ALIGN_BOTTOM|CBRS_BORDER_TOP) + +///////////////////////////////////////////////////////////////////////////// +// Standard window components + +// Mode indicators in status bar - these are routed like commands +#define ID_INDICATOR_EXT 0xE700 // extended selection indicator +#define ID_INDICATOR_CAPS 0xE701 // cap lock indicator +#define ID_INDICATOR_NUM 0xE702 // num lock indicator +#define ID_INDICATOR_SCRL 0xE703 // scroll lock indicator +#define ID_INDICATOR_OVR 0xE704 // overtype mode indicator +#define ID_INDICATOR_REC 0xE705 // record mode indicator +#define ID_INDICATOR_KANA 0xE706 // kana lock indicator + +#define ID_SEPARATOR 0 // special separator value + +#ifndef RC_INVOKED // code only +// Standard control bars (IDW = window ID) +#define AFX_IDW_CONTROLBAR_FIRST 0xE800 +#define AFX_IDW_CONTROLBAR_LAST 0xE8FF + +#define AFX_IDW_TOOLBAR 0xE800 // main Toolbar for window +#define AFX_IDW_STATUS_BAR 0xE801 // Status bar window +#define AFX_IDW_PREVIEW_BAR 0xE802 // PrintPreview Dialog Bar +#define AFX_IDW_RESIZE_BAR 0xE803 // OLE in-place resize bar + +// Note: If your application supports docking toolbars, you should +// not use the following IDs for your own toolbars. The IDs chosen +// are at the top of the first 32 such that the bars will be hidden +// while in print preview mode, and are not likely to conflict with +// IDs your application may have used succesfully in the past. + +#define AFX_IDW_DOCKBAR_TOP 0xE81B +#define AFX_IDW_DOCKBAR_LEFT 0xE81C +#define AFX_IDW_DOCKBAR_RIGHT 0xE81D +#define AFX_IDW_DOCKBAR_BOTTOM 0xE81E +#define AFX_IDW_DOCKBAR_FLOAT 0xE81F + +// Macro for mapping standard control bars to bitmask (limit of 32) +#define AFX_CONTROLBAR_MASK(nIDC) (1L << (nIDC - AFX_IDW_CONTROLBAR_FIRST)) + +// parts of Main Frame +#define AFX_IDW_PANE_FIRST 0xE900 // first pane (256 max) +#define AFX_IDW_PANE_LAST 0xE9ff +#define AFX_IDW_HSCROLL_FIRST 0xEA00 // first Horz scrollbar (16 max) +#define AFX_IDW_VSCROLL_FIRST 0xEA10 // first Vert scrollbar (16 max) + +#define AFX_IDW_SIZE_BOX 0xEA20 // size box for splitters +#define AFX_IDW_PANE_SAVE 0xEA21 // to shift AFX_IDW_PANE_FIRST +#endif //!RC_INVOKED + +#ifndef APSTUDIO_INVOKED + +// common style for form views +#define AFX_WS_DEFAULT_VIEW (WS_CHILD | WS_VISIBLE | WS_BORDER) + +#endif //!APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// Standard app configurable strings + +// for application title (defaults to EXE name or name in constructor) +#define AFX_IDS_APP_TITLE 0xE000 +// idle message bar line +#define AFX_IDS_IDLEMESSAGE 0xE001 +// message bar line when in shift-F1 help mode +#define AFX_IDS_HELPMODEMESSAGE 0xE002 +// application title when OLE object is in-place active +#define AFX_IDS_APP_TITLE_INPLACE 0xE003 +// document title when editing OLE embedding +#define AFX_IDS_APP_TITLE_EMBEDDING 0xE004 +// company name +#define AFX_IDS_COMPANY_NAME 0xE005 +// object name when server is inplace +#define AFX_IDS_OBJ_TITLE_INPLACE 0xE006 + +///////////////////////////////////////////////////////////////////////////// +// Standard Commands + +// File commands +#define ID_FILE_NEW 0xE100 +#define ID_FILE_OPEN 0xE101 +#define ID_FILE_CLOSE 0xE102 +#define ID_FILE_SAVE 0xE103 +#define ID_FILE_SAVE_AS 0xE104 +#define ID_FILE_PAGE_SETUP 0xE105 +#define ID_FILE_PRINT_SETUP 0xE106 +#define ID_FILE_PRINT 0xE107 +#define ID_FILE_PRINT_PREVIEW 0xE108 +#define ID_FILE_UPDATE 0xE109 +#define ID_FILE_SAVE_COPY_AS 0xE10A +#define ID_FILE_SEND_MAIL 0xE10B + +#define ID_FILE_MRU_FIRST 0xE110 +#define ID_FILE_MRU_FILE1 0xE110 // range - 16 max +#define ID_FILE_MRU_FILE2 0xE111 +#define ID_FILE_MRU_FILE3 0xE112 +#define ID_FILE_MRU_FILE4 0xE113 +#define ID_FILE_MRU_FILE5 0xE114 +#define ID_FILE_MRU_FILE6 0xE115 +#define ID_FILE_MRU_FILE7 0xE116 +#define ID_FILE_MRU_FILE8 0xE117 +#define ID_FILE_MRU_FILE9 0xE118 +#define ID_FILE_MRU_FILE10 0xE119 +#define ID_FILE_MRU_FILE11 0xE11A +#define ID_FILE_MRU_FILE12 0xE11B +#define ID_FILE_MRU_FILE13 0xE11C +#define ID_FILE_MRU_FILE14 0xE11D +#define ID_FILE_MRU_FILE15 0xE11E +#define ID_FILE_MRU_FILE16 0xE11F +#define ID_FILE_MRU_LAST 0xE11F + +// Edit commands +#define ID_EDIT_CLEAR 0xE120 +#define ID_EDIT_CLEAR_ALL 0xE121 +#define ID_EDIT_COPY 0xE122 +#define ID_EDIT_CUT 0xE123 +#define ID_EDIT_FIND 0xE124 +#define ID_EDIT_PASTE 0xE125 +#define ID_EDIT_PASTE_LINK 0xE126 +#define ID_EDIT_PASTE_SPECIAL 0xE127 +#define ID_EDIT_REPEAT 0xE128 +#define ID_EDIT_REPLACE 0xE129 +#define ID_EDIT_SELECT_ALL 0xE12A +#define ID_EDIT_UNDO 0xE12B +#define ID_EDIT_REDO 0xE12C + +// Window commands +#define ID_WINDOW_NEW 0xE130 +#define ID_WINDOW_ARRANGE 0xE131 +#define ID_WINDOW_CASCADE 0xE132 +#define ID_WINDOW_TILE_HORZ 0xE133 +#define ID_WINDOW_TILE_VERT 0xE134 +#define ID_WINDOW_SPLIT 0xE135 +#ifndef RC_INVOKED // code only +#define AFX_IDM_WINDOW_FIRST 0xE130 +#define AFX_IDM_WINDOW_LAST 0xE13F +#define AFX_IDM_FIRST_MDICHILD 0xFF00 // window list starts here +#endif //!RC_INVOKED + +// Help and App commands +#define ID_APP_ABOUT 0xE140 +#define ID_APP_EXIT 0xE141 +#define ID_HELP_INDEX 0xE142 +#define ID_HELP_USING 0xE143 +#define ID_CONTEXT_HELP 0xE144 // shift-F1 +// special commands for processing help +#define ID_HELP 0xE145 // first attempt for F1 +#define ID_DEFAULT_HELP 0xE146 // last attempt + +// Misc +#define ID_NEXT_PANE 0xE150 +#define ID_PREV_PANE 0xE151 + +// OLE commands +#define ID_OLE_INSERT_NEW 0xE200 +#define ID_OLE_EDIT_LINKS 0xE201 +#define ID_OLE_EDIT_CONVERT 0xE202 +#define ID_OLE_EDIT_CHANGE_ICON 0xE203 +#define ID_OLE_EDIT_PROPERTIES 0xE204 +#define ID_OLE_VERB_FIRST 0xE210 // range - 16 max +#ifndef RC_INVOKED // code only +#define ID_OLE_VERB_LAST 0xE21F +#endif //!RC_INVOKED + +// for print preview dialog bar +#define AFX_ID_PREVIEW_CLOSE 0xE300 +#define AFX_ID_PREVIEW_NUMPAGE 0xE301 // One/Two Page button +#define AFX_ID_PREVIEW_NEXT 0xE302 +#define AFX_ID_PREVIEW_PREV 0xE303 +#define AFX_ID_PREVIEW_PRINT 0xE304 +#define AFX_ID_PREVIEW_ZOOMIN 0xE305 +#define AFX_ID_PREVIEW_ZOOMOUT 0xE306 + +// View commands (same number used as IDW used for control bar) +#define ID_VIEW_TOOLBAR 0xE800 +#define ID_VIEW_STATUS_BAR 0xE801 + // -> E8FF reserved for other control bar commands + +// RecordForm commands +#define ID_RECORD_FIRST 0xE900 +#define ID_RECORD_LAST 0xE901 +#define ID_RECORD_NEXT 0xE902 +#define ID_RECORD_PREV 0xE903 + +///////////////////////////////////////////////////////////////////////////// +// Standard control IDs + +#ifdef IDC_STATIC +#undef IDC_STATIC +#endif +#define IDC_STATIC (-1) // all static controls + +///////////////////////////////////////////////////////////////////////////// +// Standard string error/warnings + +#ifndef RC_INVOKED // code only +#define AFX_IDS_SCFIRST 0xEF00 +#endif //!RC_INVOKED + +#define AFX_IDS_SCSIZE 0xEF00 +#define AFX_IDS_SCMOVE 0xEF01 +#define AFX_IDS_SCMINIMIZE 0xEF02 +#define AFX_IDS_SCMAXIMIZE 0xEF03 +#define AFX_IDS_SCNEXTWINDOW 0xEF04 +#define AFX_IDS_SCPREVWINDOW 0xEF05 +#define AFX_IDS_SCCLOSE 0xEF06 +#define AFX_IDS_SCRESTORE 0xEF12 +#define AFX_IDS_SCTASKLIST 0xEF13 + +#define AFX_IDS_MDICHILD 0xEF1F + +#define AFX_IDS_DESKACCESSORY 0xEFDA + +// General strings +#define AFX_IDS_OPENFILE 0xF000 +#define AFX_IDS_SAVEFILE 0xF001 +#define AFX_IDS_ALLFILTER 0xF002 +#define AFX_IDS_UNTITLED 0xF003 +#define AFX_IDS_SAVEFILECOPY 0xF004 +#define AFX_IDS_PREVIEW_CLOSE 0xF005 +#ifdef _MAC +#define AFX_IDS_ABOUT 0xF010 +#endif + +// Printing and print preview strings +#define AFX_IDS_PRINTONPORT 0xF040 +#define AFX_IDS_ONEPAGE 0xF041 +#define AFX_IDS_TWOPAGE 0xF042 +#define AFX_IDS_PRINTPAGENUM 0xF043 +#define AFX_IDS_PREVIEWPAGEDESC 0xF044 +#define AFX_IDS_PRINTDEFAULTEXT 0xF045 +#define AFX_IDS_PRINTDEFAULT 0xF046 +#define AFX_IDS_PRINTFILTER 0xF047 +#define AFX_IDS_PRINTCAPTION 0xF048 +#define AFX_IDS_PRINTTOFILE 0xF049 + + +// OLE strings +#define AFX_IDS_OBJECT_MENUITEM 0xF080 +#define AFX_IDS_EDIT_VERB 0xF081 +#define AFX_IDS_ACTIVATE_VERB 0xF082 +#define AFX_IDS_CHANGE_LINK 0xF083 +#define AFX_IDS_AUTO 0xF084 +#define AFX_IDS_MANUAL 0xF085 +#define AFX_IDS_FROZEN 0xF086 +#define AFX_IDS_ALL_FILES 0xF087 +// dynamically changing menu items +#define AFX_IDS_SAVE_MENU 0xF088 +#define AFX_IDS_UPDATE_MENU 0xF089 +#define AFX_IDS_SAVE_AS_MENU 0xF08A +#define AFX_IDS_SAVE_COPY_AS_MENU 0xF08B +#define AFX_IDS_EXIT_MENU 0xF08C +#define AFX_IDS_UPDATING_ITEMS 0xF08D +// COlePasteSpecialDialog defines +#define AFX_IDS_METAFILE_FORMAT 0xF08E +#define AFX_IDS_DIB_FORMAT 0xF08F +#define AFX_IDS_BITMAP_FORMAT 0xF090 +#define AFX_IDS_LINKSOURCE_FORMAT 0xF091 +#define AFX_IDS_EMBED_FORMAT 0xF092 +// other OLE utility strings +#define AFX_IDS_PASTELINKEDTYPE 0xF094 +#define AFX_IDS_UNKNOWNTYPE 0xF095 + +// General error / prompt strings +#define AFX_IDP_INVALID_FILENAME 0xF100 +#define AFX_IDP_FAILED_TO_OPEN_DOC 0xF101 +#define AFX_IDP_FAILED_TO_SAVE_DOC 0xF102 +#define AFX_IDP_ASK_TO_SAVE 0xF103 +#define AFX_IDP_FAILED_TO_CREATE_DOC 0xF104 +#define AFX_IDP_FILE_TOO_LARGE 0xF105 +#define AFX_IDP_FAILED_TO_START_PRINT 0xF106 +#define AFX_IDP_FAILED_TO_LAUNCH_HELP 0xF107 +#define AFX_IDP_INTERNAL_FAILURE 0xF108 // general failure +#define AFX_IDP_COMMAND_FAILURE 0xF109 // command failure +#define AFX_IDP_FAILED_MEMORY_ALLOC 0xF10A + +// DDV parse errors +#define AFX_IDP_PARSE_INT 0xF110 +#define AFX_IDP_PARSE_REAL 0xF111 +#define AFX_IDP_PARSE_INT_RANGE 0xF112 +#define AFX_IDP_PARSE_REAL_RANGE 0xF113 +#define AFX_IDP_PARSE_STRING_SIZE 0xF114 +#define AFX_IDP_PARSE_RADIO_BUTTON 0xF115 +#define AFX_IDP_PARSE_BYTE 0xF116 +#define AFX_IDP_PARSE_UINT 0xF117 + +// CFile/CArchive error strings for user failure +#define AFX_IDP_FAILED_INVALID_FORMAT 0xF120 +#define AFX_IDP_FAILED_INVALID_PATH 0xF121 +#define AFX_IDP_FAILED_DISK_FULL 0xF122 +#define AFX_IDP_FAILED_ACCESS_READ 0xF123 +#define AFX_IDP_FAILED_ACCESS_WRITE 0xF124 +#define AFX_IDP_FAILED_IO_ERROR_READ 0xF125 +#define AFX_IDP_FAILED_IO_ERROR_WRITE 0xF126 + +// OLE errors / prompt strings +#define AFX_IDP_STATIC_OBJECT 0xF180 +#define AFX_IDP_FAILED_TO_CONNECT 0xF181 +#define AFX_IDP_SERVER_BUSY 0xF182 +#define AFX_IDP_BAD_VERB 0xF183 +#define AFX_IDP_FAILED_TO_NOTIFY 0xF185 +#define AFX_IDP_FAILED_TO_LAUNCH 0xF186 +#define AFX_IDP_ASK_TO_UPDATE 0xF187 +#define AFX_IDP_FAILED_TO_UPDATE 0xF188 +#define AFX_IDP_FAILED_TO_REGISTER 0xF189 +#define AFX_IDP_FAILED_TO_AUTO_REGISTER 0xF18A +#define AFX_IDP_FAILED_TO_CONVERT 0xF18B +#define AFX_IDP_GET_NOT_SUPPORTED 0xF18C +#define AFX_IDP_SET_NOT_SUPPORTED 0xF18D +#define AFX_IDP_ASK_TO_DISCARD 0xF18E + +// MAPI errors / prompt strings +#define AFX_IDP_FAILED_MAPI_LOAD 0xF190 +#define AFX_IDP_INVALID_MAPI_DLL 0xF191 +#define AFX_IDP_FAILED_MAPI_SEND 0xF192 + +// 0xf200-0xf20f reserved + +// Property Sheet button strings (must be in this order) +#define AFX_IDS_PS_OK 0xF220 +#define AFX_IDS_PS_CANCEL 0xF221 +#define AFX_IDS_PS_APPLY_NOW 0xF222 +#define AFX_IDS_PS_HELP 0xF223 +#define AFX_IDS_PS_CLOSE 0xF224 + +// font names and point sizes +#define AFX_IDS_STATUS_FONT 0xF230 +#define AFX_IDS_TOOLTIP_FONT 0xF231 +#define AFX_IDS_UNICODE_FONT 0xF232 +#define AFX_IDS_MINI_FONT 0xF233 + +// Database errors / prompt strings +#ifndef RC_INVOKED // code only +#define AFX_IDP_SQL_FIRST 0xF280 +#endif //!RC_INVOKED +#define AFX_IDP_SQL_CONNECT_FAIL 0xF281 +#define AFX_IDP_SQL_RECORDSET_FORWARD_ONLY 0xF282 +#define AFX_IDP_SQL_EMPTY_COLUMN_LIST 0xF283 +#define AFX_IDP_SQL_FIELD_SCHEMA_MISMATCH 0xF284 +#define AFX_IDP_SQL_ILLEGAL_MODE 0xF285 +#define AFX_IDP_SQL_MULTIPLE_ROWS_AFFECTED 0xF286 +#define AFX_IDP_SQL_NO_CURRENT_RECORD 0xF287 +#define AFX_IDP_SQL_NO_ROWS_AFFECTED 0xF288 +#define AFX_IDP_SQL_RECORDSET_READONLY 0xF289 +#define AFX_IDP_SQL_SQL_NO_TOTAL 0xF28A +#define AFX_IDP_SQL_ODBC_LOAD_FAILED 0xF28B +#define AFX_IDP_SQL_DYNASET_NOT_SUPPORTED 0xF28C +#define AFX_IDP_SQL_SNAPSHOT_NOT_SUPPORTED 0xF28D +#define AFX_IDP_SQL_API_CONFORMANCE 0xF28E +#define AFX_IDP_SQL_SQL_CONFORMANCE 0xF28F +#define AFX_IDP_SQL_NO_DATA_FOUND 0xF290 +#define AFX_IDP_SQL_ROW_UPDATE_NOT_SUPPORTED 0xF291 +#define AFX_IDP_SQL_ODBC_V2_REQUIRED 0xF292 +#define AFX_IDP_SQL_NO_POSITIONED_UPDATES 0xF293 +#define AFX_IDP_SQL_LOCK_MODE_NOT_SUPPORTED 0xF294 +#define AFX_IDP_SQL_DATA_TRUNCATED 0xF295 +#define AFX_IDP_SQL_ROW_FETCH 0xF296 +#define AFX_IDP_SQL_INCORRECT_ODBC 0xF297 +#define AFX_IDP_SQL_UPDATE_DELETE_FAILED 0xF298 + +///////////////////////////////////////////////////////////////////////////// +// AFX implementation - control IDs (AFX_IDC) + +// Parts of dialogs +#define AFX_IDC_LISTBOX 100 +#define AFX_IDC_CHANGE 101 + +// for print dialog +#define AFX_IDC_PRINT_DOCNAME 201 +#define AFX_IDC_PRINT_PRINTERNAME 202 +#define AFX_IDC_PRINT_PORTNAME 203 +#define AFX_IDC_PRINT_PAGENUM 204 + +// Property Sheet control id's +#define ID_APPLY_NOW 0xEA00 +#define AFX_IDC_TAB_CONTROL 301 + +///////////////////////////////////////////////////////////////////////////// +// IDRs for standard components + +#ifndef RC_INVOKED // code only +// These are really COMMDLG dialogs, so there usually isn't a resource +// for them, but these IDs are used as help IDs. +#define AFX_IDD_FILEOPEN 28676 +#define AFX_IDD_FILESAVE 28677 +#define AFX_IDD_FONT 28678 +#define AFX_IDD_COLOR 28679 +#define AFX_IDD_PRINT 28680 +#define AFX_IDD_PRINTSETUP 28681 +#define AFX_IDD_FIND 28682 +#define AFX_IDD_REPLACE 28683 +#endif //!RC_INVOKED + +// Standard dialogs app should leave alone (0x7801->) +#define AFX_IDD_NEWTYPEDLG 30721 +#define AFX_IDD_PRINTDLG 30722 +#define AFX_IDD_PREVIEW_TOOLBAR 30723 +#ifdef _MAC +#define AFX_IDD_PREVIEW_SHORTTOOLBAR 30731 +#endif + +// Dialogs defined for OLE2UI library +#define AFX_IDD_INSERTOBJECT 30724 +#define AFX_IDD_CHANGEICON 30725 +#define AFX_IDD_CONVERT 30726 +#define AFX_IDD_PASTESPECIAL 30727 +#define AFX_IDD_EDITLINKS 30728 +#define AFX_IDD_FILEBROWSE 30729 +#define AFX_IDD_BUSY 30730 + +// Standard cursors (0x7901->) + // AFX_IDC = Cursor resources +#define AFX_IDC_CONTEXTHELP 30977 // context sensitive help +#define AFX_IDC_MAGNIFY 30978 // print preview zoom +#define AFX_IDC_SMALLARROWS 30979 // splitter +#define AFX_IDC_HSPLITBAR 30980 // splitter +#define AFX_IDC_VSPLITBAR 30981 // splitter +#define AFX_IDC_NODROPCRSR 30982 // No Drop Cursor +#define AFX_IDC_TRACKNWSE 30983 // tracker +#define AFX_IDC_TRACKNESW 30984 // tracker +#define AFX_IDC_TRACKNS 30985 // tracker +#define AFX_IDC_TRACKWE 30986 // tracker +#define AFX_IDC_TRACK4WAY 30987 // tracker +#define AFX_IDC_MOVE4WAY 30988 // resize bar (server only) + +// Tab Control bitmap IDs +#define AFX_IDB_SCROLL 30989 + +// Mini frame window bitmap ID +#define AFX_IDB_MINIFRAME_MENU 30994 + +// AFX standard accelerator resources +#define AFX_IDR_PREVIEW_ACCEL 30995 + +// AFX standard ICON IDs (for MFC V1 apps) (0x7A01->) +#define AFX_IDI_STD_MDIFRAME 31233 +#define AFX_IDI_STD_FRAME 31234 + +#ifdef _AFXCTL +///////////////////////////////////////////////////////////////////////////// +// AFX OLE control implementation - control IDs (AFX_IDC) + +// Font property page +#define AFX_IDC_FONTPROP 1000 +#define AFX_IDC_FONTNAMES 1001 +#define AFX_IDC_FONTSTYLES 1002 +#define AFX_IDC_FONTSIZES 1003 +#define AFX_IDC_STRIKEOUT 1004 +#define AFX_IDC_UNDERLINE 1005 +#define AFX_IDC_SAMPLEBOX 1006 + +// Color property page +#define AFX_IDC_COLOR_BLACK 1100 +#define AFX_IDC_COLOR_WHITE 1101 +#define AFX_IDC_COLOR_RED 1102 +#define AFX_IDC_COLOR_GREEN 1103 +#define AFX_IDC_COLOR_BLUE 1104 +#define AFX_IDC_COLOR_YELLOW 1105 +#define AFX_IDC_COLOR_MAGENTA 1106 +#define AFX_IDC_COLOR_CYAN 1107 +#define AFX_IDC_COLOR_GRAY 1108 +#define AFX_IDC_COLOR_LIGHTGRAY 1109 +#define AFX_IDC_COLOR_DARKRED 1110 +#define AFX_IDC_COLOR_DARKGREEN 1111 +#define AFX_IDC_COLOR_DARKBLUE 1112 +#define AFX_IDC_COLOR_LIGHTBROWN 1113 +#define AFX_IDC_COLOR_DARKMAGENTA 1114 +#define AFX_IDC_COLOR_DARKCYAN 1115 +#define AFX_IDC_COLORPROP 1116 +#define AFX_IDC_SYSTEMCOLORS 1117 + +// Picture porperty page +#define AFX_IDC_PROPNAME 1201 +#define AFX_IDC_PICTURE 1202 +#define AFX_IDC_BROWSE 1203 + +///////////////////////////////////////////////////////////////////////////// +// IDRs for OLE control standard components + +// Standard propery page dialogs app should leave alone (0x7E01->) +#define AFX_IDD_PROPPAGE_COLOR 32257 +#define AFX_IDD_PROPPAGE_FONT 32258 +#define AFX_IDD_PROPPAGE_PICTURE 32259 + +#define AFX_IDB_TRUETYPE 32384 + +///////////////////////////////////////////////////////////////////////////// +// Standard OLE control string error/warnings + +// Property Sheet button strings +#define AFX_IDS_PS_OK 0xF220 +#define AFX_IDS_PS_CANCEL 0xF221 +#define AFX_IDS_PS_APPLY_NOW 0xF222 +#define AFX_IDS_PS_HELP 0xF223 +#define AFX_IDS_PS_CLOSE 0xF224 + +#define AFX_IDS_DEFAULT_PAGE_TITLE 0xFE00 +#define AFX_IDS_PROPPAGE_UNKNOWN 0xFE01 +#define AFX_IDS_FRAMECAPTIONFORMAT 0xFE02 +#define AFX_IDS_PROPERTIES 0xFE03 +#define AFX_IDS_COLOR_DESKTOP 0xFE04 +#define AFX_IDS_COLOR_APPWORKSPACE 0xFE05 +#define AFX_IDS_COLOR_WNDBACKGND 0xFE06 +#define AFX_IDS_COLOR_WNDTEXT 0xFE07 +#define AFX_IDS_COLOR_MENUBAR 0xFE08 +#define AFX_IDS_COLOR_MENUTEXT 0xFE09 +#define AFX_IDS_COLOR_ACTIVEBAR 0xFE0A +#define AFX_IDS_COLOR_INACTIVEBAR 0xFE0B +#define AFX_IDS_COLOR_ACTIVETEXT 0xFE0C +#define AFX_IDS_COLOR_INACTIVETEXT 0xFE0D +#define AFX_IDS_COLOR_ACTIVEBORDER 0xFE0E +#define AFX_IDS_COLOR_INACTIVEBORDER 0xFE0F +#define AFX_IDS_COLOR_WNDFRAME 0xFE10 +#define AFX_IDS_COLOR_SCROLLBARS 0xFE11 +#define AFX_IDS_COLOR_BTNFACE 0xFE12 +#define AFX_IDS_COLOR_BTNSHADOW 0xFE13 +#define AFX_IDS_COLOR_BTNTEXT 0xFE14 +#define AFX_IDS_COLOR_BTNHIGHLIGHT 0xFE15 +#define AFX_IDS_COLOR_DISABLEDTEXT 0xFE16 +#define AFX_IDS_COLOR_HIGHLIGHT 0xFE17 +#define AFX_IDS_COLOR_HIGHLIGHTTEXT 0xFE18 +#define AFX_IDS_REGULAR 0xFE19 +#define AFX_IDS_BOLD 0xFE1A +#define AFX_IDS_ITALIC 0xFE1B +#define AFX_IDS_BOLDITALIC 0xFE1C +#define AFX_IDS_SAMPLETEXT 0xFE1D +#define AFX_IDS_DISPLAYSTRING_FONT 0xFE1E +#define AFX_IDS_DISPLAYSTRING_COLOR 0xFE1F +#define AFX_IDS_DISPLAYSTRING_PICTURE 0xFE20 +#define AFX_IDS_PICTUREFILTER 0xFE21 +#define AFX_IDS_PICTYPE_UNKNOWN 0xFE22 +#define AFX_IDS_PICTYPE_NONE 0xFE23 +#define AFX_IDS_PICTYPE_BITMAP 0xFE24 +#define AFX_IDS_PICTYPE_METAFILE 0xFE25 +#define AFX_IDS_PICTYPE_ICON 0xFE26 +#define AFX_IDS_PROPFRAME 0xFE27 +#define AFX_IDS_COLOR_PPG 0xFE28 +#define AFX_IDS_COLOR_PPG_CAPTION 0xFE29 +#define AFX_IDS_FONT_PPG 0xFE2A +#define AFX_IDS_FONT_PPG_CAPTION 0xFE2B +#define AFX_IDS_PICTURE_PPG 0xFE2C +#define AFX_IDS_PICTURE_PPG_CAPTION 0xFE2D +#define AFX_IDS_STANDARD_FONT 0xFE2E +#define AFX_IDS_STANDARD_PICTURE 0xFE2F +#define AFX_IDS_PICTUREBROWSETITLE 0xFE30 +#define AFX_IDS_BORDERSTYLE_0 0xFE31 +#define AFX_IDS_BORDERSTYLE_1 0xFE32 + +// OLE Control verb names +#define AFX_IDS_VERB_EDIT 0xFE40 +#define AFX_IDS_VERB_PROPERTIES 0xFE41 + +// OLE Control internal error messages +#define AFX_IDP_PROPFRAME_OOM 0xFE80 +#define AFX_IDP_PROPFRAME_OOR 0xFE81 +#define AFX_IDP_PROPFRAME_NOPAGES 0xFE82 +#define AFX_IDP_PICTURECANTOPEN 0xFE83 +#define AFX_IDP_PICTURECANTLOAD 0xFE84 +#define AFX_IDP_PICTURETOOLARGE 0xFE85 +#define AFX_IDP_PICTUREREADFAILED 0xFE86 + +// Standard OLE Control error strings +#define AFX_IDP_E_ILLEGALFUNCTIONCALL 0xFEA0 +#define AFX_IDP_E_OVERFLOW 0xFEA1 +#define AFX_IDP_E_OUTOFMEMORY 0xFEA2 +#define AFX_IDP_E_DIVISIONBYZERO 0xFEA3 +#define AFX_IDP_E_OUTOFSTRINGSPACE 0xFEA4 +#define AFX_IDP_E_OUTOFSTACKSPACE 0xFEA5 +#define AFX_IDP_E_BADFILENAMEORNUMBER 0xFEA6 +#define AFX_IDP_E_FILENOTFOUND 0xFEA7 +#define AFX_IDP_E_BADFILEMODE 0xFEA8 +#define AFX_IDP_E_FILEALREADYOPEN 0xFEA9 +#define AFX_IDP_E_DEVICEIOERROR 0xFEAA +#define AFX_IDP_E_FILEALREADYEXISTS 0xFEAB +#define AFX_IDP_E_BADRECORDLENGTH 0xFEAC +#define AFX_IDP_E_DISKFULL 0xFEAD +#define AFX_IDP_E_BADRECORDNUMBER 0xFEAE +#define AFX_IDP_E_BADFILENAME 0xFEAF +#define AFX_IDP_E_TOOMANYFILES 0xFEB0 +#define AFX_IDP_E_DEVICEUNAVAILABLE 0xFEB1 +#define AFX_IDP_E_PERMISSIONDENIED 0xFEB2 +#define AFX_IDP_E_DISKNOTREADY 0xFEB3 +#define AFX_IDP_E_PATHFILEACCESSERROR 0xFEB4 +#define AFX_IDP_E_PATHNOTFOUND 0xFEB5 +#define AFX_IDP_E_INVALIDPATTERNSTRING 0xFEB6 +#define AFX_IDP_E_INVALIDUSEOFNULL 0xFEB7 +#define AFX_IDP_E_INVALIDFILEFORMAT 0xFEB8 +#define AFX_IDP_E_INVALIDPROPERTYVALUE 0xFEB9 +#define AFX_IDP_E_INVALIDPROPERTYARRAYINDEX 0xFEBA +#define AFX_IDP_E_SETNOTSUPPORTEDATRUNTIME 0xFEBB +#define AFX_IDP_E_SETNOTSUPPORTED 0xFEBC +#define AFX_IDP_E_NEEDPROPERTYARRAYINDEX 0xFEBD +#define AFX_IDP_E_SETNOTPERMITTED 0xFEBE +#define AFX_IDP_E_GETNOTSUPPORTEDATRUNTIME 0xFEBF +#define AFX_IDP_E_GETNOTSUPPORTED 0xFEC0 +#define AFX_IDP_E_PROPERTYNOTFOUND 0xFEC1 +#define AFX_IDP_E_INVALIDCLIPBOARDFORMAT 0xFEC2 +#define AFX_IDP_E_INVALIDPICTURE 0xFEC3 +#define AFX_IDP_E_PRINTERERROR 0xFEC4 +#define AFX_IDP_E_CANTSAVEFILETOTEMP 0xFEC5 +#define AFX_IDP_E_SEARCHTEXTNOTFOUND 0xFEC6 +#define AFX_IDP_E_REPLACEMENTSTOOLONG 0xFEC7 + +#endif //_AFXCTL + +#endif //__AFXRES_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxres.rc b/public/sdk/inc/mfc30/afxres.rc new file mode 100644 index 000000000..4fc0d1f8a --- /dev/null +++ b/public/sdk/inc/mfc30/afxres.rc @@ -0,0 +1,177 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXRES_RC__ +#define __AFXRES_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< Cannot change standard MFC resources! >\0" +END +#endif //APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// Default resource description for MFC applications +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Strings + +STRINGTABLE +BEGIN + AFX_IDS_OPENFILE, "Open" +#ifndef _MAC + AFX_IDS_SAVEFILE, "Save As" + AFX_IDS_ALLFILTER, "All Files (*.*)" + AFX_IDS_UNTITLED, "Untitled" +#else + AFX_IDS_SAVEFILE, "Save document as:" + AFX_IDS_ALLFILTER, "All Files" + AFX_IDS_UNTITLED, "untitled" + AFX_IDS_ABOUT, "About " +#endif + + // General error prompts + AFX_IDP_INVALID_FILENAME, "Invalid filename." + AFX_IDP_FAILED_TO_OPEN_DOC, "Failed to open document." + AFX_IDP_FAILED_TO_SAVE_DOC, "Failed to save document." +#ifndef _MAC + AFX_IDP_ASK_TO_SAVE, "Save changes to %1?" +#else + AFX_IDP_ASK_TO_SAVE, "Save changes to the %1 document \042%2\042?" +#endif + AFX_IDP_FAILED_TO_CREATE_DOC, "Failed to create empty document." + AFX_IDP_FILE_TOO_LARGE, "The file is too large to open." + AFX_IDP_FAILED_TO_START_PRINT, "Could not start print job." + AFX_IDP_FAILED_TO_LAUNCH_HELP, "Failed to launch help." + AFX_IDP_INTERNAL_FAILURE, "Internal application error." + AFX_IDP_COMMAND_FAILURE, "Command failed." + AFX_IDP_FAILED_MEMORY_ALLOC "Insufficient memory to perform operation." + AFX_IDP_GET_NOT_SUPPORTED, "Unable to read write-only property." + AFX_IDP_SET_NOT_SUPPORTED, "Unable to write read-only property." + + // CFile/CArchive error strings for user failure + AFX_IDP_FAILED_INVALID_FORMAT "Unexpected file format." +#ifndef _MAC + AFX_IDP_FAILED_INVALID_PATH "%1\nCannot find this file.\nPlease verify that the correct path and file name are given." + AFX_IDP_FAILED_DISK_FULL "Destination disk drive is full." +#else + AFX_IDP_FAILED_INVALID_PATH "Cannot find the file \042%1.\042 Please verify that the correct file name is given." + AFX_IDP_FAILED_DISK_FULL "Destination disk is full." +#endif + AFX_IDP_FAILED_ACCESS_READ "Unable to read from %1, it is opened by someone else." + AFX_IDP_FAILED_ACCESS_WRITE "Unable to write to %1, it is read-only or opened by someone else." + AFX_IDP_FAILED_IO_ERROR_READ "An unexpected error occurred while reading %1." + AFX_IDP_FAILED_IO_ERROR_WRITE "An unexpected error occurred while writing %1." + + // Parsing error prompts + AFX_IDP_PARSE_INT, "Please enter an integer." + AFX_IDP_PARSE_REAL, "Please enter a number." + AFX_IDP_PARSE_INT_RANGE, "Please enter an integer between %1 and %2." + AFX_IDP_PARSE_REAL_RANGE, "Please enter a number between %1 and %2." + AFX_IDP_PARSE_STRING_SIZE, "Please enter no more than %1 characters." + AFX_IDP_PARSE_RADIO_BUTTON, "Please select a button." + AFX_IDP_PARSE_BYTE, "Please enter an integer between 0 and 255." + AFX_IDP_PARSE_UINT, "Please enter a positive integer." + +#ifndef _AFX_NO_PROPSHEET_RESOURCES + // Property Sheet button strings (Note: 50 is the X-axis button size) + AFX_IDS_PS_OK "OK\n50" + AFX_IDS_PS_CANCEL "Cancel\n50" + AFX_IDS_PS_APPLY_NOW "&Apply\n50" + AFX_IDS_PS_HELP "&Help\n50" + AFX_IDS_PS_CLOSE "Close" +#endif //!_AFX_NO_PROPSHEET_RESOURCES + +#ifndef _AFX_NO_OLE_RESOURCES + // OLE strings required for both servers and containers + AFX_IDS_PASTELINKEDTYPE "Linked %s" + AFX_IDS_UNKNOWNTYPE "Unknown Type" +#ifndef _MAC + AFX_IDP_FAILED_TO_NOTIFY "%1\nUnable to register document.\nThe document may already be open." +#else + AFX_IDP_FAILED_TO_NOTIFY "Unable to register document \042%1.\042 The document may already be open." +#endif +#endif //!_AFX_NO_OLE_RESOURCES + +#ifndef _AFX_NO_MAPI_RESOURCES + // MAPI strings / error messages + AFX_IDP_FAILED_MAPI_LOAD "Unable to load mail system support." + AFX_IDP_INVALID_MAPI_DLL "Mail system DLL is invalid." + AFX_IDP_FAILED_MAPI_SEND "Send Mail failed to send message." +#endif //!_AFX_NO_MAPI_RESOURCES +END + +///////////////////////////////////////////////////////////////////////////// +// Cursors + +AFX_IDC_CONTEXTHELP CURSOR DISCARDABLE "res\\help.cur" + +#ifndef _AFX_NO_SPLITTER_RESOURCES +AFX_IDC_SMALLARROWS CURSOR DISCARDABLE "res\\sarrows.cur" +AFX_IDC_HSPLITBAR CURSOR DISCARDABLE "res\\splith.cur" +AFX_IDC_VSPLITBAR CURSOR DISCARDABLE "res\\splitv.cur" +AFX_IDC_NODROPCRSR CURSOR DISCARDABLE "res\\nodrop.cur" +#endif //!_AFX_NO_SPLITTER_RESOURCES + +#ifndef _AFX_NO_TRACKER_RESOURCES +AFX_IDC_TRACKNWSE CURSOR DISCARDABLE "res\\trcknwse.cur" +AFX_IDC_TRACKNESW CURSOR DISCARDABLE "res\\trcknesw.cur" +AFX_IDC_TRACKNS CURSOR DISCARDABLE "res\\trckns.cur" +AFX_IDC_TRACKWE CURSOR DISCARDABLE "res\\trckwe.cur" +AFX_IDC_TRACK4WAY CURSOR DISCARDABLE "res\\trck4way.cur" +AFX_IDC_MOVE4WAY CURSOR DISCARDABLE "res\\move4way.cur" +#endif //!_AFX_NO_TRACKER_RESOURCES + +///////////////////////////////////////////////////////////////////////////// +// Standard Dialogs + +AFX_IDD_NEWTYPEDLG DIALOG DISCARDABLE 9, 26, 183, 70 +#ifndef _MAC +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | 0x04 +#else +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +#endif +CAPTION "New" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "&New ",IDC_STATIC,6,5,123,8,NOT WS_GROUP + LISTBOX AFX_IDC_LISTBOX,6,15,125,49,WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "OK",IDOK,137,6,40,14 + PUSHBUTTON "Cancel",IDCANCEL,137,23,40,14 + PUSHBUTTON "&Help",ID_HELP,137,43,40,14 +END + +///////////////////////////////////////////////////////////////////////////// +// Property Sheet Bitmaps + +#ifndef _AFX_NO_PROPERTY_RESOURCES +AFX_IDB_SCROLL BITMAP DISCARDABLE "res\\psscroll.bmp" +#endif //!_AFX_NO_PROPERTY_RESOURCES + +///////////////////////////////////////////////////////////////////////////// +// CMiniFrameWnd Bitmap + +AFX_IDB_MINIFRAME_MENU BITMAP DISCARDABLE "res\\minifwnd.bmp" + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //!__AFXRES_RC__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxsock.h b/public/sdk/inc/mfc30/afxsock.h new file mode 100644 index 000000000..26e00a273 --- /dev/null +++ b/public/sdk/inc/mfc30/afxsock.h @@ -0,0 +1,350 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1994 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXSOCK_H__ +#define __AFXSOCK_H__ + +#ifdef _AFX_NO_SOCKET_SUPPORT + #error Windows Sockets classes not supported in this library variant. +#endif + +#ifndef __AFXWIN_H__ + #include <afxwin.h> +#endif + +#include <winsock.h> + +#ifndef _AFX_NOFORCE_LIBS +#ifndef _MAC + +///////////////////////////////////////////////////////////////////////////// +// Win32 libraries + +#ifndef _AFXCTL +#ifdef _AFXDLL + #ifndef _UNICODE + #ifdef _DEBUG + #pragma comment(lib, "cfmn30d.lib") + #else + #pragma comment(lib, "cfmn30.lib") + #endif + #else + #ifdef _DEBUG + #pragma comment(lib, "cfmn30ud.lib") + #else + #pragma comment(lib, "cfmn30u.lib") + #endif + #endif +#endif + +#endif // !_AFXCTL + +#pragma comment(lib, "wsock32.lib") + +#else //!_MAC + +///////////////////////////////////////////////////////////////////////////// +// Mac libraries + +#endif //_MAC +#endif //!_AFX_NOFORCE_LIBS + +///////////////////////////////////////////////////////////////////////////// + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +///////////////////////////////////////////////////////////////////////////// +// AFXSOCK - MFC support for Windows Sockets + +// Classes declared in this file + + // CObject + class CAsyncSocket; // Async Socket implementation and + // base class for Synchronous Socket + class CSocket; // Synchronous Socket + + // CFile + class CSocketFile; // Used with CSocket and CArchive for + // streaming objects on sockets. + +///////////////////////////////////////////////////////////////////////////// + +// AFXDLL support +#undef AFX_DATA +#define AFX_DATA AFX_NET_DATA + +///////////////////////////////////////////////////////////////////////////// +// CSocketWnd -- internal use only +// Implementation for sockets notification callbacks. +// Future versions of MFC may or may not include this exact class. + +class CSocketWnd : public CWnd +{ +// Construction +public: + CSocketWnd(); + +// Implementation +public: + virtual ~CSocketWnd(); + +protected: + //{{AFX_MSG(CSocketWnd) + LRESULT OnSocketNotify(WPARAM wParam, LPARAM lParam); + LRESULT OnSocketDead(WPARAM wParam, LPARAM lParam); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// CAsyncSocket + +class CAsyncSocket : public CObject +{ + DECLARE_DYNAMIC(CAsyncSocket); +private: + CAsyncSocket(const CAsyncSocket& rSrc); // no implementation + void operator=(const CAsyncSocket& rSrc); // no implementation + +// Construction +public: + CAsyncSocket(); + BOOL Create(UINT nSocketPort = 0, int nSocketType=SOCK_STREAM, + long lEvent = FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT | FD_CLOSE, + LPCTSTR lpszSocketAddress = NULL); + +// Attributes +public: + SOCKET m_hSocket; + + BOOL Attach(SOCKET hSocket, long lEvent = + FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT | FD_CLOSE); + SOCKET Detach(); + + BOOL GetPeerName(CString& rPeerAddress, UINT& rPeerPort); + BOOL GetPeerName(SOCKADDR* lpSockAddr, int* lpSockAddrLen); + + BOOL GetSockName(CString& rSocketAddress, UINT& rSocketPort); + BOOL GetSockName(SOCKADDR* lpSockAddr, int* lpSockAddrLen); + + BOOL SetSockOpt(int nOptionName, const void* lpOptionValue, + int nOptionLen, int nLevel = SOL_SOCKET); + BOOL GetSockOpt(int nOptionName, void* lpOptionValue, + int* lpOptionLen, int nLevel = SOL_SOCKET); + + static CAsyncSocket* PASCAL FromHandle(SOCKET hSocket); + static int GetLastError(); + +// Operations +public: + + virtual BOOL Accept(CAsyncSocket& rConnectedSocket, + SOCKADDR* lpSockAddr = NULL, int* lpSockAddrLen = NULL); + + BOOL Bind(UINT nSocketPort, LPCTSTR lpszSocketAddress = NULL); + BOOL Bind (const SOCKADDR* lpSockAddr, int nSockAddrLen); + + virtual void Close(); + + BOOL Connect(LPCTSTR lpszHostAddress, UINT nHostPort); + BOOL Connect(const SOCKADDR* lpSockAddr, int nSockAddrLen); + + BOOL IOCtl(long lCommand, DWORD* lpArgument); + + BOOL Listen(int nConnectionBacklog=5); + + virtual int Receive(void* lpBuf, int nBufLen, int nFlags = 0); + + int ReceiveFrom(void* lpBuf, int nBufLen, + CString& rSocketAddress, UINT& rSocketPort, int nFlags = 0); + int ReceiveFrom(void* lpBuf, int nBufLen, + SOCKADDR* lpSockAddr, int* lpSockAddrLen, int nFlags = 0); + + enum { receives = 0, sends = 1, both = 2 }; + BOOL ShutDown(int nHow = sends); + + virtual int Send(const void* lpBuf, int nBufLen, int nFlags = 0); + + int SendTo(const void* lpBuf, int nBufLen, + UINT nHostPort, LPCTSTR lpszHostAddress = NULL, int nFlags = 0); + int SendTo(const void* lpBuf, int nBufLen, + const SOCKADDR* lpSockAddr, int nSockAddrLen, int nFlags = 0); + + BOOL AsyncSelect(long lEvent = + FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT | FD_CLOSE); + +// Overridable callbacks +protected: + virtual void OnReceive(int nErrorCode); + virtual void OnSend(int nErrorCode); + virtual void OnOutOfBandData(int nErrorCode); + virtual void OnAccept(int nErrorCode); + virtual void OnConnect(int nErrorCode); + virtual void OnClose(int nErrorCode); + +// Implementation +public: + virtual ~CAsyncSocket(); + + static CAsyncSocket* PASCAL LookupHandle(SOCKET hSocket, BOOL bDead = FALSE); + static void PASCAL AttachHandle(SOCKET hSocket, CAsyncSocket* pSocket, BOOL bDead = FALSE); + static void PASCAL DetachHandle(SOCKET hSocket, BOOL bDead = FALSE); + static void PASCAL KillSocket(SOCKET hSocket, CAsyncSocket* pSocket); + static void PASCAL DoCallBack(WPARAM wParam, LPARAM lParam); + + BOOL Socket(int nSocketType=SOCK_STREAM, long lEvent = + FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT | FD_CLOSE, + int nProtocolType = 0, int nAddressFormat = PF_INET); + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + friend class CSocketWnd; + + virtual BOOL ConnectHelper(const SOCKADDR* lpSockAddr, int nSockAddrLen); + virtual int ReceiveFromHelper(void* lpBuf, int nBufLen, + SOCKADDR* lpSockAddr, int* lpSockAddrLen, int nFlags); + virtual int SendToHelper(const void* lpBuf, int nBufLen, + const SOCKADDR* lpSockAddr, int nSockAddrLen, int nFlags); +}; + +///////////////////////////////////////////////////////////////////////////// +// CSocket + +class CSocket : public CAsyncSocket +{ + DECLARE_DYNAMIC(CSocket); +private: + CSocket(const CSocket& rSrc); // no implementation + void operator=(const CSocket& rSrc); // no implementation + +// Construction +public: + CSocket(); + BOOL Create(UINT nSocketPort = 0, int nSocketType=SOCK_STREAM, + LPCTSTR lpszSocketAddress = NULL); + +// Attributes +public: + BOOL IsBlocking(); + static CSocket* PASCAL FromHandle(SOCKET hSocket); + BOOL Attach(SOCKET hSocket); + +// Operations +public: + void CancelBlockingCall(); + +// Overridable callbacks +protected: + virtual BOOL OnMessagePending(); + +// Implementation +public: + int m_nTimeOut; + + virtual ~CSocket(); + + static int PASCAL ProcessAuxQueue(); + + virtual BOOL Accept(CAsyncSocket& rConnectedSocket, + SOCKADDR* lpSockAddr = NULL, int* lpSockAddrLen = NULL); + virtual void Close(); + virtual int Receive(void* lpBuf, int nBufLen, int nFlags = 0); + virtual int Send(const void* lpBuf, int nBufLen, int nFlags = 0); + + int SendChunk(const void* lpBuf, int nBufLen, int nFlags); + +protected: + BOOL* m_pbBlocking; + int m_nConnectError; + + virtual BOOL ConnectHelper(const SOCKADDR* lpSockAddr, int nSockAddrLen); + virtual int ReceiveFromHelper(void* lpBuf, int nBufLen, + SOCKADDR* lpSockAddr, int* lpSockAddrLen, int nFlags); + virtual int SendToHelper(const void* lpBuf, int nBufLen, + const SOCKADDR* lpSockAddr, int nSockAddrLen, int nFlags); + + static void PASCAL AuxQueueAdd(UINT message, WPARAM wParam, LPARAM lParam); + + virtual BOOL PumpMessages(UINT uStopFlag); + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif +}; + +///////////////////////////////////////////////////////////////////////////// +// CSocketFile + +class CSocketFile : public CFile +{ + DECLARE_DYNAMIC(CSocketFile) +public: +//Constructors + CSocketFile(CSocket* pSocket, BOOL bArchiveCompatible = TRUE); + +// Implementation +public: + CSocket* m_pSocket; + BOOL m_bArchiveCompatible; + + virtual ~CSocketFile(); + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + virtual UINT Read(void* lpBuf, UINT nCount); + virtual void Write(const void* lpBuf, UINT nCount); + virtual void Close(); + +// Unsupported APIs + virtual BOOL Open(LPCTSTR lpszFileName, UINT nOpenFlags, CFileException* pError = NULL); + virtual CFile* Duplicate() const; + virtual DWORD GetPosition() const; + virtual LONG Seek(LONG lOff, UINT nFrom); + virtual void SetLength(DWORD dwNewLen); + virtual DWORD GetLength() const; + virtual void LockRange(DWORD dwPos, DWORD dwCount); + virtual void UnlockRange(DWORD dwPos, DWORD dwCount); + virtual void Flush(); + virtual void Abort(); +}; + +///////////////////////////////////////////////////////////////////////////// +// Global functions + +BOOL AfxSocketInit(WSADATA* lpwsaData = NULL); + +///////////////////////////////////////////////////////////////////////////// +// Inline function declarations + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +#ifdef _AFX_ENABLE_INLINES +#define _AFXSOCK_INLINE inline +#include <afxsock.inl> +#undef _AFXSOCK_INLINE +#endif + +#undef AFX_DATA +#define AFX_DATA + +#endif // __AFXSOCK_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxsock.inl b/public/sdk/inc/mfc30/afxsock.inl new file mode 100644 index 000000000..e590170a2 --- /dev/null +++ b/public/sdk/inc/mfc30/afxsock.inl @@ -0,0 +1,51 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1993 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// Inlines for AFXSOCK.H + +#ifdef _AFXSOCK_INLINE + +_AFXSOCK_INLINE BOOL CAsyncSocket::GetPeerName(SOCKADDR* lpSockAddr, int* lpSockAddrLen) + { return (SOCKET_ERROR != getpeername(m_hSocket, lpSockAddr, lpSockAddrLen)); } +_AFXSOCK_INLINE BOOL CAsyncSocket::GetSockName(SOCKADDR* lpSockAddr, int* lpSockAddrLen) + { return (SOCKET_ERROR != getsockname(m_hSocket, lpSockAddr, lpSockAddrLen)); } +_AFXSOCK_INLINE BOOL CAsyncSocket::SetSockOpt(int nOptionName, const void* lpOptionValue, int nOptionLen, int nLevel) + { return (SOCKET_ERROR != setsockopt(m_hSocket, nLevel, nOptionName, (LPCSTR)lpOptionValue, nOptionLen)); } +_AFXSOCK_INLINE BOOL CAsyncSocket::GetSockOpt(int nOptionName, void* lpOptionValue, int* lpOptionLen, int nLevel) + { return (SOCKET_ERROR != getsockopt(m_hSocket, nLevel, nOptionName, (LPSTR)lpOptionValue, lpOptionLen)); } +_AFXSOCK_INLINE CAsyncSocket* PASCAL CAsyncSocket::FromHandle(SOCKET hSocket) + { return CAsyncSocket::LookupHandle(hSocket, FALSE); } +_AFXSOCK_INLINE int CAsyncSocket::GetLastError() + { return WSAGetLastError(); } +_AFXSOCK_INLINE BOOL CAsyncSocket::Bind(const SOCKADDR* lpSockAddr, int nSockAddrLen) + { return (SOCKET_ERROR != bind(m_hSocket, lpSockAddr, nSockAddrLen)); } +_AFXSOCK_INLINE BOOL CAsyncSocket::Connect(const SOCKADDR* lpSockAddr, int nSockAddrLen) + { return ConnectHelper(lpSockAddr, nSockAddrLen); } +_AFXSOCK_INLINE BOOL CAsyncSocket::IOCtl(long lCommand, DWORD* lpArgument) + { *lpArgument = 0; return (SOCKET_ERROR != ioctlsocket(m_hSocket, lCommand, lpArgument)); } +_AFXSOCK_INLINE BOOL CAsyncSocket::Listen(int nConnectionBacklog) + { return (SOCKET_ERROR != listen(m_hSocket, nConnectionBacklog)); } +_AFXSOCK_INLINE int CAsyncSocket::ReceiveFrom(void* lpBuf, int nBufLen, SOCKADDR* lpSockAddr, int* lpSockAddrLen, int nFlags) + { return ReceiveFromHelper(lpBuf, nBufLen, lpSockAddr, lpSockAddrLen, nFlags); } +_AFXSOCK_INLINE BOOL CAsyncSocket::ShutDown(int nHow) + { return (SOCKET_ERROR != shutdown(m_hSocket,nHow)); } +_AFXSOCK_INLINE int CAsyncSocket::SendTo(const void* lpBuf, int nBufLen, const SOCKADDR* lpSockAddr, int nSockAddrLen, int nFlags) + { return SendToHelper(lpBuf, nBufLen, lpSockAddr, nSockAddrLen, nFlags); } + +_AFXSOCK_INLINE BOOL CSocket::Create(UINT nSocketPort, int nSocketType, LPCTSTR lpszSocketAddress) + { return CAsyncSocket::Create(nSocketPort, nSocketType, FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT | FD_CLOSE, lpszSocketAddress); } +_AFXSOCK_INLINE BOOL CSocket::IsBlocking() + { return (m_pbBlocking != NULL); } +_AFXSOCK_INLINE CSocket* PASCAL CSocket::FromHandle(SOCKET hSocket) + { return (CSocket*)CAsyncSocket::LookupHandle(hSocket, FALSE); } +_AFXSOCK_INLINE BOOL CSocket::Attach(SOCKET hSocket) + { return CAsyncSocket::Attach(hSocket); } + +#endif //_AFXSOCK_INLINE diff --git a/public/sdk/inc/mfc30/afxstat_.h b/public/sdk/inc/mfc30/afxstat_.h new file mode 100644 index 000000000..abee25a2d --- /dev/null +++ b/public/sdk/inc/mfc30/afxstat_.h @@ -0,0 +1,537 @@ +// This is a part of the Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation +// All rights reserved. +// +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXSTATE_H__ +#define __AFXSTATE_H__ + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +#undef AFX_DATA +#define AFX_DATA AFX_CORE_DATA + +///////////////////////////////////////////////////////////////////////////// +// Application global state + +class CWinApp; +class COleObjectFactory; +class CDynLinkLibrary; + +struct AFX_CORE_STATE +{ +// Implementation +public: + CWinApp* m_pCurrentWinApp; + HINSTANCE m_hCurrentInstanceHandle; + HINSTANCE m_hCurrentResourceHandle; + LPCTSTR m_lpszCurrentAppName; + + // instance specific lists + CRuntimeClass* m_pFirstClass; + + // exceptions + AFX_TERM_PROC m_pfnTerminate; + +#ifdef _AFXDLL + CDynLinkLibrary* m_pFirstDLL; // start of DLL list + HINSTANCE m_appLangDLL; +#endif + +public: + AFX_CORE_STATE(); +}; + +#if defined(_AFXDLL) || defined(_AFXCTL) + #define AfxGetCoreState() (&AfxGetAppState()->m_coreState) +#else + extern AFX_DATA AFX_CORE_STATE _afxCoreState; + #define AfxGetCoreState() (&_afxCoreState) +#endif + +///////////////////////////////////////////////////////////////////////////// +// AFX_WIN_STATE + +class CView; +class CFrameWnd; + +struct AFX_WIN_STATE +{ +// Implementation +public: + // custom colors are held here and saved between calls + COLORREF m_crSavedCustom[16]; + + // gray dialog support + HBRUSH m_hDlgBkBrush; // dialog and message box background brush + COLORREF m_crDlgTextClr; +#ifdef _MAC + COLORREF m_crDlgBkClr; +#endif + +#if !defined(_MAC) && !defined(_USRDLL) && !defined(_AFXCTL) + // 3d controls support + BOOL m_bCtl3dInited; + HINSTANCE m_hCtl3dLib; + BOOL (WINAPI* m_pfnRegister)(HINSTANCE); + BOOL (WINAPI* m_pfnUnregister)(HINSTANCE); + BOOL (WINAPI* m_pfnAutoSubclass)(HINSTANCE); + BOOL (WINAPI* m_pfnUnAutoSubclass)(); + BOOL (WINAPI* m_pfnColorChange)(); + BOOL (WINAPI* m_pfnSubclassDlgEx)(HWND, DWORD); + void (WINAPI* m_pfnWinIniChange)(); + BOOL (WINAPI* m_pfnSubclassCtl)(HWND); + BOOL (WINAPI* m_pfnSubclassCtlEx)(HWND, int); +#endif + + // printing abort + BOOL m_bUserAbort; + + // pen support + void (CALLBACK* m_pfnRegisterPenAppProc)(UINT, BOOL); + + // application shutdown behavior + DWORD m_nObjectCount; + BOOL m_bUserCtrl; + +#if defined(_USRDLL) || defined(_AFXCTL) + TCHAR m_szUnregisterList[4096]; // per-process AfxRegisterClass data +#endif + +public: + AFX_WIN_STATE(); + ~AFX_WIN_STATE(); +}; + +#if defined(_AFXDLL) || defined(_AFXCTL) + #define AfxGetWinState() (&AfxGetAppState()->m_winState) +#else + extern AFX_DATA AFX_WIN_STATE _afxWinState; + #define AfxGetWinState() (&_afxWinState) +#endif + +///////////////////////////////////////////////////////////////////////////// +// AFX_EDIT_STATE : last find/replace state + +class CFindReplaceDialog; + +struct AFX_EDIT_STATE +{ + CFindReplaceDialog* pFindReplaceDlg; // find or replace dialog + BOOL bFindOnly; // Is pFindReplace the find or replace? + CString strFind; // last find string + CString strReplace; // last replace string + BOOL bCase; // TRUE==case sensitive, FALSE==not + int bNext; // TRUE==search down, FALSE== search up + + AFX_EDIT_STATE(); + ~AFX_EDIT_STATE(); +}; + + +#if defined(_WINDLL) || defined(_AFXDLL) + #define AfxGetEditState() (&AfxGetAppState()->m_editState) +#else + extern AFX_DATA AFX_EDIT_STATE _afxEditState; + #define AfxGetEditState() (&_afxEditState) +#endif + +///////////////////////////////////////////////////////////////////////////// +// AFX_OLE_STATE + +#undef AFX_DATA +#define AFX_DATA AFX_OLE_DATA + +class COleDataSource; + +struct AFX_OLE_STATE +{ +// Implementation +public: + COleObjectFactory* m_pFirstFactory; + + BOOL m_bNeedTerm; + BOOL m_bNeedTermCOM; + + CView* m_pActivateView; // activation view + COleDataSource* m_pClipboardSource; + +public: + AFX_OLE_STATE(); +}; + +#if defined(_AFXDLL) || defined(_AFXCTL) + #define AfxGetOleState() (&AfxGetAppState()->m_oleState) +#else + extern AFX_DATA AFX_OLE_STATE _afxOleState; + #define AfxGetOleState() (&_afxOleState) +#endif + +///////////////////////////////////////////////////////////////////////////// +// AFX_DB_STATE + +#undef AFX_DATA +#define AFX_DATA AFX_DB_DATA + +typedef void* HENV; // must match SQL.H + +struct AFX_DB_STATE +{ +// Implementation +public: + // MFC/DB global data + HENV m_henvAllConnections; // per-app HENV (CDatabase) + int m_nAllocatedConnections; // per-app reference to HENV above + +public: + AFX_DB_STATE(); +}; + +#if defined(_WINDLL) || defined(_AFXDLL) + #define AfxGetDbState() (&AfxGetAppState()->m_dbState) +#else + extern AFX_DATA AFX_DB_STATE _afxDbState; + #define AfxGetDbState() (&_afxDbState) +#endif + +///////////////////////////////////////////////////////////////////////////// +// AFX_MAIL_STATE + +struct AFX_MAIL_STATE +{ +// Implementation +public: + HINSTANCE m_hInstMail; // handle to MAPI32.DLL + +public: + ~AFX_MAIL_STATE(); +}; + +#if defined(_WINDLL) || defined(_AFXDLL) + #define AfxGetMailState() (&AfxGetAppState()->m_mailState) +#else + extern AFX_DATA AFX_MAIL_STATE _afxMailState; + #define AfxGetMailState() (&_afxMailState) +#endif + +///////////////////////////////////////////////////////////////////////////// +// AFX_SOCK_STATE + +struct AFX_SOCK_STATE +{ +// Implementation +public: + void (*m_lpfnCleanup)(); + +public: + ~AFX_SOCK_STATE(); +}; + +#if defined(_WINDLL) || defined(_AFXDLL) + #define AfxGetSockState() (&AfxGetAppState()->m_sockState) +#else + extern AFX_DATA AFX_SOCK_STATE _afxSockState; + #define AfxGetSockState() (&_afxSockState) +#endif + +///////////////////////////////////////////////////////////////////////////// +// AFX_ALLOC_STATE + +struct IMalloc; // must match OBJBASE.H +typedef IMalloc* LPMALLOC; + +struct AFX_ALLOC_STATE +{ +// Implementation +public: + LPMALLOC m_lpTaskMalloc; // OLE task allocator. + +#ifdef _DEBUG + // options for tuning the allocation diagnostics + CDumpContext m_afxDump; + BOOL m_bTraceEnabled; + int m_nTraceFlags; +#if defined(_USRDLL) || defined(_AFXDLL) + int m_nMemDF; // a global variable with static linking +#endif + + // memory diagnostics state + LONG m_lTotalAlloc; // total bytes of memory allocated + LONG m_lCurAlloc; // current bytes of memory allocated + LONG m_lMaxAlloc; // maximum bytes of memory allocated at any one time + + CBlockHeader* m_pFirstBlock; // add in reverse order + BOOL (AFXAPI *m_lpfnAssertFailedLine)(LPCSTR, int); +#endif + +public: + AFX_ALLOC_STATE(); +}; + +#if defined(_WINDLL) || defined(_AFXDLL) + #define AfxGetAllocState() (&AfxGetAppState()->m_allocState) +#else + extern AFX_DATA AFX_ALLOC_STATE _afxAllocState; + #define AfxGetAllocState() (&_afxAllocState) +#endif + +///////////////////////////////////////////////////////////////////////////// +// AFX_APP_STATE (only used for DLL versions) + +#undef AFX_DATA +#define AFX_DATA AFX_CORE_DATA + +#if defined(_WINDLL) || defined(_AFXDLL) + +struct AFX_MODULE_STATE +{ +// Implementation +public: +#ifdef _AFXCTL + AFX_MODULE_STATE* m_pID; // Uniquely identify where this data came from. +#endif +#if defined(_AFXDLL) || defined(_AFXCTL) + AFX_CORE_STATE m_coreState; + AFX_WIN_STATE m_winState; + AFX_OLE_STATE m_oleState; + +public: + AFX_MODULE_STATE(); + ~AFX_MODULE_STATE(); +#endif + +#ifdef _AFXCTL +public: + void* operator new(size_t nSize); + void operator delete(void* p); +#endif +}; + +struct AFX_APP_STATE : AFX_MODULE_STATE +{ +// Implementation +public: + AFX_DB_STATE m_dbState; + AFX_ALLOC_STATE m_allocState; + AFX_EDIT_STATE m_editState; + AFX_MAIL_STATE m_mailState; + AFX_SOCK_STATE m_sockState; + +#ifdef _AFXCTL + CMapPtrToPtr m_mapExtraData; // Extra data for OLE controls. +#endif + + void* AFX_CDECL operator new(size_t nSize); + void AFX_CDECL operator delete(void* p); + +public: + AFX_APP_STATE(); + ~AFX_APP_STATE(); +}; + +AFX_APP_STATE* AFXAPI AfxGetAppState(); + +#ifdef _AFXCTL +#define AfxGetExtraDataMap() (&AfxGetAppState()->m_mapExtraData) + +AFX_MODULE_STATE* AFXAPI AfxGetBaseModuleContext(); +AFX_MODULE_STATE* AFXAPI AfxGetCurrentModuleContext(); + +#define _afxModuleAddrCurrent AfxGetCurrentModuleContext() + +#define AFX_MANAGE_STATE(pData) AFX_MAINTAIN_STATE _ctlState(pData); + +#define METHOD_MANAGE_STATE(theClass, localClass) \ + METHOD_PROLOGUE_EX(theClass, localClass) \ + AFX_MANAGE_STATE(pThis->m_pModuleState) + +extern AFX_MODULE_STATE* AFXAPI AfxPushModuleContext(AFX_MODULE_STATE* psIn); +extern void AFXAPI AfxPopModuleContext(AFX_MODULE_STATE* psIn, + BOOL bCopy = FALSE); + +// When using this object, or the macros above that use this object +// it is necessary to insure that the object's destructor cannot be +// thrown past, by an unexpected exception. + +class AFX_MAINTAIN_STATE +{ +private: + AFX_MODULE_STATE* m_psPrevious; + +public: + AFX_MAINTAIN_STATE(AFX_MODULE_STATE* psData); + ~AFX_MAINTAIN_STATE(); +}; +#endif //_AFXCTL + +#endif //_WINDLL || _AFXDLL + +// Stub special OLE Control macros +#ifndef _AFXCTL +#define AFX_MANAGE_CTL_STATE() +#define METHOD_MANAGE_STATE(theClass, localClass) \ + METHOD_PROLOGUE_EX(theClass, localClass) +#endif + +///////////////////////////////////////////////////////////////////////////// +// CHandleMap (needed for AFX_THREAD_STATE) + +// Note: Do not access the members of this class directly. +// Use CWnd::FromHandle, CDC::FromHandle, etc. +// The actual definition is only included because it is +// necessary for the definition of CWinThread. +// +// Most Windows objects are represented with a HANDLE, including +// the most important ones, HWND, HDC, HPEN, HFONT etc. +// We want C++ objects to wrap these handle based objects whenever we can. +// Since Windows objects can be created outside of C++ (eg: calling +// ::CreateWindow will return an HWND with no C++ wrapper) we must +// support a reasonably uniform mapping from permanent handles +// (i.e. the ones allocated in C++) and temporary handles (i.e. +// the ones allocated in C, but passed through a C++ interface. +// We keep two dictionaries for this purpose. The permanent dictionary +// stores those C++ objects that have been explicitly created by +// the developer. The C++ constructor for the wrapper class will +// insert the mapping into the permanent dictionary and the C++ +// destructor will remove it and possibly free up the associated +// Windows object. +// When a handle passes through a C++ interface that doesn't exist in +// the permanent dictionary, we allocate a temporary wrapping object +// and store that mapping into the temporary dictionary. +// At idle time the temporary wrapping objects are flushed (since you better +// not be holding onto something you didn't create). +// + +class CWinThread; // forward reference for friend declaration + +class CHandleMap +{ +private: // implementation + CMapPtrToPtr m_permanentMap; + CMapPtrToPtr m_temporaryMap; + CRuntimeClass* m_pClass; + size_t m_nOffset; // offset of handles in the object + int m_nHandles; // 1 or 2 (for CDC) + +// Constructors +public: + CHandleMap(CRuntimeClass* pClass, size_t nOffset, int nHandles = 1); + +// Operations +public: + CObject* FromHandle(HANDLE h); + void DeleteTemp(); + + void SetPermanent(HANDLE h, CObject* permOb); + void RemoveHandle(HANDLE h); + + BOOL LookupPermanent(HANDLE h, CObject*& pObject); + BOOL LookupTemporary(HANDLE h, CObject*& pObject); + + friend class CWinThread; +}; + +// Note: out-of-line _DEBUG version is in winhand.cpp +#ifndef _DEBUG +inline void CHandleMap::SetPermanent(HANDLE h, CObject* permOb) + { m_permanentMap[(LPVOID)h] = permOb; } +#endif + +///////////////////////////////////////////////////////////////////////////// +// Thread global state + +class CWinThread; // forward reference (see afxwin.h) +class CWnd; // forward reference (see afxwin.h) + +struct AFX_THREAD_STATE +{ +// Implementation +public: + // current CWinThread pointer + CWinThread* m_pCurrentWinThread; + BOOL m_bInMsgFilter; + + // list of CFrameWnds for thread + CFrameWnd* m_pFirstFrameWnd; + + // memory safety pool for temp maps + void* m_pSafetyPoolBuffer; // current buffer + + // thread local exception context + AFX_EXCEPTION_CONTEXT m_exceptionContext; + + // temp map state + DWORD m_nTempMapLock; // if not 0, temp maps locked + CHandleMap* m_pmapHWND; + CHandleMap* m_pmapHMENU; + CHandleMap* m_pmapHDC; + CHandleMap* m_pmapHGDIOBJ; + + // CWnd create and gray dialog hook + CWnd* m_pWndInit; + HWND m_hWndInit; + BOOL m_bDlgCreate; + HHOOK m_hHookOldSendMsg; + HHOOK m_hHookOldCbtFilter; + + // other CWnd modal data + MSG m_lastSentMsg; // see CWnd::WindowProc + HWND m_hTrackingWindow; // see CWnd::TrackPopupMenu + HMENU m_hTrackingMenu; + TCHAR m_szTempClassName[64]; // see AfxRegisterWndClass + HWND m_hLockoutNotifyWindow; // see CWnd::OnCommand + + // other framework modal data + CView* m_pRoutingView; // see CCmdTarget::GetRoutingView + + // MFC/DB thread-local data + BOOL m_bWaitForDataSource; + +#ifndef _AFXCTL +#ifndef _USRDLL + HHOOK m_hHookOldMsgFilter; +#endif +#endif + + // WinSock specific thread state + HWND m_hSocketWindow; + CMapPtrToPtr m_mapSocketHandle; + CMapPtrToPtr m_mapDeadSockets; + CPtrList m_listSocketNotifications; + + // common controls thread state + CHandleMap* m_pmapHIMAGELIST; + + void* AFX_CDECL operator new(size_t nSize); +#ifdef _DEBUG + void* AFX_CDECL operator new(size_t nSize, LPCSTR lpszFileName, int nLine); +#endif + + void AFX_CDECL operator delete(void* p); + +public: + AFX_THREAD_STATE(); + ~AFX_THREAD_STATE(); +}; + +AFX_THREAD_STATE* AFXAPI AfxGetThreadState(); + +///////////////////////////////////////////////////////////////////////////// + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +#undef AFX_DATA +#define AFX_DATA + +#endif //__AFXSTATE_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxtempl.h b/public/sdk/inc/mfc30/afxtempl.h new file mode 100644 index 000000000..eab8cab45 --- /dev/null +++ b/public/sdk/inc/mfc30/afxtempl.h @@ -0,0 +1,1501 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXTEMPL_H__ +#define __AFXTEMPL_H__ + +#include <limits.h> +#include <string.h> + +#ifndef __AFXPLEX_H__ + #include <afxplex_.h> +#endif + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +#ifdef _DEBUG +static char _szAfxTempl[] = "afxtempl.h"; +#undef THIS_FILE +#define THIS_FILE _szAfxTempl +#endif + +#define new DEBUG_NEW + +///////////////////////////////////////////////////////////////////////////// +// global helpers (can be overridden) + +template<class TYPE> +inline void AFXAPI ConstructElements(TYPE* pElements, int nCount) +{ + ASSERT(nCount == 0 || + AfxIsValidAddress(pElements, nCount * sizeof(TYPE))); + + // default is bit-wise zero initialization + memset((void*)pElements, 0, nCount * sizeof(TYPE)); +} + +template<class TYPE> +inline void AFXAPI DestructElements(TYPE* pElements, int nCount) +{ + ASSERT(nCount == 0 || + AfxIsValidAddress(pElements, nCount * sizeof(TYPE))); + pElements; // not used + nCount; // not used + + // default does nothing +} + +template<class TYPE> +void AFXAPI SerializeElements(CArchive& ar, TYPE* pElements, int nCount) +{ + ASSERT(nCount == 0 || + AfxIsValidAddress(pElements, nCount * sizeof(TYPE))); + + // default is bit-wise read/write + if (ar.IsStoring()) + ar.Write((void*)pElements, nCount * sizeof(TYPE)); + else + ar.Read((void*)pElements, nCount * sizeof(TYPE)); +} + +#ifdef _DEBUG +template<class TYPE> +void AFXAPI DumpElements(CDumpContext& dc, const TYPE* pElements, int nCount) +{ + ASSERT(nCount == 0 || + AfxIsValidAddress(pElements, nCount * sizeof(TYPE))); + dc; // not used + pElements; // not used + nCount; // not used + + // default does nothing +} +#endif + +template<class TYPE, class ARG_TYPE> +BOOL AFXAPI CompareElements(const TYPE* pElement1, const ARG_TYPE* pElement2) +{ + ASSERT(AfxIsValidAddress(pElement1, sizeof(TYPE))); + ASSERT(AfxIsValidAddress(pElement2, sizeof(ARG_TYPE))); + + return *pElement1 == *pElement2; +} + +template<class ARG_KEY> +inline UINT AFXAPI HashKey(ARG_KEY key) +{ + // default identity hash - works for most primitive values + return ((UINT)(void*)(DWORD)key) >> 4; +} + +// special versions for CString +void AFXAPI SerializeElements(CArchive& ar, CString* pElements, int nCount); +void AFXAPI ConstructElements(CString* pElements, int nCount); +void AFXAPI DestructElements(CString* pElements, int nCount); +UINT AFXAPI HashKey(LPCTSTR key); + +///////////////////////////////////////////////////////////////////////////// +// CArray<TYPE, ARG_TYPE> + +template<class TYPE, class ARG_TYPE> +class CArray : public CObject +{ +public: +// Construction + CArray(); + +// Attributes + int GetSize() const; + int GetUpperBound() const; + void SetSize(int nNewSize, int nGrowBy = -1); + +// Operations + // Clean up + void FreeExtra(); + void RemoveAll(); + + // Accessing elements + TYPE GetAt(int nIndex) const; + void SetAt(int nIndex, ARG_TYPE newElement); + TYPE& ElementAt(int nIndex); + + // Potentially growing the array + void SetAtGrow(int nIndex, ARG_TYPE newElement); + int Add(ARG_TYPE newElement); + + // overloaded operator helpers + TYPE operator[](int nIndex) const; + TYPE& operator[](int nIndex); + + // Operations that move elements around + void InsertAt(int nIndex, ARG_TYPE newElement, int nCount = 1); + void RemoveAt(int nIndex, int nCount = 1); + void InsertAt(int nStartIndex, CArray* pNewArray); + +// Implementation +protected: + TYPE* m_pData; // the actual array of data + int m_nSize; // # of elements (upperBound - 1) + int m_nMaxSize; // max allocated + int m_nGrowBy; // grow amount + +public: + ~CArray(); + void Serialize(CArchive&); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif +}; + +///////////////////////////////////////////////////////////////////////////// +// CArray<TYPE, ARG_TYPE> inline functions + +template<class TYPE, class ARG_TYPE> +inline int CArray<TYPE, ARG_TYPE>::GetSize() const + { return m_nSize; } +template<class TYPE, class ARG_TYPE> +inline int CArray<TYPE, ARG_TYPE>::GetUpperBound() const + { return m_nSize-1; } +template<class TYPE, class ARG_TYPE> +inline void CArray<TYPE, ARG_TYPE>::RemoveAll() + { SetSize(0, -1); } +template<class TYPE, class ARG_TYPE> +inline TYPE CArray<TYPE, ARG_TYPE>::GetAt(int nIndex) const + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +template<class TYPE, class ARG_TYPE> +inline void CArray<TYPE, ARG_TYPE>::SetAt(int nIndex, ARG_TYPE newElement) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + m_pData[nIndex] = newElement; } +template<class TYPE, class ARG_TYPE> +inline TYPE& CArray<TYPE, ARG_TYPE>::ElementAt(int nIndex) + { ASSERT(nIndex >= 0 && nIndex < m_nSize); + return m_pData[nIndex]; } +template<class TYPE, class ARG_TYPE> +inline int CArray<TYPE, ARG_TYPE>::Add(ARG_TYPE newElement) + { int nIndex = m_nSize; + SetAtGrow(nIndex, newElement); + return nIndex; } +template<class TYPE, class ARG_TYPE> +inline TYPE CArray<TYPE, ARG_TYPE>::operator[](int nIndex) const + { return GetAt(nIndex); } +template<class TYPE, class ARG_TYPE> +inline TYPE& CArray<TYPE, ARG_TYPE>::operator[](int nIndex) + { return ElementAt(nIndex); } + +///////////////////////////////////////////////////////////////////////////// +// CArray<TYPE, ARG_TYPE> out-of-line functions + +template<class TYPE, class ARG_TYPE> +CArray<TYPE, ARG_TYPE>::CArray() +{ + m_pData = NULL; + m_nSize = m_nMaxSize = m_nGrowBy = 0; +} + +template<class TYPE, class ARG_TYPE> +CArray<TYPE, ARG_TYPE>::~CArray() +{ + ASSERT_VALID(this); + + if (m_pData != NULL) + { + DestructElements(m_pData, m_nSize); + delete[] (BYTE*)m_pData; + } +} + +template<class TYPE, class ARG_TYPE> +void CArray<TYPE, ARG_TYPE>::SetSize(int nNewSize, int nGrowBy) +{ + ASSERT_VALID(this); + ASSERT(nNewSize >= 0); + + if (nGrowBy != -1) + m_nGrowBy = nGrowBy; // set new size + + if (nNewSize == 0) + { + // shrink to nothing + if (m_pData != NULL) + { + DestructElements(m_pData, m_nSize); + delete[] (BYTE*)m_pData; + m_pData = NULL; + } + m_nSize = m_nMaxSize = 0; + } + else if (m_pData == NULL) + { + // create one with exact size +#ifdef SIZE_T_MAX + ASSERT(nNewSize <= SIZE_T_MAX/sizeof(TYPE)); // no overflow +#endif + m_pData = (TYPE*) new BYTE[nNewSize * sizeof(TYPE)]; + ConstructElements(m_pData, nNewSize); + m_nSize = m_nMaxSize = nNewSize; + } + else if (nNewSize <= m_nMaxSize) + { + // it fits + if (nNewSize > m_nSize) + { + // initialize the new elements + ConstructElements(&m_pData[m_nSize], nNewSize-m_nSize); + } + else if (m_nSize > nNewSize) + { + // destroy the old elements + DestructElements(&m_pData[nNewSize], m_nSize-nNewSize); + } + m_nSize = nNewSize; + } + else + { + // otherwise, grow array + int nGrowBy = m_nGrowBy; + if (nGrowBy == 0) + { + // heuristically determe growth when nGrowBy == 0 + // (this avoids heap fragmentation in many situations) + nGrowBy = min(1024, max(4, m_nSize / 8)); + } + int nNewMax; + if (nNewSize < m_nMaxSize + nGrowBy) + nNewMax = m_nMaxSize + nGrowBy; // granularity + else + nNewMax = nNewSize; // no slush + + ASSERT(nNewMax >= m_nMaxSize); // no wrap around +#ifdef SIZE_T_MAX + ASSERT(nNewMax <= SIZE_T_MAX/sizeof(TYPE)); // no overflow +#endif + TYPE* pNewData = (TYPE*) new BYTE[nNewMax * sizeof(TYPE)]; + + // copy new data from old + memcpy(pNewData, m_pData, m_nSize * sizeof(TYPE)); + + // construct remaining elements + ASSERT(nNewSize > m_nSize); + ConstructElements(&pNewData[m_nSize], nNewSize-m_nSize); + + // get rid of old stuff (note: no destructors called) + delete[] (BYTE*)m_pData; + m_pData = pNewData; + m_nSize = nNewSize; + m_nMaxSize = nNewMax; + } +} + +template<class TYPE, class ARG_TYPE> +void CArray<TYPE, ARG_TYPE>::FreeExtra() +{ + ASSERT_VALID(this); + + if (m_nSize != m_nMaxSize) + { + // shrink to desired size +#ifdef SIZE_T_MAX + ASSERT(m_nSize <= SIZE_T_MAX/sizeof(TYPE)); // no overflow +#endif + TYPE* pNewData = NULL; + if (m_nSize != 0) + { + pNewData = (TYPE*) new BYTE[m_nSize * sizeof(TYPE)]; + // copy new data from old + memcpy(pNewData, m_pData, m_nSize * sizeof(TYPE)); + } + + // get rid of old stuff (note: no destructors called) + delete[] (BYTE*)m_pData; + m_pData = pNewData; + m_nMaxSize = m_nSize; + } +} + +template<class TYPE, class ARG_TYPE> +void CArray<TYPE, ARG_TYPE>::SetAtGrow(int nIndex, ARG_TYPE newElement) +{ + ASSERT_VALID(this); + ASSERT(nIndex >= 0); + + if (nIndex >= m_nSize) + SetSize(nIndex+1, -1); + m_pData[nIndex] = newElement; +} + +template<class TYPE, class ARG_TYPE> +void CArray<TYPE, ARG_TYPE>::InsertAt(int nIndex, ARG_TYPE newElement, int nCount /*=1*/) +{ + ASSERT_VALID(this); + ASSERT(nIndex >= 0); // will expand to meet need + ASSERT(nCount > 0); // zero or negative size not allowed + + if (nIndex >= m_nSize) + { + // adding after the end of the array + SetSize(nIndex + nCount, -1); // grow so nIndex is valid + } + else + { + // inserting in the middle of the array + int nOldSize = m_nSize; + SetSize(m_nSize + nCount, -1); // grow it to new size + // shift old data up to fill gap + memmove(&m_pData[nIndex+nCount], &m_pData[nIndex], + (nOldSize-nIndex) * sizeof(TYPE)); + + // re-init slots we copied from + ConstructElements(&m_pData[nIndex], nCount); + } + + // insert new value in the gap + ASSERT(nIndex + nCount <= m_nSize); + while (nCount--) + m_pData[nIndex++] = newElement; +} + +template<class TYPE, class ARG_TYPE> +void CArray<TYPE, ARG_TYPE>::RemoveAt(int nIndex, int nCount) +{ + ASSERT_VALID(this); + ASSERT(nIndex >= 0); + ASSERT(nCount >= 0); + ASSERT(nIndex + nCount <= m_nSize); + + // just remove a range + int nMoveCount = m_nSize - (nIndex + nCount); + DestructElements(&m_pData[nIndex], nCount); + if (nMoveCount) + memcpy(&m_pData[nIndex], &m_pData[nIndex + nCount], + nMoveCount * sizeof(TYPE)); + m_nSize -= nCount; +} + +template<class TYPE, class ARG_TYPE> +void CArray<TYPE, ARG_TYPE>::InsertAt(int nStartIndex, CArray* pNewArray) +{ + ASSERT_VALID(this); + ASSERT(pNewArray != NULL); + ASSERT_VALID(pNewArray); + ASSERT(nStartIndex >= 0); + + if (pNewArray->GetSize() > 0) + { + InsertAt(nStartIndex, pNewArray->GetAt(0), pNewArray->GetSize()); + for (int i = 0; i < pNewArray->GetSize(); i++) + SetAt(nStartIndex + i, pNewArray->GetAt(i)); + } +} + +template<class TYPE, class ARG_TYPE> +void CArray<TYPE, ARG_TYPE>::Serialize(CArchive& ar) +{ + ASSERT_VALID(this); + + CObject::Serialize(ar); + if (ar.IsStoring()) + { + ar << (WORD) m_nSize; + } + else + { + WORD nOldSize; + ar >> nOldSize; + SetSize(nOldSize, -1); + } + SerializeElements(ar, m_pData, m_nSize); +} + +#ifdef _DEBUG +template<class TYPE, class ARG_TYPE> +void CArray<TYPE, ARG_TYPE>::Dump(CDumpContext& dc) const +{ + CObject::Dump(dc); + + dc << "with " << m_nSize << " elements"; + if (dc.GetDepth() > 0) + { + dc << "\n"; + DumpElements(dc, m_pData, m_nSize); + } + + dc << "\n"; +} + +template<class TYPE, class ARG_TYPE> +void CArray<TYPE, ARG_TYPE>::AssertValid() const +{ + CObject::AssertValid(); + + if (m_pData == NULL) + { + ASSERT(m_nSize == 0); + ASSERT(m_nMaxSize == 0); + } + else + { + ASSERT(m_nSize >= 0); + ASSERT(m_nMaxSize >= 0); + ASSERT(m_nSize <= m_nMaxSize); + ASSERT(AfxIsValidAddress(m_pData, m_nMaxSize * sizeof(TYPE))); + } +} +#endif //_DEBUG + +///////////////////////////////////////////////////////////////////////////// +// CList<TYPE, ARG_TYPE> + +template<class TYPE, class ARG_TYPE> +class CList : public CObject +{ +protected: + struct CNode + { + CNode* pNext; + CNode* pPrev; + TYPE data; + }; +public: +// Construction + CList(int nBlockSize = 10); + +// Attributes (head and tail) + // count of elements + int GetCount() const; + BOOL IsEmpty() const; + + // peek at head or tail + TYPE& GetHead(); + TYPE GetHead() const; + TYPE& GetTail(); + TYPE GetTail() const; + +// Operations + // get head or tail (and remove it) - don't call on empty list ! + TYPE RemoveHead(); + TYPE RemoveTail(); + + // add before head or after tail + POSITION AddHead(ARG_TYPE newElement); + POSITION AddTail(ARG_TYPE newElement); + + // add another list of elements before head or after tail + void AddHead(CList* pNewList); + void AddTail(CList* pNewList); + + // remove all elements + void RemoveAll(); + + // iteration + POSITION GetHeadPosition() const; + POSITION GetTailPosition() const; + TYPE& GetNext(POSITION& rPosition); // return *Position++ + TYPE GetNext(POSITION& rPosition) const; // return *Position++ + TYPE& GetPrev(POSITION& rPosition); // return *Position-- + TYPE GetPrev(POSITION& rPosition) const; // return *Position-- + + // getting/modifying an element at a given position + TYPE& GetAt(POSITION position); + TYPE GetAt(POSITION position) const; + void SetAt(POSITION pos, ARG_TYPE newElement); + void RemoveAt(POSITION position); + + // inserting before or after a given position + POSITION InsertBefore(POSITION position, ARG_TYPE newElement); + POSITION InsertAfter(POSITION position, ARG_TYPE newElement); + + // helper functions (note: O(n) speed) + POSITION Find(ARG_TYPE searchValue, POSITION startAfter = NULL) const; + // defaults to starting at the HEAD, return NULL if not found + POSITION FindIndex(int nIndex) const; + // get the 'nIndex'th element (may return NULL) + +// Implementation +protected: + CNode* m_pNodeHead; + CNode* m_pNodeTail; + int m_nCount; + CNode* m_pNodeFree; + struct CPlex* m_pBlocks; + int m_nBlockSize; + + CNode* NewNode(CNode*, CNode*); + void FreeNode(CNode*); + +public: + ~CList(); + void Serialize(CArchive&); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif +}; + +///////////////////////////////////////////////////////////////////////////// +// CList<TYPE, ARG_TYPE> inline functions + +template<class TYPE, class ARG_TYPE> +inline int CList<TYPE, ARG_TYPE>::GetCount() const + { return m_nCount; } +template<class TYPE, class ARG_TYPE> +inline BOOL CList<TYPE, ARG_TYPE>::IsEmpty() const + { return m_nCount == 0; } +template<class TYPE, class ARG_TYPE> +inline TYPE& CList<TYPE, ARG_TYPE>::GetHead() + { ASSERT(m_pNodeHead != NULL); + return m_pNodeHead->data; } +template<class TYPE, class ARG_TYPE> +inline TYPE CList<TYPE, ARG_TYPE>::GetHead() const + { ASSERT(m_pNodeHead != NULL); + return m_pNodeHead->data; } +template<class TYPE, class ARG_TYPE> +inline TYPE& CList<TYPE, ARG_TYPE>::GetTail() + { ASSERT(m_pNodeTail != NULL); + return m_pNodeTail->data; } +template<class TYPE, class ARG_TYPE> +inline TYPE CList<TYPE, ARG_TYPE>::GetTail() const + { ASSERT(m_pNodeTail != NULL); + return m_pNodeTail->data; } +template<class TYPE, class ARG_TYPE> +inline POSITION CList<TYPE, ARG_TYPE>::GetHeadPosition() const + { return (POSITION) m_pNodeHead; } +template<class TYPE, class ARG_TYPE> +inline POSITION CList<TYPE, ARG_TYPE>::GetTailPosition() const + { return (POSITION) m_pNodeTail; } +template<class TYPE, class ARG_TYPE> +inline TYPE& CList<TYPE, ARG_TYPE>::GetNext(POSITION& rPosition) // return *Position++ + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pNext; + return pNode->data; } +template<class TYPE, class ARG_TYPE> +inline TYPE CList<TYPE, ARG_TYPE>::GetNext(POSITION& rPosition) const // return *Position++ + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pNext; + return pNode->data; } +template<class TYPE, class ARG_TYPE> +inline TYPE& CList<TYPE, ARG_TYPE>::GetPrev(POSITION& rPosition) // return *Position-- + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pPrev; + return pNode->data; } +template<class TYPE, class ARG_TYPE> +inline TYPE CList<TYPE, ARG_TYPE>::GetPrev(POSITION& rPosition) const // return *Position-- + { CNode* pNode = (CNode*) rPosition; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + rPosition = (POSITION) pNode->pPrev; + return pNode->data; } +template<class TYPE, class ARG_TYPE> +inline TYPE& CList<TYPE, ARG_TYPE>::GetAt(POSITION position) + { CNode* pNode = (CNode*) position; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + return pNode->data; } +template<class TYPE, class ARG_TYPE> +inline TYPE CList<TYPE, ARG_TYPE>::GetAt(POSITION position) const + { CNode* pNode = (CNode*) position; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + return pNode->data; } +template<class TYPE, class ARG_TYPE> +inline void CList<TYPE, ARG_TYPE>::SetAt(POSITION pos, ARG_TYPE newElement) + { CNode* pNode = (CNode*) pos; + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + pNode->data = newElement; } + +template<class TYPE, class ARG_TYPE> +CList<TYPE, ARG_TYPE>::CList(int nBlockSize) +{ + ASSERT(nBlockSize > 0); + + m_nCount = 0; + m_pNodeHead = m_pNodeTail = m_pNodeFree = NULL; + m_pBlocks = NULL; + m_nBlockSize = nBlockSize; +} + +template<class TYPE, class ARG_TYPE> +void CList<TYPE, ARG_TYPE>::RemoveAll() +{ + ASSERT_VALID(this); + + // destroy elements + CNode* pNode; + for (pNode = m_pNodeHead; pNode != NULL; pNode = pNode->pNext) + DestructElements(&pNode->data, 1); + + m_nCount = 0; + m_pNodeHead = m_pNodeTail = m_pNodeFree = NULL; + m_pBlocks->FreeDataChain(); + m_pBlocks = NULL; +} + +template<class TYPE, class ARG_TYPE> +CList<TYPE, ARG_TYPE>::~CList() +{ + RemoveAll(); + ASSERT(m_nCount == 0); +} + +///////////////////////////////////////////////////////////////////////////// +// Node helpers +// +// Implementation note: CNode's are stored in CPlex blocks and +// chained together. Free blocks are maintained in a singly linked list +// using the 'pNext' member of CNode with 'm_pNodeFree' as the head. +// Used blocks are maintained in a doubly linked list using both 'pNext' +// and 'pPrev' as links and 'm_pNodeHead' and 'm_pNodeTail' +// as the head/tail. +// +// We never free a CPlex block unless the List is destroyed or RemoveAll() +// is used - so the total number of CPlex blocks may grow large depending +// on the maximum past size of the list. +// + +template<class TYPE, class ARG_TYPE> +CList<TYPE, ARG_TYPE>::CNode* +CList<TYPE, ARG_TYPE>::NewNode(CList::CNode* pPrev, CList::CNode* pNext) +{ + if (m_pNodeFree == NULL) + { + // add another block + CPlex* pNewBlock = CPlex::Create(m_pBlocks, m_nBlockSize, + sizeof(CNode)); + + // chain them into free list + CNode* pNode = (CNode*) pNewBlock->data(); + // free in reverse order to make it easier to debug + pNode += m_nBlockSize - 1; + for (int i = m_nBlockSize-1; i >= 0; i--, pNode--) + { + pNode->pNext = m_pNodeFree; + m_pNodeFree = pNode; + } + } + ASSERT(m_pNodeFree != NULL); // we must have something + + CList::CNode* pNode = m_pNodeFree; + m_pNodeFree = m_pNodeFree->pNext; + pNode->pPrev = pPrev; + pNode->pNext = pNext; + m_nCount++; + ASSERT(m_nCount > 0); // make sure we don't overflow + + ConstructElements(&pNode->data, 1); + return pNode; +} + +template<class TYPE, class ARG_TYPE> +void CList<TYPE, ARG_TYPE>::FreeNode(CList::CNode* pNode) +{ + DestructElements(&pNode->data, 1); + pNode->pNext = m_pNodeFree; + m_pNodeFree = pNode; + m_nCount--; + ASSERT(m_nCount >= 0); // make sure we don't underflow +} + +template<class TYPE, class ARG_TYPE> +POSITION CList<TYPE, ARG_TYPE>::AddHead(ARG_TYPE newElement) +{ + ASSERT_VALID(this); + + CNode* pNewNode = NewNode(NULL, m_pNodeHead); + pNewNode->data = newElement; + if (m_pNodeHead != NULL) + m_pNodeHead->pPrev = pNewNode; + else + m_pNodeTail = pNewNode; + m_pNodeHead = pNewNode; + return (POSITION) pNewNode; +} + +template<class TYPE, class ARG_TYPE> +POSITION CList<TYPE, ARG_TYPE>::AddTail(ARG_TYPE newElement) +{ + ASSERT_VALID(this); + + CNode* pNewNode = NewNode(m_pNodeTail, NULL); + pNewNode->data = newElement; + if (m_pNodeTail != NULL) + m_pNodeTail->pNext = pNewNode; + else + m_pNodeHead = pNewNode; + m_pNodeTail = pNewNode; + return (POSITION) pNewNode; +} + +template<class TYPE, class ARG_TYPE> +void CList<TYPE, ARG_TYPE>::AddHead(CList* pNewList) +{ + ASSERT_VALID(this); + + ASSERT(pNewList != NULL); + ASSERT_VALID(pNewList); + + // add a list of same elements to head (maintain order) + POSITION pos = pNewList->GetTailPosition(); + while (pos != NULL) + AddHead(pNewList->GetPrev(pos)); +} + +template<class TYPE, class ARG_TYPE> +void CList<TYPE, ARG_TYPE>::AddTail(CList* pNewList) +{ + ASSERT_VALID(this); + ASSERT(pNewList != NULL); + ASSERT_VALID(pNewList); + + // add a list of same elements + POSITION pos = pNewList->GetHeadPosition(); + while (pos != NULL) + AddTail(pNewList->GetNext(pos)); +} + +template<class TYPE, class ARG_TYPE> +TYPE CList<TYPE, ARG_TYPE>::RemoveHead() +{ + ASSERT_VALID(this); + ASSERT(m_pNodeHead != NULL); // don't call on empty list !!! + ASSERT(AfxIsValidAddress(m_pNodeHead, sizeof(CNode))); + + CNode* pOldNode = m_pNodeHead; + TYPE returnValue = pOldNode->data; + + m_pNodeHead = pOldNode->pNext; + if (m_pNodeHead != NULL) + m_pNodeHead->pPrev = NULL; + else + m_pNodeTail = NULL; + FreeNode(pOldNode); + return returnValue; +} + +template<class TYPE, class ARG_TYPE> +TYPE CList<TYPE, ARG_TYPE>::RemoveTail() +{ + ASSERT_VALID(this); + ASSERT(m_pNodeTail != NULL); // don't call on empty list !!! + ASSERT(AfxIsValidAddress(m_pNodeTail, sizeof(CNode))); + + CNode* pOldNode = m_pNodeTail; + TYPE returnValue = pOldNode->data; + + m_pNodeTail = pOldNode->pPrev; + if (m_pNodeTail != NULL) + m_pNodeTail->pNext = NULL; + else + m_pNodeHead = NULL; + FreeNode(pOldNode); + return returnValue; +} + +template<class TYPE, class ARG_TYPE> +POSITION CList<TYPE, ARG_TYPE>::InsertBefore(POSITION position, ARG_TYPE newElement) +{ + ASSERT_VALID(this); + + if (position == NULL) + return AddHead(newElement); // insert before nothing -> head of the list + + // Insert it before position + CNode* pOldNode = (CNode*) position; + CNode* pNewNode = NewNode(pOldNode->pPrev, pOldNode); + pNewNode->data = newElement; + + if (pOldNode->pPrev != NULL) + { + ASSERT(AfxIsValidAddress(pOldNode->pPrev, sizeof(CNode))); + pOldNode->pPrev->pNext = pNewNode; + } + else + { + ASSERT(pOldNode == m_pNodeHead); + m_pNodeHead = pNewNode; + } + pOldNode->pPrev = pNewNode; + return (POSITION) pNewNode; +} + +template<class TYPE, class ARG_TYPE> +POSITION CList<TYPE, ARG_TYPE>::InsertAfter(POSITION position, ARG_TYPE newElement) +{ + ASSERT_VALID(this); + + if (position == NULL) + return AddTail(newElement); // insert after nothing -> tail of the list + + // Insert it before position + CNode* pOldNode = (CNode*) position; + ASSERT(AfxIsValidAddress(pOldNode, sizeof(CNode))); + CNode* pNewNode = NewNode(pOldNode, pOldNode->pNext); + pNewNode->data = newElement; + + if (pOldNode->pNext != NULL) + { + ASSERT(AfxIsValidAddress(pOldNode->pNext, sizeof(CNode))); + pOldNode->pNext->pPrev = pNewNode; + } + else + { + ASSERT(pOldNode == m_pNodeTail); + m_pNodeTail = pNewNode; + } + pOldNode->pNext = pNewNode; + return (POSITION) pNewNode; +} + +template<class TYPE, class ARG_TYPE> +void CList<TYPE, ARG_TYPE>::RemoveAt(POSITION position) +{ + ASSERT_VALID(this); + + CNode* pOldNode = (CNode*) position; + ASSERT(AfxIsValidAddress(pOldNode, sizeof(CNode))); + + // remove pOldNode from list + if (pOldNode == m_pNodeHead) + { + m_pNodeHead = pOldNode->pNext; + } + else + { + ASSERT(AfxIsValidAddress(pOldNode->pPrev, sizeof(CNode))); + pOldNode->pPrev->pNext = pOldNode->pNext; + } + if (pOldNode == m_pNodeTail) + { + m_pNodeTail = pOldNode->pPrev; + } + else + { + ASSERT(AfxIsValidAddress(pOldNode->pNext, sizeof(CNode))); + pOldNode->pNext->pPrev = pOldNode->pPrev; + } + FreeNode(pOldNode); +} + +template<class TYPE, class ARG_TYPE> +POSITION CList<TYPE, ARG_TYPE>::FindIndex(int nIndex) const +{ + ASSERT_VALID(this); + ASSERT(nIndex >= 0); + + if (nIndex >= m_nCount) + return NULL; // went too far + + CNode* pNode = m_pNodeHead; + while (nIndex--) + { + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + pNode = pNode->pNext; + } + return (POSITION) pNode; +} + +template<class TYPE, class ARG_TYPE> +POSITION CList<TYPE, ARG_TYPE>::Find(ARG_TYPE searchValue, POSITION startAfter) const +{ + ASSERT_VALID(this); + + CNode* pNode = (CNode*) startAfter; + if (pNode == NULL) + { + pNode = m_pNodeHead; // start at head + } + else + { + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + pNode = pNode->pNext; // start after the one specified + } + + for (; pNode != NULL; pNode = pNode->pNext) + if (CompareElements(&pNode->data, &searchValue)) + return (POSITION)pNode; + return NULL; +} + +template<class TYPE, class ARG_TYPE> +void CList<TYPE, ARG_TYPE>::Serialize(CArchive& ar) +{ + ASSERT_VALID(this); + + CObject::Serialize(ar); + + if (ar.IsStoring()) + { + ar << (WORD) m_nCount; + for (CNode* pNode = m_pNodeHead; pNode != NULL; pNode = pNode->pNext) + { + ASSERT(AfxIsValidAddress(pNode, sizeof(CNode))); + SerializeElements(ar, &pNode->data, 1); + } + } + else + { + WORD nNewCount; + ar >> nNewCount; + + TYPE newData; + while (nNewCount--) + { + SerializeElements(ar, &newData, 1); + AddTail(newData); + } + } +} + +#ifdef _DEBUG +template<class TYPE, class ARG_TYPE> +void CList<TYPE, ARG_TYPE>::Dump(CDumpContext& dc) const +{ + CObject::Dump(dc); + + dc << "with " << m_nCount << " elements"; + if (dc.GetDepth() > 0) + { + POSITION pos = GetHeadPosition(); + while (pos != NULL) + { + dc << "\n"; + DumpElements(dc, &((CList*)this)->GetNext(pos), 1); + } + } + + dc << "\n"; +} + +template<class TYPE, class ARG_TYPE> +void CList<TYPE, ARG_TYPE>::AssertValid() const +{ + CObject::AssertValid(); + + if (m_nCount == 0) + { + // empty list + ASSERT(m_pNodeHead == NULL); + ASSERT(m_pNodeTail == NULL); + } + else + { + // non-empty list + ASSERT(AfxIsValidAddress(m_pNodeHead, sizeof(CNode))); + ASSERT(AfxIsValidAddress(m_pNodeTail, sizeof(CNode))); + } +} +#endif //_DEBUG + +///////////////////////////////////////////////////////////////////////////// +// CMap<KEY, ARG_KEY, VALUE, ARG_VALUE> + +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +class CMap : public CObject +{ +protected: + // Association + struct CAssoc + { + CAssoc* pNext; + UINT nHashValue; // needed for efficient iteration + KEY key; + VALUE value; + }; +public: +// Construction + CMap(int nBlockSize = 10); + +// Attributes + // number of elements + int GetCount() const; + BOOL IsEmpty() const; + + // Lookup + BOOL Lookup(ARG_KEY key, VALUE& rValue) const; + +// Operations + // Lookup and add if not there + VALUE& operator[](ARG_KEY key); + + // add a new (key, value) pair + void SetAt(ARG_KEY key, ARG_VALUE newValue); + + // removing existing (key, ?) pair + BOOL RemoveKey(ARG_KEY key); + void RemoveAll(); + + // iterating all (key, value) pairs + POSITION GetStartPosition() const; + void GetNextAssoc(POSITION& rNextPosition, KEY& rKey, VALUE& rValue) const; + + // advanced features for derived classes + UINT GetHashTableSize() const; + void InitHashTable(UINT hashSize, BOOL bAllocNow = TRUE); + +// Implementation +protected: + CAssoc** m_pHashTable; + UINT m_nHashTableSize; + int m_nCount; + CAssoc* m_pFreeList; + struct CPlex* m_pBlocks; + int m_nBlockSize; + + CAssoc* NewAssoc(); + void FreeAssoc(CAssoc*); + CAssoc* GetAssocAt(ARG_KEY, UINT&) const; + +public: + ~CMap(); + void Serialize(CArchive&); +#ifdef _DEBUG + void Dump(CDumpContext&) const; + void AssertValid() const; +#endif +}; + +///////////////////////////////////////////////////////////////////////////// +// CMap<KEY, ARG_KEY, VALUE, ARG_VALUE> inline functions + +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +inline int CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::GetCount() const + { return m_nCount; } +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +inline BOOL CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::IsEmpty() const + { return m_nCount == 0; } +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +inline void CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::SetAt(ARG_KEY key, ARG_VALUE newValue) + { (*this)[key] = newValue; } +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +inline POSITION CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::GetStartPosition() const + { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; } +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +inline UINT CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::GetHashTableSize() const + { return m_nHashTableSize; } + +///////////////////////////////////////////////////////////////////////////// +// CMap<KEY, ARG_KEY, VALUE, ARG_VALUE> out-of-line functions + +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::CMap(int nBlockSize) +{ + ASSERT(nBlockSize > 0); + + m_pHashTable = NULL; + m_nHashTableSize = 17; // default size + m_nCount = 0; + m_pFreeList = NULL; + m_pBlocks = NULL; + m_nBlockSize = nBlockSize; +} + +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +void CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::InitHashTable( + UINT nHashSize, BOOL bAllocNow) +// +// Used to force allocation of a hash table or to override the default +// hash table size of (which is fairly small) +{ + ASSERT_VALID(this); + ASSERT(m_nCount == 0); + ASSERT(nHashSize > 0); + + if (m_pHashTable != NULL) + { + // free hash table + delete[] m_pHashTable; + m_pHashTable = NULL; + } + + if (bAllocNow) + { + m_pHashTable = new CAssoc* [nHashSize]; + memset(m_pHashTable, 0, sizeof(CAssoc*) * nHashSize); + } + m_nHashTableSize = nHashSize; +} + +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +void CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::RemoveAll() +{ + ASSERT_VALID(this); + + if (m_pHashTable != NULL) + { + // destroy elements (values and keys) + for (UINT nHash = 0; nHash < m_nHashTableSize; nHash++) + { + CAssoc* pAssoc; + for (pAssoc = m_pHashTable[nHash]; pAssoc != NULL; + pAssoc = pAssoc->pNext) + { + DestructElements(&pAssoc->value, 1); + DestructElements(&pAssoc->key, 1); + } + } + } + + // free hash table + delete[] m_pHashTable; + m_pHashTable = NULL; + + m_nCount = 0; + m_pFreeList = NULL; + m_pBlocks->FreeDataChain(); + m_pBlocks = NULL; +} + +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::~CMap() +{ + RemoveAll(); + ASSERT(m_nCount == 0); +} + +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::CAssoc* +CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::NewAssoc() +{ + if (m_pFreeList == NULL) + { + // add another block + CPlex* newBlock = CPlex::Create(m_pBlocks, m_nBlockSize, sizeof(CMap::CAssoc)); + // chain them into free list + CMap::CAssoc* pAssoc = (CMap::CAssoc*) newBlock->data(); + // free in reverse order to make it easier to debug + pAssoc += m_nBlockSize - 1; + for (int i = m_nBlockSize-1; i >= 0; i--, pAssoc--) + { + pAssoc->pNext = m_pFreeList; + m_pFreeList = pAssoc; + } + } + ASSERT(m_pFreeList != NULL); // we must have something + + CMap::CAssoc* pAssoc = m_pFreeList; + m_pFreeList = m_pFreeList->pNext; + m_nCount++; + ASSERT(m_nCount > 0); // make sure we don't overflow + ConstructElements(&pAssoc->key, 1); + ConstructElements(&pAssoc->value, 1); // special construct values + return pAssoc; +} + +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +void CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::FreeAssoc(CMap::CAssoc* pAssoc) +{ + DestructElements(&pAssoc->value, 1); + DestructElements(&pAssoc->key, 1); + pAssoc->pNext = m_pFreeList; + m_pFreeList = pAssoc; + m_nCount--; + ASSERT(m_nCount >= 0); // make sure we don't underflow +} + +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::CAssoc* +CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::GetAssocAt(ARG_KEY key, UINT& nHash) const +// find association (or return NULL) +{ + nHash = HashKey(key) % m_nHashTableSize; + + if (m_pHashTable == NULL) + return NULL; + + // see if it exists + CAssoc* pAssoc; + for (pAssoc = m_pHashTable[nHash]; pAssoc != NULL; pAssoc = pAssoc->pNext) + { + if (CompareElements(&pAssoc->key, &key)) + return pAssoc; + } + return NULL; +} + +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +BOOL CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::Lookup(ARG_KEY key, VALUE& rValue) const +{ + ASSERT_VALID(this); + + UINT nHash; + CAssoc* pAssoc = GetAssocAt(key, nHash); + if (pAssoc == NULL) + return FALSE; // not in map + + rValue = pAssoc->value; + return TRUE; +} + +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +VALUE& CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::operator[](ARG_KEY key) +{ + ASSERT_VALID(this); + + UINT nHash; + CAssoc* pAssoc; + if ((pAssoc = GetAssocAt(key, nHash)) == NULL) + { + if (m_pHashTable == NULL) + InitHashTable(m_nHashTableSize); + + // it doesn't exist, add a new Association + pAssoc = NewAssoc(); + pAssoc->nHashValue = nHash; + pAssoc->key = key; + // 'pAssoc->value' is a constructed object, nothing more + + // put into hash table + pAssoc->pNext = m_pHashTable[nHash]; + m_pHashTable[nHash] = pAssoc; + } + return pAssoc->value; // return new reference +} + +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +BOOL CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::RemoveKey(ARG_KEY key) +// remove key - return TRUE if removed +{ + ASSERT_VALID(this); + + if (m_pHashTable == NULL) + return FALSE; // nothing in the table + + CAssoc** ppAssocPrev; + ppAssocPrev = &m_pHashTable[HashKey(key) % m_nHashTableSize]; + + CAssoc* pAssoc; + for (pAssoc = *ppAssocPrev; pAssoc != NULL; pAssoc = pAssoc->pNext) + { + if (CompareElements(&pAssoc->key, &key)) + { + // remove it + *ppAssocPrev = pAssoc->pNext; // remove from list + FreeAssoc(pAssoc); + return TRUE; + } + ppAssocPrev = &pAssoc->pNext; + } + return FALSE; // not found +} + +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +void CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::GetNextAssoc(POSITION& rNextPosition, + KEY& rKey, VALUE& rValue) const +{ + ASSERT_VALID(this); + ASSERT(m_pHashTable != NULL); // never call on empty map + + CAssoc* pAssocRet = (CAssoc*)rNextPosition; + ASSERT(pAssocRet != NULL); + + if (pAssocRet == (CAssoc*) BEFORE_START_POSITION) + { + // find the first association + for (UINT nBucket = 0; nBucket < m_nHashTableSize; nBucket++) + if ((pAssocRet = m_pHashTable[nBucket]) != NULL) + break; + ASSERT(pAssocRet != NULL); // must find something + } + + // find next association + ASSERT(AfxIsValidAddress(pAssocRet, sizeof(CAssoc))); + CAssoc* pAssocNext; + if ((pAssocNext = pAssocRet->pNext) == NULL) + { + // go to next bucket + for (UINT nBucket = pAssocRet->nHashValue + 1; + nBucket < m_nHashTableSize; nBucket++) + if ((pAssocNext = m_pHashTable[nBucket]) != NULL) + break; + } + + rNextPosition = (POSITION) pAssocNext; + + // fill in return data + rKey = pAssocRet->key; + rValue = pAssocRet->value; +} + +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +void CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::Serialize(CArchive& ar) +{ + ASSERT_VALID(this); + + CObject::Serialize(ar); + + if (ar.IsStoring()) + { + ar << (WORD) m_nCount; + if (m_nCount == 0) + return; // nothing more to do + + ASSERT(m_pHashTable != NULL); + for (UINT nHash = 0; nHash < m_nHashTableSize; nHash++) + { + CAssoc* pAssoc; + for (pAssoc = m_pHashTable[nHash]; pAssoc != NULL; + pAssoc = pAssoc->pNext) + { + SerializeElements(ar, &pAssoc->key, 1); + SerializeElements(ar, &pAssoc->value, 1); + } + } + } + else + { + WORD wNewCount; + ar >> wNewCount; + + KEY newKey; + VALUE newValue; + while (wNewCount--) + { + SerializeElements(ar, &newKey, 1); + SerializeElements(ar, &newValue, 1); + SetAt(newKey, newValue); + } + } +} + +#ifdef _DEBUG +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +void CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::Dump(CDumpContext& dc) const +{ + CObject::Dump(dc); + + dc << "with " << m_nCount << " elements"; + if (dc.GetDepth() > 0) + { + // Dump in format "[key] -> value" + KEY key; + VALUE val; + + POSITION pos = GetStartPosition(); + while (pos != NULL) + { + GetNextAssoc(pos, key, val); + dc << "\n\t["; + DumpElements(dc, &key, 1); + dc << "] = "; + DumpElements(dc, &val, 1); + } + } + + dc << "\n"; +} + +template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE> +void CMap<KEY, ARG_KEY, VALUE, ARG_VALUE>::AssertValid() const +{ + CObject::AssertValid(); + + ASSERT(m_nHashTableSize > 0); + ASSERT(m_nCount == 0 || m_pHashTable != NULL); + // non-empty map should have hash table +} +#endif //_DEBUG + +///////////////////////////////////////////////////////////////////////////// +// CTypedPtrArray<BASE_CLASS, TYPE> + +template<class BASE_CLASS, class TYPE> +class CTypedPtrArray : public BASE_CLASS +{ +public: + // Accessing elements + TYPE GetAt(int nIndex) const + { return (TYPE)BASE_CLASS::GetAt(nIndex); } + TYPE& ElementAt(int nIndex) + { return (TYPE&)BASE_CLASS::ElementAt(nIndex); } + + // overloaded operator helpers + TYPE operator[](int nIndex) const + { return (TYPE)BASE_CLASS::operator[](nIndex); } + TYPE& operator[](int nIndex) + { return (TYPE&)BASE_CLASS::operator[](nIndex); } +}; + +///////////////////////////////////////////////////////////////////////////// +// CTypedPtrList<BASE_CLASS, TYPE> + +template<class BASE_CLASS, class TYPE> +class CTypedPtrList : public BASE_CLASS +{ +public: + // peek at head or tail + TYPE& GetHead() + { return (TYPE&)BASE_CLASS::GetHead(); } + TYPE GetHead() const + { return (TYPE)BASE_CLASS::GetHead(); } + TYPE& GetTail() + { return (TYPE&)BASE_CLASS::GetTail(); } + TYPE GetTail() const + { return (TYPE)BASE_CLASS::GetTail(); } + + // get head or tail (and remove it) - don't call on empty list! + TYPE RemoveHead() + { return (TYPE)BASE_CLASS::RemoveHead(); } + TYPE RemoveTail() + { return (TYPE)BASE_CLASS::RemoveTail(); } + + // iteration + TYPE& GetNext(POSITION& rPosition) + { return (TYPE&)BASE_CLASS::GetNext(rPosition); } + TYPE GetNext(POSITION& rPosition) const + { return (TYPE)BASE_CLASS::GetNext(rPosition); } + TYPE& GetPrev(POSITION& rPosition) + { return (TYPE&)BASE_CLASS::GetPrev(rPosition); } + TYPE GetPrev(POSITION& rPosition) const + { return (TYPE)BASE_CLASS::GetPrev(rPosition); } + + // getting/modifying an element at a given position + TYPE& GetAt(POSITION position) + { return (TYPE&)BASE_CLASS::GetAt(position); } + TYPE GetAt(POSITION position) const + { return (TYPE)BASE_CLASS::GetAt(position); } +}; + +///////////////////////////////////////////////////////////////////////////// +// CTypedPtrMap<BASE_CLASS, KEY, VALUE> + +template<class BASE_CLASS, class KEY, class VALUE> +class CTypedPtrMap : public BASE_CLASS +{ +public: + // Lookup + BOOL Lookup(BASE_CLASS::BASE_ARG_KEY key, VALUE& rValue) const + { return BASE_CLASS::Lookup(key, (BASE_CLASS::BASE_VALUE&)rValue); } + + // Lookup and add if not there + VALUE& operator[](BASE_CLASS::BASE_ARG_KEY key) + { return (VALUE&)BASE_CLASS::operator[](key); } + + // iteration + void GetNextAssoc(POSITION& rPosition, KEY& rKey, VALUE& rValue) const + { BASE_CLASS::GetNextAssoc(rPosition, (BASE_CLASS::BASE_KEY&)rKey, + (BASE_CLASS::BASE_VALUE&)rValue); } +}; + +///////////////////////////////////////////////////////////////////////////// + +#undef THIS_FILE +#define THIS_FILE __FILE__ + +#undef new + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +#endif //__AFXTEMPL_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxv_cfg.h b/public/sdk/inc/mfc30/afxv_cfg.h new file mode 100644 index 000000000..6b6ea2818 --- /dev/null +++ b/public/sdk/inc/mfc30/afxv_cfg.h @@ -0,0 +1,7 @@ +// afxv_cfg.h - target configuration control for non-Microsoft compilers + +// You can define _AFX_PORTABLE in order to keep the library from using +// certain Microsoft extensions that are not commonly implemented by +// other compilers. + +#define _AFX_PORTABLE diff --git a/public/sdk/inc/mfc30/afxv_cpu.h b/public/sdk/inc/mfc30/afxv_cpu.h new file mode 100644 index 000000000..8b83ae8eb --- /dev/null +++ b/public/sdk/inc/mfc30/afxv_cpu.h @@ -0,0 +1,65 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// afxv_cpu.h - target version/configuration control for non-Intel CPUs + +#if !defined(_M_MRX000) && !defined(_M_ALPHA) && !defined(_M_PPC) && !defined(_M_M68K) && !defined(_M_MPPC) + #error afxv_cpu.h is only for MIPS R4000, DEC AXP, Motorola M68000, and Motorola PowerPC builds +#endif + +///////////////////////////////////////////////////////////////////////////// + +#ifdef _M_M68K +// specific overrides for MAC_68K... +#define AFXAPI __cdecl +#endif //_M_M68K + +///////////////////////////////////////////////////////////////////////////// + +#ifdef _M_MPPC +// specific overrides for MAC_PPC... +#define AFXAPI __cdecl +#endif //_M_MPPC + +///////////////////////////////////////////////////////////////////////////// + +#ifdef _MIPS_ +// specific overrides for MIPS... +#define _AFX_PACKING 8 // default MIPS alignment (required) +#define _AFX_NO_DB_SUPPORT +#endif //_MIPS_ + +///////////////////////////////////////////////////////////////////////////// + +#ifdef _ALPHA_ +#if (_MSC_VER < 900) +#pragma warning(disable: 4135) // common warning with Win32 headers +#define _AFX_NO_NESTED_DERIVATION +#endif +// specific overrides for ALPHA... +#define _AFX_PACKING 8 // default AXP alignment (required) +extern "C" void _BPT(); +#pragma intrinsic(_BPT) +#define AfxDebugBreak() _BPT() +#endif //_ALPHA_ + +///////////////////////////////////////////////////////////////////////////// + +#ifdef _PPC_ +#if (_MSC_VER < 900) +#pragma warning(disable: 4135) // common warning with Win32 headers +#define _AFX_NO_NESTED_DERIVATION +#endif +// specific overrides for PPC... + +#define _AFX_PACKING 8 // default PPC alignment (required) +#endif //_PPC_ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxv_dll.h b/public/sdk/inc/mfc30/afxv_dll.h new file mode 100644 index 000000000..66f26ef37 --- /dev/null +++ b/public/sdk/inc/mfc30/afxv_dll.h @@ -0,0 +1,53 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. +// +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// special header for _AFXDLL variant. + +// default AFX_XXX_DATA and AFX_XXX_DATADEF macros for using MFC DLLs + +#ifndef AFX_CORE_DATA + #define AFX_CORE_DATA AFX_DATA_IMPORT + #define AFX_CORE_DATADEF +#endif + +#ifndef AFX_OLE_DATA + #define AFX_OLE_DATA AFX_DATA_IMPORT + #define AFX_OLE_DATADEF +#endif + +#ifndef AFX_DB_DATA + #define AFX_DB_DATA AFX_DATA_IMPORT + #define AFX_DB_DATADEF +#endif + +#ifndef AFX_NET_DATA + #define AFX_NET_DATA AFX_DATA_IMPORT + #define AFX_NET_DATADEF +#endif + +// default AFX_EXT_DATA and AFX_EXT_DATADEF macros for using or +// creating MFC extension DLLs, depending on _AFX_EXT_IMPL +// AFX_EXT_CLASS can be used to import or export entire classes +// in an extension DLL without the hassle of creating a .DEF file +// with decorated names. + +#ifndef AFX_EXT_DATA + #ifdef _AFXEXT + #define AFX_EXT_CLASS AFX_CLASS_EXPORT + #define AFX_EXT_API AFX_API_EXPORT + #define AFX_EXT_DATA AFX_DATA_EXPORT + #define AFX_EXT_DATADEF + #else + #define AFX_EXT_CLASS AFX_CLASS_IMPORT + #define AFX_EXT_API AFX_API_IMPORT + #define AFX_EXT_DATA AFX_DATA_IMPORT + #define AFX_EXT_DATADEF + #endif +#endif diff --git a/public/sdk/inc/mfc30/afxv_mac.h b/public/sdk/inc/mfc30/afxv_mac.h new file mode 100644 index 000000000..ffc3bbf0e --- /dev/null +++ b/public/sdk/inc/mfc30/afxv_mac.h @@ -0,0 +1,57 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// afxv_mac.h - target version/configuration control for Macintosh OS + +#if !defined(_MAC) + #error afxv_mac.h is used only for Macintosh-targeted builds +#endif + +#if !defined(_M_M68K) && !defined(_M_MPPC) + #error afxv_mac.h is used only for Motorola M68000 and Motorola PowerPC builds +#endif + +#define SystemSevenOrLater 1 + +#define AFX_DATA_IMPORT +#define AFX_CLASS_IMPORT +#define AFX_API_IMPORT + +#if defined(_68K_) +pascal void AfxDebugger(void) = 0xA9FF; +#else +extern "C" pascal void Debugger(void); +inline void AfxDebugger(void) + { Debugger(); } +#endif + +#define AfxDebugBreak() AfxDebugger() + +#define _beginthreadex(p1, p2, p3, p4, p5, p6) NULL +#define _endthreadex(p1) + +extern "C" size_t __cdecl wcslen(const wchar_t*); + +#ifndef _HYPER_DEFINED +typedef double hyper; +#endif + +#define _AFX_NO_OLE_SUPPORT +#define _AFX_NO_DB_SUPPORT +#define _AFX_NO_SOCKET_SUPPORT + +#ifndef ALL_WARNINGS +#pragma warning(disable: 4103) +#ifdef _PPC_ +#pragma warning(disable:4069) +#endif +#endif //!ALL_WARNINGS + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxv_w32.h b/public/sdk/inc/mfc30/afxv_w32.h new file mode 100644 index 000000000..2856e24a8 --- /dev/null +++ b/public/sdk/inc/mfc30/afxv_w32.h @@ -0,0 +1,201 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// afxv_w32.h - target version/configuration control for Win32 + +#ifdef _WINDOWS_ + #error WINDOWS.H already included. MFC apps must not #include <windows.h> +#endif + +// STRICT is the only supported option (NOSTRICT is no longer supported) +#ifndef STRICT +#define STRICT 1 +#endif + +// certain parts of WINDOWS.H are necessary +#undef NOKERNEL +#undef NOGDI +#undef NOUSER +#undef NOSOUND +#undef NOCOMM +#undef NODRIVERS +#undef NOLOGERROR +#undef NOPROFILER +#undef NOMEMMGR +#undef NOLFILEIO +#undef NOOPENFILE +#undef NORESOURCE +#undef NOATOM +#undef NOLANGUAGE +#undef NOLSTRING +#undef NODBCS +#undef NOKEYBOARDINFO +#undef NOGDICAPMASKS +#undef NOCOLOR +#undef NOGDIOBJ +#undef NODRAWTEXT +#undef NOTEXTMETRIC +#undef NOSCALABLEFONT +#undef NOBITMAP +#undef NORASTEROPS +#undef NOMETAFILE +#undef NOSYSMETRICS +#undef NOSYSTEMPARAMSINFO +#undef NOMSG +#undef NOWINSTYLES +#undef NOWINOFFSETS +#undef NOSHOWWINDOW +#undef NODEFERWINDOWPOS +#undef NOVIRTUALKEYCODES +#undef NOKEYSTATES +#undef NOWH +#undef NOMENUS +#undef NOSCROLL +#undef NOCLIPBOARD +#undef NOICONS +#undef NOMB +#undef NOSYSCOMMANDS +#undef NOMDI +#undef NOCTLMGR +#undef NOWINMESSAGES + +#ifndef WIN32 +#define WIN32 +#endif + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#ifdef _MAC +#define _WIN32NLS +#define _WIN32REG +#define _WLM_NOFORCE_LIBS +#if defined(_WINDLL) || defined(_AFXDLL) +#define _WLMDLL +#endif +#endif + +///////////////////////////////////////////////////////////////////////////// +// Turn off warnings for /W4 +// To resume any of these warning: #pragma warning(default: 4xxx) +// which should be placed after the AFX include files + +#ifndef ALL_WARNINGS +#pragma warning(disable: 4201) // winnt.h uses nameless structs +#endif + +#ifdef _UNICODE +#ifndef UNICODE +#define UNICODE // UNICODE is used by Windows headers +#endif +#endif + +#ifdef UNICODE +#ifndef _UNICODE +#define _UNICODE // _UNICODE is used by C-runtime/MFC headers +#endif +#endif + +#include <windows.h> + +#ifndef WM_NOTIFY +// WM_NOTIFY is new in later versions of Win32 +#define WM_NOTIFY 0x004e +typedef struct tagNMHDR +{ + HWND hwndFrom; + UINT idFrom; + UINT code; +} NMHDR; +#endif //!WM_NOTIFY + +#ifndef _INC_COMMCTRL + #if (WINVER < 0x400) + #define _REDEF_WINVER + #undef WINVER + #define WINVER 0x0400 + #endif + #include <commctrl.h> + #ifdef _REDEF_WINVER + #undef _REDEF_WINVER + #undef WINVER + #define WINVER 0x030A + #endif +#endif + +#ifndef EXPORT +#define EXPORT +#endif + +#include <tchar.h> // used for ANSI v.s. UNICODE abstraction +#ifdef _MBCS +#include <mbctype.h> +#include <mbstring.h> +#endif + +///////////////////////////////////////////////////////////////////////////// +// Now for the Windows API specific parts + +// WM_CTLCOLOR for 16 bit API compatability +#define WM_CTLCOLOR 0x0019 + +// Win32 uses macros with parameters for this, which breaks C++ code. +#ifdef GetWindowTask +#undef GetWindowTask +inline HTASK GetWindowTask(HWND hWnd) + { return (HTASK)::GetWindowThreadProcessId(hWnd, NULL); } +#endif + +// Win32 uses macros with parameters for this, which breaks C++ code. +#ifdef GetNextWindow +#undef GetNextWindow +inline HWND GetNextWindow(HWND hWnd, UINT nDirection) + { return ::GetWindow(hWnd, nDirection); } +#endif + +// Win32 now includes lstrcpyn, but original Windows/NT didn't +#undef lstrcpyn +#define lstrcpyn afx_lstrcpyn +LPCTSTR WINAPI afx_lstrcpyn(LPTSTR, LPCTSTR, int); + +// Avoid Windows NT 3.1 bug in FindResource +#undef FindResource +#define FindResource AfxFindResource +HRSRC WINAPI +AfxFindResource(HINSTANCE hInstance, LPCTSTR lpstrName, LPCTSTR lpstrType); + +// Avoid Win95 mapping CToolBar::DrawState to DrawState[A/W] +#ifdef DrawState +#undef DrawState +inline BOOL WINAPI DrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC lpOutputFunc, + LPARAM lData, WPARAM wData, int x, int y, int cx, int cy, UINT fuFlags) +#ifdef UNICODE + { return ::DrawStateW(hdc, hbr, lpOutputFunc, lData, wData, x, y, cx, cy, + fuFlags); } +#else + { return ::DrawStateA(hdc, hbr, lpOutputFunc, lData, wData, x, y, cx, cy, + fuFlags); } +#endif +#endif + +// Avoid Win95 mapping CStatusBar::DrawStatusText to DrawStatusText[A/W] +#ifdef DrawStatusText +#undef DrawStatusText +inline void WINAPI DrawStatusText(HDC hDC, LPRECT lprc, LPTSTR szText, + UINT uFlags) +#ifdef UNICODE + { ::DrawStatusTextW(hDC, lprc, szText, uFlags); } +#else + { ::DrawStatusTextA(hDC, lprc, szText, uFlags); } +#endif +#endif + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxver_.h b/public/sdk/inc/mfc30/afxver_.h new file mode 100644 index 000000000..b8c9f855a --- /dev/null +++ b/public/sdk/inc/mfc30/afxver_.h @@ -0,0 +1,324 @@ + +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// afxver_.h - target version/configuration control + +///////////////////////////////////////////////////////////////////////////// +// Master version numbers + +#define _AFX 1 // Microsoft Application Framework Classes +#define _MFC_VER 0x0310 // Microsoft Foundation Classes 3.10 + +///////////////////////////////////////////////////////////////////////////// +// Default swap tuning for AFX library + +#ifndef _68K_ + #define _TEXTSEG(name) ".text$" #name +#else + #define _TEXTSEG(name) #name, "swappable" +#endif + +// Most segments are tuned via function order list (DLL version) +#ifndef _AFX_FUNCTION_ORDER +#define AFX_CORE1_SEG _TEXTSEG(AFX_CORE1) // core functionality +#define AFX_CORE2_SEG _TEXTSEG(AFX_CORE2) // more core functionality +#define AFX_CORE3_SEG _TEXTSEG(AFX_CORE3) // more core functionality +#define AFX_CORE4_SEG _TEXTSEG(AFX_CORE4) // more core functionality +#define AFX_AUX_SEG _TEXTSEG(AFX_AUX) // auxilliary functionality +#define AFX_COLL_SEG _TEXTSEG(AFX_COL1) // collections +#define AFX_COLL2_SEG _TEXTSEG(AFX_COL2) // more collections +#define AFX_OLE_SEG _TEXTSEG(AFX_OLE1) // OLE support +#define AFX_OLE2_SEG _TEXTSEG(AFX_OLE2) // more OLE support +#define AFX_OLE3_SEG _TEXTSEG(AFX_OLE3) // and more OLE support +#define AFX_OLE4_SEG _TEXTSEG(AFX_OLE4) // and more OLE support +#define AFX_OLE5_SEG _TEXTSEG(AFX_OLE5) // and even more OLE support +#define AFX_PRINT_SEG _TEXTSEG(AFX_PRNT) // Printing functionality +#define AFX_DBG1_SEG _TEXTSEG(AFX_DBG1) // inlines go here in _DEBUG +#define AFX_DBG2_SEG _TEXTSEG(AFX_DBG2) // inlines go here in _DEBUG +#define AFX_VDEL_SEG _TEXTSEG(AFX_VDEL) // vector deleting destructors +#define AFX_TERM_SEG _TEXTSEG(AFX_TERM) // cleanup routines +#define AFX_MAPI_SEG _TEXTSEG(AFX_MAPI) // simple MAPI support +#define AFX_SOCK_SEG _TEXTSEG(AFX_SOCK) // windows sockets support +#else +#define AFX_CORE1_SEG // core functionality +#define AFX_CORE2_SEG // more core functionality +#define AFX_CORE3_SEG // more core functionality +#define AFX_CORE4_SEG // more core functionality +#define AFX_AUX_SEG // auxilliary functionality +#define AFX_COLL_SEG // collections +#define AFX_COLL2_SEG // more collections +#define AFX_OLE_SEG // OLE support +#define AFX_OLE2_SEG // more OLE support +#define AFX_OLE3_SEG // and more OLE support +#define AFX_OLE4_SEG // and more OLE support +#define AFX_OLE5_SEG // and even more OLE support +#define AFX_PRINT_SEG // Printing functionality +#define AFX_DBG1_SEG // inlines go here in _DEBUG +#define AFX_DBG2_SEG // inlines go here in _DEBUG +#define AFX_VDEL_SEG // vector deleting destructors +#define AFX_TERM_SEG // cleanup routines +#define AFX_MAPI_SEG // simple MAPI support +#define AFX_SOCK_SEG // windows sockets support +#endif + +// AFX_INIT_SEG is hand tuned even in DLL version +#define AFX_INIT_SEG _TEXTSEG(AFX_INIT) // initialization + +///////////////////////////////////////////////////////////////////////////// +// For target version (one of) +// _CUSTOM : for custom configurations (causes afxv_cfg.h to be included) +// +// Additional build options: +// _DEBUG debug versions (full diagnostics) +// _WINDLL DLL version, used in conjunction with _USRDLL +// _USRDLL Statically linked DLL version +// _AFXDLL Use shared MFC DLL +// _AFXEXT extension DLL version, implies _AFXDLL +// _AFXCTL OLE Custom Controls runtime library + +#ifndef _DEBUG + #define _AFX_ENABLE_INLINES +#endif + +///////////////////////////////////////////////////////////////////////////// +// Special configurations + +// _AFXEXT implies _AFXDLL +#if defined(_AFXEXT) && !defined(_AFXDLL) + #define _AFXDLL +#endif + +#if defined(_WINDLL) && !defined(_USRDLL) && !defined(_AFXDLL) + #error Please define one of _AFXDLL, or _USRDLL with _WINDLL +#endif + +#if defined(_AFXDLL) && defined(_USRDLL) + #error Please define only one of _AFXDLL or _USRDLL +#endif + +#if defined(_USRDLL) && !defined(_WINDLL) + #error Please define _WINDLL along with _USRDLL +#endif + +#if defined(_AFXCTL) && !defined(_AFXDLL) + #error Please define _AFXDLL along with _AFXCTL +#endif + +#ifndef _MAC +#if defined(_AFXDLL) && !defined(_DLL) + #error Please use the /MD switch for _AFXDLL builds +#endif + +#if defined(_AFXDLL) && !defined(_MT) + #error Please use the /MD switch (multithreaded DLL C-runtime) +#endif +#endif + +///////////////////////////////////////////////////////////////////////////// +// special include files + +#include <afxv_w32.h> + +// Include any non-Intel platform specific items +#ifndef _X86_ + #include <afxv_cpu.h> +#endif + +// Include any non-Windows OS-specific items +#ifdef _MAC + #include <afxv_mac.h> +#endif + +#ifdef _CUSTOM +// Put any custom configuration items in afxv_cfg.h + #include <afxv_cfg.h> +#endif + +// setup default packing value +#ifndef _AFX_PACKING + #define _AFX_PACKING 4 // default packs structs at 4 bytes +#endif + +#ifdef _AFXDLL +// stand alone DLL (_WINDLL defined for DLL, not defined for app using DLL) + #include <afxv_dll.h> +#endif + +// Define this virtual key for use by status bar +#ifndef VK_KANA +#define VK_KANA 0x15 +#endif + +#if defined(_UNICODE) + #define _AFX_NO_DB_SUPPORT +#endif + +#define _AFX_NO_DB_SUPPORT +#define _AFX_OLD_EXCEPTIONS + +#define _istlead(_c) (0) + +#ifdef _UNICODE + #define _ttoi _wtoi +// #define _tcsftime wscftime + typedef wchar_t _TUCHAR; + #define _tWinMain wWinMain +#else + #define _ttoi atoi +// #define _tcsftime strftime + typedef unsigned char _TUCHAR; + #define _tWinMain WinMain +#endif + +///////////////////////////////////////////////////////////////////////////// +// Special AfxDebugBreak: used to break into debugger at critical times + +#ifndef AfxDebugBreak +// by default, debug break is asm int 3, or a call to DebugBreak, or nothing +#if defined(_M_IX86) && !defined(_AFX_PORTABLE) +#define AfxDebugBreak() _asm { int 3 } +#else +#define AfxDebugBreak() DebugBreak() +#endif +#endif + +#ifndef _DEBUG +#ifdef AfxDebugBreak +#undef AfxDebugBreak +#endif +#define AfxDebugBreak() +#endif // _DEBUG + +///////////////////////////////////////////////////////////////////////////// +// Standard preprocessor symbols if not already defined +///////////////////////////////////////////////////////////////////////////// + +// SIZE_T_MAX is used by the collection classes +#ifndef SIZE_T_MAX + #define SIZE_T_MAX UINT_MAX +#endif + +// PASCAL is used for static member functions +#ifndef PASCAL + #define PASCAL +#endif + +// CDECL and EXPORT are defined in case WINDOWS.H doesn't +#ifndef CDECL + #define CDECL __cdecl +#endif + +#ifndef EXPORT + #define EXPORT +#endif + +// UNALIGNED is used for unaligned data access (in CArchive mostly) +#ifndef UNALIGNED + #define UNALIGNED +#endif + +// AFXAPI is used on global public functions +#ifndef AFXAPI + #define AFXAPI __stdcall +#endif + +// AFX_CDECL is used for rare functions taking variable arguments +#ifndef AFX_CDECL + #define AFX_CDECL __cdecl +#endif + +// AFX_EXPORT is used for functions which need to be exported +#ifndef AFX_EXPORT + #define AFX_EXPORT EXPORT +#endif + +// The following macros are used to enable export/import + +// for data +#ifndef AFX_DATA_EXPORT + #define AFX_DATA_EXPORT __declspec(dllexport) +#endif +#ifndef AFX_DATA_IMPORT + #define AFX_DATA_IMPORT __declspec(dllimport) +#endif + +// for classes +#ifndef AFX_CLASS_EXPORT + #define AFX_CLASS_EXPORT __declspec(dllexport) +#endif +#ifndef AFX_CLASS_IMPORT + #define AFX_CLASS_IMPORT __declspec(dllimport) +#endif + +// for global APIs +#ifndef AFX_API_EXPORT + #define AFX_API_EXPORT __declspec(dllexport) +#endif +#ifndef AFX_API_IMPORT + #define AFX_API_IMPORT __declspec(dllimport) +#endif + +// The following macros are used on data declarations/definitions +// (they are redefined for extension DLLs and the shared MFC DLL) +#define AFX_DATA +#define AFX_DATADEF + +// used when building the "core" MFC30.DLL +#ifndef AFX_CORE_DATA + #define AFX_CORE_DATA + #define AFX_CORE_DATADEF +#endif + +// used when building the MFC/OLE support MFCO30.DLL +#ifndef AFX_OLE_DATA + #define AFX_OLE_DATA + #define AFX_OLE_DATADEF +#endif + +// used when building the MFC/DB support MFCD30.DLL +#ifndef AFX_DB_DATA + #define AFX_DB_DATA + #define AFX_DB_DATADEF +#endif + +// used when building the MFC/NET support MFCN30.DLL +#ifndef AFX_NET_DATA + #define AFX_NET_DATA + #define AFX_NET_DATADEF +#endif + +// used when building extension DLLs +#ifndef AFX_EXT_DATA + #define AFX_EXT_DATA + #define AFX_EXT_DATADEF + #define AFX_EXT_CLASS + #define AFX_EXT_API +#endif + +// BASED_XXXX macros are provided for backward compatibility +#ifndef BASED_CODE + #define BASED_CODE +#endif + +#ifndef BASED_DEBUG + #define BASED_DEBUG +#endif + +#ifndef BASED_STACK + #define BASED_STACK +#endif + +// setup default code segment +#ifdef AFX_DEF_SEG + #pragma code_seg(AFX_DEF_SEG) +#endif + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxwin.h b/public/sdk/inc/mfc30/afxwin.h new file mode 100644 index 000000000..fabdec92f --- /dev/null +++ b/public/sdk/inc/mfc30/afxwin.h @@ -0,0 +1,3755 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992-1993 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXWIN_H__ +#ifndef RC_INVOKED +#define __AFXWIN_H__ + +///////////////////////////////////////////////////////////////////////////// +// Make sure 'afx.h' is included first + +#ifndef __AFX_H__ + #include <afx.h> +#endif + +// Note: WINDOWS.H already included from AFXV_W32.H + +#include <shellapi.h> + +#ifndef __AFXRES_H__ + #include <afxres.h> // standard resource IDs +#endif + +#ifndef __AFXCOLL_H__ + #include <afxcoll.h> // standard collections +#endif + +#ifdef _INC_WINDOWSX +// The following names from WINDOWSX.H collide with names in this header +#undef SubclassWindow +#undef CopyRgn +#endif + +#ifdef _AFX_PACKING +#pragma pack(push, _AFX_PACKING) +#endif + +///////////////////////////////////////////////////////////////////////////// +// Classes declared in this file + +class CSize; +class CPoint; +class CRect; + +//CObject + //CException + class CResourceException;// Win resource failure exception + class CUserException; // Message Box alert and stop operation + + class CGdiObject; // CDC drawing tool + class CPen; // a pen / HPEN wrapper + class CBrush; // a brush / HBRUSH wrapper + class CFont; // a font / HFONT wrapper + class CBitmap; // a bitmap / HBITMAP wrapper + class CPalette; // a palette / HPALLETE wrapper + class CRgn; // a region / HRGN wrapper + + class CDC; // a Display Context / HDC wrapper + class CClientDC; // CDC for client of window + class CWindowDC; // CDC for entire window + class CPaintDC; // embeddable BeginPaint struct helper + + class CMenu; // a menu / HMENU wrapper + + class CCmdTarget; // a target for user commands + class CWnd; // a window / HWND wrapper + class CDialog; // a dialog + + // standard windows controls + class CStatic; // Static control + class CButton; // Button control + class CListBox; // ListBox control + class CComboBox; // ComboBox control + class CEdit; // Edit control + class CScrollBar; // ScrollBar control + + // frame windows + class CFrameWnd; // standard SDI frame +#ifndef _AFXCTL + class CMDIFrameWnd; // standard MDI frame + class CMDIChildWnd; // standard MDI child +#endif + class CMiniFrameWnd;// half-height caption frame wnd + + // views on a document + class CView; // a view on a document + class CScrollView; // a scrolling view + + class CWinThread; // thread base class + class CWinApp; // application base class + + class CDocTemplate; // template for document creation +#ifndef _AFXCTL + class CSingleDocTemplate;// SDI support + class CMultiDocTemplate; // MDI support +#endif + + class CDocument; // main document abstraction + + +// Helper classes +class CCmdUI; // Menu/button enabling +class CDataExchange; // Data exchange and validation context + +///////////////////////////////////////////////////////////////////////////// + +// Type modifier for message handlers +#ifndef afx_msg +#define afx_msg // intentional placeholder +#endif + +#undef AFX_DATA +#define AFX_DATA AFX_CORE_DATA + +///////////////////////////////////////////////////////////////////////////// +// CSize - An extent, similar to Windows SIZE structure. + +class CSize : public tagSIZE +{ +public: + +// Constructors + CSize(); + CSize(int initCX, int initCY); + CSize(SIZE initSize); + CSize(POINT initPt); + CSize(DWORD dwSize); + +// Operations + BOOL operator==(SIZE size) const; + BOOL operator!=(SIZE size) const; + void operator+=(SIZE size); + void operator-=(SIZE size); + +// Operators returning CSize values + CSize operator+(SIZE size) const; + CSize operator-(SIZE size) const; + CSize operator-() const; +}; + +///////////////////////////////////////////////////////////////////////////// +// CPoint - A 2-D point, similar to Windows POINT structure. + +class CPoint : public tagPOINT +{ +public: + +// Constructors + CPoint(); + CPoint(int initX, int initY); + CPoint(POINT initPt); + CPoint(SIZE initSize); + CPoint(DWORD dwPoint); + +// Operations + void Offset(int xOffset, int yOffset); + void Offset(POINT point); + void Offset(SIZE size); + BOOL operator==(POINT point) const; + BOOL operator!=(POINT point) const; + void operator+=(SIZE size); + void operator-=(SIZE size); + +// Operators returning CPoint values + CPoint operator+(SIZE size) const; + CPoint operator-(SIZE size) const; + CPoint operator-() const; + +// Operators returning CSize values + CSize operator-(POINT point) const; +}; + +///////////////////////////////////////////////////////////////////////////// +// CRect - A 2-D rectangle, similar to Windows RECT structure. + +typedef const RECT* LPCRECT; // pointer to read/only RECT + +class CRect : public tagRECT +{ +public: + +// Constructors + CRect(); + CRect(int l, int t, int r, int b); + CRect(const RECT& srcRect); + CRect(LPCRECT lpSrcRect); + CRect(POINT point, SIZE size); + +// Attributes (in addition to RECT members) + int Width() const; + int Height() const; + CSize Size() const; + CPoint& TopLeft(); + CPoint& BottomRight(); + + // convert between CRect and LPRECT/LPCRECT (no need for &) + operator LPRECT(); + operator LPCRECT() const; + + BOOL IsRectEmpty() const; + BOOL IsRectNull() const; + BOOL PtInRect(POINT point) const; + +// Operations + void SetRect(int x1, int y1, int x2, int y2); + void SetRectEmpty(); + void CopyRect(LPCRECT lpSrcRect); + BOOL EqualRect(LPCRECT lpRect) const; + + void InflateRect(int x, int y); + void InflateRect(SIZE size); + void OffsetRect(int x, int y); + void OffsetRect(SIZE size); + void OffsetRect(POINT point); + void NormalizeRect(); + + // operations that fill '*this' with result + BOOL IntersectRect(LPCRECT lpRect1, LPCRECT lpRect2); + BOOL UnionRect(LPCRECT lpRect1, LPCRECT lpRect2); + BOOL SubtractRect(LPCRECT lpRectSrc1, LPCRECT lpRectSrc2); + +// Additional Operations + void operator=(const RECT& srcRect); + BOOL operator==(const RECT& rect) const; + BOOL operator!=(const RECT& rect) const; + void operator+=(POINT point); + void operator-=(POINT point); + void operator&=(const RECT& rect); + void operator|=(const RECT& rect); + +// Operators returning CRect values + CRect operator+(POINT point) const; + CRect operator-(POINT point) const; + CRect operator&(const RECT& rect2) const; + CRect operator|(const RECT& rect2) const; +}; + +#ifdef _DEBUG +// Diagnostic Output +CDumpContext& AFXAPI operator<<(CDumpContext& dc, SIZE size); +CDumpContext& AFXAPI operator<<(CDumpContext& dc, POINT point); +CDumpContext& AFXAPI operator<<(CDumpContext& dc, const RECT& rect); +#endif //_DEBUG + +// Serialization +CArchive& AFXAPI operator<<(CArchive& ar, SIZE size); +CArchive& AFXAPI operator<<(CArchive& ar, POINT point); +CArchive& AFXAPI operator<<(CArchive& ar, const RECT& rect); +CArchive& AFXAPI operator>>(CArchive& ar, SIZE& size); +CArchive& AFXAPI operator>>(CArchive& ar, POINT& point); +CArchive& AFXAPI operator>>(CArchive& ar, RECT& rect); + +///////////////////////////////////////////////////////////////////////////// +// Standard exceptions + +class CResourceException : public CException // resource failure +{ + DECLARE_DYNAMIC(CResourceException) +public: + CResourceException(); + +// Implementation + CResourceException(BOOL bAutoDelete); + virtual ~CResourceException(); +}; + +class CUserException : public CException // general user visible alert +{ + DECLARE_DYNAMIC(CUserException) +public: + CUserException(); + +// Implementation + CUserException(BOOL bAutoDelete); + virtual ~CUserException(); +}; + +void AFXAPI AfxThrowResourceException(); +void AFXAPI AfxThrowUserException(); + +///////////////////////////////////////////////////////////////////////////// +// CGdiObject abstract class for CDC SelectObject + +class CGdiObject : public CObject +{ + DECLARE_DYNCREATE(CGdiObject) +public: + +// Attributes + HGDIOBJ m_hObject; // must be first data member + HGDIOBJ GetSafeHandle() const; + + static CGdiObject* PASCAL FromHandle(HGDIOBJ hObject); + static void PASCAL DeleteTempMap(); + BOOL Attach(HGDIOBJ hObject); + HGDIOBJ Detach(); + +// Constructors + CGdiObject(); // must Create a derived class object + BOOL DeleteObject(); + +// Operations + int GetObject(int nCount, LPVOID lpObject) const; + UINT GetObjectType() const; + BOOL CreateStockObject(int nIndex); + BOOL UnrealizeObject(); + +// Implementation +public: + virtual ~CGdiObject(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; + virtual void AssertValid() const; +#endif +}; + +///////////////////////////////////////////////////////////////////////////// +// CGdiObject subclasses (drawing tools) + +class CPen : public CGdiObject +{ + DECLARE_DYNAMIC(CPen) + +public: + static CPen* PASCAL FromHandle(HPEN hPen); + +// Constructors + CPen(); + CPen(int nPenStyle, int nWidth, COLORREF crColor); +#ifndef _MAC + CPen(int nPenStyle, int nWidth, const LOGBRUSH* pLogBrush, + int nStyleCount = 0, const DWORD* lpStyle = NULL); +#endif + BOOL CreatePen(int nPenStyle, int nWidth, COLORREF crColor); +#ifndef _MAC + BOOL CreatePen(int nPenStyle, int nWidth, const LOGBRUSH* pLogBrush, + int nStyleCount = 0, const DWORD* lpStyle = NULL); +#endif + BOOL CreatePenIndirect(LPLOGPEN lpLogPen); + +// Implementation +public: + virtual ~CPen(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; +#endif +}; + +class CBrush : public CGdiObject +{ + DECLARE_DYNAMIC(CBrush) + +public: + static CBrush* PASCAL FromHandle(HBRUSH hBrush); + +// Constructors + CBrush(); + CBrush(COLORREF crColor); // CreateSolidBrush + CBrush(int nIndex, COLORREF crColor); // CreateHatchBrush + CBrush(CBitmap* pBitmap); // CreatePatternBrush + + BOOL CreateSolidBrush(COLORREF crColor); + BOOL CreateHatchBrush(int nIndex, COLORREF crColor); + BOOL CreateBrushIndirect(LPLOGBRUSH lpLogBrush); + BOOL CreatePatternBrush(CBitmap* pBitmap); + BOOL CreateDIBPatternBrush(HGLOBAL hPackedDIB, UINT nUsage); + BOOL CreateDIBPatternBrush(const void* lpPackedDIB, UINT nUsage); + +// Implementation +public: + virtual ~CBrush(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; +#endif +}; + +class CFont : public CGdiObject +{ + DECLARE_DYNAMIC(CFont) + +public: + static CFont* PASCAL FromHandle(HFONT hFont); + +// Constructors + CFont(); + BOOL CreateFontIndirect(const LOGFONT* lpLogFont); + BOOL CreateFont(int nHeight, int nWidth, int nEscapement, + int nOrientation, int nWeight, BYTE bItalic, BYTE bUnderline, + BYTE cStrikeOut, BYTE nCharSet, BYTE nOutPrecision, + BYTE nClipPrecision, BYTE nQuality, BYTE nPitchAndFamily, + LPCTSTR lpszFacename); +// Implementation +public: + virtual ~CFont(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; +#endif +}; + +class CBitmap : public CGdiObject +{ + DECLARE_DYNAMIC(CBitmap) + +public: + static CBitmap* PASCAL FromHandle(HBITMAP hBitmap); + +// Constructors + CBitmap(); + + BOOL LoadBitmap(LPCTSTR lpszResourceName); + BOOL LoadBitmap(UINT nIDResource); +#ifndef _MAC + BOOL LoadOEMBitmap(UINT nIDBitmap); // for OBM_/OCR_/OIC_ +#endif + BOOL CreateBitmap(int nWidth, int nHeight, UINT nPlanes, UINT nBitcount, + const void* lpBits); + BOOL CreateBitmapIndirect(LPBITMAP lpBitmap); + BOOL CreateCompatibleBitmap(CDC* pDC, int nWidth, int nHeight); + BOOL CreateDiscardableBitmap(CDC* pDC, int nWidth, int nHeight); + +// Operations + DWORD SetBitmapBits(DWORD dwCount, const void* lpBits); + DWORD GetBitmapBits(DWORD dwCount, LPVOID lpBits) const; + CSize SetBitmapDimension(int nWidth, int nHeight); + CSize GetBitmapDimension() const; + +// Implementation +public: + virtual ~CBitmap(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; +#endif +}; + +class CPalette : public CGdiObject +{ + DECLARE_DYNAMIC(CPalette) + +public: + static CPalette* PASCAL FromHandle(HPALETTE hPalette); + +// Constructors + CPalette(); + BOOL CreatePalette(LPLOGPALETTE lpLogPalette); +#ifndef _MAC + BOOL CreateHalftonePalette(CDC* pDC); +#endif + +// Operations + UINT GetPaletteEntries(UINT nStartIndex, UINT nNumEntries, + LPPALETTEENTRY lpPaletteColors) const; + UINT SetPaletteEntries(UINT nStartIndex, UINT nNumEntries, + LPPALETTEENTRY lpPaletteColors); +#ifndef _MAC + void AnimatePalette(UINT nStartIndex, UINT nNumEntries, + LPPALETTEENTRY lpPaletteColors); +#endif + UINT GetNearestPaletteIndex(COLORREF crColor) const; + BOOL ResizePalette(UINT nNumEntries); + +// Implementation + virtual ~CPalette(); +}; + +class CRgn : public CGdiObject +{ + DECLARE_DYNAMIC(CRgn) + +public: + static CRgn* PASCAL FromHandle(HRGN hRgn); + +// Constructors + CRgn(); + BOOL CreateRectRgn(int x1, int y1, int x2, int y2); + BOOL CreateRectRgnIndirect(LPCRECT lpRect); + BOOL CreateEllipticRgn(int x1, int y1, int x2, int y2); + BOOL CreateEllipticRgnIndirect(LPCRECT lpRect); + BOOL CreatePolygonRgn(LPPOINT lpPoints, int nCount, int nMode); +#ifndef _MAC + BOOL CreatePolyPolygonRgn(LPPOINT lpPoints, LPINT lpPolyCounts, + int nCount, int nPolyFillMode); +#endif + BOOL CreateRoundRectRgn(int x1, int y1, int x2, int y2, int x3, int y3); +#ifndef _MAC + BOOL CreateFromPath(CDC* pDC); + BOOL CreateFromData(const XFORM* lpXForm, int nCount, + const RGNDATA* pRgnData); +#endif + +// Operations + void SetRectRgn(int x1, int y1, int x2, int y2); + void SetRectRgn(LPCRECT lpRect); + int CombineRgn(CRgn* pRgn1, CRgn* pRgn2, int nCombineMode); + int CopyRgn(CRgn* pRgnSrc); + BOOL EqualRgn(CRgn* pRgn) const; + int OffsetRgn(int x, int y); + int OffsetRgn(POINT point); + int GetRgnBox(LPRECT lpRect) const; + BOOL PtInRegion(int x, int y) const; + BOOL PtInRegion(POINT point) const; + BOOL RectInRegion(LPCRECT lpRect) const; +#ifndef _MAC + int GetRegionData(LPRGNDATA lpRgnData, int nCount) const; +#endif + +// Implementation + virtual ~CRgn(); +}; + +///////////////////////////////////////////////////////////////////////////// +// The device context + +class CDC : public CObject +{ + DECLARE_DYNCREATE(CDC) +public: + +// Attributes + HDC m_hDC; // The output DC (must be first data member) + HDC m_hAttribDC; // The Attribute DC + HDC GetSafeHdc() const; // Always returns the Output DC + + static CDC* PASCAL FromHandle(HDC hDC); + static void PASCAL DeleteTempMap(); + BOOL Attach(HDC hDC); // Attach/Detach affects only the Output DC + HDC Detach(); + + virtual void SetAttribDC(HDC hDC); // Set the Attribute DC + virtual void SetOutputDC(HDC hDC); // Set the Output DC + virtual void ReleaseAttribDC(); // Release the Attribute DC + virtual void ReleaseOutputDC(); // Release the Output DC + + BOOL IsPrinting() const; // TRUE if being used for printing + + CPen* GetCurrentPen() const; + CBrush* GetCurrentBrush() const; + CPalette* GetCurrentPalette() const; + CFont* GetCurrentFont() const; + CBitmap* GetCurrentBitmap() const; + +// Constructors + CDC(); + BOOL CreateDC(LPCTSTR lpszDriverName, LPCTSTR lpszDeviceName, + LPCTSTR lpszOutput, const void* lpInitData); + BOOL CreateIC(LPCTSTR lpszDriverName, LPCTSTR lpszDeviceName, + LPCTSTR lpszOutput, const void* lpInitData); + BOOL CreateCompatibleDC(CDC* pDC); + + BOOL DeleteDC(); + +// Device-Context Functions + virtual int SaveDC(); + virtual BOOL RestoreDC(int nSavedDC); + int GetDeviceCaps(int nIndex) const; +#ifndef _MAC + UINT SetBoundsRect(LPCRECT lpRectBounds, UINT flags); + UINT GetBoundsRect(LPRECT lpRectBounds, UINT flags); +#endif + BOOL ResetDC(const DEVMODE* lpDevMode); + +// Drawing-Tool Functions + CPoint GetBrushOrg() const; + CPoint SetBrushOrg(int x, int y); + CPoint SetBrushOrg(POINT point); + int EnumObjects(int nObjectType, + int (CALLBACK EXPORT* lpfn)(LPVOID, LPARAM), LPARAM lpData); + +// Type-safe selection helpers +public: + virtual CGdiObject* SelectStockObject(int nIndex); + CPen* SelectObject(CPen* pPen); + CBrush* SelectObject(CBrush* pBrush); + virtual CFont* SelectObject(CFont* pFont); + CBitmap* SelectObject(CBitmap* pBitmap); + int SelectObject(CRgn* pRgn); // special return for regions + CGdiObject* SelectObject(CGdiObject* pObject); + // CGdiObject* provided so compiler doesn't use SelectObject(HGDIOBJ) + +// Color and Color Palette Functions + COLORREF GetNearestColor(COLORREF crColor) const; + CPalette* SelectPalette(CPalette* pPalette, BOOL bForceBackground); + UINT RealizePalette(); + void UpdateColors(); + +// Drawing-Attribute Functions + COLORREF GetBkColor() const; + int GetBkMode() const; + int GetPolyFillMode() const; + int GetROP2() const; + int GetStretchBltMode() const; + COLORREF GetTextColor() const; + + virtual COLORREF SetBkColor(COLORREF crColor); + int SetBkMode(int nBkMode); + int SetPolyFillMode(int nPolyFillMode); + int SetROP2(int nDrawMode); + int SetStretchBltMode(int nStretchMode); + virtual COLORREF SetTextColor(COLORREF crColor); + +#ifndef _MAC + BOOL GetColorAdjustment(LPCOLORADJUSTMENT lpColorAdjust) const; + BOOL SetColorAdjustment(const COLORADJUSTMENT* lpColorAdjust); +#endif + +// Mapping Functions + int GetMapMode() const; + CPoint GetViewportOrg() const; + virtual int SetMapMode(int nMapMode); + // Viewport Origin + virtual CPoint SetViewportOrg(int x, int y); + CPoint SetViewportOrg(POINT point); + virtual CPoint OffsetViewportOrg(int nWidth, int nHeight); + + // Viewport Extent + CSize GetViewportExt() const; + virtual CSize SetViewportExt(int cx, int cy); + CSize SetViewportExt(SIZE size); + virtual CSize ScaleViewportExt(int xNum, int xDenom, int yNum, int yDenom); + + // Window Origin + CPoint GetWindowOrg() const; + CPoint SetWindowOrg(int x, int y); + CPoint SetWindowOrg(POINT point); + CPoint OffsetWindowOrg(int nWidth, int nHeight); + + // Window extent + CSize GetWindowExt() const; + virtual CSize SetWindowExt(int cx, int cy); + CSize SetWindowExt(SIZE size); + virtual CSize ScaleWindowExt(int xNum, int xDenom, int yNum, int yDenom); + +// Coordinate Functions + void DPtoLP(LPPOINT lpPoints, int nCount = 1) const; + void DPtoLP(LPRECT lpRect) const; + void DPtoLP(LPSIZE lpSize) const; + void LPtoDP(LPPOINT lpPoints, int nCount = 1) const; + void LPtoDP(LPRECT lpRect) const; + void LPtoDP(LPSIZE lpSize) const; + +// Special Coordinate Functions (useful for dealing with metafiles and OLE) + void DPtoHIMETRIC(LPSIZE lpSize) const; + void LPtoHIMETRIC(LPSIZE lpSize) const; + void HIMETRICtoDP(LPSIZE lpSize) const; + void HIMETRICtoLP(LPSIZE lpSize) const; + +// Region Functions + BOOL FillRgn(CRgn* pRgn, CBrush* pBrush); + BOOL FrameRgn(CRgn* pRgn, CBrush* pBrush, int nWidth, int nHeight); + BOOL InvertRgn(CRgn* pRgn); + BOOL PaintRgn(CRgn* pRgn); + +// Clipping Functions + virtual int GetClipBox(LPRECT lpRect) const; + virtual BOOL PtVisible(int x, int y) const; + BOOL PtVisible(POINT point) const; + virtual BOOL RectVisible(LPCRECT lpRect) const; + int SelectClipRgn(CRgn* pRgn); + int ExcludeClipRect(int x1, int y1, int x2, int y2); + int ExcludeClipRect(LPCRECT lpRect); + int ExcludeUpdateRgn(CWnd* pWnd); + int IntersectClipRect(int x1, int y1, int x2, int y2); + int IntersectClipRect(LPCRECT lpRect); + int OffsetClipRgn(int x, int y); + int OffsetClipRgn(SIZE size); +#ifndef _MAC + int SelectClipRgn(CRgn* pRgn, int nMode); +#endif + +// Line-Output Functions + CPoint GetCurrentPosition() const; + CPoint MoveTo(int x, int y); + CPoint MoveTo(POINT point); + BOOL LineTo(int x, int y); + BOOL LineTo(POINT point); + BOOL Arc(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4); + BOOL Arc(LPCRECT lpRect, POINT ptStart, POINT ptEnd); + BOOL Polyline(LPPOINT lpPoints, int nCount); + +#ifndef _MAC + BOOL AngleArc(int x, int y, int nRadius, float fStartAngle, float fSweepAngle); + BOOL ArcTo(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4); + BOOL ArcTo(LPCRECT lpRect, POINT ptStart, POINT ptEnd); + int GetArcDirection() const; + int SetArcDirection(int nArcDirection); + + BOOL PolyDraw(const POINT* lpPoints, const BYTE* lpTypes, int nCount); + BOOL PolylineTo(const POINT* lpPoints, int nCount); + BOOL PolyPolyline(const POINT* lpPoints, + const DWORD* lpPolyPoints, int nCount); + + BOOL PolyBezier(const POINT* lpPoints, int nCount); + BOOL PolyBezierTo(const POINT* lpPoints, int nCount); +#endif + +// Simple Drawing Functions + void FillRect(LPCRECT lpRect, CBrush* pBrush); + void FrameRect(LPCRECT lpRect, CBrush* pBrush); + void InvertRect(LPCRECT lpRect); + BOOL DrawIcon(int x, int y, HICON hIcon); + BOOL DrawIcon(POINT point, HICON hIcon); + +// Ellipse and Polygon Functions +#ifndef _MAC + BOOL Chord(int x1, int y1, int x2, int y2, int x3, int y3, + int x4, int y4); + BOOL Chord(LPCRECT lpRect, POINT ptStart, POINT ptEnd); +#endif + void DrawFocusRect(LPCRECT lpRect); + BOOL Ellipse(int x1, int y1, int x2, int y2); + BOOL Ellipse(LPCRECT lpRect); + BOOL Pie(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4); + BOOL Pie(LPCRECT lpRect, POINT ptStart, POINT ptEnd); + BOOL Polygon(LPPOINT lpPoints, int nCount); +#ifndef _MAC + BOOL PolyPolygon(LPPOINT lpPoints, LPINT lpPolyCounts, int nCount); +#endif + BOOL Rectangle(int x1, int y1, int x2, int y2); + BOOL Rectangle(LPCRECT lpRect); + BOOL RoundRect(int x1, int y1, int x2, int y2, int x3, int y3); + BOOL RoundRect(LPCRECT lpRect, POINT point); + +// Bitmap Functions + BOOL PatBlt(int x, int y, int nWidth, int nHeight, DWORD dwRop); + BOOL BitBlt(int x, int y, int nWidth, int nHeight, CDC* pSrcDC, + int xSrc, int ySrc, DWORD dwRop); + BOOL StretchBlt(int x, int y, int nWidth, int nHeight, CDC* pSrcDC, + int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, DWORD dwRop); + COLORREF GetPixel(int x, int y) const; + COLORREF GetPixel(POINT point) const; + COLORREF SetPixel(int x, int y, COLORREF crColor); + COLORREF SetPixel(POINT point, COLORREF crColor); +#ifndef _MAC + BOOL FloodFill(int x, int y, COLORREF crColor); + BOOL ExtFloodFill(int x, int y, COLORREF crColor, UINT nFillType); + BOOL MaskBlt(int x, int y, int nWidth, int nHeight, CDC* pSrcDC, + int xSrc, int ySrc, CBitmap& maskBitmap, int xMask, int yMask, + DWORD dwRop); + BOOL PlgBlt(LPPOINT lpPoint, CDC* pSrcDC, int xSrc, int ySrc, + int nWidth, int nHeight, CBitmap& maskBitmap, int xMask, int yMask); + BOOL SetPixelV(int x, int y, COLORREF crColor); + BOOL SetPixelV(POINT point, COLORREF crColor); +#endif + +// Text Functions + virtual BOOL TextOut(int x, int y, LPCTSTR lpszString, int nCount); + BOOL TextOut(int x, int y, const CString& str); + virtual BOOL ExtTextOut(int x, int y, UINT nOptions, LPCRECT lpRect, + LPCTSTR lpszString, UINT nCount, LPINT lpDxWidths); + virtual CSize TabbedTextOut(int x, int y, LPCTSTR lpszString, int nCount, + int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin); + virtual int DrawText(LPCTSTR lpszString, int nCount, LPRECT lpRect, + UINT nFormat); + CSize GetTextExtent(LPCTSTR lpszString, int nCount) const; + CSize GetOutputTextExtent(LPCTSTR lpszString, int nCount) const; + CSize GetTabbedTextExtent(LPCTSTR lpszString, int nCount, + int nTabPositions, LPINT lpnTabStopPositions) const; + CSize GetOutputTabbedTextExtent(LPCTSTR lpszString, int nCount, + int nTabPositions, LPINT lpnTabStopPositions) const; + virtual BOOL GrayString(CBrush* pBrush, + BOOL (CALLBACK EXPORT* lpfnOutput)(HDC, LPARAM, int), LPARAM lpData, + int nCount, int x, int y, int nWidth, int nHeight); + UINT GetTextAlign() const; + UINT SetTextAlign(UINT nFlags); + int GetTextFace(int nCount, LPTSTR lpszFacename) const; + BOOL GetTextMetrics(LPTEXTMETRIC lpMetrics) const; + BOOL GetOutputTextMetrics(LPTEXTMETRIC lpMetrics) const; +#ifndef _MAC + int SetTextJustification(int nBreakExtra, int nBreakCount); +#endif + int GetTextCharacterExtra() const; + int SetTextCharacterExtra(int nCharExtra); + +// Font Functions + BOOL GetCharWidth(UINT nFirstChar, UINT nLastChar, LPINT lpBuffer) const; + BOOL GetOutputCharWidth(UINT nFirstChar, UINT nLastChar, LPINT lpBuffer) const; + DWORD SetMapperFlags(DWORD dwFlag); + CSize GetAspectRatioFilter() const; + + BOOL GetCharABCWidths(UINT nFirstChar, UINT nLastChar, LPABC lpabc) const; + DWORD GetFontData(DWORD dwTable, DWORD dwOffset, LPVOID lpData, DWORD cbData) const; +#ifndef _MAC + int GetKerningPairs(int nPairs, LPKERNINGPAIR lpkrnpair) const; +#endif + UINT GetOutlineTextMetrics(UINT cbData, LPOUTLINETEXTMETRIC lpotm) const; +#ifndef _MAC + DWORD GetGlyphOutline(UINT nChar, UINT nFormat, LPGLYPHMETRICS lpgm, + DWORD cbBuffer, LPVOID lpBuffer, const MAT2* lpmat2) const; +#endif + +#ifndef _MAC + BOOL GetCharABCWidths(UINT nFirstChar, UINT nLastChar, + LPABCFLOAT lpABCF) const; + BOOL GetCharWidth(UINT nFirstChar, UINT nLastChar, + float* lpFloatBuffer) const; +#endif + +// Printer/Device Escape Functions + virtual int Escape(int nEscape, int nCount, + LPCSTR lpszInData, LPVOID lpOutData); +#ifndef _MAC + int Escape(int nEscape, int nInputSize, LPCSTR lpszInputData, + int nOutputSize, LPSTR lpszOutputData); + int DrawEscape(int nEscape, int nInputSize, LPCSTR lpszInputData); +#endif + + // Escape helpers + int StartDoc(LPCTSTR lpszDocName); // old Win3.0 version + int StartDoc(LPDOCINFO lpDocInfo); + int StartPage(); + int EndPage(); + int SetAbortProc(BOOL (CALLBACK EXPORT* lpfn)(HDC, int)); + int AbortDoc(); + int EndDoc(); + +// Scrolling Functions + BOOL ScrollDC(int dx, int dy, LPCRECT lpRectScroll, LPCRECT lpRectClip, + CRgn* pRgnUpdate, LPRECT lpRectUpdate); + +// MetaFile Functions + BOOL PlayMetaFile(HMETAFILE hMF); +#ifndef _MAC + BOOL PlayMetaFile(HENHMETAFILE hEnhMetaFile, LPCRECT lpBounds); + BOOL AddMetaFileComment(UINT nDataSize, const BYTE* pCommentData); + // can be used for enhanced metafiles only + +// Path Functions + BOOL AbortPath(); + BOOL BeginPath(); + BOOL CloseFigure(); + BOOL EndPath(); + BOOL FillPath(); + BOOL FlattenPath(); + BOOL StrokeAndFillPath(); + BOOL StrokePath(); + BOOL WidenPath(); + float GetMiterLimit() const; + BOOL SetMiterLimit(float fMiterLimit); + int GetPath(LPPOINT lpPoints, LPBYTE lpTypes, int nCount) const; + BOOL SelectClipPath(int nMode); +#endif + +// Implementation +public: + virtual ~CDC(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + + // advanced use and implementation + BOOL m_bPrinting; + HGDIOBJ SelectObject(HGDIOBJ); // do not use for regions + + // DrawDragRect is useful for drawing drag rects with no flicker + static CBrush* PASCAL GetHalftoneBrush(); + void DrawDragRect(LPCRECT lpRect, SIZE size, + LPCRECT lpRectLast, SIZE sizeLast, + CBrush* pBrush = NULL, CBrush* pBrushLast = NULL); + void FillSolidRect(LPCRECT lpRect, COLORREF clr); + void FillSolidRect(int x, int y, int cx, int cy, COLORREF clr); + void Draw3dRect(LPCRECT lpRect, COLORREF clrTopLeft, COLORREF clrBottomRight); + void Draw3dRect(int x, int y, int cx, int cy, + COLORREF clrTopLeft, COLORREF clrBottomRight); + +protected: + // used for implementation of non-virtual SelectObject calls + static CGdiObject* PASCAL SelectGdiObject(HDC hDC, HGDIOBJ h); +}; + +///////////////////////////////////////////////////////////////////////////// +// CDC Helpers + +class CPaintDC : public CDC +{ + DECLARE_DYNAMIC(CPaintDC) + +// Constructors +public: + CPaintDC(CWnd* pWnd); // BeginPaint + +// Attributes +protected: + HWND m_hWnd; +public: + PAINTSTRUCT m_ps; // actual paint struct! + +// Implementation +public: + virtual ~CPaintDC(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif +}; + +class CClientDC : public CDC +{ + DECLARE_DYNAMIC(CClientDC) + +// Constructors +public: + CClientDC(CWnd* pWnd); + +// Attributes +protected: + HWND m_hWnd; + +// Implementation +public: + virtual ~CClientDC(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif +}; + +class CWindowDC : public CDC +{ + DECLARE_DYNAMIC(CWindowDC) + +// Constructors +public: + CWindowDC(CWnd* pWnd); + +// Attributes +protected: + HWND m_hWnd; + +// Implementation +public: + virtual ~CWindowDC(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif +}; + +///////////////////////////////////////////////////////////////////////////// +// CMenu + +class CMenu : public CObject +{ + DECLARE_DYNCREATE(CMenu) +public: + +// Constructors + CMenu(); + + BOOL CreateMenu(); + BOOL CreatePopupMenu(); + BOOL LoadMenu(LPCTSTR lpszResourceName); + BOOL LoadMenu(UINT nIDResource); + BOOL LoadMenuIndirect(const void* lpMenuTemplate); + BOOL DestroyMenu(); + +// Attributes + HMENU m_hMenu; // must be first data member + HMENU GetSafeHmenu() const; + + static CMenu* PASCAL FromHandle(HMENU hMenu); + static void PASCAL DeleteTempMap(); + BOOL Attach(HMENU hMenu); + HMENU Detach(); + +// CMenu Operations + BOOL DeleteMenu(UINT nPosition, UINT nFlags); + BOOL TrackPopupMenu(UINT nFlags, int x, int y, + CWnd* pWnd, LPCRECT lpRect = 0); + +// CMenuItem Operations + BOOL AppendMenu(UINT nFlags, UINT nIDNewItem = 0, + LPCTSTR lpszNewItem = NULL); + BOOL AppendMenu(UINT nFlags, UINT nIDNewItem, const CBitmap* pBmp); + UINT CheckMenuItem(UINT nIDCheckItem, UINT nCheck); + UINT EnableMenuItem(UINT nIDEnableItem, UINT nEnable); + UINT GetMenuItemCount() const; + UINT GetMenuItemID(int nPos) const; + UINT GetMenuState(UINT nID, UINT nFlags) const; + int GetMenuString(UINT nIDItem, LPTSTR lpString, int nMaxCount, + UINT nFlags) const; + CMenu* GetSubMenu(int nPos) const; + BOOL InsertMenu(UINT nPosition, UINT nFlags, UINT nIDNewItem = 0, + LPCTSTR lpszNewItem = NULL); + BOOL InsertMenu(UINT nPosition, UINT nFlags, UINT nIDNewItem, + const CBitmap* pBmp); + BOOL ModifyMenu(UINT nPosition, UINT nFlags, UINT nIDNewItem = 0, + LPCTSTR lpszNewItem = NULL); + BOOL ModifyMenu(UINT nPosition, UINT nFlags, UINT nIDNewItem, + const CBitmap* pBmp); + BOOL RemoveMenu(UINT nPosition, UINT nFlags); + BOOL SetMenuItemBitmaps(UINT nPosition, UINT nFlags, + const CBitmap* pBmpUnchecked, const CBitmap* pBmpChecked); + +// Overridables (must override draw and measure for owner-draw menu items) + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct); + +// Implementation +public: + virtual ~CMenu(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + static CMenu* PASCAL CMenu::FromHandlePermanent(HMENU hMenu); +}; + +///////////////////////////////////////////////////////////////////////////// +// Window message map handling + +struct AFX_MSGMAP_ENTRY; // declared below after CWnd + +struct AFX_MSGMAP +{ +#ifdef _AFXDLL + const AFX_MSGMAP* (PASCAL* pfnGetBaseMap)(); +#else + const AFX_MSGMAP* pBaseMap; +#endif + const AFX_MSGMAP_ENTRY* lpEntries; +}; + +#ifdef _AFXDLL +#define DECLARE_MESSAGE_MAP() \ +private: \ + static const AFX_MSGMAP_ENTRY _messageEntries[]; \ +protected: \ + static AFX_DATA const AFX_MSGMAP messageMap; \ + static const AFX_MSGMAP* PASCAL _GetBaseMessageMap(); \ + virtual const AFX_MSGMAP* GetMessageMap() const; \ + +#else +#define DECLARE_MESSAGE_MAP() \ +private: \ + static const AFX_MSGMAP_ENTRY _messageEntries[]; \ +protected: \ + static AFX_DATA const AFX_MSGMAP messageMap; \ + virtual const AFX_MSGMAP* GetMessageMap() const; \ + +#endif + +#ifdef _AFXDLL +#define BEGIN_MESSAGE_MAP(theClass, baseClass) \ + const AFX_MSGMAP* PASCAL theClass::_GetBaseMessageMap() \ + { return &baseClass::messageMap; } \ + const AFX_MSGMAP* theClass::GetMessageMap() const \ + { return &theClass::messageMap; } \ + AFX_DATADEF const AFX_MSGMAP theClass::messageMap = \ + { &theClass::_GetBaseMessageMap, &theClass::_messageEntries[0] }; \ + const AFX_MSGMAP_ENTRY theClass::_messageEntries[] = \ + { \ + +#else +#define BEGIN_MESSAGE_MAP(theClass, baseClass) \ + const AFX_MSGMAP* theClass::GetMessageMap() const \ + { return &theClass::messageMap; } \ + AFX_DATADEF const AFX_MSGMAP theClass::messageMap = \ + { &baseClass::messageMap, &theClass::_messageEntries[0] }; \ + const AFX_MSGMAP_ENTRY theClass::_messageEntries[] = \ + { \ + +#endif + +#define END_MESSAGE_MAP() \ + {0, 0, 0, 0, AfxSig_end, (AFX_PMSG)0 } \ + }; \ + +// Message map signature values and macros in separate header +#include <afxmsg_.h> + +///////////////////////////////////////////////////////////////////////////// +// Dialog data exchange (DDX_) and validation (DDV_) + +// CDataExchange - for data exchange and validation +class CDataExchange +{ +// Attributes +public: + BOOL m_bSaveAndValidate; // TRUE => save and validate data + CWnd* m_pDlgWnd; // container usually a dialog + +// Operations (for implementors of DDX and DDV procs) + HWND PrepareCtrl(int nIDC); // return HWND of control + HWND PrepareEditCtrl(int nIDC); // return HWND of control + void Fail(); // will throw exception + +// Implementation + CDataExchange(CWnd* pDlgWnd, BOOL bSaveAndValidate); + + HWND m_hWndLastControl; // last control used (for validation) + BOOL m_bEditLastControl; // last control was an edit item +}; + +#include <afxdd_.h> // standard DDX_ and DDV_ routines + +///////////////////////////////////////////////////////////////////////////// +// OLE types + +struct IUnknown; +typedef IUnknown* LPUNKNOWN; + +struct IDispatch; +typedef IDispatch* LPDISPATCH; + +typedef unsigned short VARTYPE; +typedef long SCODE; + +struct tagDISPPARAMS; +typedef tagDISPPARAMS DISPPARAMS; + +struct tagVARIANT; +typedef tagVARIANT VARIANT; + +///////////////////////////////////////////////////////////////////////////// +// CCmdTarget + +// private structures +struct AFX_CMDHANDLERINFO; // info about where the command is handled + +///////////////////////////////////////////////////////////////////////////// +// OLE 2.0 interface map handling (more in AFXDISP.H) + +#ifndef _AFX_NO_OLE_SUPPORT + +struct AFX_INTERFACEMAP_ENTRY +{ + const void* piid; // the interface id (IID) (NULL for aggregate) + size_t nOffset; // offset of the interface vtable from m_unknown +}; + +struct AFX_INTERFACEMAP +{ +#ifdef _AFXDLL + const AFX_INTERFACEMAP* (PASCAL* pfnGetBaseMap)(); // NULL is root class +#else + const AFX_INTERFACEMAP* pBaseMap; +#endif + const AFX_INTERFACEMAP_ENTRY* pEntry; // map for this class +}; + + +#ifdef _AFXDLL +#define DECLARE_INTERFACE_MAP() \ +private: \ + static const AFX_INTERFACEMAP_ENTRY _interfaceEntries[]; \ +protected: \ + static AFX_DATA const AFX_INTERFACEMAP interfaceMap; \ + static const AFX_INTERFACEMAP* PASCAL _GetBaseInterfaceMap(); \ + virtual const AFX_INTERFACEMAP* GetInterfaceMap() const; \ + +#else +#define DECLARE_INTERFACE_MAP() \ +private: \ + static const AFX_INTERFACEMAP_ENTRY _interfaceEntries[]; \ +protected: \ + static AFX_DATA const AFX_INTERFACEMAP interfaceMap; \ + virtual const AFX_INTERFACEMAP* GetInterfaceMap() const; \ + +#endif + +#endif //!_AFX_NO_OLE_SUPPORT + +///////////////////////////////////////////////////////////////////////////// +// OLE 2.0 dispatch map handling (more in AFXDISP.H) + +#ifndef _AFX_NO_OLE_SUPPORT + +struct AFX_DISPMAP_ENTRY; + +struct AFX_DISPMAP +{ +#ifdef _AFXDLL + const AFX_DISPMAP* (PASCAL* pfnGetBaseMap)(); +#else + const AFX_DISPMAP* pBaseMap; +#endif + const AFX_DISPMAP_ENTRY* lpEntries; + UINT* lpEntryCount; +}; + +#ifdef _AFXDLL +#define DECLARE_DISPATCH_MAP() \ +private: \ + static const AFX_DISPMAP_ENTRY _dispatchEntries[]; \ + static UINT _dispatchEntryCount; \ +protected: \ + static AFX_DATA const AFX_DISPMAP dispatchMap; \ + static const AFX_DISPMAP* PASCAL _GetBaseDispatchMap(); \ + virtual const AFX_DISPMAP* GetDispatchMap() const; \ + +#else +#define DECLARE_DISPATCH_MAP() \ +private: \ + static const AFX_DISPMAP_ENTRY _dispatchEntries[]; \ + static UINT _dispatchEntryCount; \ +protected: \ + static AFX_DATA const AFX_DISPMAP dispatchMap; \ + virtual const AFX_DISPMAP* GetDispatchMap() const; \ + +#endif + +#endif //!_AFX_NO_OLE_SUPPORT + +///////////////////////////////////////////////////////////////////////////// +// CCmdTarget proper + +class CCmdTarget : public CObject +{ + DECLARE_DYNAMIC(CCmdTarget) +protected: + +public: +// Constructors + CCmdTarget(); + +// Attributes + LPDISPATCH GetIDispatch(BOOL bAddRef); + // retrieve IDispatch part of CCmdTarget + static CCmdTarget* PASCAL FromIDispatch(LPDISPATCH lpDispatch); + // map LPDISPATCH back to CCmdTarget* (inverse of GetIDispatch) + BOOL IsResultExpected(); + // returns TRUE if automation function should return a value + +// Operations + void EnableAutomation(); + // call in constructor to wire up IDispatch + + void BeginWaitCursor(); + void EndWaitCursor(); + void RestoreWaitCursor(); // call after messagebox + +// Overridables + // route and dispatch standard command message types + // (more sophisticated than OnCommand) + virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, + AFX_CMDHANDLERINFO* pHandlerInfo); + +#ifndef _AFX_NO_OLE_SUPPORT + // called when last OLE reference is released + virtual void OnFinalRelease(); +#endif + +// Implementation +public: + virtual ~CCmdTarget(); +#ifdef _DEBUG + virtual void Dump(CDumpContext& dc) const; + virtual void AssertValid() const; +#endif +#ifndef _AFX_NO_OLE_SUPPORT + void GetNotSupported(); + void SetNotSupported(); +#endif + +protected: + friend class CView; + + CView* GetRoutingView(); + DECLARE_MESSAGE_MAP() // base class - no {{ }} macros + +#ifndef _AFX_NO_OLE_SUPPORT + DECLARE_DISPATCH_MAP() + DECLARE_INTERFACE_MAP() + + // OLE interface map implementation +public: + // data used when CCmdTarget is made OLE aware + DWORD m_dwRef; + LPUNKNOWN m_pOuterUnknown; // external controlling unknown if != NULL + DWORD m_xInnerUnknown; // place-holder for inner controlling unknown + +public: + // advanced operations + void EnableAggregation(); // call to enable aggregation + void ExternalDisconnect(); // forcibly disconnect + LPUNKNOWN GetControllingUnknown(); + // get controlling IUnknown for aggregate creation + + // these versions do not delegate to m_pOuterUnknown + DWORD InternalQueryInterface(const void*, LPVOID* ppvObj); + DWORD InternalAddRef(); + DWORD InternalRelease(); + // these versions delegate to m_pOuterUnknown + DWORD ExternalQueryInterface(const void*, LPVOID* ppvObj); + DWORD ExternalAddRef(); + DWORD ExternalRelease(); + + // implementation helpers + LPUNKNOWN GetInterface(const void*); + LPUNKNOWN QueryAggregates(const void*); + + // advanced overrideables for implementation + virtual BOOL OnCreateAggregates(); + virtual LPUNKNOWN GetInterfaceHook(const void*); + + // OLE automation implementation +protected: + struct XDispatch + { + DWORD m_vtbl; // place-holder for IDispatch vtable + size_t m_nOffset; + } m_xDispatch; + BOOL m_bResultExpected; + + // member variable-based properties + void GetStandardProp(const AFX_DISPMAP_ENTRY* pEntry, + VARIANT* pvarResult, UINT* puArgErr); + SCODE SetStandardProp(const AFX_DISPMAP_ENTRY* pEntry, + DISPPARAMS* pDispParams, UINT* puArgErr); + + // DISPID to dispatch map lookup + static UINT PASCAL GetEntryCount(const AFX_DISPMAP* pDispMap); + const AFX_DISPMAP_ENTRY* PASCAL GetDispEntry(LONG memid); + static LONG PASCAL MemberIDFromName(const AFX_DISPMAP* pDispMap, LPCTSTR lpszName); + + // helpers for member function calling implementation + static UINT PASCAL GetStackSize(const BYTE* pbParams, VARTYPE vtResult); +#if defined(_PPC_) + SCODE PushStackArgs(BYTE* pStack, const BYTE* pbParams, + void* pResult, VARTYPE vtResult, DISPPARAMS* pDispParams, + UINT* puArgErr, VARIANT* rgTempVars, UINT nSizeArgs); +#else + SCODE PushStackArgs(BYTE* pStack, const BYTE* pbParams, + void* pResult, VARTYPE vtResult, DISPPARAMS* pDispParams, + UINT* puArgErr, VARIANT* rgTempVars); +#endif + SCODE CallMemberFunc(const AFX_DISPMAP_ENTRY* pEntry, WORD wFlags, + VARIANT* pvarResult, DISPPARAMS* pDispParams, UINT* puArgErr); + + friend class COleDispatchImpl; +#endif //!_AFX_NO_OLE_SUPPORT +}; + +class CCmdUI // simple helper class +{ +public: +// Attributes + UINT m_nID; + UINT m_nIndex; // menu item or other index + + // if a menu item + CMenu* m_pMenu; // NULL if not a menu + CMenu* m_pSubMenu; // sub containing menu item + // if a popup sub menu - ID is for first in popup + + // if from some other window + CWnd* m_pOther; // NULL if a menu or not a CWnd + +// Operations to do in ON_UPDATE_COMMAND_UI + virtual void Enable(BOOL bOn = TRUE); + virtual void SetCheck(int nCheck = 1); // 0, 1 or 2 (indeterminate) + virtual void SetRadio(BOOL bOn = TRUE); + virtual void SetText(LPCTSTR lpszText); + +// Advanced operation + void ContinueRouting(); + +// Implementation + CCmdUI(); + BOOL m_bEnableChanged; + BOOL m_bContinueRouting; + UINT m_nIndexMax; // last + 1 for iterating m_nIndex + + CMenu* m_pParentMenu; // NULL if parent menu not easily determined + // (probably a secondary popup menu) + + void DoUpdate(CCmdTarget* pTarget, BOOL bDisableIfNoHndler); +}; + +// special CCmdUI derived classes are used for other UI paradigms +// like toolbar buttons and status indicators + +// pointer to afx_msg member function +#ifndef AFX_MSG_CALL +#define AFX_MSG_CALL +#endif +typedef void (AFX_MSG_CALL CCmdTarget::*AFX_PMSG)(void); + +struct AFX_DISPMAP_ENTRY +{ + LPCTSTR lpszName; // member/property name + long lDispID; // DISPID (may be DISPID_UNKNOWN) + LPCSTR lpszParams; // member parameter description + WORD vt; // return value type / or type of property + AFX_PMSG pfn; // normal member On<membercall> or, OnGet<property> + AFX_PMSG pfnSet; // special member for OnSet<property> + size_t nPropOffset; // property offset +}; + +///////////////////////////////////////////////////////////////////////////// +// CWnd implementation + +// structures (see afxext.h) +struct CCreateContext; // context for creating things +struct CPrintInfo; // print preview customization info + +struct AFX_MSGMAP_ENTRY +{ + UINT nMessage; // windows message + UINT nCode; // control code or WM_NOTIFY code + UINT nID; // control ID (or 0 for windows messages) + UINT nLastID; // used for entries specifying a range of control id's + UINT nSig; // signature type (action) or pointer to message # + AFX_PMSG pfn; // routine to call (or special value) +}; + +///////////////////////////////////////////////////////////////////////////// +// CWnd - a Microsoft Windows application window + +#if (WINVER < 0x400) +typedef struct tagSCROLLINFO +{ + UINT cbSize; + UINT fMask; + int nMin; + int nMax; + int nPage; + int nPos; +} SCROLLINFO; +typedef SCROLLINFO* LPSCROLLINFO; +typedef const SCROLLINFO* LPCSCROLLINFO; + +#define SIF_RANGE 0x0001 +#define SIF_PAGE 0x0002 +#define SIF_POS 0x0004 +#define SIF_DISABLENOSCROLL 0x0008 +#endif + +class COleDropTarget; // for more information see AFXOLE.H + +class CWnd : public CCmdTarget +{ + DECLARE_DYNCREATE(CWnd) +protected: + static const MSG* PASCAL GetCurrentMessage(); + +// Attributes +public: + HWND m_hWnd; // must be first data member + + HWND GetSafeHwnd() const; + DWORD GetStyle() const; + DWORD GetExStyle() const; + static BOOL PASCAL ModifyStyle(HWND hWnd, DWORD dwRemove, DWORD dwAdd, + UINT nFlags); + BOOL ModifyStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags = 0); + static BOOL PASCAL ModifyStyleEx(HWND hWnd, DWORD dwRemove, DWORD dwAdd, + UINT nFlags); + BOOL ModifyStyleEx(DWORD dwRemove, DWORD dwAdd, UINT nFlags = 0); + + CWnd* GetOwner() const; + void SetOwner(CWnd* pOwnerWnd); + +// Constructors and other creation + CWnd(); + + static CWnd* PASCAL FromHandle(HWND hWnd); + static CWnd* PASCAL FromHandlePermanent(HWND hWnd); + static void PASCAL DeleteTempMap(); + BOOL Attach(HWND hWndNew); + HWND Detach(); + BOOL SubclassWindow(HWND hWnd); + BOOL SubclassDlgItem(UINT nID, CWnd* pParent); + // for dynamic subclassing of windows control + +public: + // for child windows, views, panes etc + virtual BOOL Create(LPCTSTR lpszClassName, + LPCTSTR lpszWindowName, DWORD dwStyle, + const RECT& rect, + CWnd* pParentWnd, UINT nID, + CCreateContext* pContext = NULL); + + // advanced creation (allows access to extended styles) + BOOL CreateEx(DWORD dwExStyle, LPCTSTR lpszClassName, + LPCTSTR lpszWindowName, DWORD dwStyle, + int x, int y, int nWidth, int nHeight, + HWND hWndParent, HMENU nIDorHMenu, LPVOID lpParam = NULL); + + virtual BOOL DestroyWindow(); + + // special pre-creation and window rect adjustment hooks + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + + // Advanced: virtual AdjustWindowRect + enum AdjustType { adjustBorder = 0, adjustOutside = 1 }; + virtual void CalcWindowRect(LPRECT lpClientRect, + UINT nAdjustType = adjustBorder); + +// Window tree access + int GetDlgCtrlID() const; + int SetDlgCtrlID(int nID); + // get and set window ID, for child windows only + CWnd* GetDlgItem(int nID) const; + // get immediate child with given ID + CWnd* GetDescendantWindow(int nID, BOOL bOnlyPerm = FALSE) const; + // like GetDlgItem but recursive + void SendMessageToDescendants(UINT message, WPARAM wParam = 0, + LPARAM lParam = 0, BOOL bDeep = TRUE, BOOL bOnlyPerm = FALSE); + CFrameWnd* GetParentFrame() const; + CWnd* GetTopLevelParent() const; + CFrameWnd* GetTopLevelFrame() const; + +// Message Functions + LRESULT SendMessage(UINT message, WPARAM wParam = 0, LPARAM lParam = 0); + BOOL PostMessage(UINT message, WPARAM wParam = 0, LPARAM lParam = 0); + +#ifndef _MAC + BOOL SendNotifyMessage(UINT message, WPARAM wParam, LPARAM lParam); +#endif + +// Window Text Functions + void SetWindowText(LPCTSTR lpszString); + int GetWindowText(LPTSTR lpszStringBuf, int nMaxCount) const; + int GetWindowTextLength() const; + void GetWindowText(CString& rString) const; + void SetFont(CFont* pFont, BOOL bRedraw = TRUE); + CFont* GetFont() const; + +// CMenu Functions - non-Child windows only + CMenu* GetMenu() const; + BOOL SetMenu(CMenu* pMenu); + void DrawMenuBar(); + CMenu* GetSystemMenu(BOOL bRevert) const; + BOOL HiliteMenuItem(CMenu* pMenu, UINT nIDHiliteItem, UINT nHilite); + +// Window Size and Position Functions + BOOL IsIconic() const; + BOOL IsZoomed() const; + void MoveWindow(int x, int y, int nWidth, int nHeight, + BOOL bRepaint = TRUE); + void MoveWindow(LPCRECT lpRect, BOOL bRepaint = TRUE); + + static AFX_DATA const CWnd wndTop; // SetWindowPos's pWndInsertAfter + static AFX_DATA const CWnd wndBottom; // SetWindowPos's pWndInsertAfter + static AFX_DATA const CWnd wndTopMost; // SetWindowPos pWndInsertAfter + static AFX_DATA const CWnd wndNoTopMost; // SetWindowPos pWndInsertAfter + + BOOL SetWindowPos(const CWnd* pWndInsertAfter, int x, int y, + int cx, int cy, UINT nFlags); +#ifndef _MAC + UINT ArrangeIconicWindows(); +#endif + void BringWindowToTop(); + void GetWindowRect(LPRECT lpRect) const; + void GetClientRect(LPRECT lpRect) const; + + BOOL GetWindowPlacement(WINDOWPLACEMENT* lpwndpl) const; + BOOL SetWindowPlacement(const WINDOWPLACEMENT* lpwndpl); + +// Coordinate Mapping Functions + void ClientToScreen(LPPOINT lpPoint) const; + void ClientToScreen(LPRECT lpRect) const; + void ScreenToClient(LPPOINT lpPoint) const; + void ScreenToClient(LPRECT lpRect) const; + void MapWindowPoints(CWnd* pwndTo, LPPOINT lpPoint, UINT nCount) const; + void MapWindowPoints(CWnd* pwndTo, LPRECT lpRect) const; + +// Update/Painting Functions + CDC* BeginPaint(LPPAINTSTRUCT lpPaint); + void EndPaint(LPPAINTSTRUCT lpPaint); + CDC* GetDC(); + CDC* GetWindowDC(); + int ReleaseDC(CDC* pDC); + + void UpdateWindow(); + void SetRedraw(BOOL bRedraw = TRUE); + BOOL GetUpdateRect(LPRECT lpRect, BOOL bErase = FALSE); + int GetUpdateRgn(CRgn* pRgn, BOOL bErase = FALSE); + void Invalidate(BOOL bErase = TRUE); + void InvalidateRect(LPCRECT lpRect, BOOL bErase = TRUE); + void InvalidateRgn(CRgn* pRgn, BOOL bErase = TRUE); + void ValidateRect(LPCRECT lpRect); + void ValidateRgn(CRgn* pRgn); + BOOL ShowWindow(int nCmdShow); + BOOL IsWindowVisible() const; + void ShowOwnedPopups(BOOL bShow = TRUE); + + CDC* GetDCEx(CRgn* prgnClip, DWORD flags); +#ifndef _MAC + BOOL LockWindowUpdate(); // for backward compatibility + void UnlockWindowUpdate(); +#endif + BOOL RedrawWindow(LPCRECT lpRectUpdate = NULL, + CRgn* prgnUpdate = NULL, + UINT flags = RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); + BOOL EnableScrollBar(int nSBFlags, UINT nArrowFlags = ESB_ENABLE_BOTH); + +// Timer Functions + UINT SetTimer(UINT nIDEvent, UINT nElapse, + void (CALLBACK EXPORT* lpfnTimer)(HWND, UINT, UINT, DWORD)); + BOOL KillTimer(int nIDEvent); + +// Window State Functions + BOOL IsWindowEnabled() const; + BOOL EnableWindow(BOOL bEnable = TRUE); + + // the active window applies only to top-level (frame windows) + static CWnd* PASCAL GetActiveWindow(); + CWnd* SetActiveWindow(); + + // the foreground window applies only to top-level windows (frame windows) + BOOL SetForegroundWindow(); + static CWnd* PASCAL GetForegroundWindow(); + + // capture and focus apply to all windows + static CWnd* PASCAL GetCapture(); + CWnd* SetCapture(); + static CWnd* PASCAL GetFocus(); + CWnd* SetFocus(); + + static CWnd* PASCAL GetDesktopWindow(); + +// Obsolete and non-portable APIs - not recommended for new code +#ifndef _MAC + void CloseWindow(); + BOOL OpenIcon(); +#endif + +// Dialog-Box Item Functions +// (NOTE: Dialog-Box Items/Controls are not necessarily in dialog boxes!) + void CheckDlgButton(int nIDButton, UINT nCheck); + void CheckRadioButton(int nIDFirstButton, int nIDLastButton, + int nIDCheckButton); + int GetCheckedRadioButton(int nIDFirstButton, int nIDLastButton); +#ifndef _MAC + int DlgDirList(LPTSTR lpPathSpec, int nIDListBox, + int nIDStaticPath, UINT nFileType); + int DlgDirListComboBox(LPTSTR lpPathSpec, int nIDComboBox, + int nIDStaticPath, UINT nFileType); + BOOL DlgDirSelect(LPTSTR lpString, int nIDListBox); + BOOL DlgDirSelectComboBox(LPTSTR lpString, int nIDComboBox); +#endif + + UINT GetDlgItemInt(int nID, BOOL* lpTrans = NULL, + BOOL bSigned = TRUE) const; + int GetDlgItemText(int nID, LPTSTR lpStr, int nMaxCount) const; + CWnd* GetNextDlgGroupItem(CWnd* pWndCtl, BOOL bPrevious = FALSE) const; + + CWnd* GetNextDlgTabItem(CWnd* pWndCtl, BOOL bPrevious = FALSE) const; + UINT IsDlgButtonChecked(int nIDButton) const; + LRESULT SendDlgItemMessage(int nID, UINT message, + WPARAM wParam = 0, LPARAM lParam = 0); + void SetDlgItemInt(int nID, UINT nValue, BOOL bSigned = TRUE); + void SetDlgItemText(int nID, LPCTSTR lpszString); + +// Scrolling Functions + int GetScrollPos(int nBar) const; + void GetScrollRange(int nBar, LPINT lpMinPos, LPINT lpMaxPos) const; + void ScrollWindow(int xAmount, int yAmount, + LPCRECT lpRect = NULL, + LPCRECT lpClipRect = NULL); + int SetScrollPos(int nBar, int nPos, BOOL bRedraw = TRUE); + void SetScrollRange(int nBar, int nMinPos, int nMaxPos, + BOOL bRedraw = TRUE); + void ShowScrollBar(UINT nBar, BOOL bShow = TRUE); + void EnableScrollBarCtrl(int nBar, BOOL bEnable = TRUE); + virtual CScrollBar* GetScrollBarCtrl(int nBar) const; + // return sibling scrollbar control (or NULL if none) + + int ScrollWindowEx(int dx, int dy, + LPCRECT lpRectScroll, LPCRECT lpRectClip, + CRgn* prgnUpdate, LPRECT lpRectUpdate, UINT flags); + +// Window Access Functions + CWnd* ChildWindowFromPoint(POINT point) const; + static CWnd* PASCAL FindWindow(LPCTSTR lpszClassName, LPCTSTR lpszWindowName); + CWnd* GetNextWindow(UINT nFlag = GW_HWNDNEXT) const; + CWnd* GetTopWindow() const; + + CWnd* GetWindow(UINT nCmd) const; + CWnd* GetLastActivePopup() const; + + BOOL IsChild(const CWnd* pWnd) const; + CWnd* GetParent() const; + CWnd* SetParent(CWnd* pWndNewParent); + static CWnd* PASCAL WindowFromPoint(POINT point); + +// Alert Functions + BOOL FlashWindow(BOOL bInvert); + int MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption = NULL, + UINT nType = MB_OK); + +// Clipboard Functions + BOOL ChangeClipboardChain(HWND hWndNext); + HWND SetClipboardViewer(); + BOOL OpenClipboard(); + static CWnd* PASCAL GetClipboardOwner(); + static CWnd* PASCAL GetClipboardViewer(); + static CWnd* PASCAL GetOpenClipboardWindow(); + +// Caret Functions + void CreateCaret(CBitmap* pBitmap); + void CreateSolidCaret(int nWidth, int nHeight); + void CreateGrayCaret(int nWidth, int nHeight); + static CPoint PASCAL GetCaretPos(); + static void PASCAL SetCaretPos(POINT point); + void HideCaret(); + void ShowCaret(); + +// Shell Interaction Functions + void DragAcceptFiles(BOOL bAccept = TRUE); + +// Dialog Data support +public: + BOOL UpdateData(BOOL bSaveAndValidate = TRUE); + // data wnd must be same type as this + +// Help Command Handlers + afx_msg void OnHelp(); // F1 (uses current context) + afx_msg void OnHelpIndex(); // ID_HELP_INDEX, ID_DEFAULT_HELP + afx_msg void OnHelpUsing(); // ID_HELP_USING + virtual void WinHelp(DWORD dwData, UINT nCmd = HELP_CONTEXT); + +// Layout and other functions +public: + enum RepositionFlags + { reposDefault = 0, reposQuery = 1, reposExtra = 2 }; + void RepositionBars(UINT nIDFirst, UINT nIDLast, UINT nIDLeftOver, + UINT nFlag = reposDefault, LPRECT lpRectParam = NULL, + LPCRECT lpRectClient = NULL, BOOL bStretch = TRUE); + + void UpdateDialogControls(CCmdTarget* pTarget, BOOL bDisableIfNoHndler); + void CenterWindow(CWnd* pAlternateOwner = NULL); + +// Window-Management message handler member functions +protected: + virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); + virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult); + + afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); + afx_msg void OnActivateApp(BOOL bActive, HTASK hTask); + afx_msg void OnCancelMode(); + afx_msg void OnChildActivate(); + afx_msg void OnClose(); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + + afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); + + afx_msg void OnDestroy(); + afx_msg void OnEnable(BOOL bEnable); + afx_msg void OnEndSession(BOOL bEnding); + afx_msg void OnEnterIdle(UINT nWhy, CWnd* pWho); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI); + afx_msg void OnIconEraseBkgnd(CDC* pDC); + afx_msg void OnKillFocus(CWnd* pNewWnd); + afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu); + afx_msg void OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu); + afx_msg void OnMove(int x, int y); + afx_msg void OnPaint(); + afx_msg void OnParentNotify(UINT message, LPARAM lParam); + afx_msg HCURSOR OnQueryDragIcon(); + afx_msg BOOL OnQueryEndSession(); + afx_msg BOOL OnQueryNewPalette(); + afx_msg BOOL OnQueryOpen(); + afx_msg void OnSetFocus(CWnd* pOldWnd); + afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos); + afx_msg void OnWindowPosChanged(WINDOWPOS* lpwndpos); + +// Nonclient-Area message handler member functions + afx_msg BOOL OnNcActivate(BOOL bActive); + afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp); + afx_msg BOOL OnNcCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnNcDestroy(); + afx_msg UINT OnNcHitTest(CPoint point); + afx_msg void OnNcLButtonDblClk(UINT nHitTest, CPoint point); + afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); + afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point); + afx_msg void OnNcMButtonDblClk(UINT nHitTest, CPoint point); + afx_msg void OnNcMButtonDown(UINT nHitTest, CPoint point); + afx_msg void OnNcMButtonUp(UINT nHitTest, CPoint point); + afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point); + afx_msg void OnNcPaint(); + afx_msg void OnNcRButtonDblClk(UINT nHitTest, CPoint point); + afx_msg void OnNcRButtonDown(UINT nHitTest, CPoint point); + afx_msg void OnNcRButtonUp(UINT nHitTest, CPoint point); + +// System message handler member functions + afx_msg void OnDropFiles(HDROP hDropInfo); + afx_msg void OnPaletteIsChanging(CWnd* pRealizeWnd); + afx_msg void OnSysChar(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + afx_msg void OnSysDeadChar(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg void OnSysKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg void OnCompacting(UINT nCpuTime); + afx_msg void OnDevModeChange(LPTSTR lpDeviceName); + afx_msg void OnFontChange(); + afx_msg void OnPaletteChanged(CWnd* pFocusWnd); + afx_msg void OnSpoolerStatus(UINT nStatus, UINT nJobs); + afx_msg void OnSysColorChange(); + afx_msg void OnTimeChange(); + afx_msg void OnWinIniChange(LPCTSTR lpszSection); + +// Input message handler member functions + afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg void OnDeadChar(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnMButtonDblClk(UINT nFlags, CPoint point); + afx_msg void OnMButtonDown(UINT nFlags, CPoint point); + afx_msg void OnMButtonUp(UINT nFlags, CPoint point); + afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point); + afx_msg void OnRButtonDown(UINT nFlags, CPoint point); + afx_msg void OnRButtonUp(UINT nFlags, CPoint point); + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + afx_msg void OnTimer(UINT nIDEvent); + +// Initialization message handler member functions + afx_msg void OnInitMenu(CMenu* pMenu); + afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu); + +// Clipboard message handler member functions + afx_msg void OnAskCbFormatName(UINT nMaxCount, LPTSTR lpszString); + afx_msg void OnChangeCbChain(HWND hWndRemove, HWND hWndAfter); + afx_msg void OnDestroyClipboard(); + afx_msg void OnDrawClipboard(); + afx_msg void OnHScrollClipboard(CWnd* pClipAppWnd, UINT nSBCode, UINT nPos); + afx_msg void OnPaintClipboard(CWnd* pClipAppWnd, HGLOBAL hPaintStruct); + afx_msg void OnRenderAllFormats(); + afx_msg void OnRenderFormat(UINT nFormat); + afx_msg void OnSizeClipboard(CWnd* pClipAppWnd, HGLOBAL hRect); + afx_msg void OnVScrollClipboard(CWnd* pClipAppWnd, UINT nSBCode, UINT nPos); + +// Control message handler member functions + afx_msg int OnCompareItem(int nIDCtl, LPCOMPAREITEMSTRUCT lpCompareItemStruct); + afx_msg void OnDeleteItem(int nIDCtl, LPDELETEITEMSTRUCT lpDeleteItemStruct); + afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct); + afx_msg UINT OnGetDlgCode(); + afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct); + afx_msg int OnCharToItem(UINT nChar, CListBox* pListBox, UINT nIndex); + afx_msg int OnVKeyToItem(UINT nKey, CListBox* pListBox, UINT nIndex); + +// MDI message handler member functions + afx_msg void OnMDIActivate(BOOL bActivate, + CWnd* pActivateWnd, CWnd* pDeactivateWnd); + +// Menu loop notification messages + afx_msg void OnEnterMenuLoop(BOOL bIsTrackPopupMenu); + afx_msg void OnExitMenuLoop(BOOL bIsTrackPopupMenu); + +// Overridables and other helpers (for implementation of derived classes) +protected: + // for deriving from a standard control + virtual WNDPROC* GetSuperWndProcAddr(); + + // for dialog data exchange and validation + virtual void DoDataExchange(CDataExchange* pDX); + +public: + // for translating Windows messages in main message pump + virtual BOOL PreTranslateMessage(MSG* pMsg); + +protected: + // for processing Windows messages + virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); + + // for handling default processing + LRESULT Default(); + virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam); + + // for custom cleanup after WM_NCDESTROY + virtual void PostNcDestroy(); + + // for notifications from parent + virtual BOOL OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, + LRESULT* pResult); + // return TRUE if parent should not process this message + +// Implementation +public: + virtual ~CWnd(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif +#ifndef _AFXCTL +#ifndef _USRDLL + // 3D support (these APIs will be obsolete with next version of Windows) + BOOL SubclassCtl3d(int nControlType = -1); + // see CTL3D.H for list of control types + BOOL SubclassDlg3d(DWORD dwMask = 0xFFFF /*CTL3D_ALL*/); + // see CTL3D.H for list of mask values +#endif +#endif + + // helper routines for implementation + BOOL HandleFloatingSysCommand(UINT nID, LPARAM lParam); + HWND GetFirstLevelChild(HWND hWndLevel); + BOOL IsTopParentActive() const; + void ActivateTopParent(); + HWND FindNextControl(HWND hWnd, TCHAR ch); + static BOOL PASCAL WalkPreTranslateTree(HWND hWndStop, MSG* pMsg); + BOOL SendChildNotifyLastMsg(LRESULT* pResult = NULL); + BOOL ExecuteDlgInit(LPCTSTR lpszResourceName); + static BOOL PASCAL GrayCtlColor(HDC hDC, HWND hWnd, UINT nCtlColor, + HBRUSH hbrGray, COLORREF clrText); + HBRUSH OnGrayCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); + static CWnd* PASCAL GetDescendantWindow(HWND hWnd, int nID, + BOOL bOnlyPerm); + static void PASCAL SendMessageToDescendants(HWND hWnd, UINT message, + WPARAM wParam, LPARAM lParam, BOOL bDeep, BOOL bOnlyPerm); + virtual BOOL IsFrameWnd() const; // IsKindOf(RUNTIME_CLASS(CFrameWnd))) + virtual void OnFinalRelease(); + BOOL PreTranslateInput(LPMSG lpMsg); + + // advanced scrolling functions for future versions of Windows + BOOL SetScrollInfo(int nBar, LPSCROLLINFO lpScrollInfo, + BOOL bRedraw = TRUE); + BOOL GetScrollInfo(int nBar, LPSCROLLINFO lpScrollInfo); + +public: + HWND m_hWndOwner; // implementation of SetOwner and GetOwner + +protected: + WNDPROC m_pfnSuper; // for subclassing of controls + BOOL m_bTempHidden; // window is temporarily hidden + + COleDropTarget* m_pDropTarget; // for automatic cleanup of drop target + friend class COleDropTarget; + friend class CFrameWnd; + + // implementation of message dispatch/hooking + friend LRESULT CALLBACK _AfxSendMsgHook(int, WPARAM, LPARAM); + friend void AFXAPI _AfxStandardSubclass(HWND); + friend LRESULT AFXAPI AfxCallWndProc(CWnd*, HWND, UINT, WPARAM, LPARAM); + + // standard message implementation + afx_msg LRESULT OnNTCtlColor(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnQuery3dControls(WPARAM, LPARAM); + afx_msg LRESULT OnDisplayChange(WPARAM, LPARAM); + + //{{AFX_MSG(CWnd) + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +private: + CWnd(HWND hWnd); // just for special initialization +}; + +// helpers for registering your own WNDCLASSes +LPCTSTR AFXAPI AfxRegisterWndClass(UINT nClassStyle, + HCURSOR hCursor = 0, HBRUSH hbrBackground = 0, HICON hIcon = 0); + +#if defined(_USRDLL) || defined(_AFXCTL) +BOOL AFXAPI AfxRegisterClass(WNDCLASS* lpWndClass); +#else +#define AfxRegisterClass RegisterClass +#endif + +// Implementation +LRESULT CALLBACK AfxWndProc(HWND, UINT, WPARAM, LPARAM); + +WNDPROC AFXAPI AfxGetAfxWndProc(); +#define AfxWndProc (*AfxGetAfxWndProc()) + +typedef void (AFX_MSG_CALL CWnd::*AFX_PMSGW)(void); + // like 'AFX_PMSG' but for CWnd derived classes only + +///////////////////////////////////////////////////////////////////////////// +// CDialog - a modal or modeless dialog + +class CDialog : public CWnd +{ + DECLARE_DYNAMIC(CDialog) + + // Modeless construct +public: + CDialog(); + + BOOL Create(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL); + BOOL Create(UINT nIDTemplate, CWnd* pParentWnd = NULL); + BOOL CreateIndirect(const void* lpDialogTemplate, CWnd* pParentWnd = NULL); + + // Modal construct +public: + CDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL); + CDialog(UINT nIDTemplate, CWnd* pParentWnd = NULL); + + BOOL InitModalIndirect(HGLOBAL hDialogTemplate); + // was CModalDialog::Create() in MFC 1.0 + +// Attributes +public: + void MapDialogRect(LPRECT lpRect) const; + void SetHelpID(UINT nIDR); + +// Operations +public: + // modal processing + virtual int DoModal(); + + // message processing for modeless + BOOL IsDialogMessage(LPMSG lpMsg); + + // support for passing on tab control - use 'PostMessage' if needed + void NextDlgCtrl() const; + void PrevDlgCtrl() const; + void GotoDlgCtrl(CWnd* pWndCtrl); + + // default button access + void SetDefID(UINT nID); + DWORD GetDefID() const; + + // termination + void EndDialog(int nResult); + +// Overridables (special message map entries) + virtual BOOL OnInitDialog(); + virtual void OnSetFont(CFont* pFont); +protected: + virtual void OnOK(); + virtual void OnCancel(); + +// Implementation +public: + virtual ~CDialog(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + virtual BOOL PreTranslateMessage(MSG* pMsg); + virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, + AFX_CMDHANDLERINFO* pHandlerInfo); + BOOL CheckAutoCenter(); + +protected: + UINT m_nIDHelp; // Help ID (0 for none, see HID_BASE_RESOURCE) + + // parameters for 'DoModal' + LPCTSTR m_lpDialogTemplate; // name or MAKEINTRESOURCE + HGLOBAL m_hDialogTemplate; // Indirect if (lpDialogTemplate == NULL) + CWnd* m_pParentWnd; + HWND m_hWndTopLevel; // disabled top-level parent + + // implementation helpers + HWND PreModal(); + void PostModal(); + +protected: + //{{AFX_MSG(CDialog) + afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); + afx_msg LRESULT OnCommandHelp(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnHelpHitTest(WPARAM wParam, LPARAM lParam); + //}}AFX_MSG +#ifdef _MAC + afx_msg void OnSysColorChange(); +#endif + DECLARE_MESSAGE_MAP() +}; + +// all CModalDialog functionality is now in CDialog +#define CModalDialog CDialog + +///////////////////////////////////////////////////////////////////////////// +// Standard Windows controls + +class CStatic : public CWnd +{ + DECLARE_DYNAMIC(CStatic) + +// Constructors +public: + CStatic(); + BOOL Create(LPCTSTR lpszText, DWORD dwStyle, + const RECT& rect, CWnd* pParentWnd, UINT nID = 0xffff); + + HICON SetIcon(HICON hIcon); + HICON GetIcon() const; + +// Implementation +public: + virtual ~CStatic(); +}; + +class CButton : public CWnd +{ + DECLARE_DYNAMIC(CButton) + +// Constructors +public: + CButton(); + BOOL Create(LPCTSTR lpszCaption, DWORD dwStyle, + const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Attributes + UINT GetState() const; + void SetState(BOOL bHighlight); + int GetCheck() const; + void SetCheck(int nCheck); + UINT GetButtonStyle() const; + void SetButtonStyle(UINT nStyle, BOOL bRedraw = TRUE); + +// Overridables (for owner draw only) + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + +// Implementation +public: + virtual ~CButton(); +protected: + virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*); +}; + +class CListBox : public CWnd +{ + DECLARE_DYNAMIC(CListBox) + +// Constructors +public: + CListBox(); + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Attributes + + // for entire listbox + int GetCount() const; + int GetHorizontalExtent() const; + void SetHorizontalExtent(int cxExtent); + int GetTopIndex() const; + int SetTopIndex(int nIndex); + LCID GetLocale() const; + LCID SetLocale(LCID nNewLocale); + + // for single-selection listboxes + int GetCurSel() const; + int SetCurSel(int nSelect); + + // for multiple-selection listboxes + int GetSel(int nIndex) const; // also works for single-selection + int SetSel(int nIndex, BOOL bSelect = TRUE); + int GetSelCount() const; + int GetSelItems(int nMaxItems, LPINT rgIndex) const; + void SetAnchorIndex(int nIndex); + int GetAnchorIndex() const; + + // for listbox items + DWORD GetItemData(int nIndex) const; + int SetItemData(int nIndex, DWORD dwItemData); + void* GetItemDataPtr(int nIndex) const; + int SetItemDataPtr(int nIndex, void* pData); + int GetItemRect(int nIndex, LPRECT lpRect) const; + int GetText(int nIndex, LPTSTR lpszBuffer) const; + int GetTextLen(int nIndex) const; + void GetText(int nIndex, CString& rString) const; + + // Settable only attributes + void SetColumnWidth(int cxWidth); + BOOL SetTabStops(int nTabStops, LPINT rgTabStops); + void SetTabStops(); + BOOL SetTabStops(const int& cxEachStop); // takes an 'int' + + int SetItemHeight(int nIndex, UINT cyItemHeight); + int GetItemHeight(int nIndex) const; + int FindStringExact(int nIndexStart, LPCTSTR lpszFind) const; + int GetCaretIndex() const; + int SetCaretIndex(int nIndex, BOOL bScroll = TRUE); + +// Operations + // manipulating listbox items + int AddString(LPCTSTR lpszItem); + int DeleteString(UINT nIndex); + int InsertString(int nIndex, LPCTSTR lpszItem); + void ResetContent(); + int Dir(UINT attr, LPCTSTR lpszWildCard); + + // selection helpers + int FindString(int nStartAfter, LPCTSTR lpszItem) const; + int SelectString(int nStartAfter, LPCTSTR lpszItem); + int SelItemRange(BOOL bSelect, int nFirstItem, int nLastItem); + +// Overridables (must override draw, measure and compare for owner draw) + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct); + virtual int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct); + virtual void DeleteItem(LPDELETEITEMSTRUCT lpDeleteItemStruct); + +// Implementation +public: + virtual ~CListBox(); +protected: + virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*); +}; + +class CComboBox : public CWnd +{ + DECLARE_DYNAMIC(CComboBox) + +// Constructors +public: + CComboBox(); + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Attributes + // for entire combo box + int GetCount() const; + int GetCurSel() const; + int SetCurSel(int nSelect); + LCID GetLocale() const; + LCID SetLocale(LCID nNewLocale); + + // for edit control + DWORD GetEditSel() const; + BOOL LimitText(int nMaxChars); + BOOL SetEditSel(int nStartChar, int nEndChar); + + // for combobox item + DWORD GetItemData(int nIndex) const; + int SetItemData(int nIndex, DWORD dwItemData); + void* GetItemDataPtr(int nIndex) const; + int SetItemDataPtr(int nIndex, void* pData); + int GetLBText(int nIndex, LPTSTR lpszText) const; + int GetLBTextLen(int nIndex) const; + void GetLBText(int nIndex, CString& rString) const; + + int SetItemHeight(int nIndex, UINT cyItemHeight); + int GetItemHeight(int nIndex) const; + int FindStringExact(int nIndexStart, LPCTSTR lpszFind) const; + int SetExtendedUI(BOOL bExtended = TRUE); + BOOL GetExtendedUI() const; + void GetDroppedControlRect(LPRECT lprect) const; + BOOL GetDroppedState() const; + +// Operations + // for drop-down combo boxes + void ShowDropDown(BOOL bShowIt = TRUE); + + // manipulating listbox items + int AddString(LPCTSTR lpszString); + int DeleteString(UINT nIndex); + int InsertString(int nIndex, LPCTSTR lpszString); + void ResetContent(); + int Dir(UINT attr, LPCTSTR lpszWildCard); + + // selection helpers + int FindString(int nStartAfter, LPCTSTR lpszString) const; + int SelectString(int nStartAfter, LPCTSTR lpszString); + + // Clipboard operations + void Clear(); + void Copy(); + void Cut(); + void Paste(); + +// Overridables (must override draw, measure and compare for owner draw) + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct); + virtual int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct); + virtual void DeleteItem(LPDELETEITEMSTRUCT lpDeleteItemStruct); + +// Implementation +public: + virtual ~CComboBox(); +protected: + virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*); +}; + +class CEdit : public CWnd +{ + DECLARE_DYNAMIC(CEdit) + +// Constructors +public: + CEdit(); + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Attributes + BOOL CanUndo() const; + int GetLineCount() const; + BOOL GetModify() const; + void SetModify(BOOL bModified = TRUE); + void GetRect(LPRECT lpRect) const; + DWORD GetSel() const; + void GetSel(int& nStartChar, int& nEndChar) const; + HLOCAL GetHandle() const; + void SetHandle(HLOCAL hBuffer); + + // NOTE: first word in lpszBuffer must contain the size of the buffer! + int GetLine(int nIndex, LPTSTR lpszBuffer) const; + int GetLine(int nIndex, LPTSTR lpszBuffer, int nMaxLength) const; + +// Operations + void EmptyUndoBuffer(); + BOOL FmtLines(BOOL bAddEOL); + + void LimitText(int nChars = 0); + int LineFromChar(int nIndex = -1) const; + int LineIndex(int nLine = -1) const; + int LineLength(int nLine = -1) const; + void LineScroll(int nLines, int nChars = 0); + void ReplaceSel(LPCTSTR lpszNewText); + void SetPasswordChar(TCHAR ch); + void SetRect(LPCRECT lpRect); + void SetRectNP(LPCRECT lpRect); + void SetSel(DWORD dwSelection, BOOL bNoScroll = FALSE); + void SetSel(int nStartChar, int nEndChar, BOOL bNoScroll = FALSE); +#ifndef _MAC + BOOL SetTabStops(int nTabStops, LPINT rgTabStops); + void SetTabStops(); + BOOL SetTabStops(const int& cxEachStop); // takes an 'int' +#endif + + // Clipboard operations + BOOL Undo(); + void Clear(); + void Copy(); + void Cut(); + void Paste(); + + BOOL SetReadOnly(BOOL bReadOnly = TRUE); + int GetFirstVisibleLine() const; + TCHAR GetPasswordChar() const; + +// Implementation +public: + virtual ~CEdit(); +}; + +class CScrollBar : public CWnd +{ + DECLARE_DYNAMIC(CScrollBar) + +// Constructors +public: + CScrollBar(); + BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID); + +// Attributes + int GetScrollPos() const; + int SetScrollPos(int nPos, BOOL bRedraw = TRUE); + void GetScrollRange(LPINT lpMinPos, LPINT lpMaxPos) const; + void SetScrollRange(int nMinPos, int nMaxPos, BOOL bRedraw = TRUE); + void ShowScrollBar(BOOL bShow = TRUE); + + BOOL EnableScrollBar(UINT nArrowFlags = ESB_ENABLE_BOTH); + +// Implementation +public: + virtual ~CScrollBar(); +}; + +///////////////////////////////////////////////////////////////////////////// +// CFrameWnd - base class for SDI and other frame windows + +// Frame window styles +#define FWS_ADDTOTITLE 0x00008000L // modify title based on content +#define FWS_PREFIXTITLE 0x00004000L // show document name before app name +#define FWS_SNAPTOBARS 0x00002000L // snap size to size of contained bars + +struct CPrintPreviewState; // forward reference (see afxext.h) +class CControlBar; // forward reference (see afxext.h) + +class CDockBar; // forward reference (see afxpriv.h) +class CMiniDockFrameWnd; // forward reference (see afxpriv.h) +class CDockState; // forward reference (see afxpriv.h) + +class COleFrameHook; // forward reference (see ..\src\oleimpl.h) + +class CFrameWnd : public CWnd +{ + DECLARE_DYNCREATE(CFrameWnd) + +// Constructors +public: + static AFX_DATA const CRect rectDefault; + CFrameWnd(); + + BOOL LoadAccelTable(LPCTSTR lpszResourceName); + BOOL Create(LPCTSTR lpszClassName, + LPCTSTR lpszWindowName, + DWORD dwStyle = WS_OVERLAPPEDWINDOW, + const RECT& rect = rectDefault, + CWnd* pParentWnd = NULL, // != NULL for popups + LPCTSTR lpszMenuName = NULL, + DWORD dwExStyle = 0, + CCreateContext* pContext = NULL); + + // dynamic creation - load frame and associated resources + virtual BOOL LoadFrame(UINT nIDResource, + DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, + CWnd* pParentWnd = NULL, + CCreateContext* pContext = NULL); + +// Attributes + virtual CDocument* GetActiveDocument(); + + // Active child view maintenance + CView* GetActiveView() const; // active view or NULL + void SetActiveView(CView* pViewNew, BOOL bNotify = TRUE); + // active view or NULL, bNotify == FALSE if focus should not be set + + // Active frame (for frames within frames -- MDI) + virtual CFrameWnd* GetActiveFrame(); + + // For customizing the default messages on the status bar + virtual void GetMessageString(UINT nID, CString& rMessage) const; + + BOOL m_bAutoMenuEnable; + // TRUE => menu items without handlers will be disabled + +// Operations + virtual void RecalcLayout(BOOL bNotify = TRUE); + virtual void ActivateFrame(int nCmdShow = -1); + + // to set text of standard status bar + void SetMessageText(LPCTSTR lpszText); + void SetMessageText(UINT nID); + + // control bar docking + void EnableDocking(DWORD dwDockStyle); + void DockControlBar(CControlBar* pBar, UINT nDockBarID = 0, + LPCRECT lpRect = NULL); + void FloatControlBar(CControlBar* pBar, CPoint point, + DWORD dwStyle = CBRS_ALIGN_TOP); + CControlBar* GetControlBar(UINT nID); + + // saving and loading control bar state + void LoadBarState(LPCTSTR lpszProfileName); + void SaveBarState(LPCTSTR lpszProfileName) const; + +// Overridables + virtual void OnSetPreviewMode(BOOL bPreview, CPrintPreviewState* pState); +protected: + virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext); + +// Command Handlers +public: + afx_msg void OnContextHelp(); // for Shift+F1 help + +// Implementation +public: + virtual ~CFrameWnd(); + int m_nWindow; // general purpose window number - display as ":n" + // -1 => unknown, 0 => only window viewing document + // 1 => first of many windows viewing document, 2=> second + + HMENU m_hMenuDefault; // default menu resource for this frame + HACCEL m_hAccelTable; // accelerator table + DWORD m_dwPromptContext; // current help prompt context for message box + BOOL m_bHelpMode; // if TRUE, then Shift+F1 help mode is active + BOOL m_bStayActive; // if TRUE, then caption is forced active + CFrameWnd* m_pNextFrameWnd; // next CFrameWnd in app global list + CRect m_rectBorder; // for OLE 2.0 border space negotiation + COleFrameHook* m_pNotifyHook; + + CPtrList m_listControlBars; // array of all control bars that have this + // window as their dock site + BOOL m_bModalDisable; // TRUE if BeginModalState for WM_ENABLE + int m_nShowDelay; // SW_ command for delay show/hide + + CMiniDockFrameWnd* CreateFloatingFrame(DWORD dwStyle); + DWORD CanDock(CRect rect, DWORD dwDockStyle, + CDockBar** ppDockBar = NULL); // called by CDockContext + void AddControlBar(CControlBar *pBar); + void RemoveControlBar(CControlBar *pBar); + void DockControlBar(CControlBar* pBar, CDockBar* pDockBar, + LPCRECT lpRect = NULL); + void NotifyFloatingWindows(DWORD dwFlags); + void ShowControlBar(CControlBar* pBar, BOOL bShow, BOOL bDelay); + void DestroyDockBars(); + // for loading and saving control bar state + void SetDockState(const CDockState& state); + void GetDockState(CDockState& state) const; + +protected: + UINT m_nIDHelp; // Help ID (0 for none, see HID_BASE_RESOURCE) + UINT m_nIDTracking; // tracking command ID or string IDS + UINT m_nIDLastMessage; // last displayed message string IDS + CView* m_pViewActive; // current active view + BOOL (CALLBACK* m_lpfnCloseProc)(CFrameWnd* pFrameWnd); + UINT m_cModalStack; // BeginModalState depth + HWND* m_phWndDisable; // windows disabled because of BeginModalState + HMENU m_hMenuAlt; // menu to update to (NULL means default) + CString m_strTitle; // default title (original) + BOOL m_bInRecalcLayout; // avoid recursion in RecalcLayout + CRuntimeClass* m_pFloatingFrameClass; + static const DWORD dwDockBarMap[4][2]; + +public: +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + virtual BOOL IsFrameWnd() const; + BOOL IsTracking() const; + virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, + AFX_CMDHANDLERINFO* pHandlerInfo); + virtual CWnd* GetMessageBar(); + virtual void OnUpdateFrameTitle(BOOL bAddToTitle); + virtual void OnUpdateFrameMenu(HMENU hMenuAlt); + virtual HACCEL GetDefaultAccelerator(); + virtual BOOL PreTranslateMessage(MSG* pMsg); + void InitialUpdateFrame(CDocument* pDoc, BOOL bMakeVisible); + + // idle update of frame user interface + enum IdleFlags + { idleMenu = 1, idleTitle = 2, idleNotify = 4, idleLayout = 8 }; + UINT m_nIdleFlags; // set of bit flags for idle processing + virtual void DelayUpdateFrameMenu(HMENU hMenuAlt); + void DelayUpdateFrameTitle(); + void DelayRecalcLayout(BOOL bNotify = TRUE); + + // border space negotiation + enum BorderCmd + { borderGet = 1, borderRequest = 2, borderSet = 3 }; + virtual BOOL NegotiateBorderSpace(UINT nBorderCmd, LPRECT lpRectBorder); + + // frame window based modality + void BeginModalState(); + void EndModalState(); + BOOL InModalState() const; + void ShowOwnedWindows(BOOL bShow); + + // for Shift+F1 help support + BOOL CanEnterHelpMode(); + virtual void ExitHelpMode(); + +protected: + // implementation helpers + LPCTSTR GetIconWndClass(DWORD dwDefaultStyle, UINT nIDResource); + void UpdateFrameTitleForDocument(LPCTSTR lpszDocName); + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); + virtual void PostNcDestroy(); // default to delete this. + int OnCreateHelper(LPCREATESTRUCT lpcs, CCreateContext* pContext); + void BringToTop(int nCmdShow); + // bring window to top for SW_ commands which affect z-order + + // implementation helpers for Shift+F1 help mode + BOOL ProcessHelpMsg(MSG& msg, DWORD* pContext); + HWND SetHelpCapture(POINT point, BOOL* pbDescendant); + + // CFrameWnd list management + void AddFrameWnd(); + void RemoveFrameWnd(); + + friend class CWnd; // for access to m_bModalDisable + + //{{AFX_MSG(CFrameWnd) + // Windows messages + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnDestroy(); + afx_msg void OnClose(); + afx_msg void OnInitMenuPopup(CMenu*, UINT, BOOL); + afx_msg void OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu); + afx_msg LRESULT OnSetMessageString(WPARAM wParam, LPARAM lParam); + afx_msg void OnIdleUpdateCmdUI(); + afx_msg void OnEnterIdle(UINT nWhy, CWnd* pWho); + afx_msg void OnSetFocus(CWnd* pOldWnd); + afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); + afx_msg BOOL OnNcActivate(BOOL bActive); + afx_msg void OnSysCommand(UINT nID, LONG lParam); + afx_msg BOOL OnQueryEndSession(); + afx_msg void OnEndSession(BOOL bEnding); + afx_msg void OnDropFiles(HDROP hDropInfo); + afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); + afx_msg LRESULT OnCommandHelp(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnHelpHitTest(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnActivateTopLevel(WPARAM wParam, LPARAM lParam); + afx_msg void OnEnable(BOOL bEnable); + // standard commands + afx_msg BOOL OnToolTipText(UINT nID, NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnUpdateKeyIndicator(CCmdUI* pCmdUI); + afx_msg void OnHelp(); + afx_msg void OnUpdateContextHelp(CCmdUI* pCmdUI); + //}}AFX_MSG +public: + afx_msg void OnUpdateControlBarMenu(CCmdUI* pCmdUI); + afx_msg BOOL OnBarCheck(UINT nID); +protected: +#ifndef _MAC + afx_msg LRESULT OnDDEInitiate(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnDDEExecute(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnDDETerminate(WPARAM wParam, LPARAM lParam); +#endif +#ifdef _MAC + afx_msg void OnActivateApp(BOOL bActive, HTASK hTask); + afx_msg void OnPaint(); +#endif + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// MDI Support + +#ifndef _AFXCTL +class CMDIFrameWnd : public CFrameWnd +{ + DECLARE_DYNCREATE(CMDIFrameWnd) + +public: +// Constructors + CMDIFrameWnd(); + +// Operations + void MDIActivate(CWnd* pWndActivate); + CMDIChildWnd* MDIGetActive(BOOL* pbMaximized = NULL) const; + void MDIIconArrange(); + void MDIMaximize(CWnd* pWnd); + void MDINext(); + void MDIRestore(CWnd* pWnd); + CMenu* MDISetMenu(CMenu* pFrameMenu, CMenu* pWindowMenu); + void MDITile(); + void MDICascade(); + void MDITile(int nType); + void MDICascade(int nType); + +// Overridables + // MFC 1.0 backward compatible CreateClient hook (called by OnCreateClient) + virtual BOOL CreateClient(LPCREATESTRUCT lpCreateStruct, CMenu* pWindowMenu); + // customize if using an 'Window' menu with non-standard IDs + virtual HMENU GetWindowMenuPopup(HMENU hMenuBar); + +// Implementation +public: + HWND m_hWndMDIClient; // MDI Client window handle + +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + virtual BOOL LoadFrame(UINT nIDResource, + DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, + CWnd* pParentWnd = NULL, + CCreateContext* pContext = NULL); + virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext); + virtual BOOL PreTranslateMessage(MSG* pMsg); + virtual void OnUpdateFrameTitle(BOOL bAddToTitle); + virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, + AFX_CMDHANDLERINFO* pHandlerInfo); + virtual void OnUpdateFrameMenu(HMENU hMenuAlt); + virtual void DelayUpdateFrameMenu(HMENU hMenuAlt); + virtual CFrameWnd* GetActiveFrame(); + +protected: + virtual LRESULT DefWindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam); + virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); + + //{{AFX_MSG(CMDIFrameWnd) + afx_msg void OnDestroy(); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnUpdateMDIWindowCmd(CCmdUI* pCmdUI); + afx_msg BOOL OnMDIWindowCmd(UINT nID); + afx_msg void OnWindowNew(); + afx_msg LRESULT OnCommandHelp(WPARAM wParam, LPARAM lParam); + afx_msg void OnIdleUpdateCmdUI(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +class CMDIChildWnd : public CFrameWnd +{ + DECLARE_DYNCREATE(CMDIChildWnd) + +// Constructors +public: + CMDIChildWnd(); + + BOOL Create(LPCTSTR lpszClassName, + LPCTSTR lpszWindowName, + DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW, + const RECT& rect = rectDefault, + CMDIFrameWnd* pParentWnd = NULL, + CCreateContext* pContext = NULL); + +// Attributes + CMDIFrameWnd* GetMDIFrame(); + +// Operations + void MDIDestroy(); + void MDIActivate(); + void MDIMaximize(); + void MDIRestore(); + +// Implementation +protected: + HMENU m_hMenuShared; // menu when we are active + +public: +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + virtual BOOL LoadFrame(UINT nIDResource, DWORD dwDefaultStyle, + CWnd* pParentWnd, CCreateContext* pContext = NULL); + // 'pParentWnd' parameter is required for MDI Child + virtual BOOL DestroyWindow(); + virtual BOOL PreTranslateMessage(MSG* pMsg); + virtual void ActivateFrame(int nCmdShow = -1); + virtual void OnUpdateFrameMenu(BOOL bActive, CWnd* pActivateWnd, + HMENU hMenuAlt); + + BOOL m_bPseudoInactive; // TRUE if window is MDI active according to + // windows, but not according to MFC... + +protected: + virtual CWnd* GetMessageBar(); + virtual void OnUpdateFrameTitle(BOOL bAddToTitle); + virtual LRESULT DefWindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam); + BOOL UpdateClientEdge(LPRECT lpRect = NULL); + + //{{AFX_MSG(CMDIChildWnd) + afx_msg void OnMDIActivate(BOOL bActivate, CWnd*, CWnd*); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg BOOL OnNcCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnWindowPosChanging(LPWINDOWPOS lpWndPos); + afx_msg BOOL OnNcActivate(BOOL bActive); + afx_msg void OnDestroy(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; +#endif //!_AFXCTL + +///////////////////////////////////////////////////////////////////////////// +// CMiniFrameWnd + +// MiniFrame window styles +#define MFS_SYNCACTIVE 0x00000100L // syncronize activation w/ parent +#define MFS_4THICKFRAME 0x00000200L // thick frame all around (no tiles) +#define MFS_THICKFRAME 0x00000400L // use instead of WS_THICKFRAME +#define MFS_MOVEFRAME 0x00000800L // no sizing, just moving +#define MFS_BLOCKSYSMENU 0x00001000L // block hit testing on system menu + +class CMiniFrameWnd : public CFrameWnd +{ + DECLARE_DYNCREATE(CMiniFrameWnd) + +// Constructors +public: + CMiniFrameWnd(); + BOOL Create(LPCTSTR lpClassName, LPCTSTR lpWindowName, + DWORD dwStyle, const RECT& rect, + CWnd* pParentWnd = NULL, UINT nID = 0); + +// Implementation +public: + ~CMiniFrameWnd(); + + //{{AFX_MSG(CMiniFrameWnd) + afx_msg BOOL OnNcActivate(BOOL bActive); + afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpParams); + afx_msg UINT OnNcHitTest(CPoint point); + afx_msg void OnNcPaint(); + afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint pt ); + afx_msg void OnLButtonUp(UINT nFlags, CPoint pt ); + afx_msg void OnMouseMove(UINT nFlags, CPoint pt ); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + afx_msg void OnGetMinMaxInfo(MINMAXINFO* pMMI); + afx_msg LRESULT OnGetText(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnGetTextLength(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnFloatStatus(WPARAM wParam, LPARAM lParam); + afx_msg LRESULT OnQueryCenterWnd(WPARAM wParam, LPARAM lParam); + afx_msg BOOL OnNcCreate(LPCREATESTRUCT lpcs); + //}}AFX_MSG +#ifdef _MAC + afx_msg LRESULT OnMacintosh(WPARAM wParam, LPARAM lParam); +#endif + DECLARE_MESSAGE_MAP() + +public: + virtual void CalcWindowRect(LPRECT lpClientRect, + UINT nAdjustType = adjustBorder); + +protected: + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + +protected: + BOOL m_bSysTracking; + BOOL m_bInSys; + BOOL m_bActive; + CString m_strCaption; + + void InvertSysMenu(); +}; + +///////////////////////////////////////////////////////////////////////////// +// class CView is the client area UI for a document + +class CPrintDialog; // forward reference (see afxdlgs.h) +class CPreviewView; // forward reference (see afxpriv.h) +class CSplitterWnd; // forward reference (see afxext.h) +class COleServerDoc; // forward reference (see afxole.h) + +typedef DWORD DROPEFFECT; +class COleDataObject; // forward reference (see afxole.h) + +class CView : public CWnd +{ + DECLARE_DYNAMIC(CView) + +// Constructors +protected: + CView(); + +// Attributes +public: + CDocument* GetDocument() const; + +// Operations +public: + // for standard printing setup (override OnPreparePrinting) + BOOL DoPreparePrinting(CPrintInfo* pInfo); + +// Overridables +public: + virtual BOOL IsSelected(const CObject* pDocItem) const; // support for OLE + + // OLE 2.0 scrolling support (used for drag/drop as well) + virtual BOOL OnScroll(UINT nScrollCode, UINT nPos, BOOL bDoScroll = TRUE); + virtual BOOL OnScrollBy(CSize sizeScroll, BOOL bDoScroll = TRUE); + + // OLE 2.0 drag/drop support + virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject, + DWORD dwKeyState, CPoint point); + virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject, + DWORD dwKeyState, CPoint point); + virtual void OnDragLeave(); + virtual BOOL OnDrop(COleDataObject* pDataObject, + DROPEFFECT dropEffect, CPoint point); + + virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL); + + virtual void OnInitialUpdate(); // called first time after construct + +protected: + // Activation + virtual void OnActivateView(BOOL bActivate, CView* pActivateView, + CView* pDeactiveView); + + // General drawing/updating + virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint); + virtual void OnDraw(CDC* pDC) = 0; + + // Printing support + virtual BOOL OnPreparePrinting(CPrintInfo* pInfo); + // must override to enable printing and print preview + + virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo); + virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo); + virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo); + + // Advanced: end print preview mode, move to point + virtual void OnEndPrintPreview(CDC* pDC, CPrintInfo* pInfo, POINT point, + CPreviewView* pView); + +// Implementation +public: + virtual ~CView(); +#ifdef _DEBUG + virtual void Dump(CDumpContext&) const; + virtual void AssertValid() const; +#endif //_DEBUG + + // Advanced: for implementing custom print preview + BOOL DoPrintPreview(UINT nIDResource, CView* pPrintView, + CRuntimeClass* pPreviewViewClass, CPrintPreviewState* pState); + + virtual void CalcWindowRect(LPRECT lpClientRect, + UINT nAdjustType = adjustBorder); + virtual CScrollBar* GetScrollBarCtrl(int nBar) const; + static CSplitterWnd* PASCAL GetParentSplitter( + const CWnd* pWnd, BOOL bAnyState); + +protected: + CDocument* m_pDocument; + + virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, + AFX_CMDHANDLERINFO* pHandlerInfo); + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + virtual void PostNcDestroy(); + virtual void OnActivateFrame(UINT nState, CFrameWnd* pFrameWnd); + + // friend classes that call protected CView overridables + friend class CDocument; + friend class CDocTemplate; + friend class CPreviewView; + friend class CFrameWnd; +#ifndef _AFXCTL + friend class CMDIFrameWnd; + friend class CMDIChildWnd; +#endif + friend class CSplitterWnd; + friend class COleServerDoc; + + //{{AFX_MSG(CView) + afx_msg int OnCreate(LPCREATESTRUCT lpcs); + afx_msg void OnDestroy(); + afx_msg void OnPaint(); + afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message); + // commands + afx_msg void OnUpdateSplitCmd(CCmdUI* pCmdUI); + afx_msg BOOL OnSplitCmd(UINT nID); + afx_msg void OnUpdateNextPaneMenu(CCmdUI* pCmdUI); + afx_msg BOOL OnNextPaneCmd(UINT nID); + + // not mapped commands - must be mapped in derived class + afx_msg void OnFilePrint(); + afx_msg void OnFilePrintPreview(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// class CScrollView supports simple scrolling and scaling + +class CScrollView : public CView +{ + DECLARE_DYNAMIC(CScrollView) + +// Constructors +protected: + CScrollView(); + +public: + static AFX_DATA const SIZE sizeDefault; + // used to specify default calculated page and line sizes + + // in logical units - call one of the following Set routines + void SetScaleToFitSize(SIZE sizeTotal); + void SetScrollSizes(int nMapMode, SIZE sizeTotal, + const SIZE& sizePage = sizeDefault, + const SIZE& sizeLine = sizeDefault); + +// Attributes +public: + CPoint GetScrollPosition() const; // upper corner of scrolling + CSize GetTotalSize() const; // logical size + + // for device units + CPoint GetDeviceScrollPosition() const; + void GetDeviceScrollSizes(int& nMapMode, SIZE& sizeTotal, + SIZE& sizePage, SIZE& sizeLine) const; + +// Operations +public: + void ScrollToPosition(POINT pt); // set upper left position + void FillOutsideRect(CDC* pDC, CBrush* pBrush); + void ResizeParentToFit(BOOL bShrinkOnly = TRUE); + +// Implementation +protected: + int m_nMapMode; + CSize m_totalLog; // total size in logical units (no rounding) + CSize m_totalDev; // total size in device units + CSize m_pageDev; // per page scroll size in device units + CSize m_lineDev; // per line scroll size in device units + + BOOL m_bCenter; // Center output if larger than total size + BOOL m_bInsideUpdate; // internal state for OnSize callback + void CenterOnPoint(CPoint ptCenter); + void ScrollToDevicePosition(POINT ptDev); // explicit scrolling no checking + +protected: + virtual void OnDraw(CDC* pDC) = 0; // pass on pure virtual + + void UpdateBars(); // adjust scrollbars etc + BOOL GetTrueClientSize(CSize& size, CSize& sizeSb); + // size with no bars + void GetScrollBarSizes(CSize& sizeSb); + void GetScrollBarState(CSize sizeClient, CSize& needSb, + CSize& sizeRange, CPoint& ptMove, BOOL bInsideClient); + int GetScrollLimit(int nBar); + +public: + virtual ~CScrollView(); +#ifdef _DEBUG + virtual void Dump(CDumpContext&) const; + virtual void AssertValid() const; +#endif //_DEBUG + virtual void CalcWindowRect(LPRECT lpClientRect, + UINT nAdjustType = adjustBorder); + virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL); + void DoScrollWindow(int xAmount, int yAmount); + + // scrolling implementation support for OLE 2.0 + virtual BOOL OnScroll(UINT nScrollCode, UINT nPos, BOOL bDoScroll = TRUE); + virtual BOOL OnScrollBy(CSize sizeScroll, BOOL bDoScroll = TRUE); + + //{{AFX_MSG(CScrollView) + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// CWinThread + +typedef UINT (AFX_CDECL *AFX_THREADPROC)(LPVOID); + +class CWinThread : public CCmdTarget +{ + DECLARE_DYNAMIC(CWinThread) + +public: +// Constructors + CWinThread(); + BOOL CreateThread(DWORD dwCreateFlags = 0, UINT nStackSize = 0, + LPSECURITY_ATTRIBUTES lpSecurityAttrs = NULL); + +// Attributes + CWnd* m_pMainWnd; // main window (usually same AfxGetApp()->m_pMainWnd) + CWnd* m_pActiveWnd; // active main window (may not be m_pMainWnd) + BOOL m_bAutoDelete; // enables 'delete this' after thread termination + + // only valid while running + HANDLE m_hThread; // this thread's HANDLE + DWORD m_nThreadID; // this thread's ID + + int GetThreadPriority(); + BOOL SetThreadPriority(int nPriority); + +// Operations + DWORD SuspendThread(); + DWORD ResumeThread(); + +// Overridables + // thread initialization + virtual BOOL InitInstance(); + + // running and idle processing + virtual int Run(); + virtual BOOL PreTranslateMessage(MSG* pMsg); + virtual BOOL OnIdle(LONG lCount); // return TRUE if more idle processing + + // thread termination + virtual int ExitInstance(); // default will 'delete this' + + // Advanced: exception handling + virtual LRESULT ProcessWndProcException(CException* e, const MSG* pMsg); + + // Advanced: handling messages sent to message filter hook + virtual BOOL ProcessMessageFilter(int code, LPMSG lpMsg); + + // Advanced: virtual access to m_pMainWnd + virtual CWnd* GetMainWnd(); + +// Implementation +public: + virtual ~CWinThread(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; + int m_nDisablePumpCount; // Diagnostic trap to detect illegal re-entrancy +#endif + void CommonConstruct(); + virtual void Delete(); + // 'delete this' only if m_bAutoDelete == TRUE + + // message pump for Run + MSG m_msgCur; // current message + virtual BOOL PumpMessage(); // low level message pump + virtual BOOL IsIdleMessage(MSG* pMsg); // checks for special messages + +public: + // constructor used by implementation of AfxBeginThread + CWinThread(AFX_THREADPROC pfnThreadProc, LPVOID pParam); + + // valid after construction + LPVOID m_pThreadParams; // generic parameters passed to starting function + AFX_THREADPROC m_pfnThreadProc; + +protected: + CPoint m_ptCursorLast; // last mouse position + UINT m_nMsgLast; // last mouse message +}; + +// global helpers for threads + +CWinThread* AFXAPI AfxBeginThread(AFX_THREADPROC pfnThreadProc, LPVOID pParam, + int nPriority = THREAD_PRIORITY_NORMAL, UINT nStackSize = 0, + DWORD dwCreateFlags = 0, LPSECURITY_ATTRIBUTES lpSecurityAttrs = NULL); +CWinThread* AFXAPI AfxBeginThread(CRuntimeClass* pThreadClass, + int nPriority = THREAD_PRIORITY_NORMAL, UINT nStackSize = 0, + DWORD dwCreateFlags = 0, LPSECURITY_ATTRIBUTES lpSecurityAttrs = NULL); + +CWinThread* AFXAPI AfxGetThread(); +void AFXAPI AfxEndThread(UINT nExitCode); + +///////////////////////////////////////////////////////////////////////////// +// Global functions for access to the one and only CWinApp + +#define afxCurrentWinApp AfxGetCoreState()->m_pCurrentWinApp +#define afxCurrentInstanceHandle AfxGetCoreState()->m_hCurrentInstanceHandle +#define afxCurrentResourceHandle AfxGetCoreState()->m_hCurrentResourceHandle +#define afxCurrentAppName AfxGetCoreState()->m_lpszCurrentAppName + +// Advanced initialization: for overriding default WinMain +BOOL AFXAPI AfxWinInit(HINSTANCE, HINSTANCE, LPTSTR, int); +void AFXAPI AfxWinTerm(); + +// Global Windows state data helper functions (inlines) +CWinApp* AFXAPI AfxGetApp(); +CWnd* AFXAPI AfxGetMainWnd(); +HINSTANCE AFXAPI AfxGetInstanceHandle(); +HINSTANCE AFXAPI AfxGetResourceHandle(); +void AFXAPI AfxSetResourceHandle(HINSTANCE hInstResource); +LPCTSTR AFXAPI AfxGetAppName(); + +// Use instead of PostQuitMessage in OLE server applications +void AFXAPI AfxPostQuitMessage(int nExitCode); + +// Use AfxFindResourceHandle to find resource in chain of extension DLLs +HINSTANCE AFXAPI AfxFindResourceHandle(LPCTSTR lpszName, LPCTSTR lpszType); + +// In non-AFXDLL, the resource handle is always AfxGetResourceHandle +#ifndef _AFXDLL +#define AfxFindResourceHandle(lpszResource, lpszType) AfxGetResourceHandle() +#endif + +class COleMessageFilter; // forward reference (see afxole.h) +class CRecentFileList; // forward reference (see afxpriv.h) + +// access to message filter in CWinApp +COleMessageFilter* AFXAPI AfxOleGetMessageFilter(); + +///////////////////////////////////////////////////////////////////////////// +// CWinApp - the root of all Windows applications + +#define _AFX_MRU_COUNT 4 // default support for 4 entries in file MRU +#define _AFX_MRU_MAX_COUNT 16 // currently allocated id range supports 16 + +class CWinApp : public CWinThread +{ + DECLARE_DYNAMIC(CWinApp) +public: + +// Constructor + CWinApp(LPCTSTR lpszAppName = NULL); // app name defaults to EXE name + +// Attributes + // Startup args (do not change) + HINSTANCE m_hInstance; + HINSTANCE m_hPrevInstance; + LPTSTR m_lpCmdLine; + int m_nCmdShow; + + // Running args (can be changed in InitInstance) + LPCTSTR m_pszAppName; // human readable name + // (from constructor or AFX_IDS_APP_TITLE) + LPCTSTR m_pszRegistryKey; // used for registry entries + + // Support for Shift+F1 help mode. + BOOL m_bHelpMode; // are we in Shift+F1 mode? + +#ifdef _MAC + // Support for AppleEvent interaction levels + enum SaveOption + { + saveYes, // always save modified documents + saveNo, // never save modified documents + saveAsk // ask user whether to save modified documents + }; + SaveOption m_nSaveOption; +#endif + +public: // set in constructor to override default + LPCTSTR m_pszExeName; // executable name (no spaces) + LPCTSTR m_pszHelpFilePath; // default based on module path + LPCTSTR m_pszProfileName; // default based on app name + +// Initialization Operations - should be done in InitInstance +protected: + void LoadStdProfileSettings(UINT nMaxMRU = _AFX_MRU_COUNT); // load MRU file list and last preview state + void EnableShellOpen(); + + void SetDialogBkColor(COLORREF clrCtlBk = RGB(192, 192, 192), + COLORREF clrCtlText = RGB(0, 0, 0)); + // set dialog box and message box background color + + void SetRegistryKey(LPCTSTR lpszRegistryKey); + void SetRegistryKey(UINT nIDRegistryKey); + // enables app settings in registry instead of INI files + // (registry key is usually a "company name") + +#ifdef _MAC + friend void CFrameWnd::OnSysColorChange(); + friend void CDialog::OnSysColorChange(); +#endif + +#ifndef _AFXCTL +#ifndef _USRDLL + BOOL Enable3dControls(); // use CTL3D32.DLL for 3D controls in dialogs +#endif +#endif + + void RegisterShellFileTypes(); + // call after all doc templates are registered + +// Helper Operations - usually done in InitInstance +public: + // Cursors + HCURSOR LoadCursor(LPCTSTR lpszResourceName) const; + HCURSOR LoadCursor(UINT nIDResource) const; + HCURSOR LoadStandardCursor(LPCTSTR lpszCursorName) const; // for IDC_ values + HCURSOR LoadOEMCursor(UINT nIDCursor) const; // for OCR_ values + + // Icons + HICON LoadIcon(LPCTSTR lpszResourceName) const; + HICON LoadIcon(UINT nIDResource) const; + HICON LoadStandardIcon(LPCTSTR lpszIconName) const; // for IDI_ values + HICON LoadOEMIcon(UINT nIDIcon) const; // for OIC_ values + + // Profile settings (to the app specific .INI file, or registry) + UINT GetProfileInt(LPCTSTR lpszSection, LPCTSTR lpszEntry, int nDefault); + BOOL WriteProfileInt(LPCTSTR lpszSection, LPCTSTR lpszEntry, int nValue); + CString GetProfileString(LPCTSTR lpszSection, LPCTSTR lpszEntry, + LPCTSTR lpszDefault = NULL); + BOOL WriteProfileString(LPCTSTR lpszSection, LPCTSTR lpszEntry, + LPCTSTR lpszValue); + +// Running Operations - to be done on a running application + // Dealing with document templates + void AddDocTemplate(CDocTemplate* pTemplate); + + // Dealing with files + virtual CDocument* OpenDocumentFile(LPCTSTR lpszFileName); // open named file + virtual void AddToRecentFileList(LPCTSTR lpszPathName); // add to MRU + + // Printer DC Setup routine, 'struct tagPD' is a PRINTDLG structure +#ifndef _UNICODE + BOOL GetPrinterDeviceDefaults(struct tagPDA* pPrintDlg); +#else + BOOL GetPrinterDeviceDefaults(struct tagPDW* pPrintDlg); +#endif + + // Command line parsing + BOOL RunEmbedded(); + BOOL RunAutomated(); + +// Overridables + // hooks for your initialization code + virtual BOOL InitApplication(); + virtual BOOL InitInstance(); +#ifdef _MAC + virtual BOOL CreateInitialDocument(); +#endif + + // running and idle processing + virtual int Run(); + virtual BOOL PreTranslateMessage(MSG* pMsg); + virtual BOOL OnIdle(LONG lCount); // return TRUE if more idle processing + + // exiting + virtual BOOL SaveAllModified(); // save before exit + virtual int ExitInstance(); // return app exit code + + // Advanced: to override message boxes and other hooks + virtual int DoMessageBox(LPCTSTR lpszPrompt, UINT nType, UINT nIDPrompt); + virtual BOOL ProcessMessageFilter(int code, LPMSG lpMsg); + virtual LRESULT ProcessWndProcException(CException* e, const MSG* pMsg); + virtual void DoWaitCursor(int nCode); // 0 => restore, 1=> begin, -1=> end + +#ifndef _MAC + // Advanced: process async DDE request + virtual BOOL OnDDECommand(LPTSTR lpszCommand); +#endif + + // Advanced: Help support + virtual void WinHelp(DWORD dwData, UINT nCmd = HELP_CONTEXT); + + +// Command Handlers +protected: + // map to the following for file new/open + afx_msg void OnFileNew(); + afx_msg void OnFileOpen(); + + // map to the following to enable print setup + afx_msg void OnFilePrintSetup(); + + // map to the following to enable help + afx_msg void OnContextHelp(); // shift-F1 + afx_msg void OnHelp(); // F1 (uses current context) + afx_msg void OnHelpIndex(); // ID_HELP_INDEX, ID_DEFAULT_HELP + afx_msg void OnHelpUsing(); // ID_HELP_USING + +// Implementation +protected: + HGLOBAL m_hDevMode; // printer Dev Mode + HGLOBAL m_hDevNames; // printer Device Names + DWORD m_dwPromptContext; // help context override for message box + + int m_nWaitCursorCount; // for wait cursor (>0 => waiting) + HCURSOR m_hcurWaitCursorRestore; // old cursor to restore after wait cursor + + CRecentFileList* m_pRecentFileList; + + void UpdatePrinterSelection(BOOL bForceDefaults); + void SaveStdProfileSettings(); // save options to .INI file + +public: // public for implementation access + CPtrList m_templateList; // list of templates + + ATOM m_atomApp, m_atomSystemTopic; // for DDE open + UINT m_nNumPreviewPages; // number of default printed pages + + size_t m_nSafetyPoolSize; // ideal size + + void (CALLBACK* m_lpfnOleFreeLibraries)(); + void (CALLBACK* m_lpfnOleTerm)(BOOL); + COleMessageFilter* m_pMessageFilter; + + void DevModeChange(LPTSTR lpDeviceName); + void SetCurrentHandles(); + int GetOpenDocumentCount(); + + // helpers for standard commdlg dialogs + BOOL DoPromptFileName(CString& fileName, UINT nIDSTitle, + DWORD lFlags, BOOL bOpenFileDialog, CDocTemplate* pTemplate); + int DoPrintDialog(CPrintDialog* pPD); + + void EnableModeless(BOOL bEnable); // to disable OLE in-place dialogs + +public: + virtual ~CWinApp(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +#ifndef _MAC + // helpers for registration + HKEY GetSectionKey(LPCTSTR lpszSection); + HKEY GetAppRegistryKey(); +#endif + + void HideApplication(); // hide application before closing docs + void CloseAllDocuments(BOOL bEndSession); + // close documents before exiting + +protected: + //{{AFX_MSG(CWinApp) + afx_msg void OnAppExit(); + afx_msg void OnUpdateRecentFileMenu(CCmdUI* pCmdUI); + afx_msg BOOL OnOpenRecentFile(UINT nID); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// class CDocTemplate creates documents + +class CDocTemplate : public CCmdTarget +{ + DECLARE_DYNAMIC(CDocTemplate) + +// Constructors +protected: + CDocTemplate(UINT nIDResource, CRuntimeClass* pDocClass, + CRuntimeClass* pFrameClass, CRuntimeClass* pViewClass); + +// Attributes +public: + // setup for OLE containers + void SetContainerInfo(UINT nIDOleInPlaceContainer); + + // setup for OLE servers + void SetServerInfo(UINT nIDOleEmbedding, UINT nIDOleInPlaceServer = 0, + CRuntimeClass* pOleFrameClass = NULL, CRuntimeClass* pOleViewClass = NULL); + + // iterating over open documents + virtual POSITION GetFirstDocPosition() const = 0; + virtual CDocument* GetNextDoc(POSITION& rPos) const = 0; + +// Operations +public: + virtual void AddDocument(CDocument* pDoc); // must override + virtual void RemoveDocument(CDocument* pDoc); // must override + + enum DocStringIndex + { + windowTitle, // default window title + docName, // user visible name for default document + fileNewName, // user visible name for FileNew + // for file based documents: +#ifndef _MAC + filterName, // user visible name for FileOpen + filterExt, // user visible extension for FileOpen +#else + filterWinName, // user visible name for FileOpen + filterWinExt, // user visible extension for FileOpen +#endif + // for file based documents with Shell open support: + regFileTypeId, // REGEDIT visible registered file type identifier + regFileTypeName, // Shell visible registered file type name + // for Macintosh file based documents: +#ifdef _MAC + filterExt, // Macintosh file type for FileOpen + filterName // user visible name for Macintosh FileOpen +#else + filterMacExt, // Macintosh file type for FileOpen + filterMacName // user visible name for Macintosh FileOpen +#endif + }; + virtual BOOL GetDocString(CString& rString, + enum DocStringIndex index) const; // get one of the info strings + +// Overridables +public: + enum Confidence + { + noAttempt, + maybeAttemptForeign, + maybeAttemptNative, + yesAttemptForeign, + yesAttemptNative, + yesAlreadyOpen + }; +#ifndef _MAC + virtual Confidence MatchDocType(LPCTSTR lpszPathName, + CDocument*& rpDocMatch); +#else + virtual Confidence MatchDocType(LPCTSTR lpszFileName, + DWORD dwFileType, CDocument*& rpDocMatch); +#endif + virtual CDocument* CreateNewDocument(); + virtual CFrameWnd* CreateNewFrame(CDocument* pDoc, CFrameWnd* pOther); + virtual void InitialUpdateFrame(CFrameWnd* pFrame, CDocument* pDoc, + BOOL bMakeVisible = TRUE); + virtual BOOL SaveAllModified(); // for all documents + virtual void CloseAllDocuments(BOOL bEndSession); + virtual CDocument* OpenDocumentFile( + LPCTSTR lpszPathName, BOOL bMakeVisible = TRUE) = 0; + // open named file + // if lpszPathName == NULL => create new file with this type + virtual void SetDefaultTitle(CDocument* pDocument) = 0; + +// Implementation +public: + virtual ~CDocTemplate(); + + // back pointer to OLE or other server (NULL if none or disabled) + CObject* m_pAttachedFactory; + + // menu & accelerator resources for in-place container + HMENU m_hMenuInPlace; + HACCEL m_hAccelInPlace; + + // menu & accelerator resource for server editing embedding + HMENU m_hMenuEmbedding; + HACCEL m_hAccelEmbedding; + + // menu & accelerator resource for server editing in-place + HMENU m_hMenuInPlaceServer; + HACCEL m_hAccelInPlaceServer; + +#ifdef _DEBUG + virtual void Dump(CDumpContext&) const; + virtual void AssertValid() const; +#endif + virtual void OnIdle(); // for all documents + + // implementation helpers + CFrameWnd* CreateOleFrame(CWnd* pParentWnd, CDocument* pDoc, + BOOL bCreateView); + +protected: // standard implementation + UINT m_nIDResource; // IDR_ for frame/menu/accel as well + UINT m_nIDServerResource; // IDR_ for OLE frame/menu/accel + CRuntimeClass* m_pDocClass; // class for creating new documents + CRuntimeClass* m_pFrameClass; // class for creating new frames + CRuntimeClass* m_pViewClass; // class for creating new views + CRuntimeClass* m_pOleFrameClass; // class for creating in-place frame + CRuntimeClass* m_pOleViewClass; // class for creating in-place view + CString m_strDocStrings; // '\n' separated names + // The document names sub-strings are represented as _one_ string: + // windowTitle\ndocName\n ... (see DocStringIndex enum) +}; + +#ifndef _AFXCTL +// SDI support (1 document only) +class CSingleDocTemplate : public CDocTemplate +{ + DECLARE_DYNAMIC(CSingleDocTemplate) + +// Constructors +public: + CSingleDocTemplate(UINT nIDResource, CRuntimeClass* pDocClass, + CRuntimeClass* pFrameClass, CRuntimeClass* pViewClass); + +// Implementation +public: + virtual ~CSingleDocTemplate(); + virtual void AddDocument(CDocument* pDoc); + virtual void RemoveDocument(CDocument* pDoc); + virtual POSITION GetFirstDocPosition() const; + virtual CDocument* GetNextDoc(POSITION& rPos) const; + virtual CDocument* OpenDocumentFile( + LPCTSTR lpszPathName, BOOL bMakeVisible = TRUE); + virtual void SetDefaultTitle(CDocument* pDocument); + +#ifdef _DEBUG + virtual void Dump(CDumpContext&) const; + virtual void AssertValid() const; +#endif //_DEBUG + +protected: // standard implementation + CDocument* m_pOnlyDoc; +}; + +// MDI support (zero or more documents) +class CMultiDocTemplate : public CDocTemplate +{ + DECLARE_DYNAMIC(CMultiDocTemplate) + +// Constructors +public: + CMultiDocTemplate(UINT nIDResource, CRuntimeClass* pDocClass, + CRuntimeClass* pFrameClass, CRuntimeClass* pViewClass); + +// Implementation +public: + // Menu and accel table for MDI Child windows of this type + HMENU m_hMenuShared; + HACCEL m_hAccelTable; + + virtual ~CMultiDocTemplate(); + virtual void AddDocument(CDocument* pDoc); + virtual void RemoveDocument(CDocument* pDoc); + virtual POSITION GetFirstDocPosition() const; + virtual CDocument* GetNextDoc(POSITION& rPos) const; + virtual CDocument* OpenDocumentFile( + LPCTSTR lpszPathName, BOOL bMakeVisible = TRUE); + virtual void SetDefaultTitle(CDocument* pDocument); + +#ifdef _DEBUG + virtual void Dump(CDumpContext&) const; + virtual void AssertValid() const; +#endif //_DEBUG + +protected: // standard implementation + CPtrList m_docList; // open documents of this type + UINT m_nUntitledCount; // start at 0, for "Document1" title +}; +#endif //!_AFXCTL + +///////////////////////////////////////////////////////////////////////////// +// class CDocument is the main document data abstraction + +class CDocument : public CCmdTarget +{ + DECLARE_DYNAMIC(CDocument) + +public: +// Constructors + CDocument(); + +// Attributes +public: + const CString& GetTitle() const; + virtual void SetTitle(LPCTSTR lpszTitle); + const CString& GetPathName() const; + virtual void SetPathName(LPCTSTR lpszPathName, BOOL bAddToMRU = TRUE); + + CDocTemplate* GetDocTemplate() const; + BOOL IsModified(); + void SetModifiedFlag(BOOL bModified = TRUE); + +// Operations + void AddView(CView* pView); + void RemoveView(CView* pView); + virtual POSITION GetFirstViewPosition() const; + virtual CView* GetNextView(POSITION& rPosition) const; + + // Update Views (simple update - DAG only) + void UpdateAllViews(CView* pSender, LPARAM lHint = 0L, + CObject* pHint = NULL); + +// Overridables + // Special notifications + virtual void OnChangedViewList(); // after Add or Remove view + virtual void DeleteContents(); // delete doc items etc + + // File helpers + virtual BOOL OnNewDocument(); + virtual BOOL OnOpenDocument(LPCTSTR lpszPathName); + virtual BOOL OnSaveDocument(LPCTSTR lpszPathName); +#ifdef _MAC + virtual void RecordDataFileOwner(LPCTSTR lpszPathName, LPCTSTR lpszAppName); +#endif + virtual void OnCloseDocument(); + virtual void ReportSaveLoadException(LPCTSTR lpszPathName, + CException* e, BOOL bSaving, UINT nIDPDefault); + + // advanced overridables, closing down frame/doc, etc. + virtual BOOL CanCloseFrame(CFrameWnd* pFrame); + virtual BOOL SaveModified(); // return TRUE if ok to continue + +// Implementation +protected: + // default implementation + CString m_strTitle; + CString m_strPathName; + CDocTemplate* m_pDocTemplate; + CPtrList m_viewList; // list of views + BOOL m_bModified; // changed since last saved + +public: + BOOL m_bAutoDelete; // TRUE => delete document when no more views + BOOL m_bEmbedded; // TRUE => document is being created by OLE + +#ifdef _DEBUG + virtual void Dump(CDumpContext&) const; + virtual void AssertValid() const; +#endif //_DEBUG + virtual ~CDocument(); + + // implementation helpers + virtual BOOL DoSave(LPCTSTR lpszPathName, BOOL bReplace = TRUE); + virtual BOOL DoFileSave(); + void UpdateFrameCounts(); + void DisconnectViews(); + void SendInitialUpdate(); + + // overridables for implementation + virtual HMENU GetDefaultMenu(); // get menu depending on state + virtual HACCEL GetDefaultAccelerator(); + virtual void PreCloseFrame(CFrameWnd* pFrame); + virtual void OnIdle(); + virtual void OnFinalRelease(); + virtual CFile* GetFile(LPCTSTR lpszFileName, UINT nOpenFlags, + CFileException* pError); + + virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, + AFX_CMDHANDLERINFO* pHandlerInfo); + friend class CDocTemplate; + +protected: + // file menu commands + //{{AFX_MSG(CDocument) + afx_msg void OnFileClose(); + afx_msg void OnFileSave(); + afx_msg void OnFileSaveAs(); + //}}AFX_MSG + // mail enabling + afx_msg void OnFileSendMail(); + afx_msg void OnUpdateFileSendMail(CCmdUI* pCmdUI); + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// +// Extra diagnostic tracing options + +#ifdef _DEBUG + +#define afxTraceFlags AfxGetAllocState()->m_nTraceFlags +enum AfxTraceFlags +{ + traceMultiApp = 1, // multi-app debugging + traceAppMsg = 2, // main message pump trace (includes DDE) + traceWinMsg = 4, // Windows message tracing + traceCmdRouting = 8, // Windows command routing trace (set 4+8 for control notifications) + traceOle = 16, // special OLE callback trace + traceDatabase = 32 // special database trace +}; + +#endif // _DEBUG + +////////////////////////////////////////////////////////////////////////////// +// MessageBox helpers + +void AFXAPI AfxFormatString1(CString& rString, UINT nIDS, LPCTSTR lpsz1); +void AFXAPI AfxFormatString2(CString& rString, UINT nIDS, + LPCTSTR lpsz1, LPCTSTR lpsz2); +int AFXAPI AfxMessageBox(LPCTSTR lpszText, UINT nType = MB_OK, + UINT nIDHelp = 0); +int AFXAPI AfxMessageBox(UINT nIDPrompt, UINT nType = MB_OK, + UINT nIDHelp = (UINT)-1); + +// Implementation string helpers +void AFXAPI AfxFormatStrings(CString& rString, UINT nIDS, + LPCTSTR* rglpsz, int nString); +void AFXAPI AfxFormatStrings(CString& rString, LPCTSTR lpszFormat, + LPCTSTR* rglpsz, int nString); +BOOL AFXAPI AfxExtractSubString(CString& rString, LPCTSTR lpszFullString, + int iSubString, TCHAR chSep = '\n'); + +///////////////////////////////////////////////////////////////////////////// +// Special target variant APIs + +#ifdef _AFXDLL + #include <afxdll_.h> +#endif + +// Windows Version compatibility (obsolete) +#define AfxEnableWin30Compatibility() +#define AfxEnableWin31Compatibility() +#define AfxEnableWin40Compatibility() + +// Temporary map management (locks temp map on current thread) +void AFXAPI AfxLockTempMaps(); +BOOL AFXAPI AfxUnlockTempMaps(); + +///////////////////////////////////////////////////////////////////////////// +// Special OLE related functions (see OLELOCK.CPP) + +void AFXAPI AfxOleOnReleaseAllObjects(); +BOOL AFXAPI AfxOleCanExitApp(); +void AFXAPI AfxOleLockApp(); +void AFXAPI AfxOleUnlockApp(); + +void AFXAPI AfxOleSetUserCtrl(BOOL bUserCtrl); +BOOL AFXAPI AfxOleGetUserCtrl(); + +///////////////////////////////////////////////////////////////////////////// +// Inline function declarations + +#ifdef _AFX_PACKING +#pragma pack(pop) +#endif + +#ifdef _AFX_ENABLE_INLINES +#define _AFXWIN_INLINE inline +#include <afxwin1.inl> +#include <afxwin2.inl> +#endif + +#undef AFX_DATA +#define AFX_DATA + +///////////////////////////////////////////////////////////////////////////// + +#else //RC_INVOKED +#include <afxres.h> // standard resource IDs +#endif //RC_INVOKED + +#endif //__AFXWIN_H__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/afxwin1.inl b/public/sdk/inc/mfc30/afxwin1.inl new file mode 100644 index 000000000..82e6eaf37 --- /dev/null +++ b/public/sdk/inc/mfc30/afxwin1.inl @@ -0,0 +1,931 @@ + +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// Inlines for AFXWIN.H (part 1) + +#ifdef _AFXWIN_INLINE + +///////////////////////////////////////////////////////////////////////////// + +// Global helper functions +_AFXWIN_INLINE CWinApp* AFXAPI AfxGetApp() + { return afxCurrentWinApp; } +_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetInstanceHandle() + { ASSERT(afxCurrentInstanceHandle != NULL); + return afxCurrentInstanceHandle; } +_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle() + { ASSERT(afxCurrentResourceHandle != NULL); + return afxCurrentResourceHandle; } +_AFXWIN_INLINE void AFXAPI AfxSetResourceHandle(HINSTANCE hInstResource) + { ASSERT(hInstResource != NULL); afxCurrentResourceHandle = hInstResource; } +_AFXWIN_INLINE LPCTSTR AFXAPI AfxGetAppName() + { ASSERT(afxCurrentAppName != NULL); return afxCurrentAppName; } +_AFXWIN_INLINE COleMessageFilter* AFXAPI AfxOleGetMessageFilter() + { ASSERT_VALID(AfxGetApp()); return AfxGetApp()->m_pMessageFilter; } +#ifndef _AFXCTL +_AFXWIN_INLINE CWnd* AFXAPI AfxGetMainWnd() + { return AfxGetThread() != NULL ? AfxGetThread()->GetMainWnd() : NULL; } +#else +_AFXWIN_INLINE CWnd* AFXAPI AfxGetMainWnd() + { return CWnd::GetActiveWindow(); } +_AFXWIN_INLINE AFX_MAINTAIN_STATE::AFX_MAINTAIN_STATE(AFX_MODULE_STATE* psData) + { m_psPrevious = AfxPushModuleContext(psData); } +_AFXWIN_INLINE AFX_MAINTAIN_STATE::~AFX_MAINTAIN_STATE() + { if (m_psPrevious != NULL) + AfxPopModuleContext(m_psPrevious); } +#endif + +// CHandleMap functions +_AFXWIN_INLINE BOOL CHandleMap::LookupPermanent(HANDLE h, CObject*& pObject) + { return m_permanentMap.Lookup((LPVOID)h, (void*&)pObject); } +_AFXWIN_INLINE BOOL CHandleMap::LookupTemporary(HANDLE h, CObject*& pObject) + { return m_temporaryMap.Lookup((LPVOID)h, (void*&)pObject); } + +// CSize +_AFXWIN_INLINE CSize::CSize() + { /* random filled */ } +_AFXWIN_INLINE CSize::CSize(int initCX, int initCY) + { cx = initCX; cy = initCY; } +_AFXWIN_INLINE CSize::CSize(SIZE initSize) + { *(SIZE*)this = initSize; } +_AFXWIN_INLINE CSize::CSize(POINT initPt) + { *(POINT*)this = initPt; } +_AFXWIN_INLINE CSize::CSize(DWORD dwSize) + { + cx = (short)LOWORD(dwSize); + cy = (short)HIWORD(dwSize); + } +_AFXWIN_INLINE BOOL CSize::operator==(SIZE size) const + { return (cx == size.cx && cy == size.cy); } +_AFXWIN_INLINE BOOL CSize::operator!=(SIZE size) const + { return (cx != size.cx || cy != size.cy); } +_AFXWIN_INLINE void CSize::operator+=(SIZE size) + { cx += size.cx; cy += size.cy; } +_AFXWIN_INLINE void CSize::operator-=(SIZE size) + { cx -= size.cx; cy -= size.cy; } +_AFXWIN_INLINE CSize CSize::operator+(SIZE size) const + { return CSize(cx + size.cx, cy + size.cy); } +_AFXWIN_INLINE CSize CSize::operator-(SIZE size) const + { return CSize(cx - size.cx, cy - size.cy); } +_AFXWIN_INLINE CSize CSize::operator-() const + { return CSize(-cx, -cy); } + +// CPoint +_AFXWIN_INLINE CPoint::CPoint() + { /* random filled */ } +_AFXWIN_INLINE CPoint::CPoint(int initX, int initY) + { x = initX; y = initY; } +_AFXWIN_INLINE CPoint::CPoint(POINT initPt) + { *(POINT*)this = initPt; } +_AFXWIN_INLINE CPoint::CPoint(SIZE initSize) + { *(SIZE*)this = initSize; } +_AFXWIN_INLINE CPoint::CPoint(DWORD dwPoint) + { + x = (short)LOWORD(dwPoint); + y = (short)HIWORD(dwPoint); + } +_AFXWIN_INLINE void CPoint::Offset(int xOffset, int yOffset) + { x += xOffset; y += yOffset; } +_AFXWIN_INLINE void CPoint::Offset(POINT point) + { x += point.x; y += point.y; } +_AFXWIN_INLINE void CPoint::Offset(SIZE size) + { x += size.cx; y += size.cy; } +_AFXWIN_INLINE BOOL CPoint::operator==(POINT point) const + { return (x == point.x && y == point.y); } +_AFXWIN_INLINE BOOL CPoint::operator!=(POINT point) const + { return (x != point.x || y != point.y); } +_AFXWIN_INLINE void CPoint::operator+=(SIZE size) + { x += size.cx; y += size.cy; } +_AFXWIN_INLINE void CPoint::operator-=(SIZE size) + { x -= size.cx; y -= size.cy; } +_AFXWIN_INLINE CPoint CPoint::operator+(SIZE size) const + { return CPoint(x + size.cx, y + size.cy); } +_AFXWIN_INLINE CPoint CPoint::operator-(SIZE size) const + { return CPoint(x - size.cx, y - size.cy); } +_AFXWIN_INLINE CPoint CPoint::operator-() const + { return CPoint(-x, -y); } +_AFXWIN_INLINE CSize CPoint::operator-(POINT point) const + { return CSize(x - point.x, y - point.y); } + +// CRect +_AFXWIN_INLINE CRect::CRect() + { /* random filled */ } +_AFXWIN_INLINE CRect::CRect(int l, int t, int r, int b) + { left = l; top = t; right = r; bottom = b; } +_AFXWIN_INLINE CRect::CRect(const RECT& srcRect) + { ::CopyRect(this, &srcRect); } +_AFXWIN_INLINE CRect::CRect(LPCRECT lpSrcRect) + { ::CopyRect(this, lpSrcRect); } +_AFXWIN_INLINE CRect::CRect(POINT point, SIZE size) + { right = (left = point.x) + size.cx; bottom = (top = point.y) + size.cy; } +_AFXWIN_INLINE int CRect::Width() const + { return right - left; } +_AFXWIN_INLINE int CRect::Height() const + { return bottom - top; } +_AFXWIN_INLINE CSize CRect::Size() const + { return CSize(right - left, bottom - top); } +_AFXWIN_INLINE CPoint& CRect::TopLeft() + { return *((CPoint*)this); } +_AFXWIN_INLINE CPoint& CRect::BottomRight() + { return *((CPoint*)this+1); } +_AFXWIN_INLINE CRect::operator LPRECT() + { return this; } +_AFXWIN_INLINE CRect::operator LPCRECT() const + { return this; } +_AFXWIN_INLINE BOOL CRect::IsRectEmpty() const + { return ::IsRectEmpty(this); } +_AFXWIN_INLINE BOOL CRect::IsRectNull() const + { return (left == 0 && right == 0 && top == 0 && bottom == 0); } +_AFXWIN_INLINE BOOL CRect::PtInRect(POINT point) const + { return ::PtInRect(this, point); } +_AFXWIN_INLINE void CRect::SetRect(int x1, int y1, int x2, int y2) + { ::SetRect(this, x1, y1, x2, y2); } +_AFXWIN_INLINE void CRect::SetRectEmpty() + { ::SetRectEmpty(this); } +_AFXWIN_INLINE void CRect::CopyRect(LPCRECT lpSrcRect) + { ::CopyRect(this, lpSrcRect); } +_AFXWIN_INLINE BOOL CRect::EqualRect(LPCRECT lpRect) const + { return ::EqualRect(this, lpRect); } +_AFXWIN_INLINE void CRect::InflateRect(int x, int y) + { ::InflateRect(this, x, y); } +_AFXWIN_INLINE void CRect::InflateRect(SIZE size) + { ::InflateRect(this, size.cx, size.cy); } +_AFXWIN_INLINE void CRect::OffsetRect(int x, int y) + { ::OffsetRect(this, x, y); } +_AFXWIN_INLINE void CRect::OffsetRect(POINT point) + { ::OffsetRect(this, point.x, point.y); } +_AFXWIN_INLINE void CRect::OffsetRect(SIZE size) + { ::OffsetRect(this, size.cx, size.cy); } +_AFXWIN_INLINE BOOL CRect::IntersectRect(LPCRECT lpRect1, LPCRECT lpRect2) + { return ::IntersectRect(this, lpRect1, lpRect2);} +_AFXWIN_INLINE BOOL CRect::UnionRect(LPCRECT lpRect1, LPCRECT lpRect2) + { return ::UnionRect(this, lpRect1, lpRect2); } +_AFXWIN_INLINE void CRect::operator=(const RECT& srcRect) + { ::CopyRect(this, &srcRect); } +_AFXWIN_INLINE BOOL CRect::operator==(const RECT& rect) const + { return ::EqualRect(this, &rect); } +_AFXWIN_INLINE BOOL CRect::operator!=(const RECT& rect) const + { return !::EqualRect(this, &rect); } +_AFXWIN_INLINE void CRect::operator+=(POINT point) + { ::OffsetRect(this, point.x, point.y); } +_AFXWIN_INLINE void CRect::operator-=(POINT point) + { ::OffsetRect(this, -point.x, -point.y); } +_AFXWIN_INLINE void CRect::operator&=(const RECT& rect) + { ::IntersectRect(this, this, &rect); } +_AFXWIN_INLINE void CRect::operator|=(const RECT& rect) + { ::UnionRect(this, this, &rect); } +_AFXWIN_INLINE CRect CRect::operator+(POINT pt) const + { CRect rect(*this); ::OffsetRect(&rect, pt.x, pt.y); return rect; } +_AFXWIN_INLINE CRect CRect::operator-(POINT pt) const + { CRect rect(*this); ::OffsetRect(&rect, -pt.x, -pt.y); return rect; } +_AFXWIN_INLINE CRect CRect::operator&(const RECT& rect2) const + { CRect rect; ::IntersectRect(&rect, this, &rect2); + return rect; } +_AFXWIN_INLINE CRect CRect::operator|(const RECT& rect2) const + { CRect rect; ::UnionRect(&rect, this, &rect2); + return rect; } +_AFXWIN_INLINE BOOL CRect::SubtractRect(LPCRECT lpRectSrc1, LPCRECT lpRectSrc2) + { return ::SubtractRect(this, lpRectSrc1, lpRectSrc2); } + +// CArchive output helpers +_AFXWIN_INLINE CArchive& AFXAPI operator<<(CArchive& ar, SIZE size) + { ar.Write(&size, sizeof(SIZE)); + return ar; } +_AFXWIN_INLINE CArchive& AFXAPI operator<<(CArchive& ar, POINT point) + { ar.Write(&point, sizeof(POINT)); + return ar; } +_AFXWIN_INLINE CArchive& AFXAPI operator<<(CArchive& ar, const RECT& rect) + { ar.Write(&rect, sizeof(RECT)); + return ar; } +_AFXWIN_INLINE CArchive& AFXAPI operator>>(CArchive& ar, SIZE& size) + { ar.Read(&size, sizeof(SIZE)); + return ar; } +_AFXWIN_INLINE CArchive& AFXAPI operator>>(CArchive& ar, POINT& point) + { ar.Read(&point, sizeof(POINT)); + return ar; } +_AFXWIN_INLINE CArchive& AFXAPI operator>>(CArchive& ar, RECT& rect) + { ar.Read(&rect, sizeof(RECT)); + return ar; } + +// exception support +_AFXWIN_INLINE CResourceException::CResourceException() + { } +_AFXWIN_INLINE CResourceException::CResourceException(BOOL bAutoDelete) + : CException(bAutoDelete) { } +_AFXWIN_INLINE CResourceException::~CResourceException() + { } +_AFXWIN_INLINE CUserException::CUserException() + { } +_AFXWIN_INLINE CUserException::CUserException(BOOL bAutoDelete) + : CException(bAutoDelete) { } +_AFXWIN_INLINE CUserException::~CUserException() + { } + +// CGdiObject +_AFXWIN_INLINE HGDIOBJ CGdiObject::GetSafeHandle() const + { return this == NULL ? NULL : m_hObject; } +_AFXWIN_INLINE CGdiObject::CGdiObject() + { m_hObject = NULL; } +_AFXWIN_INLINE CGdiObject::~CGdiObject() + { DeleteObject(); } +_AFXWIN_INLINE int CGdiObject::GetObject(int nCount, LPVOID lpObject) const + { ASSERT(m_hObject != NULL); return ::GetObject(m_hObject, nCount, lpObject); } +_AFXWIN_INLINE BOOL CGdiObject::CreateStockObject(int nIndex) + { return (m_hObject = ::GetStockObject(nIndex)) != NULL; } +_AFXWIN_INLINE BOOL CGdiObject::UnrealizeObject() + { return TRUE; } +_AFXWIN_INLINE UINT CGdiObject::GetObjectType() const + { return (UINT)::GetObjectType(m_hObject); } + +// CPen +_AFXWIN_INLINE CPen* PASCAL CPen::FromHandle(HPEN hPen) + { return (CPen*) CGdiObject::FromHandle(hPen); } +_AFXWIN_INLINE CPen::CPen() + { } +_AFXWIN_INLINE CPen::~CPen() + { } +_AFXWIN_INLINE BOOL CPen::CreatePen(int nPenStyle, int nWidth, COLORREF crColor) + { return Attach(::CreatePen(nPenStyle, nWidth, crColor)); } +_AFXWIN_INLINE BOOL CPen::CreatePenIndirect(LPLOGPEN lpLogPen) + { return Attach(::CreatePenIndirect(lpLogPen)); } +#ifndef _MAC +_AFXWIN_INLINE BOOL CPen::CreatePen(int nPenStyle, int nWidth, const LOGBRUSH* pLogBrush, + int nStyleCount, const DWORD* lpStyle) + { return Attach(::ExtCreatePen(nPenStyle, nWidth, pLogBrush, nStyleCount, + lpStyle)); } +#endif + +// CBrush +_AFXWIN_INLINE CBrush* PASCAL CBrush::FromHandle(HBRUSH hBrush) + { return (CBrush*) CGdiObject::FromHandle(hBrush); } +_AFXWIN_INLINE CBrush::CBrush() + { } +_AFXWIN_INLINE CBrush::~CBrush() + { } +_AFXWIN_INLINE BOOL CBrush::CreateSolidBrush(COLORREF crColor) + { return Attach(::CreateSolidBrush(crColor)); } +_AFXWIN_INLINE BOOL CBrush::CreateHatchBrush(int nIndex, COLORREF crColor) + { return Attach(::CreateHatchBrush(nIndex, crColor)); } +_AFXWIN_INLINE BOOL CBrush::CreateBrushIndirect(LPLOGBRUSH lpLogBrush) + { return Attach(::CreateBrushIndirect(lpLogBrush)); } +_AFXWIN_INLINE BOOL CBrush::CreateDIBPatternBrush(HGLOBAL hPackedDIB, UINT nUsage) + { return Attach(::CreateDIBPatternBrush(hPackedDIB, nUsage)); } +_AFXWIN_INLINE BOOL CBrush::CreatePatternBrush(CBitmap* pBitmap) + { return Attach(::CreatePatternBrush((HBITMAP)pBitmap->GetSafeHandle())); } +_AFXWIN_INLINE BOOL CBrush::CreateDIBPatternBrush(const void* lpPackedDIB, UINT nUsage) + { return Attach(::CreateDIBPatternBrushPt(lpPackedDIB, nUsage)); } + +// CFont +_AFXWIN_INLINE CFont* PASCAL CFont::FromHandle(HFONT hFont) + { return (CFont*) CGdiObject::FromHandle(hFont); } +_AFXWIN_INLINE CFont::CFont() + { } +_AFXWIN_INLINE CFont::~CFont() + { } +_AFXWIN_INLINE BOOL CFont::CreateFontIndirect(const LOGFONT* lpLogFont) + { return Attach(::CreateFontIndirect(lpLogFont)); } +_AFXWIN_INLINE BOOL CFont::CreateFont(int nHeight, int nWidth, int nEscapement, + int nOrientation, int nWeight, BYTE bItalic, BYTE bUnderline, + BYTE cStrikeOut, BYTE nCharSet, BYTE nOutPrecision, + BYTE nClipPrecision, BYTE nQuality, BYTE nPitchAndFamily, + LPCTSTR lpszFacename) + { return Attach(::CreateFont(nHeight, nWidth, nEscapement, + nOrientation, nWeight, bItalic, bUnderline, cStrikeOut, + nCharSet, nOutPrecision, nClipPrecision, nQuality, + nPitchAndFamily, lpszFacename)); } + +// CBitmap +_AFXWIN_INLINE CBitmap* PASCAL CBitmap::FromHandle(HBITMAP hBitmap) + { return (CBitmap*) CGdiObject::FromHandle(hBitmap); } +_AFXWIN_INLINE CBitmap::CBitmap() + { } +_AFXWIN_INLINE CBitmap::~CBitmap() + { } +_AFXWIN_INLINE BOOL CBitmap::CreateBitmap(int nWidth, int nHeight, UINT nPlanes, + UINT nBitcount, const void* lpBits) + { return Attach(::CreateBitmap(nWidth, nHeight, nPlanes, nBitcount, lpBits)); } +_AFXWIN_INLINE BOOL CBitmap::CreateBitmapIndirect(LPBITMAP lpBitmap) + { return Attach(::CreateBitmapIndirect(lpBitmap)); } + +_AFXWIN_INLINE DWORD CBitmap::SetBitmapBits(DWORD dwCount, const void* lpBits) + { return ::SetBitmapBits((HBITMAP)m_hObject, dwCount, lpBits); } +_AFXWIN_INLINE DWORD CBitmap::GetBitmapBits(DWORD dwCount, LPVOID lpBits) const + { return ::GetBitmapBits((HBITMAP)m_hObject, dwCount, lpBits); } +_AFXWIN_INLINE BOOL CBitmap::LoadBitmap(LPCTSTR lpszResourceName) + { return Attach(::LoadBitmap(AfxFindResourceHandle( + lpszResourceName, RT_BITMAP), lpszResourceName));} +_AFXWIN_INLINE CSize CBitmap::SetBitmapDimension(int nWidth, int nHeight) + { + SIZE size; + VERIFY(::SetBitmapDimensionEx((HBITMAP)m_hObject, nWidth, nHeight, &size)); + return size; + } +_AFXWIN_INLINE CSize CBitmap::GetBitmapDimension() const + { + SIZE size; + VERIFY(::GetBitmapDimensionEx((HBITMAP)m_hObject, &size)); + return size; + } + +_AFXWIN_INLINE BOOL CBitmap::LoadBitmap(UINT nIDResource) + { return Attach(::LoadBitmap(AfxFindResourceHandle( + MAKEINTRESOURCE(nIDResource), RT_BITMAP), MAKEINTRESOURCE(nIDResource))); } +#ifndef _MAC +_AFXWIN_INLINE BOOL CBitmap::LoadOEMBitmap(UINT nIDBitmap) + { return Attach(::LoadBitmap(NULL, MAKEINTRESOURCE(nIDBitmap))); } +#endif +_AFXWIN_INLINE BOOL CBitmap::CreateCompatibleBitmap(CDC* pDC, int nWidth, int nHeight) + { return Attach(::CreateCompatibleBitmap(pDC->m_hDC, nWidth, nHeight)); } +_AFXWIN_INLINE BOOL CBitmap::CreateDiscardableBitmap(CDC* pDC, int nWidth, int nHeight) + { return Attach(::CreateDiscardableBitmap(pDC->m_hDC, nWidth, nHeight)); } + +// CPalette +_AFXWIN_INLINE CPalette* PASCAL CPalette::FromHandle(HPALETTE hPalette) + { return (CPalette*) CGdiObject::FromHandle(hPalette); } +_AFXWIN_INLINE CPalette::CPalette() + { } +_AFXWIN_INLINE CPalette::~CPalette() + { } +_AFXWIN_INLINE BOOL CPalette::CreatePalette(LPLOGPALETTE lpLogPalette) + { return Attach(::CreatePalette(lpLogPalette)); } +#ifndef _MAC +_AFXWIN_INLINE BOOL CPalette::CreateHalftonePalette(CDC* pDC) + { ASSERT(pDC != NULL && pDC->m_hDC != NULL); return Attach( + ::CreateHalftonePalette(pDC->m_hDC)); } +#endif +_AFXWIN_INLINE UINT CPalette::GetPaletteEntries(UINT nStartIndex, UINT nNumEntries, + LPPALETTEENTRY lpPaletteColors) const + { ASSERT(m_hObject != NULL); return ::GetPaletteEntries((HPALETTE)m_hObject, nStartIndex, + nNumEntries, lpPaletteColors); } +_AFXWIN_INLINE UINT CPalette::SetPaletteEntries(UINT nStartIndex, UINT nNumEntries, + LPPALETTEENTRY lpPaletteColors) + { ASSERT(m_hObject != NULL); return ::SetPaletteEntries((HPALETTE)m_hObject, nStartIndex, + nNumEntries, lpPaletteColors); } +#ifndef _MAC +_AFXWIN_INLINE void CPalette::AnimatePalette(UINT nStartIndex, UINT nNumEntries, + LPPALETTEENTRY lpPaletteColors) + { ASSERT(m_hObject != NULL); ::AnimatePalette((HPALETTE)m_hObject, nStartIndex, nNumEntries, + lpPaletteColors); } +#endif +_AFXWIN_INLINE UINT CPalette::GetNearestPaletteIndex(COLORREF crColor) const + { ASSERT(m_hObject != NULL); return ::GetNearestPaletteIndex((HPALETTE)m_hObject, crColor); } +_AFXWIN_INLINE BOOL CPalette::ResizePalette(UINT nNumEntries) + { ASSERT(m_hObject != NULL); return ::ResizePalette((HPALETTE)m_hObject, nNumEntries); } + +// CRgn +_AFXWIN_INLINE CRgn* PASCAL CRgn::FromHandle(HRGN hRgn) + { return (CRgn*) CGdiObject::FromHandle(hRgn); } +_AFXWIN_INLINE CRgn::CRgn() + { } +_AFXWIN_INLINE CRgn::~CRgn() + { } +_AFXWIN_INLINE BOOL CRgn::CreateRectRgn(int x1, int y1, int x2, int y2) + { return Attach(::CreateRectRgn(x1, y1, x2, y2)); } +_AFXWIN_INLINE BOOL CRgn::CreateRectRgnIndirect(LPCRECT lpRect) + { return Attach(::CreateRectRgnIndirect(lpRect)); } +_AFXWIN_INLINE BOOL CRgn::CreateEllipticRgn(int x1, int y1, int x2, int y2) + { return Attach(::CreateEllipticRgn(x1, y1, x2, y2)); } +_AFXWIN_INLINE BOOL CRgn::CreateEllipticRgnIndirect(LPCRECT lpRect) + { return Attach(::CreateEllipticRgnIndirect(lpRect)); } +_AFXWIN_INLINE BOOL CRgn::CreatePolygonRgn(LPPOINT lpPoints, int nCount, int nMode) + { return Attach(::CreatePolygonRgn(lpPoints, nCount, nMode)); } +#ifndef _MAC +_AFXWIN_INLINE BOOL CRgn::CreatePolyPolygonRgn(LPPOINT lpPoints, LPINT lpPolyCounts, int nCount, int nPolyFillMode) + { return Attach(::CreatePolyPolygonRgn(lpPoints, lpPolyCounts, nCount, nPolyFillMode)); } +#endif +_AFXWIN_INLINE BOOL CRgn::CreateRoundRectRgn(int x1, int y1, int x2, int y2, int x3, int y3) + { return Attach(::CreateRoundRectRgn(x1, y1, x2, y2, x3, y3)); } +#ifndef _MAC +_AFXWIN_INLINE BOOL CRgn::CreateFromPath(CDC* pDC) + { ASSERT(pDC != NULL); return Attach(::PathToRegion(pDC->m_hDC)); } +_AFXWIN_INLINE BOOL CRgn::CreateFromData(const XFORM* lpXForm, int nCount, const RGNDATA* pRgnData) + { return Attach(::ExtCreateRegion(lpXForm, nCount, pRgnData)); } +_AFXWIN_INLINE int CRgn::GetRegionData(LPRGNDATA lpRgnData, int nDataSize) const + { ASSERT(m_hObject != NULL); return (int)::GetRegionData((HRGN)m_hObject, nDataSize, lpRgnData); } +#endif +_AFXWIN_INLINE void CRgn::SetRectRgn(int x1, int y1, int x2, int y2) + { ASSERT(m_hObject != NULL); ::SetRectRgn((HRGN)m_hObject, x1, y1, x2, y2); } +_AFXWIN_INLINE void CRgn::SetRectRgn(LPCRECT lpRect) + { ASSERT(m_hObject != NULL); ::SetRectRgn((HRGN)m_hObject, lpRect->left, lpRect->top, + lpRect->right, lpRect->bottom); } +_AFXWIN_INLINE int CRgn::CombineRgn(CRgn* pRgn1, CRgn* pRgn2, int nCombineMode) + { ASSERT(m_hObject != NULL); return ::CombineRgn((HRGN)m_hObject, (HRGN)pRgn1->GetSafeHandle(), + (HRGN)pRgn2->GetSafeHandle(), nCombineMode); } +_AFXWIN_INLINE int CRgn::CopyRgn(CRgn* pRgnSrc) + { ASSERT(m_hObject != NULL); return ::CombineRgn((HRGN)m_hObject, (HRGN)pRgnSrc->GetSafeHandle(), NULL, RGN_COPY); } +_AFXWIN_INLINE BOOL CRgn::EqualRgn(CRgn* pRgn) const + { ASSERT(m_hObject != NULL); return ::EqualRgn((HRGN)m_hObject, (HRGN)pRgn->GetSafeHandle()); } +_AFXWIN_INLINE int CRgn::OffsetRgn(int x, int y) + { ASSERT(m_hObject != NULL); return ::OffsetRgn((HRGN)m_hObject, x, y); } +_AFXWIN_INLINE int CRgn::OffsetRgn(POINT point) + { ASSERT(m_hObject != NULL); return ::OffsetRgn((HRGN)m_hObject, point.x, point.y); } +_AFXWIN_INLINE int CRgn::GetRgnBox(LPRECT lpRect) const + { ASSERT(m_hObject != NULL); return ::GetRgnBox((HRGN)m_hObject, lpRect); } +_AFXWIN_INLINE BOOL CRgn::PtInRegion(int x, int y) const + { ASSERT(m_hObject != NULL); return ::PtInRegion((HRGN)m_hObject, x, y); } +_AFXWIN_INLINE BOOL CRgn::PtInRegion(POINT point) const + { ASSERT(m_hObject != NULL); return ::PtInRegion((HRGN)m_hObject, point.x, point.y); } +_AFXWIN_INLINE BOOL CRgn::RectInRegion(LPCRECT lpRect) const + { ASSERT(m_hObject != NULL); return ::RectInRegion((HRGN)m_hObject, lpRect); } + +// CDC +_AFXWIN_INLINE HDC CDC::GetSafeHdc() const + { return this == NULL ? NULL : m_hDC; } +_AFXWIN_INLINE BOOL CDC::IsPrinting() const + { return m_bPrinting; } +_AFXWIN_INLINE BOOL CDC::CreateDC(LPCTSTR lpszDriverName, + LPCTSTR lpszDeviceName, LPCTSTR lpszOutput, const void* lpInitData) + { return Attach(::CreateDC(lpszDriverName, + lpszDeviceName, lpszOutput, (const DEVMODE*)lpInitData)); } +_AFXWIN_INLINE BOOL CDC::CreateIC(LPCTSTR lpszDriverName, + LPCTSTR lpszDeviceName, LPCTSTR lpszOutput, const void* lpInitData) + { return Attach(::CreateIC(lpszDriverName, + lpszDeviceName, lpszOutput, (const DEVMODE*) lpInitData)); } +_AFXWIN_INLINE BOOL CDC::CreateCompatibleDC(CDC* pDC) + { return Attach(::CreateCompatibleDC(pDC->GetSafeHdc())); } +_AFXWIN_INLINE int CDC::ExcludeUpdateRgn(CWnd* pWnd) + { ASSERT(m_hDC != NULL); return ::ExcludeUpdateRgn(m_hDC, pWnd->m_hWnd); } +_AFXWIN_INLINE int CDC::GetDeviceCaps(int nIndex) const + { ASSERT(m_hAttribDC != NULL); return ::GetDeviceCaps(m_hAttribDC, nIndex); } +_AFXWIN_INLINE CPoint CDC::GetBrushOrg() const + { + ASSERT(m_hDC != NULL); + POINT point; + VERIFY(::GetBrushOrgEx(m_hDC, &point)); + return point; + } +_AFXWIN_INLINE CPoint CDC::SetBrushOrg(int x, int y) + { + ASSERT(m_hDC != NULL); + POINT point; + VERIFY(::SetBrushOrgEx(m_hDC, x, y, &point)); + return point; + } +_AFXWIN_INLINE CPoint CDC::SetBrushOrg(POINT point) + { + ASSERT(m_hDC != NULL); + VERIFY(::SetBrushOrgEx(m_hDC, point.x, point.y, &point)); + return point; + } + +_AFXWIN_INLINE int CDC::EnumObjects(int nObjectType, + int (CALLBACK EXPORT* lpfn)(LPVOID, LPARAM), LPARAM lpData) + { ASSERT(m_hAttribDC != NULL); return ::EnumObjects(m_hAttribDC, nObjectType, (GOBJENUMPROC)lpfn, lpData); } + +_AFXWIN_INLINE CBitmap* CDC::SelectObject(CBitmap* pBitmap) + { ASSERT(m_hDC != NULL); return (CBitmap*) SelectGdiObject(m_hDC, pBitmap->GetSafeHandle()); } +_AFXWIN_INLINE CGdiObject* CDC::SelectObject(CGdiObject* pObject) + { ASSERT(m_hDC != NULL); return SelectGdiObject(m_hDC, pObject->GetSafeHandle()); } +_AFXWIN_INLINE HGDIOBJ CDC::SelectObject(HGDIOBJ hObject) // Safe for NULL handles + { ASSERT(m_hDC == m_hAttribDC); // ASSERT a simple CDC object + return (hObject != NULL) ? ::SelectObject(m_hDC, hObject) : NULL; } +_AFXWIN_INLINE COLORREF CDC::GetNearestColor(COLORREF crColor) const + { ASSERT(m_hAttribDC != NULL); return ::GetNearestColor(m_hAttribDC, crColor); } +_AFXWIN_INLINE UINT CDC::RealizePalette() + { ASSERT(m_hDC != NULL); return ::RealizePalette(m_hDC); } +_AFXWIN_INLINE void CDC::UpdateColors() + { ASSERT(m_hDC != NULL); ::UpdateColors(m_hDC); } +_AFXWIN_INLINE COLORREF CDC::GetBkColor() const + { ASSERT(m_hAttribDC != NULL); return ::GetBkColor(m_hAttribDC); } +_AFXWIN_INLINE int CDC::GetBkMode() const + { ASSERT(m_hAttribDC != NULL); return ::GetBkMode(m_hAttribDC); } +_AFXWIN_INLINE int CDC::GetPolyFillMode() const + { ASSERT(m_hAttribDC != NULL); return ::GetPolyFillMode(m_hAttribDC); } +_AFXWIN_INLINE int CDC::GetROP2() const + { ASSERT(m_hAttribDC != NULL); return ::GetROP2(m_hAttribDC); } +_AFXWIN_INLINE int CDC::GetStretchBltMode() const + { ASSERT(m_hAttribDC != NULL); return ::GetStretchBltMode(m_hAttribDC); } +_AFXWIN_INLINE COLORREF CDC::GetTextColor() const + { ASSERT(m_hAttribDC != NULL); return ::GetTextColor(m_hAttribDC); } +_AFXWIN_INLINE int CDC::GetMapMode() const + { ASSERT(m_hAttribDC != NULL); return ::GetMapMode(m_hAttribDC); } + +_AFXWIN_INLINE CPoint CDC::GetViewportOrg() const + { + ASSERT(m_hAttribDC != NULL); + POINT point; + VERIFY(::GetViewportOrgEx(m_hAttribDC, &point)); + return point; + } +_AFXWIN_INLINE CSize CDC::GetViewportExt() const + { + ASSERT(m_hAttribDC != NULL); + SIZE size; + VERIFY(::GetViewportExtEx(m_hAttribDC, &size)); + return size; + } +_AFXWIN_INLINE CPoint CDC::GetWindowOrg() const + { + ASSERT(m_hAttribDC != NULL); + POINT point; + VERIFY(::GetWindowOrgEx(m_hAttribDC, &point)); + return point; + } +_AFXWIN_INLINE CSize CDC::GetWindowExt() const + { + ASSERT(m_hAttribDC != NULL); + SIZE size; + VERIFY(::GetWindowExtEx(m_hAttribDC, &size)); + return size; + } + +// non-virtual helpers calling virtual mapping functions +_AFXWIN_INLINE CPoint CDC::SetViewportOrg(POINT point) + { ASSERT(m_hDC != NULL); return SetViewportOrg(point.x, point.y); } +_AFXWIN_INLINE CSize CDC::SetViewportExt(SIZE size) + { ASSERT(m_hDC != NULL); return SetViewportExt(size.cx, size.cy); } +_AFXWIN_INLINE CPoint CDC::SetWindowOrg(POINT point) + { ASSERT(m_hDC != NULL); return SetWindowOrg(point.x, point.y); } +_AFXWIN_INLINE CSize CDC::SetWindowExt(SIZE size) + { ASSERT(m_hDC != NULL); return SetWindowExt(size.cx, size.cy); } + +_AFXWIN_INLINE void CDC::DPtoLP(LPPOINT lpPoints, int nCount) const + { ASSERT(m_hAttribDC != NULL); VERIFY(::DPtoLP(m_hAttribDC, lpPoints, nCount)); } +_AFXWIN_INLINE void CDC::DPtoLP(LPRECT lpRect) const + { ASSERT(m_hAttribDC != NULL); VERIFY(::DPtoLP(m_hAttribDC, (LPPOINT)lpRect, 2)); } +_AFXWIN_INLINE void CDC::LPtoDP(LPPOINT lpPoints, int nCount) const + { ASSERT(m_hAttribDC != NULL); VERIFY(::LPtoDP(m_hAttribDC, lpPoints, nCount)); } +_AFXWIN_INLINE void CDC::LPtoDP(LPRECT lpRect) const + { ASSERT(m_hAttribDC != NULL); VERIFY(::LPtoDP(m_hAttribDC, (LPPOINT)lpRect, 2)); } + +_AFXWIN_INLINE BOOL CDC::FillRgn(CRgn* pRgn, CBrush* pBrush) + { ASSERT(m_hDC != NULL); return ::FillRgn(m_hDC, (HRGN)pRgn->GetSafeHandle(), (HBRUSH)pBrush->GetSafeHandle()); } +_AFXWIN_INLINE BOOL CDC::FrameRgn(CRgn* pRgn, CBrush* pBrush, int nWidth, int nHeight) + { ASSERT(m_hDC != NULL); return ::FrameRgn(m_hDC, (HRGN)pRgn->GetSafeHandle(), (HBRUSH)pBrush->GetSafeHandle(), + nWidth, nHeight); } +_AFXWIN_INLINE BOOL CDC::InvertRgn(CRgn* pRgn) + { ASSERT(m_hDC != NULL); return ::InvertRgn(m_hDC, (HRGN)pRgn->GetSafeHandle()); } +_AFXWIN_INLINE BOOL CDC::PaintRgn(CRgn* pRgn) + { ASSERT(m_hDC != NULL); return ::PaintRgn(m_hDC, (HRGN)pRgn->GetSafeHandle()); } +_AFXWIN_INLINE BOOL CDC::PtVisible(int x, int y) const + { ASSERT(m_hDC != NULL); return ::PtVisible(m_hDC, x, y); } +_AFXWIN_INLINE BOOL CDC::PtVisible(POINT point) const + { ASSERT(m_hDC != NULL); return PtVisible(point.x, point.y); } // call virtual +_AFXWIN_INLINE BOOL CDC::RectVisible(LPCRECT lpRect) const + { ASSERT(m_hDC != NULL); return ::RectVisible(m_hDC, lpRect); } +_AFXWIN_INLINE CPoint CDC::GetCurrentPosition() const + { + ASSERT(m_hAttribDC != NULL); + POINT point; + VERIFY(::GetCurrentPositionEx(m_hAttribDC, &point)); + return point; + } + +_AFXWIN_INLINE CPoint CDC::MoveTo(POINT point) + { ASSERT(m_hDC != NULL); return MoveTo(point.x, point.y); } +_AFXWIN_INLINE BOOL CDC::LineTo(POINT point) + { ASSERT(m_hDC != NULL); return LineTo(point.x, point.y); } +_AFXWIN_INLINE BOOL CDC::Arc(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) + { ASSERT(m_hDC != NULL); return ::Arc(m_hDC, x1, y1, x2, y2, x3, y3, x4, y4); } +_AFXWIN_INLINE BOOL CDC::Arc(LPCRECT lpRect, POINT ptStart, POINT ptEnd) + { ASSERT(m_hDC != NULL); return ::Arc(m_hDC, lpRect->left, lpRect->top, + lpRect->right, lpRect->bottom, ptStart.x, ptStart.y, + ptEnd.x, ptEnd.y); } +_AFXWIN_INLINE BOOL CDC::Polyline(LPPOINT lpPoints, int nCount) + { ASSERT(m_hDC != NULL); return ::Polyline(m_hDC, lpPoints, nCount); } +_AFXWIN_INLINE void CDC::FillRect(LPCRECT lpRect, CBrush* pBrush) + { ASSERT(m_hDC != NULL); ::FillRect(m_hDC, lpRect, (HBRUSH)pBrush->GetSafeHandle()); } +_AFXWIN_INLINE void CDC::FrameRect(LPCRECT lpRect, CBrush* pBrush) + { ASSERT(m_hDC != NULL); ::FrameRect(m_hDC, lpRect, (HBRUSH)pBrush->GetSafeHandle()); } +_AFXWIN_INLINE void CDC::InvertRect(LPCRECT lpRect) + { ASSERT(m_hDC != NULL); ::InvertRect(m_hDC, lpRect); } +_AFXWIN_INLINE BOOL CDC::DrawIcon(int x, int y, HICON hIcon) + { ASSERT(m_hDC != NULL); return ::DrawIcon(m_hDC, x, y, hIcon); } +_AFXWIN_INLINE BOOL CDC::DrawIcon(POINT point, HICON hIcon) + { ASSERT(m_hDC != NULL); return ::DrawIcon(m_hDC, point.x, point.y, hIcon); } +#ifndef _MAC +_AFXWIN_INLINE BOOL CDC::Chord(int x1, int y1, int x2, int y2, int x3, int y3, + int x4, int y4) + { ASSERT(m_hDC != NULL); return ::Chord(m_hDC, x1, y1, x2, y2, x3, y3, x4, y4); } +_AFXWIN_INLINE BOOL CDC::Chord(LPCRECT lpRect, POINT ptStart, POINT ptEnd) + { ASSERT(m_hDC != NULL); return ::Chord(m_hDC, lpRect->left, lpRect->top, + lpRect->right, lpRect->bottom, ptStart.x, ptStart.y, + ptEnd.x, ptEnd.y); } +#endif +_AFXWIN_INLINE void CDC::DrawFocusRect(LPCRECT lpRect) + { ASSERT(m_hDC != NULL); ::DrawFocusRect(m_hDC, lpRect); } +_AFXWIN_INLINE BOOL CDC::Ellipse(int x1, int y1, int x2, int y2) + { ASSERT(m_hDC != NULL); return ::Ellipse(m_hDC, x1, y1, x2, y2); } +_AFXWIN_INLINE BOOL CDC::Ellipse(LPCRECT lpRect) + { ASSERT(m_hDC != NULL); return ::Ellipse(m_hDC, lpRect->left, lpRect->top, + lpRect->right, lpRect->bottom); } +_AFXWIN_INLINE BOOL CDC::Pie(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) + { ASSERT(m_hDC != NULL); return ::Pie(m_hDC, x1, y1, x2, y2, x3, y3, x4, y4); } +_AFXWIN_INLINE BOOL CDC::Pie(LPCRECT lpRect, POINT ptStart, POINT ptEnd) + { ASSERT(m_hDC != NULL); return ::Pie(m_hDC, lpRect->left, lpRect->top, + lpRect->right, lpRect->bottom, ptStart.x, ptStart.y, + ptEnd.x, ptEnd.y); } +_AFXWIN_INLINE BOOL CDC::Polygon(LPPOINT lpPoints, int nCount) + { ASSERT(m_hDC != NULL); return ::Polygon(m_hDC, lpPoints, nCount); } +#ifndef _MAC +_AFXWIN_INLINE BOOL CDC::PolyPolygon(LPPOINT lpPoints, LPINT lpPolyCounts, int nCount) + { ASSERT(m_hDC != NULL); return ::PolyPolygon(m_hDC, lpPoints, lpPolyCounts, nCount); } +#endif +_AFXWIN_INLINE BOOL CDC::Rectangle(int x1, int y1, int x2, int y2) + { ASSERT(m_hDC != NULL); return ::Rectangle(m_hDC, x1, y1, x2, y2); } +_AFXWIN_INLINE BOOL CDC::Rectangle(LPCRECT lpRect) + { ASSERT(m_hDC != NULL); return ::Rectangle(m_hDC, lpRect->left, lpRect->top, + lpRect->right, lpRect->bottom); } +_AFXWIN_INLINE BOOL CDC::RoundRect(int x1, int y1, int x2, int y2, int x3, int y3) + { ASSERT(m_hDC != NULL); return ::RoundRect(m_hDC, x1, y1, x2, y2, x3, y3); } +_AFXWIN_INLINE BOOL CDC::RoundRect(LPCRECT lpRect, POINT point) + { ASSERT(m_hDC != NULL); return ::RoundRect(m_hDC, lpRect->left, lpRect->top, + lpRect->right, lpRect->bottom, point.x, point.y); } +_AFXWIN_INLINE BOOL CDC::PatBlt(int x, int y, int nWidth, int nHeight, DWORD dwRop) + { ASSERT(m_hDC != NULL); return ::PatBlt(m_hDC, x, y, nWidth, nHeight, dwRop); } +_AFXWIN_INLINE BOOL CDC::BitBlt(int x, int y, int nWidth, int nHeight, CDC* pSrcDC, + int xSrc, int ySrc, DWORD dwRop) + { ASSERT(m_hDC != NULL); return ::BitBlt(m_hDC, x, y, nWidth, nHeight, + pSrcDC->GetSafeHdc(), xSrc, ySrc, dwRop); } +_AFXWIN_INLINE BOOL CDC::StretchBlt(int x, int y, int nWidth, int nHeight, CDC* pSrcDC, + int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, DWORD dwRop) + { ASSERT(m_hDC != NULL); return ::StretchBlt(m_hDC, x, y, nWidth, nHeight, + pSrcDC->GetSafeHdc(), xSrc, ySrc, nSrcWidth, nSrcHeight, + dwRop); } +_AFXWIN_INLINE COLORREF CDC::GetPixel(int x, int y) const + { ASSERT(m_hDC != NULL); return ::GetPixel(m_hDC, x, y); } +_AFXWIN_INLINE COLORREF CDC::GetPixel(POINT point) const + { ASSERT(m_hDC != NULL); return ::GetPixel(m_hDC, point.x, point.y); } +_AFXWIN_INLINE COLORREF CDC::SetPixel(int x, int y, COLORREF crColor) + { ASSERT(m_hDC != NULL); return ::SetPixel(m_hDC, x, y, crColor); } +_AFXWIN_INLINE COLORREF CDC::SetPixel(POINT point, COLORREF crColor) + { ASSERT(m_hDC != NULL); return ::SetPixel(m_hDC, point.x, point.y, crColor); } +#ifndef _MAC +_AFXWIN_INLINE BOOL CDC::FloodFill(int x, int y, COLORREF crColor) + { ASSERT(m_hDC != NULL); return ::FloodFill(m_hDC, x, y, crColor); } +_AFXWIN_INLINE BOOL CDC::ExtFloodFill(int x, int y, COLORREF crColor, UINT nFillType) + { ASSERT(m_hDC != NULL); return ::ExtFloodFill(m_hDC, x, y, crColor, nFillType); } +#endif +_AFXWIN_INLINE BOOL CDC::TextOut(int x, int y, LPCTSTR lpszString, int nCount) + { ASSERT(m_hDC != NULL); return ::TextOut(m_hDC, x, y, lpszString, nCount); } +_AFXWIN_INLINE BOOL CDC::TextOut(int x, int y, const CString& str) + { ASSERT(m_hDC != NULL); return TextOut(x, y, (LPCTSTR)str, str.GetLength()); } // call virtual +_AFXWIN_INLINE BOOL CDC::ExtTextOut(int x, int y, UINT nOptions, LPCRECT lpRect, + LPCTSTR lpszString, UINT nCount, LPINT lpDxWidths) + { ASSERT(m_hDC != NULL); return ::ExtTextOut(m_hDC, x, y, nOptions, lpRect, + lpszString, nCount, lpDxWidths); } +_AFXWIN_INLINE CSize CDC::TabbedTextOut(int x, int y, LPCTSTR lpszString, int nCount, + int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin) + { ASSERT(m_hDC != NULL); return ::TabbedTextOut(m_hDC, x, y, lpszString, nCount, + nTabPositions, lpnTabStopPositions, nTabOrigin); } +_AFXWIN_INLINE int CDC::DrawText(LPCTSTR lpszString, int nCount, LPRECT lpRect, + UINT nFormat) + { ASSERT(m_hDC != NULL); return ::DrawText(m_hDC, lpszString, nCount, lpRect, nFormat); } +_AFXWIN_INLINE CSize CDC::GetTextExtent(LPCTSTR lpszString, int nCount) const + { + ASSERT(m_hAttribDC != NULL); + SIZE size; + VERIFY(::GetTextExtentPoint(m_hAttribDC, lpszString, nCount, &size)); + return size; + } +_AFXWIN_INLINE CSize CDC::GetOutputTextExtent(LPCTSTR lpszString, int nCount) const + { + ASSERT(m_hDC != NULL); + SIZE size; + VERIFY(::GetTextExtentPoint(m_hDC, lpszString, nCount, &size)); + return size; + } +_AFXWIN_INLINE CSize CDC::GetTabbedTextExtent(LPCTSTR lpszString, int nCount, + int nTabPositions, LPINT lpnTabStopPositions) const + { ASSERT(m_hAttribDC != NULL); return ::GetTabbedTextExtent(m_hAttribDC, lpszString, nCount, + nTabPositions, lpnTabStopPositions); } +_AFXWIN_INLINE CSize CDC::GetOutputTabbedTextExtent(LPCTSTR lpszString, int nCount, + int nTabPositions, LPINT lpnTabStopPositions) const + { ASSERT(m_hDC != NULL); return ::GetTabbedTextExtent(m_hDC, lpszString, nCount, + nTabPositions, lpnTabStopPositions); } +_AFXWIN_INLINE BOOL CDC::GrayString(CBrush* pBrush, + BOOL (CALLBACK EXPORT* lpfnOutput)(HDC, LPARAM, int), + LPARAM lpData, int nCount, + int x, int y, int nWidth, int nHeight) + { ASSERT(m_hDC != NULL); return ::GrayString(m_hDC, (HBRUSH)pBrush->GetSafeHandle(), + (GRAYSTRINGPROC)lpfnOutput, lpData, nCount, x, y, nWidth, nHeight); } +_AFXWIN_INLINE UINT CDC::GetTextAlign() const + { ASSERT(m_hAttribDC != NULL); return ::GetTextAlign(m_hAttribDC); } +_AFXWIN_INLINE int CDC::GetTextFace(int nCount, LPTSTR lpszFacename) const + { ASSERT(m_hAttribDC != NULL); return ::GetTextFace(m_hAttribDC, nCount, lpszFacename); } +_AFXWIN_INLINE BOOL CDC::GetTextMetrics(LPTEXTMETRIC lpMetrics) const + { ASSERT(m_hAttribDC != NULL); return ::GetTextMetrics(m_hAttribDC, lpMetrics); } +_AFXWIN_INLINE BOOL CDC::GetOutputTextMetrics(LPTEXTMETRIC lpMetrics) const + { ASSERT(m_hDC != NULL); return ::GetTextMetrics(m_hDC, lpMetrics); } +_AFXWIN_INLINE int CDC::GetTextCharacterExtra() const + { ASSERT(m_hAttribDC != NULL); return ::GetTextCharacterExtra(m_hAttribDC); } +_AFXWIN_INLINE BOOL CDC::GetCharWidth(UINT nFirstChar, UINT nLastChar, LPINT lpBuffer) const + { ASSERT(m_hAttribDC != NULL); return ::GetCharWidth(m_hAttribDC, nFirstChar, nLastChar, lpBuffer); } +_AFXWIN_INLINE BOOL CDC::GetOutputCharWidth(UINT nFirstChar, UINT nLastChar, LPINT lpBuffer) const + { ASSERT(m_hDC != NULL); return ::GetCharWidth(m_hDC, nFirstChar, nLastChar, lpBuffer); } +_AFXWIN_INLINE CSize CDC::GetAspectRatioFilter() const + { + ASSERT(m_hAttribDC != NULL); + SIZE size; + VERIFY(::GetAspectRatioFilterEx(m_hAttribDC, &size)); + return size; + } +_AFXWIN_INLINE BOOL CDC::ScrollDC(int dx, int dy, + LPCRECT lpRectScroll, LPCRECT lpRectClip, + CRgn* pRgnUpdate, LPRECT lpRectUpdate) + { ASSERT(m_hDC != NULL); return ::ScrollDC(m_hDC, dx, dy, lpRectScroll, + lpRectClip, (HRGN)pRgnUpdate->GetSafeHandle(), lpRectUpdate); } + +// Printer Escape Functions +_AFXWIN_INLINE int CDC::Escape(int nEscape, int nCount, LPCSTR lpszInData, LPVOID lpOutData) + { ASSERT(m_hDC != NULL); return ::Escape(m_hDC, nEscape, nCount, lpszInData, lpOutData);} + +// CDC 3.1 Specific functions +#ifndef _MAC +_AFXWIN_INLINE UINT CDC::SetBoundsRect(LPCRECT lpRectBounds, UINT flags) + { ASSERT(m_hDC != NULL); return ::SetBoundsRect(m_hDC, lpRectBounds, flags); } +_AFXWIN_INLINE UINT CDC::GetBoundsRect(LPRECT lpRectBounds, UINT flags) + { ASSERT(m_hAttribDC != NULL); return ::GetBoundsRect(m_hAttribDC, lpRectBounds, flags); } +#endif +_AFXWIN_INLINE BOOL CDC::ResetDC(const DEVMODE* lpDevMode) + { ASSERT(m_hAttribDC != NULL); return ::ResetDC(m_hAttribDC, lpDevMode) != NULL; } +_AFXWIN_INLINE UINT CDC::GetOutlineTextMetrics(UINT cbData, LPOUTLINETEXTMETRIC lpotm) const + { ASSERT(m_hAttribDC != NULL); return ::GetOutlineTextMetrics(m_hAttribDC, cbData, lpotm); } +_AFXWIN_INLINE BOOL CDC::GetCharABCWidths(UINT nFirstChar, UINT nLastChar, LPABC lpabc) const + { ASSERT(m_hAttribDC != NULL); return ::GetCharABCWidths(m_hAttribDC, nFirstChar, nLastChar, lpabc); } +_AFXWIN_INLINE DWORD CDC::GetFontData(DWORD dwTable, DWORD dwOffset, LPVOID lpData, + DWORD cbData) const + { ASSERT(m_hAttribDC != NULL); return ::GetFontData(m_hAttribDC, dwTable, dwOffset, lpData, cbData); } +#ifndef _MAC +_AFXWIN_INLINE int CDC::GetKerningPairs(int nPairs, LPKERNINGPAIR lpkrnpair) const + { ASSERT(m_hAttribDC != NULL); return ::GetKerningPairs(m_hAttribDC, nPairs, lpkrnpair); } +_AFXWIN_INLINE DWORD CDC::GetGlyphOutline(UINT nChar, UINT nFormat, LPGLYPHMETRICS lpgm, + DWORD cbBuffer, LPVOID lpBuffer, const MAT2* lpmat2) const + { ASSERT(m_hAttribDC != NULL); return ::GetGlyphOutline(m_hAttribDC, nChar, nFormat, + lpgm, cbBuffer, lpBuffer, lpmat2); } +#endif + +// Document handling functions +_AFXWIN_INLINE int CDC::StartDoc(LPDOCINFO lpDocInfo) + { ASSERT(m_hDC != NULL); return ::StartDoc(m_hDC, lpDocInfo); } +_AFXWIN_INLINE int CDC::StartPage() + { ASSERT(m_hDC != NULL); return ::StartPage(m_hDC); } +_AFXWIN_INLINE int CDC::EndPage() + { ASSERT(m_hDC != NULL); return ::EndPage(m_hDC); } +_AFXWIN_INLINE int CDC::SetAbortProc(BOOL (CALLBACK EXPORT* lpfn)(HDC, int)) + { ASSERT(m_hDC != NULL); return ::SetAbortProc(m_hDC, (ABORTPROC)lpfn); } +_AFXWIN_INLINE int CDC::AbortDoc() + { ASSERT(m_hDC != NULL); return ::AbortDoc(m_hDC); } +_AFXWIN_INLINE int CDC::EndDoc() + { ASSERT(m_hDC != NULL); return ::EndDoc(m_hDC); } + +#ifndef _MAC +_AFXWIN_INLINE BOOL CDC::MaskBlt(int x, int y, int nWidth, int nHeight, CDC* pSrcDC, + int xSrc, int ySrc, CBitmap& maskBitmap, int xMask, int yMask, DWORD dwRop) + { ASSERT(m_hDC != NULL); return ::MaskBlt(m_hDC, x, y, nWidth, nHeight, pSrcDC->GetSafeHdc(), + xSrc, ySrc, (HBITMAP)maskBitmap.m_hObject, xMask, yMask, dwRop); } +_AFXWIN_INLINE BOOL CDC::PlgBlt(LPPOINT lpPoint, CDC* pSrcDC, int xSrc, int ySrc, + int nWidth, int nHeight, CBitmap& maskBitmap, int xMask, int yMask) + { ASSERT(m_hDC != NULL); return ::PlgBlt(m_hDC, lpPoint, pSrcDC->GetSafeHdc(), xSrc, ySrc, nWidth, + nHeight, (HBITMAP)maskBitmap.m_hObject, xMask, yMask); } +_AFXWIN_INLINE BOOL CDC::SetPixelV(int x, int y, COLORREF crColor) + { ASSERT(m_hDC != NULL); return ::SetPixelV(m_hDC, x, y, crColor); } +_AFXWIN_INLINE BOOL CDC::SetPixelV(POINT point, COLORREF crColor) + { ASSERT(m_hDC != NULL); return ::SetPixelV(m_hDC, point.x, point.y, crColor); } +_AFXWIN_INLINE BOOL CDC::AngleArc(int x, int y, int nRadius, + float fStartAngle, float fSweepAngle) + { ASSERT(m_hDC != NULL); return ::AngleArc(m_hDC, x, y, nRadius, fStartAngle, fSweepAngle); } +_AFXWIN_INLINE BOOL CDC::ArcTo(LPCRECT lpRect, POINT ptStart, POINT ptEnd) + { ASSERT(m_hDC != NULL); return ArcTo(lpRect->left, lpRect->top, lpRect->right, + lpRect->bottom, ptStart.x, ptStart.y, ptEnd.x, ptEnd.y); } +_AFXWIN_INLINE int CDC::GetArcDirection() const + { ASSERT(m_hAttribDC != NULL); return ::GetArcDirection(m_hAttribDC); } +_AFXWIN_INLINE BOOL CDC::PolyPolyline(const POINT* lpPoints, const DWORD* lpPolyPoints, + int nCount) + { ASSERT(m_hDC != NULL); return ::PolyPolyline(m_hDC, lpPoints, lpPolyPoints, nCount); } +_AFXWIN_INLINE BOOL CDC::GetColorAdjustment(LPCOLORADJUSTMENT lpColorAdjust) const + { ASSERT(m_hAttribDC != NULL); return ::GetColorAdjustment(m_hAttribDC, lpColorAdjust); } +_AFXWIN_INLINE CPen* CDC::GetCurrentPen() const + { ASSERT(m_hAttribDC != NULL); return CPen::FromHandle((HPEN)::GetCurrentObject(m_hAttribDC, OBJ_PEN)); } +_AFXWIN_INLINE CBrush* CDC::GetCurrentBrush() const + { ASSERT(m_hAttribDC != NULL); return CBrush::FromHandle((HBRUSH)::GetCurrentObject(m_hAttribDC, OBJ_BRUSH)); } +_AFXWIN_INLINE CPalette* CDC::GetCurrentPalette() const + { ASSERT(m_hAttribDC != NULL); return CPalette::FromHandle((HPALETTE)::GetCurrentObject(m_hAttribDC, OBJ_PAL)); } +_AFXWIN_INLINE CFont* CDC::GetCurrentFont() const + { ASSERT(m_hAttribDC != NULL); return CFont::FromHandle((HFONT)::GetCurrentObject(m_hAttribDC, OBJ_FONT)); } +_AFXWIN_INLINE CBitmap* CDC::GetCurrentBitmap() const + { ASSERT(m_hAttribDC != NULL); return CBitmap::FromHandle((HBITMAP)::GetCurrentObject(m_hAttribDC, OBJ_BITMAP)); } +_AFXWIN_INLINE BOOL CDC::PolyBezier(const POINT* lpPoints, int nCount) + { ASSERT(m_hDC != NULL); return ::PolyBezier(m_hDC, lpPoints, nCount); } + +_AFXWIN_INLINE int CDC::DrawEscape(int nEscape, int nInputSize, LPCSTR lpszInputData) + { ASSERT(m_hDC != NULL); return ::DrawEscape(m_hDC, nEscape, nInputSize, lpszInputData); } +_AFXWIN_INLINE int CDC::Escape(int nEscape, int nInputSize, LPCSTR lpszInputData, + int nOutputSize, LPSTR lpszOutputData) + { ASSERT(m_hDC != NULL); return ::ExtEscape(m_hDC, nEscape, nInputSize, lpszInputData, + nOutputSize, lpszOutputData); } + +_AFXWIN_INLINE BOOL CDC::GetCharABCWidths(UINT nFirstChar, UINT nLastChar, + LPABCFLOAT lpABCF) const + { ASSERT(m_hAttribDC != NULL); return ::GetCharABCWidthsFloat(m_hAttribDC, nFirstChar, nLastChar, lpABCF); } +_AFXWIN_INLINE BOOL CDC::GetCharWidth(UINT nFirstChar, UINT nLastChar, + float* lpFloatBuffer) const + { ASSERT(m_hAttribDC != NULL); return ::GetCharWidthFloat(m_hAttribDC, nFirstChar, nLastChar, lpFloatBuffer); } + +_AFXWIN_INLINE BOOL CDC::AbortPath() + { ASSERT(m_hDC != NULL); return ::AbortPath(m_hDC); } +_AFXWIN_INLINE BOOL CDC::BeginPath() + { ASSERT(m_hDC != NULL); return ::BeginPath(m_hDC); } +_AFXWIN_INLINE BOOL CDC::CloseFigure() + { ASSERT(m_hDC != NULL); return ::CloseFigure(m_hDC); } +_AFXWIN_INLINE BOOL CDC::EndPath() + { ASSERT(m_hDC != NULL); return ::EndPath(m_hDC); } +_AFXWIN_INLINE BOOL CDC::FillPath() + { ASSERT(m_hDC != NULL); return ::FillPath(m_hDC); } +_AFXWIN_INLINE BOOL CDC::FlattenPath() + { ASSERT(m_hDC != NULL); return ::FlattenPath(m_hDC); } +_AFXWIN_INLINE float CDC::GetMiterLimit() const + { ASSERT(m_hDC != NULL); float fMiterLimit; + VERIFY(::GetMiterLimit(m_hDC, &fMiterLimit)); return fMiterLimit; } +_AFXWIN_INLINE int CDC::GetPath(LPPOINT lpPoints, LPBYTE lpTypes, int nCount) const + { ASSERT(m_hDC != NULL); return ::GetPath(m_hDC, lpPoints, lpTypes, nCount); } +_AFXWIN_INLINE BOOL CDC::SetMiterLimit(float fMiterLimit) + { ASSERT(m_hDC != NULL); return ::SetMiterLimit(m_hDC, fMiterLimit, NULL); } +_AFXWIN_INLINE BOOL CDC::StrokeAndFillPath() + { ASSERT(m_hDC != NULL); return ::StrokeAndFillPath(m_hDC); } +_AFXWIN_INLINE BOOL CDC::StrokePath() + { ASSERT(m_hDC != NULL); return ::StrokePath(m_hDC); } +_AFXWIN_INLINE BOOL CDC::WidenPath() + { ASSERT(m_hDC != NULL); return ::WidenPath(m_hDC); } + +_AFXWIN_INLINE BOOL CDC::AddMetaFileComment(UINT nDataSize, const BYTE* pCommentData) + { ASSERT(m_hDC != NULL); return ::GdiComment(m_hDC, nDataSize, pCommentData); } +_AFXWIN_INLINE BOOL CDC::PlayMetaFile(HENHMETAFILE hEnhMF, LPCRECT lpBounds) + { ASSERT(m_hDC != NULL); return ::PlayEnhMetaFile(m_hDC, hEnhMF, lpBounds); } +#endif + +// CMenu +_AFXWIN_INLINE CMenu::CMenu() + { m_hMenu = NULL; } +_AFXWIN_INLINE CMenu::~CMenu() + { DestroyMenu(); } +_AFXWIN_INLINE BOOL CMenu::CreateMenu() + { return Attach(::CreateMenu()); } +_AFXWIN_INLINE BOOL CMenu::CreatePopupMenu() + { return Attach(::CreatePopupMenu()); } +_AFXWIN_INLINE HMENU CMenu::GetSafeHmenu() const + { ASSERT(this == NULL || m_hMenu == NULL || ::IsMenu(m_hMenu)); + return this == NULL ? NULL : m_hMenu; } +_AFXWIN_INLINE BOOL CMenu::DeleteMenu(UINT nPosition, UINT nFlags) + { ASSERT(::IsMenu(m_hMenu)); return ::DeleteMenu(m_hMenu, nPosition, nFlags); } +_AFXWIN_INLINE BOOL CMenu::AppendMenu(UINT nFlags, UINT nIDNewItem, LPCTSTR lpszNewItem) + { ASSERT(::IsMenu(m_hMenu)); return ::AppendMenu(m_hMenu, nFlags, nIDNewItem, lpszNewItem); } +_AFXWIN_INLINE BOOL CMenu::AppendMenu(UINT nFlags, UINT nIDNewItem, const CBitmap* pBmp) + { ASSERT(::IsMenu(m_hMenu)); return ::AppendMenu(m_hMenu, nFlags | MF_BITMAP, nIDNewItem, + (LPCTSTR)pBmp->GetSafeHandle()); } +_AFXWIN_INLINE UINT CMenu::CheckMenuItem(UINT nIDCheckItem, UINT nCheck) + { ASSERT(::IsMenu(m_hMenu)); return (UINT)::CheckMenuItem(m_hMenu, nIDCheckItem, nCheck); } +_AFXWIN_INLINE UINT CMenu::EnableMenuItem(UINT nIDEnableItem, UINT nEnable) + { ASSERT(::IsMenu(m_hMenu)); return ::EnableMenuItem(m_hMenu, nIDEnableItem, nEnable); } +_AFXWIN_INLINE UINT CMenu::GetMenuItemCount() const + { ASSERT(::IsMenu(m_hMenu)); return ::GetMenuItemCount(m_hMenu); } +_AFXWIN_INLINE UINT CMenu::GetMenuItemID(int nPos) const + { ASSERT(::IsMenu(m_hMenu)); return ::GetMenuItemID(m_hMenu, nPos); } +_AFXWIN_INLINE UINT CMenu::GetMenuState(UINT nID, UINT nFlags) const + { ASSERT(::IsMenu(m_hMenu)); return ::GetMenuState(m_hMenu, nID, nFlags); } +_AFXWIN_INLINE int CMenu::GetMenuString(UINT nIDItem, LPTSTR lpString, int nMaxCount, UINT nFlags) const + { ASSERT(::IsMenu(m_hMenu)); return ::GetMenuString(m_hMenu, nIDItem, lpString, nMaxCount, nFlags); } +_AFXWIN_INLINE CMenu* CMenu::GetSubMenu(int nPos) const + { ASSERT(::IsMenu(m_hMenu)); return CMenu::FromHandle(::GetSubMenu(m_hMenu, nPos)); } +_AFXWIN_INLINE BOOL CMenu::InsertMenu(UINT nPosition, UINT nFlags, UINT nIDNewItem, + LPCTSTR lpszNewItem) + { ASSERT(::IsMenu(m_hMenu)); return ::InsertMenu(m_hMenu, nPosition, nFlags, nIDNewItem, lpszNewItem); } +_AFXWIN_INLINE BOOL CMenu::InsertMenu(UINT nPosition, UINT nFlags, UINT nIDNewItem, const CBitmap* pBmp) + { ASSERT(::IsMenu(m_hMenu)); return ::InsertMenu(m_hMenu, nPosition, nFlags | MF_BITMAP, nIDNewItem, + (LPCTSTR)pBmp->GetSafeHandle()); } +_AFXWIN_INLINE BOOL CMenu::ModifyMenu(UINT nPosition, UINT nFlags, UINT nIDNewItem, LPCTSTR lpszNewItem) + { ASSERT(::IsMenu(m_hMenu)); return ::ModifyMenu(m_hMenu, nPosition, nFlags, nIDNewItem, lpszNewItem); } +_AFXWIN_INLINE BOOL CMenu::ModifyMenu(UINT nPosition, UINT nFlags, UINT nIDNewItem, const CBitmap* pBmp) + { ASSERT(::IsMenu(m_hMenu)); return ::ModifyMenu(m_hMenu, nPosition, nFlags | MF_BITMAP, nIDNewItem, + (LPCTSTR)pBmp->GetSafeHandle()); } +_AFXWIN_INLINE BOOL CMenu::RemoveMenu(UINT nPosition, UINT nFlags) + { ASSERT(::IsMenu(m_hMenu)); return ::RemoveMenu(m_hMenu, nPosition, nFlags); } +_AFXWIN_INLINE BOOL CMenu::SetMenuItemBitmaps(UINT nPosition, UINT nFlags, + const CBitmap* pBmpUnchecked, const CBitmap* pBmpChecked) + { ASSERT(::IsMenu(m_hMenu)); return ::SetMenuItemBitmaps(m_hMenu, nPosition, nFlags, + (HBITMAP)pBmpUnchecked->GetSafeHandle(), + (HBITMAP)pBmpChecked->GetSafeHandle()); } +_AFXWIN_INLINE BOOL CMenu::LoadMenu(LPCTSTR lpszResourceName) + { return Attach(::LoadMenu(AfxFindResourceHandle(lpszResourceName, + RT_MENU), lpszResourceName)); } +_AFXWIN_INLINE BOOL CMenu::LoadMenu(UINT nIDResource) + { return Attach(::LoadMenu(AfxFindResourceHandle( + MAKEINTRESOURCE(nIDResource), RT_MENU), MAKEINTRESOURCE(nIDResource))); } +_AFXWIN_INLINE BOOL CMenu::LoadMenuIndirect(const void* lpMenuTemplate) + { return Attach(::LoadMenuIndirect(lpMenuTemplate)); } + +// CCmdUI +_AFXWIN_INLINE void CCmdUI::ContinueRouting() + { m_bContinueRouting = TRUE; } + +///////////////////////////////////////////////////////////////////////////// + +#endif //_AFXWIN_INLINE diff --git a/public/sdk/inc/mfc30/afxwin2.inl b/public/sdk/inc/mfc30/afxwin2.inl new file mode 100644 index 000000000..d7b21fdf9 --- /dev/null +++ b/public/sdk/inc/mfc30/afxwin2.inl @@ -0,0 +1,899 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// Inlines for AFXWIN.H (part 2) + +#include <limits.h> + +#ifdef _AFXWIN_INLINE + +///////////////////////////////////////////////////////////////////////////// + +// CWnd +_AFXWIN_INLINE HWND CWnd::GetSafeHwnd() const + { return this == NULL ? NULL : m_hWnd; } +_AFXWIN_INLINE DWORD CWnd::GetStyle() const + { ASSERT(::IsWindow(m_hWnd)); return (DWORD)GetWindowLong(m_hWnd, GWL_STYLE); } +_AFXWIN_INLINE DWORD CWnd::GetExStyle() const + { ASSERT(::IsWindow(m_hWnd)); return (DWORD)GetWindowLong(m_hWnd, GWL_EXSTYLE); } +_AFXWIN_INLINE BOOL CWnd::ModifyStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags) + { ASSERT(::IsWindow(m_hWnd)); return ModifyStyle(m_hWnd, dwRemove, dwAdd, nFlags); } +_AFXWIN_INLINE BOOL CWnd::ModifyStyleEx(DWORD dwRemove, DWORD dwAdd, UINT nFlags) + { ASSERT(::IsWindow(m_hWnd)); return ModifyStyleEx(m_hWnd, dwRemove, dwAdd, nFlags); } +_AFXWIN_INLINE CWnd* CWnd::GetOwner() const + { return m_hWndOwner != NULL ? CWnd::FromHandle(m_hWndOwner) : GetParent(); } +_AFXWIN_INLINE void CWnd::SetOwner(CWnd* pOwnerWnd) + { m_hWndOwner = pOwnerWnd != NULL ? pOwnerWnd->m_hWnd : NULL; } +_AFXWIN_INLINE LRESULT CWnd::SendMessage(UINT message, WPARAM wParam, LPARAM lParam) + { ASSERT(::IsWindow(m_hWnd)); return ::SendMessage(m_hWnd, message, wParam, lParam); } +_AFXWIN_INLINE BOOL CWnd::PostMessage(UINT message, WPARAM wParam, LPARAM lParam) + { ASSERT(::IsWindow(m_hWnd)); return ::PostMessage(m_hWnd, message, wParam, lParam); } +_AFXWIN_INLINE void CWnd::SetWindowText(LPCTSTR lpszString) + { ASSERT(::IsWindow(m_hWnd)); ::SetWindowText(m_hWnd, lpszString); } +_AFXWIN_INLINE int CWnd::GetWindowText(LPTSTR lpszString, int nMaxCount) const + { ASSERT(::IsWindow(m_hWnd)); return ::GetWindowText(m_hWnd, lpszString, nMaxCount); } +_AFXWIN_INLINE int CWnd::GetWindowTextLength() const + { ASSERT(::IsWindow(m_hWnd)); return ::GetWindowTextLength(m_hWnd); } +_AFXWIN_INLINE void CWnd::SetFont(CFont* pFont, BOOL bRedraw) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_SETFONT, (WPARAM)pFont->GetSafeHandle(), bRedraw); } +_AFXWIN_INLINE CFont* CWnd::GetFont() const + { ASSERT(::IsWindow(m_hWnd)); return CFont::FromHandle( + (HFONT)::SendMessage(m_hWnd, WM_GETFONT, 0, 0)); } +_AFXWIN_INLINE CMenu* CWnd::GetMenu() const + { ASSERT(::IsWindow(m_hWnd)); return CMenu::FromHandle(::GetMenu(m_hWnd)); } +_AFXWIN_INLINE BOOL CWnd::SetMenu(CMenu* pMenu) + { ASSERT(::IsWindow(m_hWnd)); return ::SetMenu(m_hWnd, pMenu->GetSafeHmenu()); } +_AFXWIN_INLINE void CWnd::DrawMenuBar() + { ASSERT(::IsWindow(m_hWnd)); ::DrawMenuBar(m_hWnd); } +_AFXWIN_INLINE CMenu* CWnd::GetSystemMenu(BOOL bRevert) const + { ASSERT(::IsWindow(m_hWnd)); return CMenu::FromHandle(::GetSystemMenu(m_hWnd, bRevert)); } +_AFXWIN_INLINE BOOL CWnd::HiliteMenuItem(CMenu* pMenu, UINT nIDHiliteItem, UINT nHilite) + { ASSERT(::IsWindow(m_hWnd)); return ::HiliteMenuItem(m_hWnd, pMenu->m_hMenu, nIDHiliteItem, nHilite); } +_AFXWIN_INLINE int CWnd::GetDlgCtrlID() const + { ASSERT(::IsWindow(m_hWnd)); return ::GetDlgCtrlID(m_hWnd); } +_AFXWIN_INLINE int CWnd::SetDlgCtrlID(int nID) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SetWindowLong(m_hWnd, GWL_ID, nID); } +_AFXWIN_INLINE BOOL CWnd::IsIconic() const + { ASSERT(::IsWindow(m_hWnd)); return ::IsIconic(m_hWnd); } +_AFXWIN_INLINE BOOL CWnd::IsZoomed() const + { ASSERT(::IsWindow(m_hWnd)); return ::IsZoomed(m_hWnd); } +_AFXWIN_INLINE void CWnd::MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint) + { ASSERT(::IsWindow(m_hWnd)); ::MoveWindow(m_hWnd, x, y, nWidth, nHeight, bRepaint); } +_AFXWIN_INLINE void CWnd::MoveWindow(LPCRECT lpRect, BOOL bRepaint) + { ASSERT(::IsWindow(m_hWnd)); ::MoveWindow(m_hWnd, lpRect->left, lpRect->top, + lpRect->right - lpRect->left, lpRect->bottom - lpRect->top, bRepaint); } +_AFXWIN_INLINE BOOL CWnd::SetWindowPos(const CWnd* pWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags) + { ASSERT(::IsWindow(m_hWnd)); return ::SetWindowPos(m_hWnd, pWndInsertAfter->GetSafeHwnd(), + x, y, cx, cy, nFlags); } +#ifndef _MAC +_AFXWIN_INLINE UINT CWnd::ArrangeIconicWindows() + { ASSERT(::IsWindow(m_hWnd)); return ::ArrangeIconicWindows(m_hWnd); } +#endif +_AFXWIN_INLINE void CWnd::BringWindowToTop() + { ASSERT(::IsWindow(m_hWnd)); ::BringWindowToTop(m_hWnd); } +_AFXWIN_INLINE void CWnd::GetWindowRect(LPRECT lpRect) const + { ASSERT(::IsWindow(m_hWnd)); ::GetWindowRect(m_hWnd, lpRect); } +_AFXWIN_INLINE void CWnd::GetClientRect(LPRECT lpRect) const + { ASSERT(::IsWindow(m_hWnd)); ::GetClientRect(m_hWnd, lpRect); } +_AFXWIN_INLINE BOOL CWnd::GetWindowPlacement(WINDOWPLACEMENT* lpwndpl) const + { ASSERT(::IsWindow(m_hWnd)); return ::GetWindowPlacement(m_hWnd, lpwndpl); } +_AFXWIN_INLINE BOOL CWnd::SetWindowPlacement(const WINDOWPLACEMENT* lpwndpl) + { ASSERT(::IsWindow(m_hWnd)); return ::SetWindowPlacement(m_hWnd, lpwndpl); } +_AFXWIN_INLINE void CWnd::MapWindowPoints(CWnd* pwndTo, LPPOINT lpPoint, UINT nCount) const + { ASSERT(::IsWindow(m_hWnd)); ::MapWindowPoints(m_hWnd, pwndTo->GetSafeHwnd(), lpPoint, nCount); } +_AFXWIN_INLINE void CWnd::MapWindowPoints(CWnd* pwndTo, LPRECT lpRect) const + { ASSERT(::IsWindow(m_hWnd)); ::MapWindowPoints(m_hWnd, pwndTo->GetSafeHwnd(), (LPPOINT)lpRect, 2); } +_AFXWIN_INLINE void CWnd::ClientToScreen(LPPOINT lpPoint) const + { ASSERT(::IsWindow(m_hWnd)); ::ClientToScreen(m_hWnd, lpPoint); } +_AFXWIN_INLINE void CWnd::ClientToScreen(LPRECT lpRect) const + { ASSERT(::IsWindow(m_hWnd)); ::ClientToScreen(m_hWnd, (LPPOINT)lpRect); + ::ClientToScreen(m_hWnd, ((LPPOINT)lpRect)+1); } +_AFXWIN_INLINE void CWnd::ScreenToClient(LPPOINT lpPoint) const + { ASSERT(::IsWindow(m_hWnd)); ::ScreenToClient(m_hWnd, lpPoint); } +_AFXWIN_INLINE void CWnd::ScreenToClient(LPRECT lpRect) const + { ASSERT(::IsWindow(m_hWnd)); ::ScreenToClient(m_hWnd, (LPPOINT)lpRect); + ::ScreenToClient(m_hWnd, ((LPPOINT)lpRect)+1); } +_AFXWIN_INLINE CDC* CWnd::BeginPaint(LPPAINTSTRUCT lpPaint) + { ASSERT(::IsWindow(m_hWnd)); return CDC::FromHandle(::BeginPaint(m_hWnd, lpPaint)); } +_AFXWIN_INLINE void CWnd::EndPaint(LPPAINTSTRUCT lpPaint) + { ASSERT(::IsWindow(m_hWnd)); ::EndPaint(m_hWnd, lpPaint); } +_AFXWIN_INLINE CDC* CWnd::GetDC() + { ASSERT(::IsWindow(m_hWnd)); return CDC::FromHandle(::GetDC(m_hWnd)); } +_AFXWIN_INLINE CDC* CWnd::GetWindowDC() + { ASSERT(::IsWindow(m_hWnd)); return CDC::FromHandle(::GetWindowDC(m_hWnd)); } +_AFXWIN_INLINE int CWnd::ReleaseDC(CDC* pDC) + { ASSERT(::IsWindow(m_hWnd)); return ::ReleaseDC(m_hWnd, pDC->m_hDC); } +_AFXWIN_INLINE void CWnd::UpdateWindow() + { ASSERT(::IsWindow(m_hWnd)); ::UpdateWindow(m_hWnd); } +_AFXWIN_INLINE void CWnd::SetRedraw(BOOL bRedraw) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_SETREDRAW, bRedraw, 0); } +_AFXWIN_INLINE BOOL CWnd::GetUpdateRect(LPRECT lpRect, BOOL bErase) + { ASSERT(::IsWindow(m_hWnd)); return ::GetUpdateRect(m_hWnd, lpRect, bErase); } +_AFXWIN_INLINE int CWnd::GetUpdateRgn(CRgn* pRgn, BOOL bErase) + { ASSERT(::IsWindow(m_hWnd)); return ::GetUpdateRgn(m_hWnd, (HRGN)pRgn->GetSafeHandle(), bErase); } +_AFXWIN_INLINE void CWnd::Invalidate(BOOL bErase) + { ASSERT(::IsWindow(m_hWnd)); ::InvalidateRect(m_hWnd, NULL, bErase); } +_AFXWIN_INLINE void CWnd::InvalidateRect(LPCRECT lpRect, BOOL bErase) + { ASSERT(::IsWindow(m_hWnd)); ::InvalidateRect(m_hWnd, lpRect, bErase); } +_AFXWIN_INLINE void CWnd::InvalidateRgn(CRgn* pRgn, BOOL bErase) + { ASSERT(::IsWindow(m_hWnd)); ::InvalidateRgn(m_hWnd, (HRGN)pRgn->GetSafeHandle(), bErase); } +_AFXWIN_INLINE void CWnd::ValidateRect(LPCRECT lpRect) + { ASSERT(::IsWindow(m_hWnd)); ::ValidateRect(m_hWnd, lpRect); } +_AFXWIN_INLINE void CWnd::ValidateRgn(CRgn* pRgn) + { ASSERT(::IsWindow(m_hWnd)); ::ValidateRgn(m_hWnd, (HRGN)pRgn->GetSafeHandle()); } +_AFXWIN_INLINE BOOL CWnd::ShowWindow(int nCmdShow) + { ASSERT(::IsWindow(m_hWnd)); return ::ShowWindow(m_hWnd, nCmdShow); } +_AFXWIN_INLINE BOOL CWnd::IsWindowVisible() const + { ASSERT(::IsWindow(m_hWnd)); return ::IsWindowVisible(m_hWnd); } +_AFXWIN_INLINE void CWnd::ShowOwnedPopups(BOOL bShow) + { ASSERT(::IsWindow(m_hWnd)); ::ShowOwnedPopups(m_hWnd, bShow); } +_AFXWIN_INLINE void CWnd::SendMessageToDescendants( + UINT message, WPARAM wParam, LPARAM lParam, BOOL bDeep, BOOL bOnlyPerm) + { ASSERT(::IsWindow(m_hWnd)); CWnd::SendMessageToDescendants(m_hWnd, message, wParam, lParam, bDeep, + bOnlyPerm); } +_AFXWIN_INLINE CWnd* CWnd::GetDescendantWindow(int nID, BOOL bOnlyPerm) const + { ASSERT(::IsWindow(m_hWnd)); return CWnd::GetDescendantWindow(m_hWnd, nID, bOnlyPerm); } + +_AFXWIN_INLINE CDC* CWnd::GetDCEx(CRgn* prgnClip, DWORD flags) + { ASSERT(::IsWindow(m_hWnd)); return CDC::FromHandle(::GetDCEx(m_hWnd, (HRGN)prgnClip->GetSafeHandle(), flags)); } +#ifndef _MAC +_AFXWIN_INLINE BOOL CWnd::LockWindowUpdate() + { ASSERT(::IsWindow(m_hWnd)); return ::LockWindowUpdate(m_hWnd); } +_AFXWIN_INLINE void CWnd::UnlockWindowUpdate() + { ASSERT(::IsWindow(m_hWnd)); ::LockWindowUpdate(NULL); } +#endif +_AFXWIN_INLINE BOOL CWnd::RedrawWindow(LPCRECT lpRectUpdate, CRgn* prgnUpdate, + UINT flags) + { ASSERT(::IsWindow(m_hWnd)); return ::RedrawWindow(m_hWnd, lpRectUpdate, (HRGN)prgnUpdate->GetSafeHandle(), flags); } +_AFXWIN_INLINE BOOL CWnd::EnableScrollBar(int nSBFlags, UINT nArrowFlags) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::EnableScrollBar(m_hWnd, nSBFlags, nArrowFlags); } + +_AFXWIN_INLINE UINT CWnd::SetTimer(UINT nIDEvent, UINT nElapse, + void (CALLBACK EXPORT* lpfnTimer)(HWND, UINT, UINT, DWORD)) + { ASSERT(::IsWindow(m_hWnd)); return ::SetTimer(m_hWnd, nIDEvent, nElapse, + (TIMERPROC)lpfnTimer); } +_AFXWIN_INLINE BOOL CWnd::KillTimer(int nIDEvent) + { ASSERT(::IsWindow(m_hWnd)); return ::KillTimer(m_hWnd, nIDEvent); } +_AFXWIN_INLINE BOOL CWnd::IsWindowEnabled() const + { ASSERT(::IsWindow(m_hWnd)); return ::IsWindowEnabled(m_hWnd); } +_AFXWIN_INLINE BOOL CWnd::EnableWindow(BOOL bEnable) + { ASSERT(::IsWindow(m_hWnd)); return ::EnableWindow(m_hWnd, bEnable); } +_AFXWIN_INLINE CWnd* PASCAL CWnd::GetActiveWindow() + { return CWnd::FromHandle(::GetActiveWindow()); } +_AFXWIN_INLINE CWnd* CWnd::SetActiveWindow() + { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::SetActiveWindow(m_hWnd)); } +_AFXWIN_INLINE CWnd* PASCAL CWnd::GetCapture() + { return CWnd::FromHandle(::GetCapture()); } +_AFXWIN_INLINE CWnd* CWnd::SetCapture() + { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::SetCapture(m_hWnd)); } +_AFXWIN_INLINE CWnd* PASCAL CWnd::GetFocus() + { return CWnd::FromHandle(::GetFocus()); } +_AFXWIN_INLINE CWnd* CWnd::SetFocus() + { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::SetFocus(m_hWnd)); } +_AFXWIN_INLINE CWnd* PASCAL CWnd::GetDesktopWindow() + { return CWnd::FromHandle(::GetDesktopWindow()); } +_AFXWIN_INLINE void CWnd::CheckDlgButton(int nIDButton, UINT nCheck) + { ASSERT(::IsWindow(m_hWnd)); ::CheckDlgButton(m_hWnd, nIDButton, nCheck); } +_AFXWIN_INLINE void CWnd::CheckRadioButton(int nIDFirstButton, int nIDLastButton, + int nIDCheckButton) + { ASSERT(::IsWindow(m_hWnd)); ::CheckRadioButton(m_hWnd, nIDFirstButton, nIDLastButton, nIDCheckButton); } +#ifndef _MAC +_AFXWIN_INLINE int CWnd::DlgDirList(LPTSTR lpPathSpec, int nIDListBox, + int nIDStaticPath, UINT nFileType) + { ASSERT(::IsWindow(m_hWnd)); return ::DlgDirList(m_hWnd, lpPathSpec, nIDListBox, + nIDStaticPath, nFileType); } +_AFXWIN_INLINE int CWnd::DlgDirListComboBox(LPTSTR lpPathSpec, int nIDComboBox, + int nIDStaticPath, UINT nFileType) + { ASSERT(::IsWindow(m_hWnd)); return ::DlgDirListComboBox(m_hWnd, lpPathSpec, + nIDComboBox, nIDStaticPath, nFileType); } +_AFXWIN_INLINE BOOL CWnd::DlgDirSelect(LPTSTR lpString, int nIDListBox) + { ASSERT(::IsWindow(m_hWnd)); return ::DlgDirSelectEx(m_hWnd, lpString, _MAX_PATH, nIDListBox); } +_AFXWIN_INLINE BOOL CWnd::DlgDirSelectComboBox(LPTSTR lpString, int nIDComboBox) + { ASSERT(::IsWindow(m_hWnd)); return ::DlgDirSelectComboBoxEx(m_hWnd, lpString, _MAX_PATH, nIDComboBox);} +#endif +_AFXWIN_INLINE CWnd* CWnd::GetDlgItem(int nID) const + { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetDlgItem(m_hWnd, nID)); } +_AFXWIN_INLINE UINT CWnd::GetDlgItemInt(int nID, BOOL* lpTrans, + BOOL bSigned) const + { ASSERT(::IsWindow(m_hWnd)); return ::GetDlgItemInt(m_hWnd, nID, lpTrans, bSigned);} +_AFXWIN_INLINE int CWnd::GetDlgItemText(int nID, LPTSTR lpStr, int nMaxCount) const + { ASSERT(::IsWindow(m_hWnd)); return ::GetDlgItemText(m_hWnd, nID, lpStr, nMaxCount);} +_AFXWIN_INLINE CWnd* CWnd::GetNextDlgGroupItem(CWnd* pWndCtl, BOOL bPrevious) const + { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetNextDlgGroupItem(m_hWnd, + pWndCtl->m_hWnd, bPrevious)); } +_AFXWIN_INLINE CWnd* CWnd::GetNextDlgTabItem(CWnd* pWndCtl, BOOL bPrevious) const + { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetNextDlgTabItem(m_hWnd, + pWndCtl->m_hWnd, bPrevious)); } +_AFXWIN_INLINE UINT CWnd::IsDlgButtonChecked(int nIDButton) const + { ASSERT(::IsWindow(m_hWnd)); return ::IsDlgButtonChecked(m_hWnd, nIDButton); } +_AFXWIN_INLINE LPARAM CWnd::SendDlgItemMessage(int nID, UINT message, WPARAM wParam, LPARAM lParam) + { ASSERT(::IsWindow(m_hWnd)); return ::SendDlgItemMessage(m_hWnd, nID, message, wParam, lParam); } +_AFXWIN_INLINE void CWnd::SetDlgItemInt(int nID, UINT nValue, BOOL bSigned) + { ASSERT(::IsWindow(m_hWnd)); ::SetDlgItemInt(m_hWnd, nID, nValue, bSigned); } +_AFXWIN_INLINE void CWnd::SetDlgItemText(int nID, LPCTSTR lpszString) + { ASSERT(::IsWindow(m_hWnd)); ::SetDlgItemText(m_hWnd, nID, lpszString); } +_AFXWIN_INLINE void CWnd::ScrollWindow(int xAmount, int yAmount, + LPCRECT lpRect, LPCRECT lpClipRect) + { ASSERT(::IsWindow(m_hWnd)); ::ScrollWindow(m_hWnd, xAmount, yAmount, lpRect, lpClipRect); } +_AFXWIN_INLINE int CWnd::ScrollWindowEx(int dx, int dy, + LPCRECT lpRectScroll, LPCRECT lpRectClip, + CRgn* prgnUpdate, LPRECT lpRectUpdate, UINT flags) + { ASSERT(::IsWindow(m_hWnd)); return ::ScrollWindowEx(m_hWnd, dx, dy, lpRectScroll, lpRectClip, + (HRGN)prgnUpdate->GetSafeHandle(), lpRectUpdate, flags); } + +_AFXWIN_INLINE void CWnd::ShowScrollBar(UINT nBar, BOOL bShow) + { ASSERT(::IsWindow(m_hWnd)); ::ShowScrollBar(m_hWnd, nBar, bShow); } +_AFXWIN_INLINE CWnd* CWnd::ChildWindowFromPoint(POINT point) const + { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::ChildWindowFromPoint(m_hWnd, point)); } +_AFXWIN_INLINE CWnd* PASCAL CWnd::FindWindow(LPCTSTR lpszClassName, LPCTSTR lpszWindowName) + { return CWnd::FromHandle(::FindWindow(lpszClassName, lpszWindowName)); } +_AFXWIN_INLINE CWnd* CWnd::GetNextWindow(UINT nFlag) const + { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetNextWindow(m_hWnd, nFlag)); } +_AFXWIN_INLINE CWnd* CWnd::GetTopWindow() const + { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetTopWindow(m_hWnd)); } +_AFXWIN_INLINE CWnd* CWnd::GetWindow(UINT nCmd) const + { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetWindow(m_hWnd, nCmd)); } +_AFXWIN_INLINE CWnd* CWnd::GetLastActivePopup() const + { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetLastActivePopup(m_hWnd)); } +_AFXWIN_INLINE BOOL CWnd::IsChild(const CWnd* pWnd) const + { ASSERT(::IsWindow(m_hWnd)); return ::IsChild(m_hWnd, pWnd->GetSafeHwnd()); } +_AFXWIN_INLINE CWnd* CWnd::GetParent() const + { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::GetParent(m_hWnd)); } +_AFXWIN_INLINE CWnd* CWnd::SetParent(CWnd* pWndNewParent) + { ASSERT(::IsWindow(m_hWnd)); return CWnd::FromHandle(::SetParent(m_hWnd, + pWndNewParent->GetSafeHwnd())); } +_AFXWIN_INLINE CWnd* PASCAL CWnd::WindowFromPoint(POINT point) + { return CWnd::FromHandle(::WindowFromPoint(point)); } +_AFXWIN_INLINE BOOL CWnd::FlashWindow(BOOL bInvert) + { ASSERT(::IsWindow(m_hWnd)); return ::FlashWindow(m_hWnd, bInvert); } +_AFXWIN_INLINE BOOL CWnd::ChangeClipboardChain(HWND hWndNext) + { ASSERT(::IsWindow(m_hWnd)); return ::ChangeClipboardChain(m_hWnd, hWndNext); } +_AFXWIN_INLINE HWND CWnd::SetClipboardViewer() + { ASSERT(::IsWindow(m_hWnd)); return ::SetClipboardViewer(m_hWnd); } +_AFXWIN_INLINE BOOL CWnd::OpenClipboard() + { ASSERT(::IsWindow(m_hWnd)); return ::OpenClipboard(m_hWnd); } +_AFXWIN_INLINE CWnd* PASCAL CWnd::GetOpenClipboardWindow() + { return CWnd::FromHandle(::GetOpenClipboardWindow()); } +_AFXWIN_INLINE CWnd* PASCAL CWnd::GetClipboardOwner() + { return CWnd::FromHandle(::GetClipboardOwner()); } +_AFXWIN_INLINE CWnd* PASCAL CWnd::GetClipboardViewer() + { return CWnd::FromHandle(::GetClipboardViewer()); } +_AFXWIN_INLINE void CWnd::CreateCaret(CBitmap* pBitmap) + { ASSERT(::IsWindow(m_hWnd)); ::CreateCaret(m_hWnd, (HBITMAP)pBitmap->GetSafeHandle(), 0, 0); } +_AFXWIN_INLINE void CWnd::CreateSolidCaret(int nWidth, int nHeight) + { ASSERT(::IsWindow(m_hWnd)); ::CreateCaret(m_hWnd, (HBITMAP)0, nWidth, nHeight); } +_AFXWIN_INLINE void CWnd::CreateGrayCaret(int nWidth, int nHeight) + { ASSERT(::IsWindow(m_hWnd)); ::CreateCaret(m_hWnd, (HBITMAP)1, nWidth, nHeight); } +_AFXWIN_INLINE CPoint PASCAL CWnd::GetCaretPos() + { CPoint point; ::GetCaretPos((LPPOINT)&point); return point; } +_AFXWIN_INLINE void PASCAL CWnd::SetCaretPos(POINT point) + { ::SetCaretPos(point.x, point.y); } +_AFXWIN_INLINE void CWnd::HideCaret() + { ASSERT(::IsWindow(m_hWnd)); ::HideCaret(m_hWnd); } +_AFXWIN_INLINE void CWnd::ShowCaret() + { ASSERT(::IsWindow(m_hWnd)); ::ShowCaret(m_hWnd); } +_AFXWIN_INLINE void CWnd::DragAcceptFiles(BOOL bAccept) + { ASSERT(::IsWindow(m_hWnd)); ::DragAcceptFiles(m_hWnd, bAccept); } +_AFXWIN_INLINE BOOL CWnd::SetForegroundWindow() + { ASSERT(::IsWindow(m_hWnd)); return ::SetForegroundWindow(m_hWnd); } +_AFXWIN_INLINE CWnd* PASCAL CWnd::GetForegroundWindow() + { return CWnd::FromHandle(::GetForegroundWindow()); } + +#ifndef _MAC +_AFXWIN_INLINE BOOL CWnd::SendNotifyMessage(UINT message, WPARAM wParam, LPARAM lParam) + { ASSERT(::IsWindow(m_hWnd)); return ::SendNotifyMessage(m_hWnd, message, wParam, lParam); } +#endif + +// Default message map implementations +_AFXWIN_INLINE void CWnd::OnActivateApp(BOOL, HTASK) + { Default(); } +_AFXWIN_INLINE void CWnd::OnActivate(UINT, CWnd*, BOOL) + { Default(); } +_AFXWIN_INLINE void CWnd::OnCancelMode() + { Default(); } +_AFXWIN_INLINE void CWnd::OnChildActivate() + { Default(); } +_AFXWIN_INLINE void CWnd::OnClose() + { Default(); } +_AFXWIN_INLINE int CWnd::OnCreate(LPCREATESTRUCT) + { return (int)Default(); } +_AFXWIN_INLINE void CWnd::OnDestroy() + { Default(); } +_AFXWIN_INLINE void CWnd::OnEnable(BOOL) + { Default(); } +_AFXWIN_INLINE void CWnd::OnEndSession(BOOL) + { Default(); } +_AFXWIN_INLINE void CWnd::OnEnterIdle(UINT, CWnd*) + { Default(); } +_AFXWIN_INLINE BOOL CWnd::OnEraseBkgnd(CDC*) + { return (BOOL)Default(); } +_AFXWIN_INLINE void CWnd::OnGetMinMaxInfo(MINMAXINFO*) + { Default(); } +_AFXWIN_INLINE void CWnd::OnIconEraseBkgnd(CDC*) + { Default(); } +_AFXWIN_INLINE void CWnd::OnKillFocus(CWnd*) + { Default(); } +_AFXWIN_INLINE LRESULT CWnd::OnMenuChar(UINT, UINT, CMenu*) + { return Default(); } +_AFXWIN_INLINE void CWnd::OnMenuSelect(UINT, UINT, HMENU) + { Default(); } +_AFXWIN_INLINE void CWnd::OnMove(int, int) + { Default(); } +_AFXWIN_INLINE void CWnd::OnPaint() + { Default(); } +_AFXWIN_INLINE HCURSOR CWnd::OnQueryDragIcon() + { return (HCURSOR)Default(); } +_AFXWIN_INLINE BOOL CWnd::OnQueryEndSession() + { return (BOOL)Default(); } +_AFXWIN_INLINE BOOL CWnd::OnQueryNewPalette() + { return (BOOL)Default(); } +_AFXWIN_INLINE BOOL CWnd::OnQueryOpen() + { return (BOOL)Default(); } +_AFXWIN_INLINE BOOL CWnd::OnSetCursor(CWnd*, UINT, UINT) + { return (BOOL)Default(); } +_AFXWIN_INLINE void CWnd::OnSetFocus(CWnd*) + { Default(); } +_AFXWIN_INLINE void CWnd::OnShowWindow(BOOL, UINT) + { Default(); } +_AFXWIN_INLINE void CWnd::OnSize(UINT, int, int) + { Default(); } +_AFXWIN_INLINE void CWnd::OnWindowPosChanging(WINDOWPOS*) + { Default(); } +_AFXWIN_INLINE void CWnd::OnWindowPosChanged(WINDOWPOS*) + { Default(); } +_AFXWIN_INLINE void CWnd::OnDropFiles(HDROP) + { Default(); } +_AFXWIN_INLINE void CWnd::OnPaletteIsChanging(CWnd*) + { Default(); } +_AFXWIN_INLINE BOOL CWnd::OnNcActivate(BOOL) + { return (BOOL)Default(); } +_AFXWIN_INLINE void CWnd::OnNcCalcSize(BOOL, NCCALCSIZE_PARAMS*) + { Default(); } +_AFXWIN_INLINE BOOL CWnd::OnNcCreate(LPCREATESTRUCT) + { return (BOOL)Default(); } +_AFXWIN_INLINE UINT CWnd::OnNcHitTest(CPoint) + { return (UINT)Default(); } +_AFXWIN_INLINE void CWnd::OnNcLButtonDblClk(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnNcLButtonDown(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnNcLButtonUp(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnNcMButtonDblClk(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnNcMButtonDown(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnNcMButtonUp(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnNcMouseMove(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnNcPaint() + { Default(); } +_AFXWIN_INLINE void CWnd::OnNcRButtonDblClk(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnNcRButtonDown(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnNcRButtonUp(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnSysChar(UINT, UINT, UINT) + { Default(); } +_AFXWIN_INLINE void CWnd::OnSysCommand(UINT, LPARAM) + { Default(); } +_AFXWIN_INLINE void CWnd::OnSysDeadChar(UINT, UINT, UINT) + { Default(); } +_AFXWIN_INLINE void CWnd::OnSysKeyDown(UINT, UINT, UINT) + { Default(); } +_AFXWIN_INLINE void CWnd::OnSysKeyUp(UINT, UINT, UINT) + { Default(); } +_AFXWIN_INLINE void CWnd::OnCompacting(UINT) + { Default(); } +_AFXWIN_INLINE void CWnd::OnFontChange() + { Default(); } +_AFXWIN_INLINE void CWnd::OnPaletteChanged(CWnd*) + { Default(); } +_AFXWIN_INLINE void CWnd::OnSpoolerStatus(UINT, UINT) + { Default(); } +_AFXWIN_INLINE void CWnd::OnTimeChange() + { Default(); } +_AFXWIN_INLINE void CWnd::OnChar(UINT, UINT, UINT) + { Default(); } +_AFXWIN_INLINE void CWnd::OnDeadChar(UINT, UINT, UINT) + { Default(); } +_AFXWIN_INLINE void CWnd::OnKeyDown(UINT, UINT, UINT) + { Default(); } +_AFXWIN_INLINE void CWnd::OnKeyUp(UINT, UINT, UINT) + { Default(); } +_AFXWIN_INLINE void CWnd::OnLButtonDblClk(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnLButtonDown(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnLButtonUp(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnMButtonDblClk(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnMButtonDown(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnMButtonUp(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE int CWnd::OnMouseActivate(CWnd*, UINT, UINT) + { return (int)Default(); } +_AFXWIN_INLINE void CWnd::OnMouseMove(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnRButtonDblClk(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnRButtonDown(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnRButtonUp(UINT, CPoint) + { Default(); } +_AFXWIN_INLINE void CWnd::OnTimer(UINT) + { Default(); } +_AFXWIN_INLINE void CWnd::OnInitMenu(CMenu*) + { Default(); } +_AFXWIN_INLINE void CWnd::OnInitMenuPopup(CMenu*, UINT, BOOL) + { Default(); } +_AFXWIN_INLINE void CWnd::OnAskCbFormatName(UINT, LPTSTR) + { Default(); } +_AFXWIN_INLINE void CWnd::OnChangeCbChain(HWND, HWND) + { Default(); } +_AFXWIN_INLINE void CWnd::OnDestroyClipboard() + { Default(); } +_AFXWIN_INLINE void CWnd::OnDrawClipboard() + { Default(); } +_AFXWIN_INLINE void CWnd::OnHScrollClipboard(CWnd*, UINT, UINT) + { Default(); } +_AFXWIN_INLINE void CWnd::OnPaintClipboard(CWnd*, HGLOBAL) + { Default(); } +_AFXWIN_INLINE void CWnd::OnRenderAllFormats() + { Default(); } +_AFXWIN_INLINE void CWnd::OnRenderFormat(UINT) + { Default(); } +_AFXWIN_INLINE void CWnd::OnSizeClipboard(CWnd*, HGLOBAL) + { Default(); } +_AFXWIN_INLINE void CWnd::OnVScrollClipboard(CWnd*, UINT, UINT) + { Default(); } +_AFXWIN_INLINE UINT CWnd::OnGetDlgCode() + { return (UINT)Default(); } +_AFXWIN_INLINE int CWnd::OnCharToItem(UINT, CListBox*, UINT) + { return (int)Default(); } +_AFXWIN_INLINE int CWnd::OnVKeyToItem(UINT, CListBox*, UINT) + { return (int)Default(); } +_AFXWIN_INLINE void CWnd::OnMDIActivate(BOOL, CWnd*, CWnd*) + { Default(); } +_AFXWIN_INLINE void CWnd::OnEnterMenuLoop(BOOL) + { Default(); } +_AFXWIN_INLINE void CWnd::OnExitMenuLoop(BOOL) + { Default(); } + +// CWnd dialog data support +_AFXWIN_INLINE void CWnd::DoDataExchange(CDataExchange*) + { } // default does nothing + +// CFrameWnd +_AFXWIN_INLINE void CFrameWnd::DelayUpdateFrameTitle() + { m_nIdleFlags |= idleTitle; } +_AFXWIN_INLINE void CFrameWnd::DelayRecalcLayout(BOOL bNotify) + { m_nIdleFlags |= (idleLayout | (bNotify ? idleNotify : 0)); }; +_AFXWIN_INLINE BOOL CFrameWnd::InModalState() const + { return m_cModalStack != 0; } +_AFXWIN_INLINE void CFrameWnd::AddControlBar(CControlBar *pBar) + { m_listControlBars.AddTail(pBar); } + +// CDialog +_AFXWIN_INLINE BOOL CDialog::Create(UINT nIDTemplate, CWnd* pParentWnd) + { return Create(MAKEINTRESOURCE(nIDTemplate), pParentWnd); } +_AFXWIN_INLINE void CDialog::MapDialogRect(LPRECT lpRect) const + { ASSERT(::IsWindow(m_hWnd)); ::MapDialogRect(m_hWnd, lpRect); } +_AFXWIN_INLINE void CDialog::SetHelpID(UINT nIDR) + { m_nIDHelp = nIDR; } +_AFXWIN_INLINE BOOL CDialog::IsDialogMessage(LPMSG lpMsg) + { ASSERT(::IsWindow(m_hWnd)); return ::IsDialogMessage(m_hWnd, lpMsg); } +_AFXWIN_INLINE void CDialog::NextDlgCtrl() const + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_NEXTDLGCTL, 0, 0); } +_AFXWIN_INLINE void CDialog::PrevDlgCtrl() const + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_NEXTDLGCTL, 1, 0); } +_AFXWIN_INLINE void CDialog::GotoDlgCtrl(CWnd* pWndCtrl) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_NEXTDLGCTL, (WPARAM)pWndCtrl->m_hWnd, 1L); } +_AFXWIN_INLINE void CDialog::SetDefID(UINT nID) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, DM_SETDEFID, nID, 0); } +_AFXWIN_INLINE DWORD CDialog::GetDefID() const + { ASSERT(::IsWindow(m_hWnd)); return ::SendMessage(m_hWnd, DM_GETDEFID, 0, 0); } +_AFXWIN_INLINE void CDialog::EndDialog(int nResult) + { ASSERT(::IsWindow(m_hWnd)); ::EndDialog(m_hWnd, nResult); } + +// Window control functions +_AFXWIN_INLINE CStatic::CStatic() + { } +_AFXWIN_INLINE CButton::CButton() + { } +_AFXWIN_INLINE HICON CStatic::SetIcon(HICON hIcon) + { ASSERT(::IsWindow(m_hWnd)); return (HICON)::SendMessage(m_hWnd, STM_SETICON, (WPARAM)hIcon, 0L); } +_AFXWIN_INLINE HICON CStatic::GetIcon() const + { ASSERT(::IsWindow(m_hWnd)); return (HICON)::SendMessage(m_hWnd, STM_GETICON, 0, 0L); } + +_AFXWIN_INLINE UINT CButton::GetState() const + { ASSERT(::IsWindow(m_hWnd)); return (UINT)::SendMessage(m_hWnd, BM_GETSTATE, 0, 0); } +_AFXWIN_INLINE void CButton::SetState(BOOL bHighlight) + { ::SendMessage(m_hWnd, BM_SETSTATE, bHighlight, 0); } +_AFXWIN_INLINE int CButton::GetCheck() const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, BM_GETCHECK, 0, 0); } +_AFXWIN_INLINE void CButton::SetCheck(int nCheck) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, BM_SETCHECK, nCheck, 0); } +_AFXWIN_INLINE UINT CButton::GetButtonStyle() const + { ASSERT(::IsWindow(m_hWnd)); return (UINT)GetWindowLong(m_hWnd, GWL_STYLE) & 0xff; } +_AFXWIN_INLINE void CButton::SetButtonStyle(UINT nStyle, BOOL bRedraw) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, BM_SETSTYLE, nStyle, (LPARAM)bRedraw); } +_AFXWIN_INLINE CListBox::CListBox() + { } +_AFXWIN_INLINE int CListBox::GetCount() const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETCOUNT, 0, 0); } +_AFXWIN_INLINE int CListBox::GetCurSel() const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETCURSEL, 0, 0); } +_AFXWIN_INLINE int CListBox::SetCurSel(int nSelect) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_SETCURSEL, nSelect, 0); } +_AFXWIN_INLINE int CListBox::GetHorizontalExtent() const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETHORIZONTALEXTENT, + 0, 0); } +_AFXWIN_INLINE void CListBox::SetHorizontalExtent(int cxExtent) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, LB_SETHORIZONTALEXTENT, cxExtent, 0); } +_AFXWIN_INLINE int CListBox::GetSelCount() const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETSELCOUNT, 0, 0); } +_AFXWIN_INLINE int CListBox::GetSelItems(int nMaxItems, LPINT rgIndex) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETSELITEMS, nMaxItems, (LPARAM)rgIndex); } +_AFXWIN_INLINE int CListBox::GetTopIndex() const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETTOPINDEX, 0, 0); } +_AFXWIN_INLINE int CListBox::SetTopIndex(int nIndex) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_SETTOPINDEX, nIndex, 0);} +_AFXWIN_INLINE DWORD CListBox::GetItemData(int nIndex) const + { ASSERT(::IsWindow(m_hWnd)); return ::SendMessage(m_hWnd, LB_GETITEMDATA, nIndex, 0); } +_AFXWIN_INLINE int CListBox::SetItemData(int nIndex, DWORD dwItemData) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_SETITEMDATA, nIndex, (LPARAM)dwItemData); } +_AFXWIN_INLINE void* CListBox::GetItemDataPtr(int nIndex) const + { ASSERT(::IsWindow(m_hWnd)); return (LPVOID)::SendMessage(m_hWnd, LB_GETITEMDATA, nIndex, 0); } +_AFXWIN_INLINE int CListBox::SetItemDataPtr(int nIndex, void* pData) + { ASSERT(::IsWindow(m_hWnd)); return SetItemData(nIndex, (DWORD)(LPVOID)pData); } +_AFXWIN_INLINE int CListBox::GetItemRect(int nIndex, LPRECT lpRect) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETITEMRECT, nIndex, (LPARAM)lpRect); } +_AFXWIN_INLINE int CListBox::GetSel(int nIndex) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETSEL, nIndex, 0); } +_AFXWIN_INLINE int CListBox::SetSel(int nIndex, BOOL bSelect) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_SETSEL, bSelect, nIndex); } +_AFXWIN_INLINE int CListBox::GetText(int nIndex, LPTSTR lpszBuffer) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETTEXT, nIndex, (LPARAM)lpszBuffer); } +_AFXWIN_INLINE int CListBox::GetTextLen(int nIndex) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETTEXTLEN, nIndex, 0); } +_AFXWIN_INLINE void CListBox::SetColumnWidth(int cxWidth) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, LB_SETCOLUMNWIDTH, cxWidth, 0); } +_AFXWIN_INLINE BOOL CListBox::SetTabStops(int nTabStops, LPINT rgTabStops) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, LB_SETTABSTOPS, nTabStops, (LPARAM)rgTabStops); } +_AFXWIN_INLINE void CListBox::SetTabStops() + { ASSERT(::IsWindow(m_hWnd)); VERIFY(::SendMessage(m_hWnd, LB_SETTABSTOPS, 0, 0)); } +_AFXWIN_INLINE BOOL CListBox::SetTabStops(const int& cxEachStop) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, LB_SETTABSTOPS, 1, (LPARAM)(LPINT)&cxEachStop); } +_AFXWIN_INLINE int CListBox::SetItemHeight(int nIndex, UINT cyItemHeight) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_SETITEMHEIGHT, nIndex, MAKELONG(cyItemHeight, 0)); } +_AFXWIN_INLINE int CListBox::GetItemHeight(int nIndex) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETITEMHEIGHT, nIndex, 0L); } +_AFXWIN_INLINE int CListBox::FindStringExact(int nIndexStart, LPCTSTR lpszFind) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_FINDSTRINGEXACT, nIndexStart, (LPARAM)lpszFind); } +_AFXWIN_INLINE int CListBox::GetCaretIndex() const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETCARETINDEX, 0, 0L); } +_AFXWIN_INLINE int CListBox::SetCaretIndex(int nIndex, BOOL bScroll) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_SETCARETINDEX, nIndex, MAKELONG(bScroll, 0)); } +_AFXWIN_INLINE int CListBox::AddString(LPCTSTR lpszItem) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_ADDSTRING, 0, (LPARAM)lpszItem); } +_AFXWIN_INLINE int CListBox::DeleteString(UINT nIndex) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_DELETESTRING, nIndex, 0); } +_AFXWIN_INLINE int CListBox::InsertString(int nIndex, LPCTSTR lpszItem) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_INSERTSTRING, nIndex, (LPARAM)lpszItem); } +_AFXWIN_INLINE void CListBox::ResetContent() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, LB_RESETCONTENT, 0, 0); } +_AFXWIN_INLINE int CListBox::Dir(UINT attr, LPCTSTR lpszWildCard) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_DIR, attr, (LPARAM)lpszWildCard); } +_AFXWIN_INLINE int CListBox::FindString(int nStartAfter, LPCTSTR lpszItem) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_FINDSTRING, + nStartAfter, (LPARAM)lpszItem); } +_AFXWIN_INLINE int CListBox::SelectString(int nStartAfter, LPCTSTR lpszItem) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_SELECTSTRING, + nStartAfter, (LPARAM)lpszItem); } +_AFXWIN_INLINE int CListBox::SelItemRange(BOOL bSelect, int nFirstItem, int nLastItem) + { ASSERT(::IsWindow(m_hWnd)); return bSelect ? + (int)::SendMessage(m_hWnd, LB_SELITEMRANGEEX, nFirstItem, nLastItem) : + (int)::SendMessage(m_hWnd, LB_SELITEMRANGEEX, nLastItem, nFirstItem); } +_AFXWIN_INLINE void CListBox::SetAnchorIndex(int nIndex) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, LB_SETANCHORINDEX, nIndex, 0); } +_AFXWIN_INLINE int CListBox::GetAnchorIndex() const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETANCHORINDEX, 0, 0); } +_AFXWIN_INLINE LCID CListBox::GetLocale() const + { ASSERT(::IsWindow(m_hWnd)); return (LCID)::SendMessage(m_hWnd, LB_GETLOCALE, 0, 0); } +_AFXWIN_INLINE LCID CListBox::SetLocale(LCID nNewLocale) + { ASSERT(::IsWindow(m_hWnd)); return (LCID)::SendMessage(m_hWnd, LB_SETLOCALE, (WPARAM)nNewLocale, 0); } + + +_AFXWIN_INLINE CComboBox::CComboBox() + { } +_AFXWIN_INLINE int CComboBox::GetCount() const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_GETCOUNT, 0, 0); } +_AFXWIN_INLINE int CComboBox::GetCurSel() const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_GETCURSEL, 0, 0); } +_AFXWIN_INLINE int CComboBox::SetCurSel(int nSelect) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_SETCURSEL, nSelect, 0); } +_AFXWIN_INLINE DWORD CComboBox::GetEditSel() const + { ASSERT(::IsWindow(m_hWnd)); return ::SendMessage(m_hWnd, CB_GETEDITSEL, 0, 0); } +_AFXWIN_INLINE BOOL CComboBox::LimitText(int nMaxChars) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, CB_LIMITTEXT, nMaxChars, 0); } +_AFXWIN_INLINE BOOL CComboBox::SetEditSel(int nStartChar, int nEndChar) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, CB_SETEDITSEL, 0, MAKELONG(nStartChar, nEndChar)); } +_AFXWIN_INLINE DWORD CComboBox::GetItemData(int nIndex) const + { ASSERT(::IsWindow(m_hWnd)); return ::SendMessage(m_hWnd, CB_GETITEMDATA, nIndex, 0); } +_AFXWIN_INLINE int CComboBox::SetItemData(int nIndex, DWORD dwItemData) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_SETITEMDATA, nIndex, (LPARAM)dwItemData); } +_AFXWIN_INLINE void* CComboBox::GetItemDataPtr(int nIndex) const + { ASSERT(::IsWindow(m_hWnd)); return (LPVOID)GetItemData(nIndex); } +_AFXWIN_INLINE int CComboBox::SetItemDataPtr(int nIndex, void* pData) + { ASSERT(::IsWindow(m_hWnd)); return SetItemData(nIndex, (DWORD)(LPVOID)pData); } +_AFXWIN_INLINE int CComboBox::GetLBText(int nIndex, LPTSTR lpszText) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_GETLBTEXT, nIndex, (LPARAM)lpszText); } +_AFXWIN_INLINE int CComboBox::GetLBTextLen(int nIndex) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_GETLBTEXTLEN, nIndex, 0); } +_AFXWIN_INLINE void CComboBox::ShowDropDown(BOOL bShowIt) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, CB_SHOWDROPDOWN, bShowIt, 0); } +_AFXWIN_INLINE int CComboBox::AddString(LPCTSTR lpszString) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_ADDSTRING, 0, (LPARAM)lpszString); } +_AFXWIN_INLINE int CComboBox::DeleteString(UINT nIndex) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_DELETESTRING, nIndex, 0);} +_AFXWIN_INLINE int CComboBox::InsertString(int nIndex, LPCTSTR lpszString) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_INSERTSTRING, nIndex, (LPARAM)lpszString); } +_AFXWIN_INLINE void CComboBox::ResetContent() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, CB_RESETCONTENT, 0, 0); } +_AFXWIN_INLINE int CComboBox::Dir(UINT attr, LPCTSTR lpszWildCard) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_DIR, attr, (LPARAM)lpszWildCard); } +_AFXWIN_INLINE int CComboBox::FindString(int nStartAfter, LPCTSTR lpszString) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_FINDSTRING, nStartAfter, + (LPARAM)lpszString); } +_AFXWIN_INLINE int CComboBox::SelectString(int nStartAfter, LPCTSTR lpszString) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_SELECTSTRING, + nStartAfter, (LPARAM)lpszString); } +_AFXWIN_INLINE void CComboBox::Clear() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_CLEAR, 0, 0); } +_AFXWIN_INLINE void CComboBox::Copy() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_COPY, 0, 0); } +_AFXWIN_INLINE void CComboBox::Cut() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_CUT, 0, 0); } +_AFXWIN_INLINE void CComboBox::Paste() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_PASTE, 0, 0); } +_AFXWIN_INLINE int CComboBox::SetItemHeight(int nIndex, UINT cyItemHeight) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_SETITEMHEIGHT, nIndex, MAKELONG(cyItemHeight, 0)); } +_AFXWIN_INLINE int CComboBox::GetItemHeight(int nIndex) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_GETITEMHEIGHT, nIndex, 0L); } +_AFXWIN_INLINE int CComboBox::FindStringExact(int nIndexStart, LPCTSTR lpszFind) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_FINDSTRINGEXACT, nIndexStart, (LPARAM)lpszFind); } +_AFXWIN_INLINE int CComboBox::SetExtendedUI(BOOL bExtended ) + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, CB_SETEXTENDEDUI, bExtended, 0L); } +_AFXWIN_INLINE BOOL CComboBox::GetExtendedUI() const + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, CB_GETEXTENDEDUI, 0, 0L); } +_AFXWIN_INLINE void CComboBox::GetDroppedControlRect(LPRECT lprect) const + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, CB_GETDROPPEDCONTROLRECT, 0, (DWORD)lprect); } +_AFXWIN_INLINE BOOL CComboBox::GetDroppedState() const + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, CB_GETDROPPEDSTATE, 0, 0L); } +_AFXWIN_INLINE LCID CComboBox::GetLocale() const + { ASSERT(::IsWindow(m_hWnd)); return (LCID)::SendMessage(m_hWnd, CB_GETLOCALE, 0, 0); } +_AFXWIN_INLINE LCID CComboBox::SetLocale(LCID nNewLocale) + { ASSERT(::IsWindow(m_hWnd)); return (LCID)::SendMessage(m_hWnd, CB_SETLOCALE, (WPARAM)nNewLocale, 0); } + +_AFXWIN_INLINE CEdit::CEdit() + { } +_AFXWIN_INLINE BOOL CEdit::CanUndo() const + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_CANUNDO, 0, 0); } +_AFXWIN_INLINE int CEdit::GetLineCount() const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, EM_GETLINECOUNT, 0, 0); } +_AFXWIN_INLINE BOOL CEdit::GetModify() const + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_GETMODIFY, 0, 0); } +_AFXWIN_INLINE void CEdit::SetModify(BOOL bModified) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETMODIFY, bModified, 0); } +_AFXWIN_INLINE void CEdit::GetRect(LPRECT lpRect) const + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_GETRECT, 0, (LPARAM)lpRect); } +_AFXWIN_INLINE void CEdit::GetSel(int& nStartChar, int& nEndChar) const + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_GETSEL, (WPARAM)&nStartChar,(LPARAM)&nEndChar); } +_AFXWIN_INLINE DWORD CEdit::GetSel() const + { ASSERT(::IsWindow(m_hWnd)); return ::SendMessage(m_hWnd, EM_GETSEL, 0, 0); } +_AFXWIN_INLINE HLOCAL CEdit::GetHandle() const + { ASSERT(::IsWindow(m_hWnd)); return (HLOCAL)::SendMessage(m_hWnd, EM_GETHANDLE, 0, 0); } +_AFXWIN_INLINE void CEdit::SetHandle(HLOCAL hBuffer) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETHANDLE, (WPARAM)hBuffer, 0); } +_AFXWIN_INLINE int CEdit::GetLine(int nIndex, LPTSTR lpszBuffer) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer); } +_AFXWIN_INLINE int CEdit::GetLine(int nIndex, LPTSTR lpszBuffer, int nMaxLength) const + { + ASSERT(::IsWindow(m_hWnd)); + *(LPWORD)lpszBuffer = (WORD)nMaxLength; + return (int)::SendMessage(m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer); + } +_AFXWIN_INLINE void CEdit::EmptyUndoBuffer() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_EMPTYUNDOBUFFER, 0, 0); } +_AFXWIN_INLINE BOOL CEdit::FmtLines(BOOL bAddEOL) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_FMTLINES, bAddEOL, 0); } +_AFXWIN_INLINE void CEdit::LimitText(int nChars) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_LIMITTEXT, nChars, 0); } +_AFXWIN_INLINE int CEdit::LineFromChar(int nIndex) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, EM_LINEFROMCHAR, nIndex, 0); } +_AFXWIN_INLINE int CEdit::LineIndex(int nLine) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, EM_LINEINDEX, nLine, 0); } +_AFXWIN_INLINE int CEdit::LineLength(int nLine) const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, EM_LINELENGTH, nLine, 0); } +_AFXWIN_INLINE void CEdit::LineScroll(int nLines, int nChars) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_LINESCROLL, nChars, nLines); } +_AFXWIN_INLINE void CEdit::ReplaceSel(LPCTSTR lpszNewText) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_REPLACESEL, 0, (LPARAM)lpszNewText); } +_AFXWIN_INLINE void CEdit::SetPasswordChar(TCHAR ch) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETPASSWORDCHAR, ch, 0); } +_AFXWIN_INLINE void CEdit::SetRect(LPCRECT lpRect) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETRECT, 0, (LPARAM)lpRect); } +_AFXWIN_INLINE void CEdit::SetRectNP(LPCRECT lpRect) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETRECTNP, 0, (LPARAM)lpRect); } +_AFXWIN_INLINE void CEdit::SetSel(DWORD dwSelection, BOOL bNoScroll) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETSEL, + LOWORD(dwSelection), HIWORD(dwSelection)); + if (!bNoScroll) + ::SendMessage(m_hWnd, EM_SCROLLCARET, 0, 0); } +_AFXWIN_INLINE void CEdit::SetSel(int nStartChar, int nEndChar, BOOL bNoScroll) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, EM_SETSEL, nStartChar, nEndChar); + if (!bNoScroll) + ::SendMessage(m_hWnd, EM_SCROLLCARET, 0, 0); } +#ifndef _MAC +_AFXWIN_INLINE BOOL CEdit::SetTabStops(int nTabStops, LPINT rgTabStops) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, nTabStops, + (LPARAM)rgTabStops); } +_AFXWIN_INLINE void CEdit::SetTabStops() + { ASSERT(::IsWindow(m_hWnd)); VERIFY(::SendMessage(m_hWnd, EM_SETTABSTOPS, 0, 0)); } +_AFXWIN_INLINE BOOL CEdit::SetTabStops(const int& cxEachStop) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_SETTABSTOPS, + 1, (LPARAM)(LPINT)&cxEachStop); } +#endif +_AFXWIN_INLINE BOOL CEdit::Undo() + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_UNDO, 0, 0); } +_AFXWIN_INLINE void CEdit::Clear() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_CLEAR, 0, 0); } +_AFXWIN_INLINE void CEdit::Copy() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_COPY, 0, 0); } +_AFXWIN_INLINE void CEdit::Cut() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_CUT, 0, 0); } +_AFXWIN_INLINE void CEdit::Paste() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_PASTE, 0, 0); } +_AFXWIN_INLINE BOOL CEdit::SetReadOnly(BOOL bReadOnly ) + { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, EM_SETREADONLY, bReadOnly, 0L); } +_AFXWIN_INLINE int CEdit::GetFirstVisibleLine() const + { ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, EM_GETFIRSTVISIBLELINE, 0, 0L); } +_AFXWIN_INLINE TCHAR CEdit::GetPasswordChar() const + { ASSERT(::IsWindow(m_hWnd)); return (TCHAR)::SendMessage(m_hWnd, EM_GETPASSWORDCHAR, 0, 0L); } + +_AFXWIN_INLINE CScrollBar::CScrollBar() + { } +_AFXWIN_INLINE int CScrollBar::GetScrollPos() const + { ASSERT(::IsWindow(m_hWnd)); return ::GetScrollPos(m_hWnd, SB_CTL); } +_AFXWIN_INLINE int CScrollBar::SetScrollPos(int nPos, BOOL bRedraw) + { ASSERT(::IsWindow(m_hWnd)); return ::SetScrollPos(m_hWnd, SB_CTL, nPos, bRedraw); } +_AFXWIN_INLINE void CScrollBar::GetScrollRange(LPINT lpMinPos, LPINT lpMaxPos) const + { ASSERT(::IsWindow(m_hWnd)); ::GetScrollRange(m_hWnd, SB_CTL, lpMinPos, lpMaxPos); } +_AFXWIN_INLINE void CScrollBar::SetScrollRange(int nMinPos, int nMaxPos, BOOL bRedraw) + { ASSERT(::IsWindow(m_hWnd)); ::SetScrollRange(m_hWnd, SB_CTL, nMinPos, nMaxPos, bRedraw); } +_AFXWIN_INLINE void CScrollBar::ShowScrollBar(BOOL bShow) + { ASSERT(::IsWindow(m_hWnd)); ::ShowScrollBar(m_hWnd, SB_CTL, bShow); } +_AFXWIN_INLINE BOOL CScrollBar::EnableScrollBar(UINT nArrowFlags) + { ASSERT(::IsWindow(m_hWnd)); return ::EnableScrollBar(m_hWnd, SB_CTL, nArrowFlags); } + +// MDI functions +#ifndef _AFXCTL +_AFXWIN_INLINE void CMDIFrameWnd::MDIActivate(CWnd* pWndActivate) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDIACTIVATE, + (WPARAM)pWndActivate->m_hWnd, 0); } +_AFXWIN_INLINE void CMDIFrameWnd::MDIIconArrange() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDIICONARRANGE, 0, 0); } +_AFXWIN_INLINE void CMDIFrameWnd::MDIMaximize(CWnd* pWnd) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDIMAXIMIZE, (WPARAM)pWnd->m_hWnd, 0); } +_AFXWIN_INLINE void CMDIFrameWnd::MDINext() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDINEXT, 0, 0); } +_AFXWIN_INLINE void CMDIFrameWnd::MDIRestore(CWnd* pWnd) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDIRESTORE, (WPARAM)pWnd->m_hWnd, 0); } +_AFXWIN_INLINE CMenu* CMDIFrameWnd::MDISetMenu(CMenu* pFrameMenu, CMenu* pWindowMenu) + { ASSERT(::IsWindow(m_hWnd)); return CMenu::FromHandle((HMENU)::SendMessage( + m_hWndMDIClient, WM_MDISETMENU, (WPARAM)pFrameMenu->GetSafeHmenu(), + (LPARAM)pWindowMenu->GetSafeHmenu())); } +_AFXWIN_INLINE void CMDIFrameWnd::MDITile() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDITILE, 0, 0); } +_AFXWIN_INLINE void CMDIFrameWnd::MDICascade() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDICASCADE, 0, 0); } + +_AFXWIN_INLINE void CMDIFrameWnd::MDICascade(int nType) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDICASCADE, nType, 0); } +_AFXWIN_INLINE void CMDIFrameWnd::MDITile(int nType) + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWndMDIClient, WM_MDITILE, nType, 0); } +_AFXWIN_INLINE void CMDIChildWnd::MDIDestroy() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(GetParent()->m_hWnd, WM_MDIDESTROY, (WPARAM)m_hWnd, 0L); } +_AFXWIN_INLINE void CMDIChildWnd::MDIActivate() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(GetParent()->m_hWnd, WM_MDIACTIVATE, (WPARAM)m_hWnd, 0L); } +_AFXWIN_INLINE void CMDIChildWnd::MDIMaximize() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(GetParent()->m_hWnd, WM_MDIMAXIMIZE, (WPARAM)m_hWnd, 0L); } +_AFXWIN_INLINE void CMDIChildWnd::MDIRestore() + { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(GetParent()->m_hWnd, WM_MDIRESTORE, (WPARAM)m_hWnd, 0L); } +#endif //!_AFXCTL + +// CView +_AFXWIN_INLINE CDocument* CView::GetDocument() const + { ASSERT(this != NULL); return m_pDocument; } +_AFXWIN_INLINE CSize CScrollView::GetTotalSize() const + { ASSERT(this != NULL); return m_totalLog; } + +// CDocument +_AFXWIN_INLINE const CString& CDocument::GetTitle() const + { ASSERT(this != NULL); return m_strTitle; } +_AFXWIN_INLINE const CString& CDocument::GetPathName() const + { ASSERT(this != NULL); return m_strPathName; } +_AFXWIN_INLINE CDocTemplate* CDocument::GetDocTemplate() const + { ASSERT(this != NULL); return m_pDocTemplate; } +_AFXWIN_INLINE BOOL CDocument::IsModified() + { ASSERT(this != NULL); return m_bModified; } +_AFXWIN_INLINE void CDocument::SetModifiedFlag(BOOL bModified) + { ASSERT(this != NULL); m_bModified = bModified; } + +// CWinThread +_AFXWIN_INLINE BOOL CWinThread::SetThreadPriority(int nPriority) + { ASSERT(m_hThread != NULL); return ::SetThreadPriority(m_hThread, nPriority); } +_AFXWIN_INLINE int CWinThread::GetThreadPriority() + { ASSERT(m_hThread != NULL); return ::GetThreadPriority(m_hThread); } +_AFXWIN_INLINE DWORD CWinThread::ResumeThread() + { ASSERT(m_hThread != NULL); return ::ResumeThread(m_hThread); } +_AFXWIN_INLINE DWORD CWinThread::SuspendThread() + { ASSERT(m_hThread != NULL); return ::SuspendThread(m_hThread); } + +// CWinApp +#ifdef _MAC +_AFXWIN_INLINE BOOL CWinApp::Enable3dControls() + { return FALSE; } +#endif +_AFXWIN_INLINE HCURSOR CWinApp::LoadCursor(LPCTSTR lpszResourceName) const + { return ::LoadCursor(AfxFindResourceHandle(lpszResourceName, + RT_GROUP_CURSOR), lpszResourceName); } +_AFXWIN_INLINE HCURSOR CWinApp::LoadCursor(UINT nIDResource) const + { return ::LoadCursor(AfxFindResourceHandle(MAKEINTRESOURCE(nIDResource), + RT_GROUP_CURSOR), MAKEINTRESOURCE(nIDResource)); } +_AFXWIN_INLINE HCURSOR CWinApp::LoadStandardCursor(LPCTSTR lpszCursorName) const + { return ::LoadCursor(NULL, lpszCursorName); } +_AFXWIN_INLINE HCURSOR CWinApp::LoadOEMCursor(UINT nIDCursor) const + { return ::LoadCursor(NULL, MAKEINTRESOURCE(nIDCursor)); } +_AFXWIN_INLINE HICON CWinApp::LoadIcon(LPCTSTR lpszResourceName) const + { return ::LoadIcon(AfxFindResourceHandle(lpszResourceName, + RT_GROUP_ICON), lpszResourceName); } +_AFXWIN_INLINE HICON CWinApp::LoadIcon(UINT nIDResource) const + { return ::LoadIcon(AfxFindResourceHandle(MAKEINTRESOURCE(nIDResource), + RT_GROUP_ICON), MAKEINTRESOURCE(nIDResource)); } +_AFXWIN_INLINE HICON CWinApp::LoadStandardIcon(LPCTSTR lpszIconName) const + { return ::LoadIcon(NULL, lpszIconName); } +_AFXWIN_INLINE HICON CWinApp::LoadOEMIcon(UINT nIDIcon) const + { return ::LoadIcon(NULL, MAKEINTRESOURCE(nIDIcon)); } +#ifdef _MAC +_AFXWIN_INLINE void CWinApp::EnableShellOpen() + { } +_AFXWIN_INLINE void CWinApp::RegisterShellFileTypes() + { } +#endif + +///////////////////////////////////////////////////////////////////////////// +// Obsolete and non-portable + +#ifndef _MAC +_AFXWIN_INLINE void CWnd::CloseWindow() + { ASSERT(::IsWindow(m_hWnd)); ::CloseWindow(m_hWnd); } +_AFXWIN_INLINE BOOL CWnd::OpenIcon() + { ASSERT(::IsWindow(m_hWnd)); return ::OpenIcon(m_hWnd); } +#endif + +///////////////////////////////////////////////////////////////////////////// + +#endif //_AFXWIN_INLINE diff --git a/public/sdk/inc/mfc30/commctrl.h b/public/sdk/inc/mfc30/commctrl.h new file mode 100644 index 000000000..e1149ebba --- /dev/null +++ b/public/sdk/inc/mfc30/commctrl.h @@ -0,0 +1,2634 @@ +/*****************************************************************************\ +* * +* commctrl.h - - Interface for the Windows Common Controls * +* * +* Version 1.0 * +* * +* Copyright (c) 1991-1994, Microsoft Corp. All rights reserved. * +* * +\*****************************************************************************/ + +#ifndef _INC_COMMCTRL +#define _INC_COMMCTRL + +#ifndef NOUSER + + +// +// Define API decoration for direct importing of DLL references. +// +#ifndef WINCOMMCTRLAPI +#if !defined(_COMCTL32_) && defined(_WIN32) +#define WINCOMMCTRLAPI DECLSPEC_IMPORT +#else +#define WINCOMMCTRLAPI +#endif +#endif // WINCOMMCTRLAPI + +// +// For compilers that don't support nameless unions +// +#ifndef DUMMYUNIONNAME +#ifdef NONAMELESSUNION +#define DUMMYUNIONNAME u +#define DUMMYUNIONNAME2 u2 +#define DUMMYUNIONNAME3 u3 +#else +#define DUMMYUNIONNAME +#define DUMMYUNIONNAME2 +#define DUMMYUNIONNAME3 +#endif +#endif // DUMMYUNIONNAME + +#ifdef _WIN32 +#include <pshpack1.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if (WINVER >= 0x0400) + +// +// Users of this header may define any number of these constants to avoid +// the definitions of each functional group. +// +// NOTOOLBAR Customizable bitmap-button toolbar control. +// NOUPDOWN Up and Down arrow increment/decrement control. +// NOSTATUSBAR Status bar control. +// NOMENUHELP APIs to help manage menus, especially with a status bar. +// NOTRACKBAR Customizable column-width tracking control. +// NODRAGLIST APIs to make a listbox source and sink drag&drop actions. +// NOPROGRESS Progress gas gauge. +// NOHOTKEY HotKey control +// NOHEADER Header bar control. +// NOIMAGEAPIS ImageList apis. +// NOLISTVIEW ListView control. +// NOTREEVIEW TreeView control. +// NOTABCONTROL Tab control. +// NOANIMATE Animate control. +// +//============================================================================= + +#include <prsht.h> + + +WINCOMMCTRLAPI void WINAPI InitCommonControls(); + +#define ODT_HEADER 100 +#define ODT_TAB 101 +#define ODT_LISTVIEW 102 + + +//====== Ranges for control message IDs ======================================= + +#define LVM_FIRST 0x1000 // ListView messages +#define TV_FIRST 0x1100 // TreeView messages +#define HDM_FIRST 0x1200 // Header messages + +//====== WM_NOTIFY Macros ===================================================== + +#define HANDLE_WM_NOTIFY(hwnd, wParam, lParam, fn) \ + (fn)((hwnd), (int)(wParam), (NMHDR FAR*)(lParam)) +#define FORWARD_WM_NOTIFY(hwnd, idFrom, pnmhdr, fn) \ + (void)(fn)((hwnd), WM_NOTIFY, (WPARAM)(int)(id), (LPARAM)(NMHDR FAR*)(pnmhdr)) + + +//====== Generic WM_NOTIFY notification codes ================================= + +#define NM_OUTOFMEMORY (NM_FIRST-1) +#define NM_CLICK (NM_FIRST-2) +#define NM_DBLCLK (NM_FIRST-3) +#define NM_RETURN (NM_FIRST-4) +#define NM_RCLICK (NM_FIRST-5) +#define NM_RDBLCLK (NM_FIRST-6) +#define NM_SETFOCUS (NM_FIRST-7) +#define NM_KILLFOCUS (NM_FIRST-8) +#define NM_STARTWAIT (NM_FIRST-9) +#define NM_ENDWAIT (NM_FIRST-10) +#define NM_BTNCLK (NM_FIRST-10) + + +//====== WM_NOTIFY codes (NMHDR.code values) ================================== + +#define NM_FIRST (0U- 0U) // generic to all controls +#define NM_LAST (0U- 99U) + +#define LVN_FIRST (0U-100U) // listview +#define LVN_LAST (0U-199U) + +#define HDN_FIRST (0U-300U) // header +#define HDN_LAST (0U-399U) + +#define TVN_FIRST (0U-400U) // treeview +#define TVN_LAST (0U-499U) + +#define TTN_FIRST (0U-520U) // tooltips +#define TTN_LAST (0U-549U) + +#define TCN_FIRST (0U-550U) // tab control +#define TCN_LAST (0U-580U) + +// Shell reserved (0U-580U) - (0U-589U) + +#define CDN_FIRST (0U-601U) // common dialog (new) +#define CDN_LAST (0U-699U) + +#define TBN_FIRST (0U-700U) // toolbar +#define TBN_LAST (0U-720U) + +#define UDN_FIRST (0U-721) // updown +#define UDN_LAST (0U-740) + +#define MSGF_COMMCTRL_BEGINDRAG 0x4200 +#define MSGF_COMMCTRL_SIZEHEADER 0x4201 +#define MSGF_COMMCTRL_DRAGSELECT 0x4202 +#define MSGF_COMMCTRL_TOOLBARCUST 0x4203 + + +//====== IMAGE APIS =========================================================== + +#ifndef NOIMAGEAPIS + +#define CLR_NONE 0xFFFFFFFFL +#define CLR_DEFAULT 0xFF000000L + +struct _IMAGELIST; +typedef struct _IMAGELIST NEAR* HIMAGELIST; + +#define ILC_MASK 0x0001 +#define ILC_COLOR 0x00FE +#define ILC_COLORDDB 0x00FE +#define ILC_COLOR4 0x0004 +#define ILC_COLOR8 0x0008 +#define ILC_COLOR16 0x0010 +#define ILC_COLOR24 0x0018 +#define ILC_COLOR32 0x0020 +#define ILC_PALETTE 0x0800 + +WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Create(int cx, int cy, UINT flags, int cInitial, int cGrow); +WINCOMMCTRLAPI BOOL WINAPI ImageList_Destroy(HIMAGELIST himl); +WINCOMMCTRLAPI int WINAPI ImageList_GetImageCount(HIMAGELIST himl); +WINCOMMCTRLAPI int WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask); +WINCOMMCTRLAPI int WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, int i, HICON hicon); +WINCOMMCTRLAPI COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST himl, COLORREF clrBk); +WINCOMMCTRLAPI COLORREF WINAPI ImageList_GetBkColor(HIMAGELIST himl); +WINCOMMCTRLAPI BOOL WINAPI ImageList_SetOverlayImage(HIMAGELIST himl, int iImage, int iOverlay); + +#define ImageList_AddIcon(himl, hicon) ImageList_ReplaceIcon(himl, -1, hicon) + +#define ILD_NORMAL 0x0000 +#define ILD_TRANSPARENT 0x0001 +#define ILD_MASK 0x0010 +#define ILD_IMAGE 0x0020 +#define ILD_BLEND 0x000E +#define ILD_BLEND25 0x0002 +#define ILD_BLEND50 0x0004 +#define ILD_OVERLAYMASK 0x0F00 +#define INDEXTOOVERLAYMASK(i) ((i) << 8) + +#define ILD_SELECTED ILD_BLEND50 +#define ILD_FOCUS ILD_BLEND25 +#define CLR_HILIGHT CLR_DEFAULT + +WINCOMMCTRLAPI BOOL WINAPI ImageList_Draw(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, UINT fStyle); + + +#ifdef _WIN32 + +WINCOMMCTRLAPI BOOL WINAPI ImageList_Replace(HIMAGELIST himl, int i, HBITMAP hbmImage, HBITMAP hbmMask); +WINCOMMCTRLAPI int WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hbmImage, COLORREF crMask); +WINCOMMCTRLAPI BOOL WINAPI ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle); +WINCOMMCTRLAPI BOOL WINAPI ImageList_Remove(HIMAGELIST himl, int i); +WINCOMMCTRLAPI HICON WINAPI ImageList_GetIcon(HIMAGELIST himl, int i, UINT flags); +WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_LoadImage(HINSTANCE hi, LPCTSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags); + +WINCOMMCTRLAPI BOOL WINAPI ImageList_BeginDrag(HIMAGELIST himlTrack, int iTrack, int dxHotspot, int dyHotspot); +WINCOMMCTRLAPI void WINAPI ImageList_EndDrag(); +WINCOMMCTRLAPI BOOL WINAPI ImageList_DragEnter(HWND hwndLock, int x, int y); +WINCOMMCTRLAPI BOOL WINAPI ImageList_DragLeave(HWND hwndLock); +WINCOMMCTRLAPI BOOL WINAPI ImageList_DragMove(int x, int y); +WINCOMMCTRLAPI BOOL WINAPI ImageList_SetDragCursorImage(HIMAGELIST himlDrag, int iDrag, int dxHotspot, int dyHotspot); + +WINCOMMCTRLAPI BOOL WINAPI ImageList_DragShowNolock(BOOL fShow); +WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_GetDragImage(POINT FAR* ppt,POINT FAR* pptHotspot); + +#define ImageList_RemoveAll(himl) ImageList_Remove(himl, -1) +#define ImageList_ExtractIcon(hi, himl, i) ImageList_GetIcon(himl, i, 0) +#define ImageList_LoadBitmap(hi, lpbmp, cx, cGrow, crMask) ImageList_LoadImage(hi, lpbmp, cx, cGrow, crMask, IMAGE_BITMAP, 0) + +#ifdef _OBJBASE_H_ +WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm); +WINCOMMCTRLAPI BOOL WINAPI ImageList_Write(HIMAGELIST himl, LPSTREAM pstm); +#endif + +typedef struct _IMAGEINFO +{ + HBITMAP hbmImage; + HBITMAP hbmMask; + int Unused1; + int Unused2; + RECT rcImage; +} IMAGEINFO; + +WINCOMMCTRLAPI BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, int FAR *cx, int FAR *cy); +WINCOMMCTRLAPI BOOL WINAPI ImageList_SetIconSize(HIMAGELIST himl, int cx, int cy); +WINCOMMCTRLAPI BOOL WINAPI ImageList_GetImageInfo(HIMAGELIST himl, int i, IMAGEINFO FAR* pImageInfo); +WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Merge(HIMAGELIST himl1, int i1, HIMAGELIST himl2, int i2, int dx, int dy); + +#endif + +#endif + + +//====== HEADER CONTROL ======================================================= + +#ifndef NOHEADER + +#ifdef _WIN32 +#define WC_HEADERA "SysHeader32" +#define WC_HEADERW L"SysHeader32" + +#ifdef UNICODE +#define WC_HEADER WC_HEADERW +#else +#define WC_HEADER WC_HEADERA +#endif + +#else +#define WC_HEADER "SysHeader" +#endif + +#define HDS_HORZ 0x00000000 +#define HDS_BUTTONS 0x00000002 +#define HDS_HIDDEN 0x00000008 + +typedef struct _HD_ITEMA +{ + UINT mask; + int cxy; + LPSTR pszText; + HBITMAP hbm; + int cchTextMax; + int fmt; + LPARAM lParam; +} HD_ITEMA; + +typedef struct _HD_ITEMW +{ + UINT mask; + int cxy; + LPWSTR pszText; + HBITMAP hbm; + int cchTextMax; + int fmt; + LPARAM lParam; +} HD_ITEMW; + +#ifdef UNICODE +#define HD_ITEM HD_ITEMW +#else +#define HD_ITEM HD_ITEMA +#endif + + +#define HDI_WIDTH 0x0001 +#define HDI_HEIGHT HDI_WIDTH +#define HDI_TEXT 0x0002 +#define HDI_FORMAT 0x0004 +#define HDI_LPARAM 0x0008 +#define HDI_BITMAP 0x0010 + +#define HDF_LEFT 0 +#define HDF_RIGHT 1 +#define HDF_CENTER 2 +#define HDF_JUSTIFYMASK 0x0003 + +#define HDF_OWNERDRAW 0x8000 +#define HDF_STRING 0x4000 +#define HDF_BITMAP 0x2000 + + +#define HDM_GETITEMCOUNT (HDM_FIRST + 0) +#define Header_GetItemCount(hwndHD) \ + (int)SendMessage((hwndHD), HDM_GETITEMCOUNT, 0, 0L) + + +#define HDM_INSERTITEMA (HDM_FIRST + 1) +#define HDM_INSERTITEMW (HDM_FIRST + 10) + +#ifdef UNICODE +#define HDM_INSERTITEM HDM_INSERTITEMW +#else +#define HDM_INSERTITEM HDM_INSERTITEMA +#endif + +#define Header_InsertItem(hwndHD, i, phdi) \ + (int)SendMessage((hwndHD), HDM_INSERTITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi)) + + +#define HDM_DELETEITEM (HDM_FIRST + 2) +#define Header_DeleteItem(hwndHD, i) \ + (BOOL)SendMessage((hwndHD), HDM_DELETEITEM, (WPARAM)(int)(i), 0L) + + +#define HDM_GETITEMA (HDM_FIRST + 3) +#define HDM_GETITEMW (HDM_FIRST + 11) + +#ifdef UNICODE +#define HDM_GETITEM HDM_GETITEMW +#else +#define HDM_GETITEM HDM_GETITEMA +#endif + +#define Header_GetItem(hwndHD, i, phdi) \ + (BOOL)SendMessage((hwndHD), HDM_GETITEM, (WPARAM)(int)(i), (LPARAM)(HD_ITEM FAR*)(phdi)) + + +#define HDM_SETITEMA (HDM_FIRST + 4) +#define HDM_SETITEMW (HDM_FIRST + 12) + +#ifdef UNICODE +#define HDM_SETITEM HDM_SETITEMW +#else +#define HDM_SETITEM HDM_SETITEMA +#endif + +#define Header_SetItem(hwndHD, i, phdi) \ + (BOOL)SendMessage((hwndHD), HDM_SETITEM, (WPARAM)(int)(i), (LPARAM)(const HD_ITEM FAR*)(phdi)) + + +typedef struct _HD_LAYOUT +{ + RECT FAR* prc; + WINDOWPOS FAR* pwpos; +} HD_LAYOUT; + + +#define HDM_LAYOUT (HDM_FIRST + 5) +#define Header_Layout(hwndHD, playout) \ + (BOOL)SendMessage((hwndHD), HDM_LAYOUT, 0, (LPARAM)(HD_LAYOUT FAR*)(playout)) + + +#define HHT_NOWHERE 0x0001 +#define HHT_ONHEADER 0x0002 +#define HHT_ONDIVIDER 0x0004 +#define HHT_ONDIVOPEN 0x0008 +#define HHT_ABOVE 0x0100 +#define HHT_BELOW 0x0200 +#define HHT_TORIGHT 0x0400 +#define HHT_TOLEFT 0x0800 + +typedef struct _HD_HITTESTINFO +{ + POINT pt; + UINT flags; + int iItem; +} HD_HITTESTINFO; +#define HDM_HITTEST (HDM_FIRST + 6) + + +#define HDN_ITEMCHANGINGA (HDN_FIRST-0) +#define HDN_ITEMCHANGINGW (HDN_FIRST-20) +#define HDN_ITEMCHANGEDA (HDN_FIRST-1) +#define HDN_ITEMCHANGEDW (HDN_FIRST-21) +#define HDN_ITEMCLICKA (HDN_FIRST-2) +#define HDN_ITEMCLICKW (HDN_FIRST-22) +#define HDN_ITEMDBLCLICKA (HDN_FIRST-3) +#define HDN_ITEMDBLCLICKW (HDN_FIRST-23) +#define HDN_DIVIDERDBLCLICKA (HDN_FIRST-5) +#define HDN_DIVIDERDBLCLICKW (HDN_FIRST-25) +#define HDN_BEGINTRACKA (HDN_FIRST-6) +#define HDN_BEGINTRACKW (HDN_FIRST-26) +#define HDN_ENDTRACKA (HDN_FIRST-7) +#define HDN_ENDTRACKW (HDN_FIRST-27) +#define HDN_TRACKA (HDN_FIRST-8) +#define HDN_TRACKW (HDN_FIRST-28) + +#ifdef UNICODE +#define HDN_ITEMCHANGING HDN_ITEMCHANGINGW +#define HDN_ITEMCHANGED HDN_ITEMCHANGEDW +#define HDN_ITEMCLICK HDN_ITEMCLICKW +#define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKW +#define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKW +#define HDN_BEGINTRACK HDN_BEGINTRACKW +#define HDN_ENDTRACK HDN_ENDTRACKW +#define HDN_TRACK HDN_TRACKW +#else +#define HDN_ITEMCHANGING HDN_ITEMCHANGINGA +#define HDN_ITEMCHANGED HDN_ITEMCHANGEDA +#define HDN_ITEMCLICK HDN_ITEMCLICKA +#define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKA +#define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKA +#define HDN_BEGINTRACK HDN_BEGINTRACKA +#define HDN_ENDTRACK HDN_ENDTRACKA +#define HDN_TRACK HDN_TRACKA +#endif + + +typedef struct _HD_NOTIFY +{ + NMHDR hdr; + int iItem; + int iButton; + HD_ITEMA FAR* pitem; +} HD_NOTIFYA; + +typedef struct _HD_NOTIFYW +{ + NMHDR hdr; + int iItem; + int iButton; + HD_ITEMW FAR* pitem; +} HD_NOTIFYW; + +#ifdef UNICODE +#define HD_NOTIFY HD_NOTIFYW +#else +#define HD_NOTIFY HD_NOTIFYA +#endif + +#endif + + +//====== TOOLBAR CONTROL ====================================================== + +#ifndef NOTOOLBAR + +#ifdef _WIN32 +#define TOOLBARCLASSNAMEW L"ToolbarWindow32" +#define TOOLBARCLASSNAMEA "ToolbarWindow32" + +#ifdef UNICODE +#define TOOLBARCLASSNAME TOOLBARCLASSNAMEW +#else +#define TOOLBARCLASSNAME TOOLBARCLASSNAMEA +#endif + +#else +#define TOOLBARCLASSNAME "ToolbarWindow" +#endif + +typedef struct _TBBUTTON { + int iBitmap; + int idCommand; + BYTE fsState; + BYTE fsStyle; +#ifdef _WIN32 + BYTE bReserved[2]; +#endif + DWORD dwData; + int iString; +} TBBUTTON, NEAR* PTBBUTTON, FAR* LPTBBUTTON; +typedef const TBBUTTON FAR* LPCTBBUTTON; + +typedef struct _COLORMAP { + COLORREF from; + COLORREF to; +} COLORMAP, FAR* LPCOLORMAP; + +WINCOMMCTRLAPI HWND WINAPI CreateToolbarEx(HWND hwnd, DWORD ws, UINT wID, int nBitmaps, + HINSTANCE hBMInst, UINT wBMID, LPCTBBUTTON lpButtons, + int iNumButtons, int dxButton, int dyButton, + int dxBitmap, int dyBitmap, UINT uStructSize); + +WINCOMMCTRLAPI HBITMAP WINAPI CreateMappedBitmap(HINSTANCE hInstance, int idBitmap, + UINT wFlags, LPCOLORMAP lpColorMap, + int iNumMaps); + +#define CMB_MASKED 0x02 + +#define TBSTATE_CHECKED 0x01 +#define TBSTATE_PRESSED 0x02 +#define TBSTATE_ENABLED 0x04 +#define TBSTATE_HIDDEN 0x08 +#define TBSTATE_INDETERMINATE 0x10 +#define TBSTATE_WRAP 0x20 + +#define TBSTYLE_BUTTON 0x00 +#define TBSTYLE_SEP 0x01 +#define TBSTYLE_CHECK 0x02 +#define TBSTYLE_GROUP 0x04 +#define TBSTYLE_CHECKGROUP (TBSTYLE_GROUP | TBSTYLE_CHECK) + +#define TBSTYLE_TOOLTIPS 0x0100 +#define TBSTYLE_WRAPABLE 0x0200 +#define TBSTYLE_ALTDRAG 0x0400 + +#define TB_ENABLEBUTTON (WM_USER + 1) +#define TB_CHECKBUTTON (WM_USER + 2) +#define TB_PRESSBUTTON (WM_USER + 3) +#define TB_HIDEBUTTON (WM_USER + 4) +#define TB_INDETERMINATE (WM_USER + 5) +#define TB_ISBUTTONENABLED (WM_USER + 9) +#define TB_ISBUTTONCHECKED (WM_USER + 10) +#define TB_ISBUTTONPRESSED (WM_USER + 11) +#define TB_ISBUTTONHIDDEN (WM_USER + 12) +#define TB_ISBUTTONINDETERMINATE (WM_USER + 13) +#define TB_SETSTATE (WM_USER + 17) +#define TB_GETSTATE (WM_USER + 18) +#define TB_ADDBITMAP (WM_USER + 19) + +#ifdef _WIN32 +typedef struct tagTBADDBITMAP { + HINSTANCE hInst; + UINT nID; +} TBADDBITMAP, *LPTBADDBITMAP; + +#define HINST_COMMCTRL ((HINSTANCE)-1) +#define IDB_STD_SMALL_COLOR 0 +#define IDB_STD_LARGE_COLOR 1 +#define IDB_VIEW_SMALL_COLOR 4 +#define IDB_VIEW_LARGE_COLOR 5 + +// icon indexes for standard bitmap + +#define STD_CUT 0 +#define STD_COPY 1 +#define STD_PASTE 2 +#define STD_UNDO 3 +#define STD_REDOW 4 +#define STD_DELETE 5 +#define STD_FILENEW 6 +#define STD_FILEOPEN 7 +#define STD_FILESAVE 8 +#define STD_PRINTPRE 9 +#define STD_PROPERTIES 10 +#define STD_HELP 11 +#define STD_FIND 12 +#define STD_REPLACE 13 +#define STD_PRINT 14 + +// icon indexes for standard view bitmap + +#define VIEW_LARGEICONS 0 +#define VIEW_SMALLICONS 1 +#define VIEW_LIST 2 +#define VIEW_DETAILS 3 +#define VIEW_SORTNAME 4 +#define VIEW_SORTSIZE 5 +#define VIEW_SORTDATE 6 +#define VIEW_SORTTYPE 7 +#define VIEW_PARENTFOLDER 8 +#define VIEW_NETCONNECT 9 +#define VIEW_NETDISCONNECT 10 +#define VIEW_NEWFOLDER 11 + + +#endif + +#define TB_ADDBUTTONS (WM_USER + 20) +#define TB_INSERTBUTTON (WM_USER + 21) +#define TB_DELETEBUTTON (WM_USER + 22) +#define TB_GETBUTTON (WM_USER + 23) +#define TB_BUTTONCOUNT (WM_USER + 24) +#define TB_COMMANDTOINDEX (WM_USER + 25) + +#ifdef _WIN32 + +typedef struct tagTBSAVEPARAMSA { + HKEY hkr; + LPCSTR pszSubKey; + LPCSTR pszValueName; +} TBSAVEPARAMSA; + +typedef struct tagTBSAVEPARAMSW { + HKEY hkr; + LPCWSTR pszSubKey; + LPCWSTR pszValueName; +} TBSAVEPARAMSW; + +#ifdef UNICODE +#define TBSAVEPARAMS TBSAVEPARAMSW +#else +#define TBSAVEPARAMS TBSAVEPARAMSA +#endif + +#endif + +#define TB_SAVERESTOREA (WM_USER + 26) +#define TB_SAVERESTOREW (WM_USER + 47) +#define TB_CUSTOMIZE (WM_USER + 27) +#define TB_ADDSTRINGA (WM_USER + 28) +#define TB_ADDSTRINGW (WM_USER + 48) +#define TB_GETITEMRECT (WM_USER + 29) +#define TB_BUTTONSTRUCTSIZE (WM_USER + 30) +#define TB_SETBUTTONSIZE (WM_USER + 31) +#define TB_SETBITMAPSIZE (WM_USER + 32) +#define TB_AUTOSIZE (WM_USER + 33) +#define TB_SETBUTTONTYPE (WM_USER + 34) +#define TB_GETTOOLTIPS (WM_USER + 35) +#define TB_SETTOOLTIPS (WM_USER + 36) +#define TB_SETPARENT (WM_USER + 37) +#define TB_SETROWS (WM_USER + 39) +#define TB_GETROWS (WM_USER + 40) +#define TB_SETCMDID (WM_USER + 42) +#define TB_CHANGEBITMAP (WM_USER + 43) +#define TB_GETBITMAP (WM_USER + 44) +#define TB_GETBUTTONTEXTA (WM_USER + 45) +#define TB_GETBUTTONTEXTW (WM_USER + 46) + +#ifdef UNICODE +#define TB_GETBUTTONTEXT TB_GETBUTTONTEXTW +#define TB_SAVERESTORE TB_SAVERESTOREW +#define TB_ADDSTRING TB_ADDSTRINGW +#else +#define TB_GETBUTTONTEXT TB_GETBUTTONTEXTA +#define TB_SAVERESTORE TB_SAVERESTOREA +#define TB_ADDSTRING TB_ADDSTRINGA +#endif + +#ifdef _WIN32 + +#define TBBF_LARGE 0x0001 + +#define TB_GETBITMAPFLAGS (WM_USER + 41) + +#define TBN_GETBUTTONINFOA (TBN_FIRST-0) +#define TBN_GETBUTTONINFOW (TBN_FIRST-20) +#define TBN_BEGINDRAG (TBN_FIRST-1) +#define TBN_ENDDRAG (TBN_FIRST-2) +#define TBN_BEGINADJUST (TBN_FIRST-3) +#define TBN_ENDADJUST (TBN_FIRST-4) +#define TBN_RESET (TBN_FIRST-5) +#define TBN_QUERYINSERT (TBN_FIRST-6) +#define TBN_QUERYDELETE (TBN_FIRST-7) +#define TBN_TOOLBARCHANGE (TBN_FIRST-8) +#define TBN_CUSTHELP (TBN_FIRST-9) + +#ifdef UNICODE +#define TBN_GETBUTTONINFO TBN_GETBUTTONINFOW +#else +#define TBN_GETBUTTONINFO TBN_GETBUTTONINFOA +#endif + +typedef struct tagTBNOTIFYA { + NMHDR hdr; + int iItem; + TBBUTTON tbButton; + int cchText; + LPSTR pszText; +} TBNOTIFYA, FAR *LPTBNOTIFYA; + +typedef struct tagTBNOTIFYW { + NMHDR hdr; + int iItem; + TBBUTTON tbButton; + int cchText; + LPWSTR pszText; +} TBNOTIFYW, FAR *LPTBNOTIFYW; + +#ifdef UNICODE +#define TBNOTIFY TBNOTIFYW +#define LPTBNOTIFY LPTBNOTIFYW +#else +#define TBNOTIFY TBNOTIFYA +#define LPTBNOTIFY LPTBNOTIFYA +#endif + +#endif + +#endif + + +//====== TOOLTIPS CONTROL ===================================================== + +#ifndef NOTOOLTIPS + +#ifdef _WIN32 + +#define TOOLTIPS_CLASSW L"tooltips_class32" +#define TOOLTIPS_CLASSA "tooltips_class32" + +#ifdef UNICODE +#define TOOLTIPS_CLASS TOOLTIPS_CLASSW +#else +#define TOOLTIPS_CLASS TOOLTIPS_CLASSA +#endif + +#else +#define TOOLTIPS_CLASS "tooltips_class" +#endif + +typedef struct tagTOOLINFOA { + UINT cbSize; + UINT uFlags; + HWND hwnd; + UINT uId; + RECT rect; + HINSTANCE hinst; + LPSTR lpszText; +} TOOLINFOA, NEAR *PTOOLINFOA, FAR *LPTOOLINFOA; + +typedef struct tagTOOLINFOW { + UINT cbSize; + UINT uFlags; + HWND hwnd; + UINT uId; + RECT rect; + HINSTANCE hinst; + LPWSTR lpszText; +} TOOLINFOW, NEAR *PTOOLINFOW, FAR *LPTOOLINFOW; + +#ifdef UNICODE +#define TOOLINFO TOOLINFOW +#define PTOOLINFO PTOOLINFOW +#define LPTOOLINFO LPTOOLINFOW +#else +#define TOOLINFO TOOLINFOA +#define PTOOLINFO PTOOLINFOA +#define LPTOOLINFO LPTOOLINFOA +#endif + + +#define TTS_ALWAYSTIP 0x01 +#define TTS_NOPREFIX 0x02 + +#define TTF_IDISHWND 0x01 +#define TTF_CENTERTIP 0x02 + +#define TTDT_AUTOMATIC 0 +#define TTDT_RESHOW 1 +#define TTDT_AUTOPOP 2 +#define TTDT_INITIAL 3 + +#define TTM_ACTIVATE (WM_USER + 1) +#define TTM_SETDELAYTIME (WM_USER + 3) +#define TTM_ADDTOOLA (WM_USER + 4) +#define TTM_ADDTOOLW (WM_USER + 50) +#define TTM_DELTOOLA (WM_USER + 5) +#define TTM_DELTOOLW (WM_USER + 51) +#define TTM_NEWTOOLRECTA (WM_USER + 6) +#define TTM_NEWTOOLRECTW (WM_USER + 52) +#define TTM_RELAYEVENT (WM_USER + 7) + +#define TTM_GETTOOLINFOA (WM_USER + 8) +#define TTM_GETTOOLINFOW (WM_USER + 53) + +#define TTM_SETTOOLINFOA (WM_USER + 9) +#define TTM_SETTOOLINFOW (WM_USER + 54) + +#define TTM_HITTESTA (WM_USER +10) +#define TTM_HITTESTW (WM_USER +55) +#define TTM_GETTEXTA (WM_USER +11) +#define TTM_GETTEXTW (WM_USER +56) +#define TTM_UPDATETIPTEXTA (WM_USER +12) +#define TTM_UPDATETIPTEXTW (WM_USER +57) +#define TTM_GETTOOLCOUNT (WM_USER +13) +#define TTM_ENUMTOOLSA (WM_USER +14) +#define TTM_ENUMTOOLSW (WM_USER +58) +#define TTM_GETCURRENTTOOLA (WM_USER + 15) +#define TTM_GETCURRENTTOOLW (WM_USER + 59) + +#ifdef UNICODE +#define TTM_ADDTOOL TTM_ADDTOOLW +#define TTM_DELTOOL TTM_DELTOOLW +#define TTM_NEWTOOLRECT TTM_NEWTOOLRECTW +#define TTM_GETTOOLINFO TTM_GETTOOLINFOW +#define TTM_SETTOOLINFO TTM_SETTOOLINFOW +#define TTM_HITTEST TTM_HITTESTW +#define TTM_GETTEXT TTM_GETTEXTW +#define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTW +#define TTM_ENUMTOOLS TTM_ENUMTOOLSW +#define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLW +#else +#define TTM_ADDTOOL TTM_ADDTOOLA +#define TTM_DELTOOL TTM_DELTOOLA +#define TTM_NEWTOOLRECT TTM_NEWTOOLRECTA +#define TTM_GETTOOLINFO TTM_GETTOOLINFOA +#define TTM_SETTOOLINFO TTM_SETTOOLINFOA +#define TTM_HITTEST TTM_HITTESTA +#define TTM_GETTEXT TTM_GETTEXTA +#define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTA +#define TTM_ENUMTOOLS TTM_ENUMTOOLSA +#define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLA +#endif + + +typedef struct _TT_HITTESTINFOA { + HWND hwnd; + POINT pt; + TOOLINFOA ti; +} TTHITTESTINFOA, FAR * LPHITTESTINFOA; + +typedef struct _TT_HITTESTINFOW { + HWND hwnd; + POINT pt; + TOOLINFOW ti; +} TTHITTESTINFOW, FAR * LPHITTESTINFOW; + + +#ifdef UNICODE +#define TTHITTESTINFO TTHITTESTINFOW +#define LPHITTESTINFO LPHITTESTINFOW +#else +#define TTHITTESTINFO TTHITTESTINFOA +#define LPHITTESTINFO LPHITTESTINFOA +#endif + + +#define TTN_NEEDTEXTA (TTN_FIRST - 0) +#define TTN_NEEDTEXTW (TTN_FIRST - 10) +#define TTN_SHOW (TTN_FIRST - 1) +#define TTN_POP (TTN_FIRST - 2) + + +#ifdef UNICODE +#define TTN_NEEDTEXT TTN_NEEDTEXTW +#else +#define TTN_NEEDTEXT TTN_NEEDTEXTA +#endif + +typedef struct tagTOOLTIPTEXTA { + NMHDR hdr; + LPSTR lpszText; + char szText[80]; + HINSTANCE hinst; + UINT uFlags; +} TOOLTIPTEXTA, FAR *LPTOOLTIPTEXTA; + +typedef struct tagTOOLTIPTEXTW { + NMHDR hdr; + LPWSTR lpszText; + WCHAR szText[80]; + HINSTANCE hinst; + UINT uFlags; +} TOOLTIPTEXTW, FAR *LPTOOLTIPTEXTW; + + +#ifdef UNICODE +#define TOOLTIPTEXT TOOLTIPTEXTW +#define LPTOOLTIPTEXT LPTOOLTIPTEXTW +#else +#define TOOLTIPTEXT TOOLTIPTEXTA +#define LPTOOLTIPTEXT LPTOOLTIPTEXTA +#endif + +#endif + + +//====== STATUS BAR CONTROL =================================================== + +#ifndef NOSTATUSBAR + +#define SBARS_SIZEGRIP 0x0100 + + +WINCOMMCTRLAPI void WINAPI DrawStatusTextA(HDC hDC, LPRECT lprc, LPCSTR szText, UINT uFlags); +WINCOMMCTRLAPI void WINAPI DrawStatusTextW(HDC hDC, LPRECT lprc, LPCWSTR szText, UINT uFlags); + +WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowA(LONG style, LPCSTR lpszText, HWND hwndParent, UINT wID); +WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowW(LONG style, LPCWSTR lpszText, HWND hwndParent, UINT wID); + +#ifdef UNICODE +#define CreateStatusWindow CreateStatusWindowW +#define DrawStatusText DrawStatusTextW +#else +#define CreateStatusWindow CreateStatusWindowA +#define DrawStatusText DrawStatusTextA +#endif + +#ifdef _WIN32 +#define STATUSCLASSNAMEW L"msctls_statusbar32" +#define STATUSCLASSNAMEA "msctls_statusbar32" + +#ifdef UNICODE +#define STATUSCLASSNAME STATUSCLASSNAMEW +#else +#define STATUSCLASSNAME STATUSCLASSNAMEA +#endif + +#else +#define STATUSCLASSNAME "msctls_statusbar" +#endif + +#define SB_SETTEXTA (WM_USER+1) +#define SB_SETTEXTW (WM_USER+11) +#define SB_GETTEXTA (WM_USER+2) +#define SB_GETTEXTW (WM_USER+13) +#define SB_GETTEXTLENGTHA (WM_USER+3) +#define SB_GETTEXTLENGTHW (WM_USER+12) + +#ifdef UNICODE +#define SB_GETTEXT SB_GETTEXTW +#define SB_SETTEXT SB_SETTEXTW +#define SB_GETTEXTLENGTH SB_GETTEXTLENGTHW +#else +#define SB_GETTEXT SB_GETTEXTA +#define SB_SETTEXT SB_SETTEXTA +#define SB_GETTEXTLENGTH SB_GETTEXTLENGTHA +#endif + + +#define SB_SETPARTS (WM_USER+4) +#define SB_SETBORDERS (WM_USER+5) +#define SB_GETPARTS (WM_USER+6) +#define SB_GETBORDERS (WM_USER+7) +#define SB_SETMINHEIGHT (WM_USER+8) +#define SB_SIMPLE (WM_USER+9) +#define SB_GETRECT (WM_USER + 10) + + +#define SBT_OWNERDRAW 0x1000 +#define SBT_NOBORDERS 0x0100 +#define SBT_POPOUT 0x0200 +#define HBT_SPRING 0x0400 + +#endif + +//====== MENU HELP ============================================================ + +#ifndef NOMENUHELP + +WINCOMMCTRLAPI void WINAPI MenuHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu, HINSTANCE hInst, HWND hwndStatus, UINT FAR *lpwIDs); +WINCOMMCTRLAPI BOOL WINAPI ShowHideMenuCtl(HWND hWnd, UINT uFlags, LPINT lpInfo); +WINCOMMCTRLAPI void WINAPI GetEffectiveClientRect(HWND hWnd, LPRECT lprc, LPINT lpInfo); + +#define MINSYSCOMMAND SC_SIZE + +#endif + + +//====== TRACKBAR CONTROL ===================================================== + +#ifndef NOTRACKBAR + +#ifdef _WIN32 + +#define TRACKBAR_CLASSA "msctls_trackbar32" +#define TRACKBAR_CLASSW L"msctls_trackbar32" + +#ifdef UNICODE +#define TRACKBAR_CLASS TRACKBAR_CLASSW +#else +#define TRACKBAR_CLASS TRACKBAR_CLASSA +#endif + +#else +#define TRACKBAR_CLASS "msctls_trackbar" +#endif + + +#define TBS_AUTOTICKS 0x0001 +#define TBS_VERT 0x0002 +#define TBS_HORZ 0x0000 +#define TBS_TOP 0x0004 +#define TBS_BOTTOM 0x0000 +#define TBS_LEFT 0x0004 +#define TBS_RIGHT 0x0000 +#define TBS_BOTH 0x0008 +#define TBS_NOTICKS 0x0010 +#define TBS_ENABLESELRANGE 0x0020 +#define TBS_FIXEDLENGTH 0x0040 +#define TBS_NOTHUMB 0x0080 + + +#define TBM_GETPOS (WM_USER) +#define TBM_GETRANGEMIN (WM_USER+1) +#define TBM_GETRANGEMAX (WM_USER+2) +#define TBM_GETTIC (WM_USER+3) +#define TBM_SETTIC (WM_USER+4) +#define TBM_SETPOS (WM_USER+5) +#define TBM_SETRANGE (WM_USER+6) +#define TBM_SETRANGEMIN (WM_USER+7) +#define TBM_SETRANGEMAX (WM_USER+8) +#define TBM_CLEARTICS (WM_USER+9) +#define TBM_SETSEL (WM_USER+10) +#define TBM_SETSELSTART (WM_USER+11) +#define TBM_SETSELEND (WM_USER+12) +#define TBM_GETPTICS (WM_USER+14) +#define TBM_GETTICPOS (WM_USER+15) +#define TBM_GETNUMTICS (WM_USER+16) +#define TBM_GETSELSTART (WM_USER+17) +#define TBM_GETSELEND (WM_USER+18) +#define TBM_CLEARSEL (WM_USER+19) +#define TBM_SETTICFREQ (WM_USER+20) +#define TBM_SETPAGESIZE (WM_USER+21) +#define TBM_GETPAGESIZE (WM_USER+22) +#define TBM_SETLINESIZE (WM_USER+23) +#define TBM_GETLINESIZE (WM_USER+24) +#define TBM_GETTHUMBRECT (WM_USER+25) +#define TBM_GETCHANNELRECT (WM_USER+26) +#define TBM_SETTHUMBLENGTH (WM_USER+27) +#define TBM_GETTHUMBLENGTH (WM_USER+28) + + +#define TB_LINEUP 0 +#define TB_LINEDOWN 1 +#define TB_PAGEUP 2 +#define TB_PAGEDOWN 3 +#define TB_THUMBPOSITION 4 +#define TB_THUMBTRACK 5 +#define TB_TOP 6 +#define TB_BOTTOM 7 +#define TB_ENDTRACK 8 + +#endif + +//====== DRAG LIST CONTROL ==================================================== + +#ifndef NODRAGLIST + +typedef struct tagDRAGLISTINFO { + UINT uNotification; + HWND hWnd; + POINT ptCursor; +} DRAGLISTINFO, FAR *LPDRAGLISTINFO; + +#define DL_BEGINDRAG (WM_USER+133) +#define DL_DRAGGING (WM_USER+134) +#define DL_DROPPED (WM_USER+135) +#define DL_CANCELDRAG (WM_USER+136) + +#define DL_CURSORSET 0 +#define DL_STOPCURSOR 1 +#define DL_COPYCURSOR 2 +#define DL_MOVECURSOR 3 + +#define DRAGLISTMSGSTRING TEXT("commctrl_DragListMsg") + +WINCOMMCTRLAPI BOOL WINAPI MakeDragList(HWND hLB); +WINCOMMCTRLAPI void WINAPI DrawInsert(HWND handParent, HWND hLB, int nItem); +WINCOMMCTRLAPI int WINAPI LBItemFromPt(HWND hLB, POINT pt, BOOL bAutoScroll); + +#endif + + +//====== UPDOWN CONTROL ======================================================= + +#ifndef NOUPDOWN + +#ifdef _WIN32 + +#define UPDOWN_CLASSA "msctls_updown32" +#define UPDOWN_CLASSW L"msctls_updown32" + +#ifdef UNICODE +#define UPDOWN_CLASS UPDOWN_CLASSW +#else +#define UPDOWN_CLASS UPDOWN_CLASSA +#endif + +#else +#define UPDOWN_CLASS "msctls_updown" +#endif + + +typedef struct _UDACCEL { + UINT nSec; + UINT nInc; +} UDACCEL, FAR *LPUDACCEL; + +#define UD_MAXVAL 0x7fff +#define UD_MINVAL (-UD_MAXVAL) + + +#define UDS_WRAP 0x0001 +#define UDS_SETBUDDYINT 0x0002 +#define UDS_ALIGNRIGHT 0x0004 +#define UDS_ALIGNLEFT 0x0008 +#define UDS_AUTOBUDDY 0x0010 +#define UDS_ARROWKEYS 0x0020 +#define UDS_HORZ 0x0040 +#define UDS_NOTHOUSANDS 0x0080 + + +#define UDM_SETRANGE (WM_USER+101) +#define UDM_GETRANGE (WM_USER+102) +#define UDM_SETPOS (WM_USER+103) +#define UDM_GETPOS (WM_USER+104) +#define UDM_SETBUDDY (WM_USER+105) +#define UDM_GETBUDDY (WM_USER+106) +#define UDM_SETACCEL (WM_USER+107) +#define UDM_GETACCEL (WM_USER+108) +#define UDM_SETBASE (WM_USER+109) +#define UDM_GETBASE (WM_USER+110) + + +WINCOMMCTRLAPI HWND WINAPI CreateUpDownControl(DWORD dwStyle, int x, int y, int cx, int cy, + HWND hParent, int nID, HINSTANCE hInst, + HWND hBuddy, + int nUpper, int nLower, int nPos); + +typedef struct _NM_UPDOWN +{ + NMHDR hdr; + int iPos; + int iDelta; +} NM_UPDOWN, FAR *LPNM_UPDOWN; + +#define UDN_DELTAPOS (UDN_FIRST - 1) + +#endif + + +//====== PROGRESS CONTROL ===================================================== + +#ifndef NOPROGRESS + +#ifdef _WIN32 + +#define PROGRESS_CLASSA "msctls_progress32" +#define PROGRESS_CLASSW L"msctls_progress32" + +#ifdef UNICODE +#define PROGRESS_CLASS PROGRESS_CLASSW +#else +#define PROGRESS_CLASS PROGRESS_CLASSA +#endif + +#else +#define PROGRESS_CLASS "msctls_progress" +#endif + + +#define PBM_SETRANGE (WM_USER+1) +#define PBM_SETPOS (WM_USER+2) +#define PBM_DELTAPOS (WM_USER+3) +#define PBM_SETSTEP (WM_USER+4) +#define PBM_STEPIT (WM_USER+5) + +#endif + + +//====== HOTKEY CONTROL ======================================================= + +#ifndef NOHOTKEY + +#define HOTKEYF_SHIFT 0x01 +#define HOTKEYF_CONTROL 0x02 +#define HOTKEYF_ALT 0x04 +#define HOTKEYF_EXT 0x08 + +#define HKCOMB_NONE 0x0001 +#define HKCOMB_S 0x0002 +#define HKCOMB_C 0x0004 +#define HKCOMB_A 0x0008 +#define HKCOMB_SC 0x0010 +#define HKCOMB_SA 0x0020 +#define HKCOMB_CA 0x0040 +#define HKCOMB_SCA 0x0080 + + +#define HKM_SETHOTKEY (WM_USER+1) +#define HKM_GETHOTKEY (WM_USER+2) +#define HKM_SETRULES (WM_USER+3) + +#ifdef _WIN32 + +#define HOTKEY_CLASSA "msctls_hotkey32" +#define HOTKEY_CLASSW L"msctls_hotkey32" + +#ifdef UNICODE +#define HOTKEY_CLASS HOTKEY_CLASSW +#else +#define HOTKEY_CLASS HOTKEY_CLASSA +#endif + +#else +#define HOTKEY_CLASS "msctls_hotkey" +#endif + +#endif + + +//====== COMMON CONTROL STYLES ================================================ + +#define CCS_TOP 0x00000001L +#define CCS_NOMOVEY 0x00000002L +#define CCS_BOTTOM 0x00000003L +#define CCS_NORESIZE 0x00000004L +#define CCS_NOPARENTALIGN 0x00000008L +#define CCS_NOHILITE 0x00000010L +#define CCS_ADJUSTABLE 0x00000020L +#define CCS_NODIVIDER 0x00000040L + + +//====== LISTVIEW CONTROL ===================================================== + +#ifndef NOLISTVIEW + +#ifdef _WIN32 + +#define WC_LISTVIEWA "SysListView32" +#define WC_LISTVIEWW L"SysListView32" + +#ifdef UNICODE +#define WC_LISTVIEW WC_LISTVIEWW +#else +#define WC_LISTVIEW WC_LISTVIEWA +#endif + +#else +#define WC_LISTVIEW "SysListView" +#endif + +#define LVS_ICON 0x0000 +#define LVS_REPORT 0x0001 +#define LVS_SMALLICON 0x0002 +#define LVS_LIST 0x0003 +#define LVS_TYPEMASK 0x0003 +#define LVS_SINGLESEL 0x0004 +#define LVS_SHOWSELALWAYS 0x0008 +#define LVS_SORTASCENDING 0x0010 +#define LVS_SORTDESCENDING 0x0020 +#define LVS_SHAREIMAGELISTS 0x0040 +#define LVS_NOLABELWRAP 0x0080 +#define LVS_AUTOARRANGE 0x0100 +#define LVS_EDITLABELS 0x0200 +#define LVS_NOSCROLL 0x2000 + +#define LVS_TYPESTYLEMASK 0xfc00 + +#define LVS_ALIGNTOP 0x0000 +#define LVS_ALIGNBOTTOM 0x0400 +#define LVS_ALIGNLEFT 0x0800 +#define LVS_ALIGNRIGHT 0x0c00 +#define LVS_ALIGNMASK 0x0c00 + +#define LVS_OWNERDRAWFIXED 0x0400 +#define LVS_NOCOLUMNHEADER 0x4000 +#define LVS_NOSORTHEADER 0x8000 + +#define LVM_GETBKCOLOR (LVM_FIRST + 0) +#define ListView_GetBkColor(hwnd) \ + (COLORREF)SendMessage((hwnd), LVM_GETBKCOLOR, 0, 0L) + +#define LVM_SETBKCOLOR (LVM_FIRST + 1) +#define ListView_SetBkColor(hwnd, clrBk) \ + (BOOL)SendMessage((hwnd), LVM_SETBKCOLOR, 0, (LPARAM)(COLORREF)(clrBk)) + +#define LVM_GETIMAGELIST (LVM_FIRST + 2) +#define ListView_GetImageList(hwnd, iImageList) \ + (HIMAGELIST)SendMessage((hwnd), LVM_GETIMAGELIST, (WPARAM)(INT)(iImageList), 0L) + +#define LVSIL_NORMAL 0 +#define LVSIL_SMALL 1 +#define LVSIL_STATE 2 + +#define LVM_SETIMAGELIST (LVM_FIRST + 3) +#define ListView_SetImageList(hwnd, himl, iImageList) \ + (HIMAGELIST)(UINT)SendMessage((hwnd), LVM_SETIMAGELIST, (WPARAM)(iImageList), (LPARAM)(UINT)(HIMAGELIST)(himl)) + +#define LVM_GETITEMCOUNT (LVM_FIRST + 4) +#define ListView_GetItemCount(hwnd) \ + (int)SendMessage((hwnd), LVM_GETITEMCOUNT, 0, 0L) + + +#define LVIF_TEXT 0x0001 +#define LVIF_IMAGE 0x0002 +#define LVIF_PARAM 0x0004 +#define LVIF_STATE 0x0008 + +#define LVIS_FOCUSED 0x0001 +#define LVIS_SELECTED 0x0002 +#define LVIS_CUT 0x0004 +#define LVIS_DROPHILITED 0x0008 +#define LVIS_LINK 0x0040 + +#define LVIS_OVERLAYMASK 0x0F00 +#define LVIS_STATEIMAGEMASK 0xF000 + +#define INDEXTOSTATEIMAGEMASK(i) ((i) << 12) + +typedef struct _LV_ITEMA +{ + UINT mask; + int iItem; + int iSubItem; + UINT state; + UINT stateMask; + LPSTR pszText; + int cchTextMax; + int iImage; + LPARAM lParam; +} LV_ITEMA; + +typedef struct _LV_ITEMW +{ + UINT mask; + int iItem; + int iSubItem; + UINT state; + UINT stateMask; + LPWSTR pszText; + int cchTextMax; + int iImage; + LPARAM lParam; +} LV_ITEMW; + +#ifdef UNICODE +#define LV_ITEM LV_ITEMW +#else +#define LV_ITEM LV_ITEMA +#endif + +#define LPSTR_TEXTCALLBACKW ((LPWSTR)-1L) +#define LPSTR_TEXTCALLBACKA ((LPSTR)-1L) +#ifdef UNICODE +#define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKW +#else +#define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKA +#endif + +#define I_IMAGECALLBACK (-1) + +#define LVM_GETITEMA (LVM_FIRST + 5) +#define LVM_GETITEMW (LVM_FIRST + 75) +#ifdef UNICODE +#define LVM_GETITEM LVM_GETITEMW +#else +#define LVM_GETITEM LVM_GETITEMA +#endif + +#define ListView_GetItem(hwnd, pitem) \ + (BOOL)SendMessage((hwnd), LVM_GETITEM, 0, (LPARAM)(LV_ITEM FAR*)(pitem)) + + +#define LVM_SETITEMA (LVM_FIRST + 6) +#define LVM_SETITEMW (LVM_FIRST + 76) +#ifdef UNICODE +#define LVM_SETITEM LVM_SETITEMW +#else +#define LVM_SETITEM LVM_SETITEMA +#endif + +#define ListView_SetItem(hwnd, pitem) \ + (BOOL)SendMessage((hwnd), LVM_SETITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem)) + + +#define LVM_INSERTITEMA (LVM_FIRST + 7) +#define LVM_INSERTITEMW (LVM_FIRST + 77) +#ifdef UNICODE +#define LVM_INSERTITEM LVM_INSERTITEMW +#else +#define LVM_INSERTITEM LVM_INSERTITEMA +#endif +#define ListView_InsertItem(hwnd, pitem) \ + (int)SendMessage((hwnd), LVM_INSERTITEM, 0, (LPARAM)(const LV_ITEM FAR*)(pitem)) + + +#define LVM_DELETEITEM (LVM_FIRST + 8) +#define ListView_DeleteItem(hwnd, i) \ + (BOOL)SendMessage((hwnd), LVM_DELETEITEM, (WPARAM)(int)(i), 0L) + + +#define LVM_DELETEALLITEMS (LVM_FIRST + 9) +#define ListView_DeleteAllItems(hwnd) \ + (BOOL)SendMessage((hwnd), LVM_DELETEALLITEMS, 0, 0L) + + +#define LVM_GETCALLBACKMASK (LVM_FIRST + 10) +#define ListView_GetCallbackMask(hwnd) \ + (BOOL)SendMessage((hwnd), LVM_GETCALLBACKMASK, 0, 0) + + +#define LVM_SETCALLBACKMASK (LVM_FIRST + 11) +#define ListView_SetCallbackMask(hwnd, mask) \ + (BOOL)SendMessage((hwnd), LVM_SETCALLBACKMASK, (WPARAM)(UINT)(mask), 0) + + +#define LVNI_ALL 0x0000 +#define LVNI_FOCUSED 0x0001 +#define LVNI_SELECTED 0x0002 +#define LVNI_CUT 0x0004 +#define LVNI_DROPHILITED 0x0008 +#define LVNI_PREVIOUS 0x0020 + +#define LVNI_ABOVE 0x0100 +#define LVNI_BELOW 0x0200 +#define LVNI_TOLEFT 0x0400 +#define LVNI_TORIGHT 0x0800 + + +#define LVM_GETNEXTITEM (LVM_FIRST + 12) +#define ListView_GetNextItem(hwnd, i, flags) \ + (int)SendMessage((hwnd), LVM_GETNEXTITEM, (WPARAM)(int)(i), MAKELPARAM((flags), 0)) + + +#define LVFI_PARAM 0x0001 +#define LVFI_STRING 0x0002 +#define LVFI_SUBSTRING 0x0004 +#define LVFI_PARTIAL 0x0008 +#define LVFI_NOCASE 0x0010 +#define LVFI_WRAP 0x0020 +#define LVFI_NEARESTXY 0x0040 + +typedef struct _LV_FINDINFOA +{ + UINT flags; + LPCSTR psz; + LPARAM lParam; + POINT pt; + UINT vkDirection; +} LV_FINDINFOA; + +typedef struct _LV_FINDINFOW +{ + UINT flags; + LPCWSTR psz; + LPARAM lParam; + POINT pt; + UINT vkDirection; +} LV_FINDINFOW; + +#ifdef UNICODE +#define LV_FINDINFO LV_FINDINFOW +#else +#define LV_FINDINFO LV_FINDINFOA +#endif + +#define LVM_FINDITEMA (LVM_FIRST + 13) +#define LVM_FINDITEMW (LVM_FIRST + 83) +#ifdef UNICODE +#define LVM_FINDITEM LVM_FINDITEMW +#else +#define LVM_FINDITEM LVM_FINDITEMA +#endif + +#define ListView_FindItem(hwnd, iStart, plvfi) \ + (int)SendMessage((hwnd), LVM_FINDITEM, (WPARAM)(int)(iStart), (LPARAM)(const LV_FINDINFO FAR*)(plvfi)) + +#define LVIR_BOUNDS 0 +#define LVIR_ICON 1 +#define LVIR_LABEL 2 +#define LVIR_SELECTBOUNDS 3 + + +#define LVM_GETITEMRECT (LVM_FIRST + 14) +#define ListView_GetItemRect(hwnd, i, prc, code) \ + ((prc)->left = (code), (BOOL)SendMessage((hwnd), LVM_GETITEMRECT, (WPARAM)(int)(i), (LPARAM)(RECT FAR*)(prc))) + + +#define LVM_SETITEMPOSITION (LVM_FIRST + 15) +#define ListView_SetItemPosition(hwndLV, i, x, y) \ + (BOOL)SendMessage((hwndLV), LVM_SETITEMPOSITION, (WPARAM)(int)(i), MAKELPARAM((x), (y))) + + +#define LVM_GETITEMPOSITION (LVM_FIRST + 16) +#define ListView_GetItemPosition(hwndLV, i, ppt) \ + (BOOL)SendMessage((hwndLV), LVM_GETITEMPOSITION, (WPARAM)(int)(i), (LPARAM)(POINT FAR*)(ppt)) + + +#define LVM_GETSTRINGWIDTHA (LVM_FIRST + 17) +#define LVM_GETSTRINGWIDTHW (LVM_FIRST + 87) +#ifdef UNICODE +#define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHW +#else +#define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHA +#endif + +#define ListView_GetStringWidth(hwndLV, psz) \ + (int)SendMessage((hwndLV), LVM_GETSTRINGWIDTH, 0, (LPARAM)(LPCTSTR)(psz)) + + +#define LVHT_NOWHERE 0x0001 +#define LVHT_ONITEMICON 0x0002 +#define LVHT_ONITEMLABEL 0x0004 +#define LVHT_ONITEMSTATEICON 0x0008 +#define LVHT_ONITEM (LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMSTATEICON) + +#define LVHT_ABOVE 0x0008 +#define LVHT_BELOW 0x0010 +#define LVHT_TORIGHT 0x0020 +#define LVHT_TOLEFT 0x0040 + +typedef struct _LV_HITTESTINFO +{ + POINT pt; + UINT flags; + int iItem; +} LV_HITTESTINFO; + +#define LVM_HITTEST (LVM_FIRST + 18) +#define ListView_HitTest(hwndLV, pinfo) \ + (int)SendMessage((hwndLV), LVM_HITTEST, 0, (LPARAM)(LV_HITTESTINFO FAR*)(pinfo)) + + +#define LVM_ENSUREVISIBLE (LVM_FIRST + 19) +#define ListView_EnsureVisible(hwndLV, i, fPartialOK) \ + (BOOL)SendMessage((hwndLV), LVM_ENSUREVISIBLE, (WPARAM)(int)(i), MAKELPARAM((fPartialOK), 0)) + + +#define LVM_SCROLL (LVM_FIRST + 20) +#define ListView_Scroll(hwndLV, dx, dy) \ + (BOOL)SendMessage((hwndLV), LVM_SCROLL, (WPARAM)(int)dx, (LPARAM)(int)dy) + + +#define LVM_REDRAWITEMS (LVM_FIRST + 21) +#define ListView_RedrawItems(hwndLV, iFirst, iLast) \ + (BOOL)SendMessage((hwndLV), LVM_REDRAWITEMS, (WPARAM)(int)iFirst, (LPARAM)(int)iLast) + + +#define LVA_DEFAULT 0x0000 +#define LVA_ALIGNLEFT 0x0001 +#define LVA_ALIGNTOP 0x0002 +#define LVA_ALIGNRIGHT 0x0003 +#define LVA_ALIGNBOTTOM 0x0004 +#define LVA_SNAPTOGRID 0x0005 + +#define LVA_SORTASCENDING 0x0100 +#define LVA_SORTDESCENDING 0x0200 + +#define LVM_ARRANGE (LVM_FIRST + 22) +#define ListView_Arrange(hwndLV, code) \ + (BOOL)SendMessage((hwndLV), LVM_ARRANGE, (WPARAM)(UINT)(code), 0L) + + +#define LVM_EDITLABEL (LVM_FIRST + 23) +#define ListView_EditLabel(hwndLV, i) \ + (HWND)SendMessage((hwndLV), LVM_EDITLABEL, (WPARAM)(int)(i), 0L) + + +#define LVM_GETEDITCONTROL (LVM_FIRST + 24) +#define ListView_GetEditControl(hwndLV) \ + (HWND)SendMessage((hwndLV), LVM_GETEDITCONTROL, 0, 0L) + + +typedef struct _LV_COLUMNA +{ + UINT mask; + int fmt; + int cx; + LPSTR pszText; + int cchTextMax; + int iSubItem; +} LV_COLUMNA; + +typedef struct _LV_COLUMNW +{ + UINT mask; + int fmt; + int cx; + LPWSTR pszText; + int cchTextMax; + int iSubItem; +} LV_COLUMNW; + +#ifdef UNICODE +#define LV_COLUMN LV_COLUMNW +#else +#define LV_COLUMN LV_COLUMNA +#endif + + +#define LVCF_FMT 0x0001 +#define LVCF_WIDTH 0x0002 +#define LVCF_TEXT 0x0004 +#define LVCF_SUBITEM 0x0008 + +#define LVCFMT_LEFT 0 +#define LVCFMT_RIGHT 1 +#define LVCFMT_CENTER 2 + + +#define LVM_GETCOLUMNA (LVM_FIRST + 25) +#define LVM_GETCOLUMNW (LVM_FIRST + 95) +#ifdef UNICODE +#define LVM_GETCOLUMN LVM_GETCOLUMNW +#else +#define LVM_GETCOLUMN LVM_GETCOLUMNA +#endif + +#define ListView_GetColumn(hwnd, iCol, pcol) \ + (BOOL)SendMessage((hwnd), LVM_GETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(LV_COLUMN FAR*)(pcol)) + + +#define LVM_SETCOLUMNA (LVM_FIRST + 26) +#define LVM_SETCOLUMNW (LVM_FIRST + 96) +#ifdef UNICODE +#define LVM_SETCOLUMN LVM_SETCOLUMNW +#else +#define LVM_SETCOLUMN LVM_SETCOLUMNA +#endif + +#define ListView_SetColumn(hwnd, iCol, pcol) \ + (BOOL)SendMessage((hwnd), LVM_SETCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN FAR*)(pcol)) + + +#define LVM_INSERTCOLUMNA (LVM_FIRST + 27) +#define LVM_INSERTCOLUMNW (LVM_FIRST + 97) +#ifdef UNICODE +# define LVM_INSERTCOLUMN LVM_INSERTCOLUMNW +#else +# define LVM_INSERTCOLUMN LVM_INSERTCOLUMNA +#endif + +#define ListView_InsertColumn(hwnd, iCol, pcol) \ + (int)SendMessage((hwnd), LVM_INSERTCOLUMN, (WPARAM)(int)(iCol), (LPARAM)(const LV_COLUMN FAR*)(pcol)) + + +#define LVM_DELETECOLUMN (LVM_FIRST + 28) +#define ListView_DeleteColumn(hwnd, iCol) \ + (BOOL)SendMessage((hwnd), LVM_DELETECOLUMN, (WPARAM)(int)(iCol), 0) + + +#define LVM_GETCOLUMNWIDTH (LVM_FIRST + 29) +#define ListView_GetColumnWidth(hwnd, iCol) \ + (int)SendMessage((hwnd), LVM_GETCOLUMNWIDTH, (WPARAM)(int)(iCol), 0) + + +#define LVSCW_AUTOSIZE -1 +#define LVSCW_AUTOSIZE_USEHEADER -2 +#define LVM_SETCOLUMNWIDTH (LVM_FIRST + 30) + +#define ListView_SetColumnWidth(hwnd, iCol, cx) \ + (BOOL)SendMessage((hwnd), LVM_SETCOLUMNWIDTH, (WPARAM)(int)(iCol), MAKELPARAM((cx), 0)) + + +#define LVM_CREATEDRAGIMAGE (LVM_FIRST + 33) +#define ListView_CreateDragImage(hwnd, i, lpptUpLeft) \ + (HIMAGELIST)SendMessage((hwnd), LVM_CREATEDRAGIMAGE, (WPARAM)(int)(i), (LPARAM)(LPPOINT)(lpptUpLeft)) + + +#define LVM_GETVIEWRECT (LVM_FIRST + 34) +#define ListView_GetViewRect(hwnd, prc) \ + (BOOL)SendMessage((hwnd), LVM_GETVIEWRECT, 0, (LPARAM)(RECT FAR*)(prc)) + + +#define LVM_GETTEXTCOLOR (LVM_FIRST + 35) +#define ListView_GetTextColor(hwnd) \ + (COLORREF)SendMessage((hwnd), LVM_GETTEXTCOLOR, 0, 0L) + + +#define LVM_SETTEXTCOLOR (LVM_FIRST + 36) +#define ListView_SetTextColor(hwnd, clrText) \ + (BOOL)SendMessage((hwnd), LVM_SETTEXTCOLOR, 0, (LPARAM)(COLORREF)(clrText)) + + +#define LVM_GETTEXTBKCOLOR (LVM_FIRST + 37) +#define ListView_GetTextBkColor(hwnd) \ + (COLORREF)SendMessage((hwnd), LVM_GETTEXTBKCOLOR, 0, 0L) + + +#define LVM_SETTEXTBKCOLOR (LVM_FIRST + 38) +#define ListView_SetTextBkColor(hwnd, clrTextBk) \ + (BOOL)SendMessage((hwnd), LVM_SETTEXTBKCOLOR, 0, (LPARAM)(COLORREF)(clrTextBk)) + + +#define LVM_GETTOPINDEX (LVM_FIRST + 39) +#define ListView_GetTopIndex(hwndLV) \ + (int)SendMessage((hwndLV), LVM_GETTOPINDEX, 0, 0) + + +#define LVM_GETCOUNTPERPAGE (LVM_FIRST + 40) +#define ListView_GetCountPerPage(hwndLV, ppt) \ + (int)SendMessage((hwndLV), LVM_GETCOUNTPERPAGE, 0, 0) + + +#define LVM_GETORIGIN (LVM_FIRST + 41) +#define ListView_GetOrigin(hwndLV, ppt) \ + (BOOL)SendMessage((hwndLV), LVM_GETORIGIN, (WPARAM)0, (LPARAM)(POINT FAR*)(ppt)) + + +#define LVM_UPDATE (LVM_FIRST + 42) +#define ListView_Update(hwndLV, i) \ + (BOOL)SendMessage((hwndLV), LVM_UPDATE, (WPARAM)i, 0L) + + +#define LVM_SETITEMSTATE (LVM_FIRST + 43) +#define ListView_SetItemState(hwndLV, i, data, mask) \ +{ LV_ITEM _ms_lvi;\ + _ms_lvi.stateMask = mask;\ + _ms_lvi.state = data;\ + SendMessage((hwndLV), LVM_SETITEMSTATE, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\ +} + + +#define LVM_GETITEMSTATE (LVM_FIRST + 44) +#define ListView_GetItemState(hwndLV, i, mask) \ + (UINT)SendMessage((hwndLV), LVM_GETITEMSTATE, (WPARAM)i, (LPARAM)mask) + + +#define LVM_GETITEMTEXTA (LVM_FIRST + 45) +#define LVM_GETITEMTEXTW (LVM_FIRST + 115) + +#ifdef UNICODE +#define LVM_GETITEMTEXT LVM_GETITEMTEXTW +#else +#define LVM_GETITEMTEXT LVM_GETITEMTEXTA +#endif + +#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_) \ +{ LV_ITEM _ms_lvi;\ + _ms_lvi.iSubItem = iSubItem_;\ + _ms_lvi.cchTextMax = cchTextMax_;\ + _ms_lvi.pszText = pszText_;\ + SendMessage((hwndLV), LVM_GETITEMTEXT, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\ +} + + +#define LVM_SETITEMTEXTA (LVM_FIRST + 46) +#define LVM_SETITEMTEXTW (LVM_FIRST + 116) + +#ifdef UNICODE +#define LVM_SETITEMTEXT LVM_SETITEMTEXTW +#else +#define LVM_SETITEMTEXT LVM_SETITEMTEXTA +#endif + +#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_) \ +{ LV_ITEM _ms_lvi;\ + _ms_lvi.iSubItem = iSubItem_;\ + _ms_lvi.pszText = pszText_;\ + SendMessage((hwndLV), LVM_SETITEMTEXT, (WPARAM)i, (LPARAM)(LV_ITEM FAR *)&_ms_lvi);\ +} + + +#define LVM_SETITEMCOUNT (LVM_FIRST + 47) +#define ListView_SetItemCount(hwndLV, cItems) \ + SendMessage((hwndLV), LVM_SETITEMCOUNT, (WPARAM)cItems, 0) + + +typedef int (CALLBACK *PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM); + + +#define LVM_SORTITEMS (LVM_FIRST + 48) +#define ListView_SortItems(hwndLV, _pfnCompare, _lPrm) \ + (BOOL)SendMessage((hwndLV), LVM_SORTITEMS, (WPARAM)(LPARAM)_lPrm, \ + (LPARAM)(PFNLVCOMPARE)_pfnCompare) + + +#define LVM_SETITEMPOSITION32 (LVM_FIRST + 49) +#define ListView_SetItemPosition32(hwndLV, i, x, y) \ +{ POINT ptNewPos = {x,y}; \ + SendMessage((hwndLV), LVM_SETITEMPOSITION32, (WPARAM)(int)(i), (LPARAM)&ptNewPos); \ +} + + +#define LVM_GETSELECTEDCOUNT (LVM_FIRST + 50) +#define ListView_GetSelectedCount(hwndLV) \ + (UINT)SendMessage((hwndLV), LVM_GETSELECTEDCOUNT, 0, 0L) + + +#define LVM_GETITEMSPACING (LVM_FIRST + 51) +#define ListView_GetItemSpacing(hwndLV, fSmall) \ + (DWORD)SendMessage((hwndLV), LVM_GETITEMSPACING, fSmall, 0L) + + +#define LVM_GETISEARCHSTRINGA (LVM_FIRST + 52) +#define LVM_GETISEARCHSTRINGW (LVM_FIRST + 117) + +#ifdef UNICODE +#define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGW +#else +#define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGA +#endif + +#define ListView_GetISearchString(hwndLV, lpsz) \ + (BOOL)SendMessage((hwndLV), LVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)lpsz) + + +typedef struct _NM_LISTVIEW +{ + NMHDR hdr; + int iItem; + int iSubItem; + UINT uNewState; + UINT uOldState; + UINT uChanged; + POINT ptAction; + LPARAM lParam; +} NM_LISTVIEW, FAR *LPNM_LISTVIEW; + +#define LVN_ITEMCHANGING (LVN_FIRST-0) +#define LVN_ITEMCHANGED (LVN_FIRST-1) +#define LVN_INSERTITEM (LVN_FIRST-2) +#define LVN_DELETEITEM (LVN_FIRST-3) +#define LVN_DELETEALLITEMS (LVN_FIRST-4) +#define LVN_BEGINLABELEDITA (LVN_FIRST-5) +#define LVN_BEGINLABELEDITW (LVN_FIRST-75) +#define LVN_ENDLABELEDITA (LVN_FIRST-6) +#define LVN_ENDLABELEDITW (LVN_FIRST-76) +#define LVN_COLUMNCLICK (LVN_FIRST-8) +#define LVN_BEGINDRAG (LVN_FIRST-9) +#define LVN_ENDDRAG (LVN_FIRST-10) +#define LVN_BEGINRDRAG (LVN_FIRST-11) +#define LVN_ENDRDRAG (LVN_FIRST-12) + +#ifdef PW2 +#define LVN_PEN (LVN_FIRST-20) +#endif + +#define LVN_GETDISPINFOA (LVN_FIRST-50) +#define LVN_GETDISPINFOW (LVN_FIRST-77) +#define LVN_SETDISPINFOA (LVN_FIRST-51) +#define LVN_SETDISPINFOW (LVN_FIRST-78) + +#ifdef UNICODE +#define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITW +#define LVN_ENDLABELEDIT LVN_ENDLABELEDITW +#define LVN_GETDISPINFO LVN_GETDISPINFOW +#define LVN_SETDISPINFO LVN_SETDISPINFOW +#else +#define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITA +#define LVN_ENDLABELEDIT LVN_ENDLABELEDITA +#define LVN_GETDISPINFO LVN_GETDISPINFOA +#define LVN_SETDISPINFO LVN_SETDISPINFOA +#endif + + + + +#define LVIF_DI_SETITEM 0x1000 + +typedef struct _LV_DISPINFO { + NMHDR hdr; + LV_ITEMA item; +} LV_DISPINFOA; + +typedef struct _LV_DISPINFOW { + NMHDR hdr; + LV_ITEMW item; +} LV_DISPINFOW; + +#ifdef UNICODE +#define LV_DISPINFO LV_DISPINFOW +#else +#define LV_DISPINFO LV_DISPINFOA +#endif + +#define LVN_KEYDOWN (LVN_FIRST-55) + +typedef struct _LV_KEYDOWN +{ + NMHDR hdr; + WORD wVKey; + UINT flags; +} LV_KEYDOWN; + +#endif + +//====== TREEVIEW CONTROL ===================================================== + +#ifndef NOTREEVIEW + +#ifdef _WIN32 +#define WC_TREEVIEWA "SysTreeView32" +#define WC_TREEVIEWW L"SysTreeView32" + +#ifdef UNICODE +#define WC_TREEVIEW WC_TREEVIEWW +#else +#define WC_TREEVIEW WC_TREEVIEWA +#endif + +#else +#define WC_TREEVIEW "SysTreeView" +#endif + +#define TVS_HASBUTTONS 0x0001 +#define TVS_HASLINES 0x0002 +#define TVS_LINESATROOT 0x0004 +#define TVS_EDITLABELS 0x0008 +#define TVS_DISABLEDRAGDROP 0x0010 +#define TVS_SHOWSELALWAYS 0x0020 + +typedef struct _TREEITEM FAR* HTREEITEM; + +#define TVIF_TEXT 0x0001 +#define TVIF_IMAGE 0x0002 +#define TVIF_PARAM 0x0004 +#define TVIF_STATE 0x0008 +#define TVIF_HANDLE 0x0010 +#define TVIF_SELECTEDIMAGE 0x0020 +#define TVIF_CHILDREN 0x0040 + +#define TVIS_FOCUSED 0x0001 +#define TVIS_SELECTED 0x0002 +#define TVIS_CUT 0x0004 +#define TVIS_DROPHILITED 0x0008 +#define TVIS_BOLD 0x0010 +#define TVIS_EXPANDED 0x0020 +#define TVIS_EXPANDEDONCE 0x0040 + +#define TVIS_OVERLAYMASK 0x0F00 +#define TVIS_STATEIMAGEMASK 0xF000 +#define TVIS_USERMASK 0xF000 + + +#define I_CHILDRENCALLBACK (-1) + +typedef struct _TV_ITEMA { + UINT mask; + HTREEITEM hItem; + UINT state; + UINT stateMask; + LPSTR pszText; + int cchTextMax; + int iImage; + int iSelectedImage; + int cChildren; + LPARAM lParam; +} TV_ITEMA, FAR *LPTV_ITEMA; + +typedef struct _TV_ITEMW { + UINT mask; + HTREEITEM hItem; + UINT state; + UINT stateMask; + LPWSTR pszText; + int cchTextMax; + int iImage; + int iSelectedImage; + int cChildren; + LPARAM lParam; +} TV_ITEMW, FAR *LPTV_ITEMW; + +#ifdef UNICODE +#define TV_ITEM TV_ITEMW +#define LPTV_ITEM LPTV_ITEMW +#else +#define TV_ITEM TV_ITEMA +#define LPTV_ITEM LPTV_ITEMA +#endif + + +#define TVI_ROOT ((HTREEITEM)0xFFFF0000) +#define TVI_FIRST ((HTREEITEM)0xFFFF0001) +#define TVI_LAST ((HTREEITEM)0xFFFF0002) +#define TVI_SORT ((HTREEITEM)0xFFFF0003) + +typedef struct _TV_INSERTSTRUCTA { + HTREEITEM hParent; + HTREEITEM hInsertAfter; + TV_ITEMA item; +} TV_INSERTSTRUCTA, FAR *LPTV_INSERTSTRUCTA; + +typedef struct _TV_INSERTSTRUCTW { + HTREEITEM hParent; + HTREEITEM hInsertAfter; + TV_ITEMW item; +} TV_INSERTSTRUCTW, FAR *LPTV_INSERTSTRUCTW; + +#ifdef UNICODE +#define TV_INSERTSTRUCT TV_INSERTSTRUCTW +#define LPTV_INSERTSTRUCT LPTV_INSERTSTRUCTW +#else +#define TV_INSERTSTRUCT TV_INSERTSTRUCTA +#define LPTV_INSERTSTRUCT LPTV_INSERTSTRUCTA +#endif + +#define TVM_INSERTITEMA (TV_FIRST + 0) +#define TVM_INSERTITEMW (TV_FIRST + 50) +#ifdef UNICODE +#define TVM_INSERTITEM TVM_INSERTITEMW +#else +#define TVM_INSERTITEM TVM_INSERTITEMA +#endif + +#define TreeView_InsertItem(hwnd, lpis) \ + (HTREEITEM)SendMessage((hwnd), TVM_INSERTITEM, 0, (LPARAM)(LPTV_INSERTSTRUCT)(lpis)) + + +#define TVM_DELETEITEM (TV_FIRST + 1) +#define TreeView_DeleteItem(hwnd, hitem) \ + (BOOL)SendMessage((hwnd), TVM_DELETEITEM, 0, (LPARAM)(HTREEITEM)(hitem)) + + +#define TreeView_DeleteAllItems(hwnd) \ + (BOOL)SendMessage((hwnd), TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT) + + +#define TVM_EXPAND (TV_FIRST + 2) +#define TreeView_Expand(hwnd, hitem, code) \ + (BOOL)SendMessage((hwnd), TVM_EXPAND, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem)) + + +#define TVE_COLLAPSE 0x0001 +#define TVE_EXPAND 0x0002 +#define TVE_TOGGLE 0x0003 +#define TVE_COLLAPSERESET 0x8000 + + +#define TVM_GETITEMRECT (TV_FIRST + 4) +#define TreeView_GetItemRect(hwnd, hitem, prc, code) \ + (*(HTREEITEM FAR *)prc = (hitem), (BOOL)SendMessage((hwnd), TVM_GETITEMRECT, (WPARAM)(code), (LPARAM)(RECT FAR*)(prc))) + + +#define TVM_GETCOUNT (TV_FIRST + 5) +#define TreeView_GetCount(hwnd) \ + (UINT)SendMessage((hwnd), TVM_GETCOUNT, 0, 0) + + +#define TVM_GETINDENT (TV_FIRST + 6) +#define TreeView_GetIndent(hwnd) \ + (UINT)SendMessage((hwnd), TVM_GETINDENT, 0, 0) + + +#define TVM_SETINDENT (TV_FIRST + 7) +#define TreeView_SetIndent(hwnd, indent) \ + (BOOL)SendMessage((hwnd), TVM_SETINDENT, (WPARAM)indent, 0) + + +#define TVM_GETIMAGELIST (TV_FIRST + 8) +#define TreeView_GetImageList(hwnd, iImage) \ + (HIMAGELIST)SendMessage((hwnd), TVM_GETIMAGELIST, iImage, 0) + + +#define TVSIL_NORMAL 0 +#define TVSIL_STATE 2 + + +#define TVM_SETIMAGELIST (TV_FIRST + 9) +#define TreeView_SetImageList(hwnd, himl, iImage) \ + (HIMAGELIST)SendMessage((hwnd), TVM_SETIMAGELIST, iImage, (LPARAM)(UINT)(HIMAGELIST)(himl)) + + +#define TVM_GETNEXTITEM (TV_FIRST + 10) +#define TreeView_GetNextItem(hwnd, hitem, code) \ + (HTREEITEM)SendMessage((hwnd), TVM_GETNEXTITEM, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem)) + + +#define TVGN_ROOT 0x0000 +#define TVGN_NEXT 0x0001 +#define TVGN_PREVIOUS 0x0002 +#define TVGN_PARENT 0x0003 +#define TVGN_CHILD 0x0004 +#define TVGN_FIRSTVISIBLE 0x0005 +#define TVGN_NEXTVISIBLE 0x0006 +#define TVGN_PREVIOUSVISIBLE 0x0007 +#define TVGN_DROPHILITE 0x0008 +#define TVGN_CARET 0x0009 + +#define TreeView_GetChild(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_CHILD) +#define TreeView_GetNextSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_NEXT) +#define TreeView_GetPrevSibling(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUS) +#define TreeView_GetParent(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_PARENT) +#define TreeView_GetFirstVisible(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_FIRSTVISIBLE) +#define TreeView_GetNextVisible(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_NEXTVISIBLE) +#define TreeView_GetPrevVisible(hwnd, hitem) TreeView_GetNextItem(hwnd, hitem, TVGN_PREVIOUSVISIBLE) +#define TreeView_GetSelection(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_CARET) +#define TreeView_GetDropHilight(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_DROPHILITE) +#define TreeView_GetRoot(hwnd) TreeView_GetNextItem(hwnd, NULL, TVGN_ROOT) + + +#define TVM_SELECTITEM (TV_FIRST + 11) +#define TreeView_Select(hwnd, hitem, code) \ + (HTREEITEM)SendMessage((hwnd), TVM_SELECTITEM, (WPARAM)code, (LPARAM)(HTREEITEM)(hitem)) + + +#define TreeView_SelectItem(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_CARET) +#define TreeView_SelectDropTarget(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_DROPHILITE) +#define TreeView_SelectSetFirstVisible(hwnd, hitem) TreeView_Select(hwnd, hitem, TVGN_FIRSTVISIBLE) + + +#define TVM_GETITEMA (TV_FIRST + 12) +#define TVM_GETITEMW (TV_FIRST + 62) + +#ifdef UNICODE +#define TVM_GETITEM TVM_GETITEMW +#else +#define TVM_GETITEM TVM_GETITEMA +#endif + +#define TreeView_GetItem(hwnd, pitem) \ + (BOOL)SendMessage((hwnd), TVM_GETITEM, 0, (LPARAM)(TV_ITEM FAR*)(pitem)) + + +#define TVM_SETITEMA (TV_FIRST + 13) +#define TVM_SETITEMW (TV_FIRST + 63) + +#ifdef UNICODE +#define TVM_SETITEM TVM_SETITEMW +#else +#define TVM_SETITEM TVM_SETITEMA +#endif + +#define TreeView_SetItem(hwnd, pitem) \ + (BOOL)SendMessage((hwnd), TVM_SETITEM, 0, (LPARAM)(const TV_ITEM FAR*)(pitem)) + + +#define TVM_EDITLABEL (TV_FIRST + 14) +#define TreeView_EditLabel(hwnd, hitem) \ + (HWND)SendMessage((hwnd), TVM_EDITLABEL, 0, (LPARAM)(HTREEITEM)(hitem)) + + +#define TVM_GETEDITCONTROL (TV_FIRST + 15) +#define TreeView_GetEditControl(hwnd) \ + (HWND)SendMessage((hwnd), TVM_GETEDITCONTROL, 0, 0) + + +#define TVM_GETVISIBLECOUNT (TV_FIRST + 16) +#define TreeView_GetVisibleCount(hwnd) \ + (UINT)SendMessage((hwnd), TVM_GETVISIBLECOUNT, 0, 0) + + +#define TVM_HITTEST (TV_FIRST + 17) +#define TreeView_HitTest(hwnd, lpht) \ + (HTREEITEM)SendMessage((hwnd), TVM_HITTEST, 0, (LPARAM)(LPTV_HITTESTINFO)(lpht)) + + +typedef struct _TV_HITTESTINFO { + POINT pt; + UINT flags; + HTREEITEM hItem; +} TV_HITTESTINFO, FAR *LPTV_HITTESTINFO; + +#define TVHT_NOWHERE 0x0001 +#define TVHT_ONITEMICON 0x0002 +#define TVHT_ONITEMLABEL 0x0004 +#define TVHT_ONITEM (TVHT_ONITEMICON | TVHT_ONITEMLABEL | TVHT_ONITEMSTATEICON) +#define TVHT_ONITEMINDENT 0x0008 +#define TVHT_ONITEMBUTTON 0x0010 +#define TVHT_ONITEMRIGHT 0x0020 +#define TVHT_ONITEMSTATEICON 0x0040 + +#define TVHT_ABOVE 0x0100 +#define TVHT_BELOW 0x0200 +#define TVHT_TORIGHT 0x0400 +#define TVHT_TOLEFT 0x0800 + + +#define TVM_CREATEDRAGIMAGE (TV_FIRST + 18) +#define TreeView_CreateDragImage(hwnd, hitem) \ + (HIMAGELIST)SendMessage((hwnd), TVM_CREATEDRAGIMAGE, 0, (LPARAM)(HTREEITEM)(hitem)) + + +#define TVM_SORTCHILDREN (TV_FIRST + 19) +#define TreeView_SortChildren(hwnd, hitem, recurse) \ + (BOOL)SendMessage((hwnd), TVM_SORTCHILDREN, (WPARAM)recurse, (LPARAM)(HTREEITEM)(hitem)) + + +#define TVM_ENSUREVISIBLE (TV_FIRST + 20) +#define TreeView_EnsureVisible(hwnd, hitem) \ + (BOOL)SendMessage((hwnd), TVM_ENSUREVISIBLE, 0, (LPARAM)(HTREEITEM)(hitem)) + + +#define TVM_SORTCHILDRENCB (TV_FIRST + 21) +#define TreeView_SortChildrenCB(hwnd, psort, recurse) \ + (BOOL)SendMessage((hwnd), TVM_SORTCHILDRENCB, (WPARAM)recurse, \ + (LPARAM)(LPTV_SORTCB)(psort)) + + +#define TVM_ENDEDITLABELNOW (TV_FIRST + 22) +#define TreeView_EndEditLabelNow(hwnd, fCancel) \ + (BOOL)SendMessage((hwnd), TVM_ENDEDITLABELNOW, (WPARAM)fCancel, 0) + + +#define TVM_GETISEARCHSTRINGA (TV_FIRST + 23) +#define TVM_GETISEARCHSTRINGW (TV_FIRST + 64) + +#ifdef UNICODE +#define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGW +#else +#define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGA +#endif + +#define TreeView_GetISearchString(hwndTV, lpsz) \ + (BOOL)SendMessage((hwndTV), TVM_GETISEARCHSTRING, 0, (LPARAM)(LPTSTR)lpsz) + + +typedef int (CALLBACK *PFNTVCOMPARE)(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort); +typedef struct _TV_SORTCB +{ + HTREEITEM hParent; + PFNTVCOMPARE lpfnCompare; + LPARAM lParam; +} TV_SORTCB, FAR *LPTV_SORTCB; + + +typedef struct _NM_TREEVIEWA { + NMHDR hdr; + UINT action; + TV_ITEMA itemOld; + TV_ITEMA itemNew; + POINT ptDrag; +} NM_TREEVIEWA, FAR *LPNM_TREEVIEWA; + +typedef struct _NM_TREEVIEWW { + NMHDR hdr; + UINT action; + TV_ITEMW itemOld; + TV_ITEMW itemNew; + POINT ptDrag; +} NM_TREEVIEWW, FAR *LPNM_TREEVIEWW; + +#ifdef UNICODE +#define NM_TREEVIEW NM_TREEVIEWW +#define LPNM_TREEVIEW LPNM_TREEVIEWW +#else +#define NM_TREEVIEW NM_TREEVIEWA +#define LPNM_TREEVIEW LPNM_TREEVIEWA +#endif + +#define TVN_SELCHANGINGA (TVN_FIRST-1) +#define TVN_SELCHANGINGW (TVN_FIRST-50) +#define TVN_SELCHANGEDA (TVN_FIRST-2) +#define TVN_SELCHANGEDW (TVN_FIRST-51) + +#define TVC_UNKNOWN 0x0000 +#define TVC_BYMOUSE 0x0001 +#define TVC_BYKEYBOARD 0x0002 + +#define TVN_GETDISPINFOA (TVN_FIRST-3) +#define TVN_GETDISPINFOW (TVN_FIRST-52) +#define TVN_SETDISPINFOA (TVN_FIRST-4) +#define TVN_SETDISPINFOW (TVN_FIRST-53) + +#define TVIF_DI_SETITEM 0x1000 + +typedef struct _TV_DISPINFOA { + NMHDR hdr; + TV_ITEMA item; +} TV_DISPINFOA; + +typedef struct _TV_DISPINFOW { + NMHDR hdr; + TV_ITEMW item; +} TV_DISPINFOW; + +#ifdef UNICODE +# define TV_DISPINFO TV_DISPINFOW +#else +# define TV_DISPINFO TV_DISPINFOA +#endif + +#define TVN_ITEMEXPANDINGA (TVN_FIRST-5) +#define TVN_ITEMEXPANDINGW (TVN_FIRST-54) +#define TVN_ITEMEXPANDEDA (TVN_FIRST-6) +#define TVN_ITEMEXPANDEDW (TVN_FIRST-55) +#define TVN_BEGINDRAGA (TVN_FIRST-7) +#define TVN_BEGINDRAGW (TVN_FIRST-56) +#define TVN_BEGINRDRAGA (TVN_FIRST-8) +#define TVN_BEGINRDRAGW (TVN_FIRST-57) +#define TVN_DELETEITEMA (TVN_FIRST-9) +#define TVN_DELETEITEMW (TVN_FIRST-58) +#define TVN_BEGINLABELEDITA (TVN_FIRST-10) +#define TVN_BEGINLABELEDITW (TVN_FIRST-59) +#define TVN_ENDLABELEDITA (TVN_FIRST-11) +#define TVN_ENDLABELEDITW (TVN_FIRST-60) +#define TVN_KEYDOWN (TVN_FIRST-12) + +typedef struct _TV_KEYDOWN { + NMHDR hdr; + WORD wVKey; + UINT flags; +} TV_KEYDOWN; + +#ifdef UNICODE +#define TVN_SELCHANGING TVN_SELCHANGINGW +#define TVN_SELCHANGED TVN_SELCHANGEDW +#define TVN_GETDISPINFO TVN_GETDISPINFOW +#define TVN_SETDISPINFO TVN_SETDISPINFOW +#define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGW +#define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDW +#define TVN_BEGINDRAG TVN_BEGINDRAGW +#define TVN_BEGINRDRAG TVN_BEGINRDRAGW +#define TVN_DELETEITEM TVN_DELETEITEMW +#define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITW +#define TVN_ENDLABELEDIT TVN_ENDLABELEDITW +#else +#define TVN_SELCHANGING TVN_SELCHANGINGA +#define TVN_SELCHANGED TVN_SELCHANGEDA +#define TVN_GETDISPINFO TVN_GETDISPINFOA +#define TVN_SETDISPINFO TVN_SETDISPINFOA +#define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGA +#define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDA +#define TVN_BEGINDRAG TVN_BEGINDRAGA +#define TVN_BEGINRDRAG TVN_BEGINRDRAGA +#define TVN_DELETEITEM TVN_DELETEITEMA +#define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITA +#define TVN_ENDLABELEDIT TVN_ENDLABELEDITA +#endif + +#endif + + +//====== TAB CONTROL ========================================================== + +#ifndef NOTABCONTROL + +#ifdef _WIN32 + +#define WC_TABCONTROLA "SysTabControl32" +#define WC_TABCONTROLW L"SysTabControl32" + +#ifdef UNICODE +#define WC_TABCONTROL WC_TABCONTROLW +#else +#define WC_TABCONTROL WC_TABCONTROLA +#endif + +#else +#define WC_TABCONTROL "SysTabControl" +#endif + + +#define TCS_FORCEICONLEFT 0x0010 +#define TCS_FORCELABELLEFT 0x0020 +#define TCS_SHAREIMAGELISTS 0x0040 +#define TCS_TABS 0x0000 +#define TCS_BUTTONS 0x0100 +#define TCS_SINGLELINE 0x0000 +#define TCS_MULTILINE 0x0200 +#define TCS_RIGHTJUSTIFY 0x0000 +#define TCS_FIXEDWIDTH 0x0400 +#define TCS_RAGGEDRIGHT 0x0800 +#define TCS_FOCUSONBUTTONDOWN 0x1000 +#define TCS_OWNERDRAWFIXED 0x2000 +#define TCS_TOOLTIPS 0x4000 +#define TCS_FOCUSNEVER 0x8000 + + +#define TCM_FIRST 0x1300 + +#define TCM_GETBKCOLOR (TCM_FIRST + 0) +#define TabCtrl_GetBkColor(hwnd) \ + (COLORREF)SendMessage((hwnd), TCM_GETBKCOLOR, 0, 0L) + + +#define TCM_SETBKCOLOR (TCM_FIRST + 1) +#define TabCtrl_SetBkColor(hwnd, clrBk) \ + (BOOL)SendMessage((hwnd), TCM_SETBKCOLOR, 0, (LPARAM)(COLORREF)(clrBk)) + + +#define TCM_GETIMAGELIST (TCM_FIRST + 2) +#define TabCtrl_GetImageList(hwnd) \ + (HIMAGELIST)SendMessage((hwnd), TCM_GETIMAGELIST, 0, 0L) + + +#define TCM_SETIMAGELIST (TCM_FIRST + 3) +#define TabCtrl_SetImageList(hwnd, himl) \ + (HIMAGELIST)SendMessage((hwnd), TCM_SETIMAGELIST, 0, (LPARAM)(UINT)(HIMAGELIST)(himl)) + + +#define TCM_GETITEMCOUNT (TCM_FIRST + 4) +#define TabCtrl_GetItemCount(hwnd) \ + (int)SendMessage((hwnd), TCM_GETITEMCOUNT, 0, 0L) + + + +#define TCIF_TEXT 0x0001 +#define TCIF_IMAGE 0x0002 +#define TCIF_PARAM 0x0008 + + +typedef struct _TC_ITEMHEADERA +{ + UINT mask; + UINT lpReserved1; + UINT lpReserved2; + LPSTR pszText; + int cchTextMax; + int iImage; +} TC_ITEMHEADERA; + +typedef struct _TC_ITEMHEADERW +{ + UINT mask; + UINT lpReserved1; + UINT lpReserved2; + LPWSTR pszText; + int cchTextMax; + int iImage; +} TC_ITEMHEADERW; + +#ifdef UNICODE +#define TC_ITEMHEADER TC_ITEMHEADERW +#else +#define TC_ITEMHEADER TC_ITEMHEADERA +#endif + + +typedef struct _TC_ITEMA +{ + UINT mask; + UINT lpReserved1; + UINT lpReserved2; + LPSTR pszText; + int cchTextMax; + int iImage; + + LPARAM lParam; +} TC_ITEMA; + +typedef struct _TC_ITEMW +{ + UINT mask; + UINT lpReserved1; + UINT lpReserved2; + LPWSTR pszText; + int cchTextMax; + int iImage; + + LPARAM lParam; +} TC_ITEMW; + +#ifdef UNICODE +#define TC_ITEM TC_ITEMW +#else +#define TC_ITEM TC_ITEMA +#endif + + +#define TCM_GETITEMA (TCM_FIRST + 5) +#define TCM_GETITEMW (TCM_FIRST + 60) + +#ifdef UNICODE +#define TCM_GETITEM TCM_GETITEMW +#else +#define TCM_GETITEM TCM_GETITEMA +#endif + +#define TabCtrl_GetItem(hwnd, iItem, pitem) \ + (BOOL)SendMessage((hwnd), TCM_GETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM FAR*)(pitem)) + + +#define TCM_SETITEMA (TCM_FIRST + 6) +#define TCM_SETITEMW (TCM_FIRST + 61) + +#ifdef UNICODE +#define TCM_SETITEM TCM_SETITEMW +#else +#define TCM_SETITEM TCM_SETITEMA +#endif + +#define TabCtrl_SetItem(hwnd, iItem, pitem) \ + (BOOL)SendMessage((hwnd), TCM_SETITEM, (WPARAM)(int)iItem, (LPARAM)(TC_ITEM FAR*)(pitem)) + + +#define TCM_INSERTITEMA (TCM_FIRST + 7) +#define TCM_INSERTITEMW (TCM_FIRST + 62) + +#ifdef UNICODE +#define TCM_INSERTITEM TCM_INSERTITEMW +#else +#define TCM_INSERTITEM TCM_INSERTITEMA +#endif + +#define TabCtrl_InsertItem(hwnd, iItem, pitem) \ + (int)SendMessage((hwnd), TCM_INSERTITEM, (WPARAM)(int)iItem, (LPARAM)(const TC_ITEM FAR*)(pitem)) + + +#define TCM_DELETEITEM (TCM_FIRST + 8) +#define TabCtrl_DeleteItem(hwnd, i) \ + (BOOL)SendMessage((hwnd), TCM_DELETEITEM, (WPARAM)(int)(i), 0L) + + +#define TCM_DELETEALLITEMS (TCM_FIRST + 9) +#define TabCtrl_DeleteAllItems(hwnd) \ + (BOOL)SendMessage((hwnd), TCM_DELETEALLITEMS, 0, 0L) + + +#define TCM_GETITEMRECT (TCM_FIRST + 10) +#define TabCtrl_GetItemRect(hwnd, i, prc) \ + (BOOL)SendMessage((hwnd), TCM_GETITEMRECT, (WPARAM)(int)(i), (LPARAM)(RECT FAR*)(prc)) + + +#define TCM_GETCURSEL (TCM_FIRST + 11) +#define TabCtrl_GetCurSel(hwnd) \ + (int)SendMessage((hwnd), TCM_GETCURSEL, 0, 0) + + +#define TCM_SETCURSEL (TCM_FIRST + 12) +#define TabCtrl_SetCurSel(hwnd, i) \ + (int)SendMessage((hwnd), TCM_SETCURSEL, (WPARAM)i, 0) + + +#define TCHT_NOWHERE 0x0001 +#define TCHT_ONITEMICON 0x0002 +#define TCHT_ONITEMLABEL 0x0004 +#define TCHT_ONITEM (TCHT_ONITEMICON | TCHT_ONITEMLABEL) + + +typedef struct _TC_HITTESTINFO +{ + POINT pt; + UINT flags; +} TC_HITTESTINFO, FAR * LPTC_HITTESTINFO; + + +#define TCM_HITTEST (TCM_FIRST + 13) +#define TabCtrl_HitTest(hwndTC, pinfo) \ + (int)SendMessage((hwndTC), TCM_HITTEST, 0, (LPARAM)(TC_HITTESTINFO FAR*)(pinfo)) + + +#define TCM_SETITEMEXTRA (TCM_FIRST + 14) +#define TabCtrl_SetItemExtra(hwndTC, cb) \ + (BOOL)SendMessage((hwndTC), TCM_SETITEMEXTRA, (WPARAM)(cb), 0L) + + +#define TCM_ADJUSTRECT (TCM_FIRST + 40) +#define TabCtrl_AdjustRect(hwnd, bLarger, prc) \ + (void)SendMessage(hwnd, TCM_ADJUSTRECT, (WPARAM)(BOOL)bLarger, (LPARAM)(RECT FAR *)prc) + + +#define TCM_SETITEMSIZE (TCM_FIRST + 41) +#define TabCtrl_SetItemSize(hwnd, x, y) \ + (DWORD)SendMessage((hwnd), TCM_SETITEMSIZE, 0, MAKELPARAM(x,y)) + + +#define TCM_REMOVEIMAGE (TCM_FIRST + 42) +#define TabCtrl_RemoveImage(hwnd, i) \ + (void)SendMessage((hwnd), TCM_REMOVEIMAGE, i, 0L) + + +#define TCM_SETPADDING (TCM_FIRST + 43) +#define TabCtrl_SetPadding(hwnd, cx, cy) \ + (void)SendMessage((hwnd), TCM_SETPADDING, 0, MAKELPARAM(cx, cy)) + + +#define TCM_GETROWCOUNT (TCM_FIRST + 44) +#define TabCtrl_GetRowCount(hwnd) \ + (int)SendMessage((hwnd), TCM_GETROWCOUNT, 0, 0L) + + +#define TCM_GETTOOLTIPS (TCM_FIRST + 45) +#define TabCtrl_GetToolTips(hwnd) \ + (HWND)SendMessage((hwnd), TCM_GETTOOLTIPS, 0, 0L) + + +#define TCM_SETTOOLTIPS (TCM_FIRST + 46) +#define TabCtrl_SetToolTips(hwnd, hwndTT) \ + (void)SendMessage((hwnd), TCM_SETTOOLTIPS, (WPARAM)hwndTT, 0L) + + +#define TCM_GETCURFOCUS (TCM_FIRST + 47) +#define TabCtrl_GetCurFocus(hwnd) \ + (int)SendMessage((hwnd), TCM_GETCURFOCUS, 0, 0) + +#define TCM_SETCURFOCUS (TCM_FIRST + 48) +#define TabCtrl_SetCurFocus(hwnd, i) \ + SendMessage((hwnd),TCM_SETCURFOCUS, i, 0) + + +#define TCN_KEYDOWN (TCN_FIRST - 0) +typedef struct _TC_KEYDOWN +{ + NMHDR hdr; + WORD wVKey; + UINT flags; +} TC_KEYDOWN; + +#define TCN_SELCHANGE (TCN_FIRST - 1) +#define TCN_SELCHANGING (TCN_FIRST - 2) + +#endif + + +//====== ANIMATE CONTROL ====================================================== + +#ifndef NOANIMATE + +#ifdef _WIN32 + +#define ANIMATE_CLASSW L"SysAnimate32" +#define ANIMATE_CLASSA "SysAnimate32" + +#ifdef UNICODE +#define ANIMATE_CLASS ANIMATE_CLASSW +#else +#define ANIMATE_CLASS ANIMATE_CLASSA +#endif + +#define ACS_CENTER 0x0001 +#define ACS_TRANSPARENT 0x0002 +#define ACS_AUTOPLAY 0x0004 + + +#define ACM_OPENA (WM_USER+100) +#define ACM_OPENW (WM_USER+103) + +#ifdef UNICODE +#define ACM_OPEN ACM_OPENW +#else +#define ACM_OPEN ACM_OPENA +#endif + +#define ACM_PLAY (WM_USER+101) +#define ACM_STOP (WM_USER+102) + + +#define ACN_START 1 +#define ACN_STOP 2 + + +#define Animate_Create(hwndP, id, dwStyle, hInstance) \ + CreateWindow(ANIMATE_CLASS, NULL, \ + dwStyle, 0, 0, 0, 0, hwndP, (HMENU)(id), hInstance, NULL) + +#define Animate_Open(hwnd, szName) (BOOL)SendMessage(hwnd, ACM_OPEN, 0, (LPARAM)(LPTSTR)(szName)) +#define Animate_Play(hwnd, from, to, rep) (BOOL)SendMessage(hwnd, ACM_PLAY, (WPARAM)(UINT)(rep), (LPARAM)MAKELONG(from, to)) +#define Animate_Stop(hwnd) (BOOL)SendMessage(hwnd, ACM_STOP, 0, 0) +#define Animate_Close(hwnd) Animate_Open(hwnd, NULL) +#define Animate_Seek(hwnd, frame) Animate_Play(hwnd, frame, frame, 1) +#endif + +#endif + + +#endif // (WINVER >= 0x0400) + +#ifdef __cplusplus +} +#endif + +#ifdef _WIN32 +#include <poppack.h> +#endif + +#endif + +#endif diff --git a/public/sdk/inc/mfc30/l.deu/afxdb.rc b/public/sdk/inc/mfc30/l.deu/afxdb.rc new file mode 100644 index 000000000..76e50446a --- /dev/null +++ b/public/sdk/inc/mfc30/l.deu/afxdb.rc @@ -0,0 +1,83 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992-1993 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXDB_RC__ +#define __AFXDB_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< Cannot change standard MFC resources! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// Database Resources + +// Database strings +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDP_SQL_CONNECT_FAIL + "Der Verbindungsversuch zur Datenquelle ist gescheitert." + AFX_IDP_SQL_RECORDSET_FORWARD_ONLY + "Datensatzmenge unterstützt nur Vorwärtsbewegung." + AFX_IDP_SQL_EMPTY_COLUMN_LIST + "Der Versuch, eine Tabelle zu öffnen, ist fehlgeschlagen, da am angegebenen Ort keine Spalten abgerufen werden konnten." + AFX_IDP_SQL_FIELD_SCHEMA_MISMATCH + "Von einer Abfrage wurden unerwartete Spaltendatentypen zurückgegeben." + AFX_IDP_SQL_ILLEGAL_MODE "Der Versuch zu aktualisieren oder zu löschen ist fehlgeschlagen." + AFX_IDP_SQL_MULTIPLE_ROWS_AFFECTED "Es wurden mehrere Zeilen aktualisiert." + AFX_IDP_SQL_NO_CURRENT_RECORD "Operation ist fehlgeschlagen; es gibt keinen aktuellen Datensatz" + AFX_IDP_SQL_NO_ROWS_AFFECTED + "Es waren keine Zeilen von der Aktualisierungs- oder Löschoperation betroffen." + AFX_IDP_SQL_RECORDSET_READONLY "Datensatzmenge kann nur gelesen werden." + AFX_IDP_SQL_SQL_NO_TOTAL + "MFC LongBinary Datenmodell wird vom ODBC Treiber nicht unterstützt." + AFX_IDP_SQL_ODBC_LOAD_FAILED + "Der Versuch, die benötigte Komponente ODBC32.DLL zu laden, ist fehlgeschlagen." + AFX_IDP_SQL_DYNASET_NOT_SUPPORTED + "Der ODBC-Treiber unterstützt keine Dynasets." + AFX_IDP_SQL_SNAPSHOT_NOT_SUPPORTED + "Statische ODBC-Cursors werden zur Unterstützung von Schnappschüssen benötigt." + AFX_IDP_SQL_API_CONFORMANCE + "Der ODBC-Treiber ist inkompatibel zu den MFC-Datenbankklassen (API_CONFORMANCE >= SQL_OAC_LEVEL1 benötigt)." + AFX_IDP_SQL_SQL_CONFORMANCE + "Der ODBC-Treiber ist inkompatibel zu den MFC-Datenbankklassen (SQL_CONFORMANCE >= SQL_OSC_MINIMUM benötigt)." + AFX_IDP_SQL_NO_DATA_FOUND + "Es wurde versucht, hinter das Ende oder vor den Anfang der Daten zu gelangen." + AFX_IDP_SQL_ROW_UPDATE_NOT_SUPPORTED + "Dynasets werden vom ODBC-Treiber nicht unterstützt." + AFX_IDP_SQL_ODBC_V2_REQUIRED + "Ein Treiber gemäß ODBC Level 2 wird benötigt." + AFX_IDP_SQL_NO_POSITIONED_UPDATES + "Positionierte Aktualisierungen werden vom ODBC-Treiber nicht unterstützt." + AFX_IDP_SQL_LOCK_MODE_NOT_SUPPORTED + "Der angeforderte Sperrmodus wird nicht unterstützt." + AFX_IDP_SQL_DATA_TRUNCATED + "Daten abgeschnitten." + AFX_IDP_SQL_ROW_FETCH + "Fehler beim Auslesen des Datensatzes." + AFX_IDP_SQL_INCORRECT_ODBC + "Ein benötigter ODBC-Einsprungspunkt konnte nicht gefunden werden. Überprüfen Sie, ob OBDC korrekt installiert ist." + AFX_IDP_SQL_UPDATE_DELETE_FAILED + "Auffrischen oder Löschen versagte." +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXDB_RC__ diff --git a/public/sdk/inc/mfc30/l.deu/afxolecl.rc b/public/sdk/inc/mfc30/l.deu/afxolecl.rc new file mode 100644 index 000000000..aa8354c66 --- /dev/null +++ b/public/sdk/inc/mfc30/l.deu/afxolecl.rc @@ -0,0 +1,60 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXOLECL_RC__ +#define __AFXOLECL_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifndef _INC_DLGS +#include <dlgs.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< Cannot change standard MFC resources! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// OLE Client Resources + +///////////////////////////////////////////////////////////////////////////// +// OLE strings + +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDP_STATIC_OBJECT "Warnung: Unerwartetes statisches Objekt." + AFX_IDP_FAILED_TO_CONNECT "Der Verbindungsversuch ist fehlgeschlagen.\nDie Verbindung ist vielleicht unterbrochen." + AFX_IDP_SERVER_BUSY "Der Befehl kann nicht verarbeitet werden, weil der Server beschäftigt ist." + AFX_IDP_BAD_VERB "Die Ausführung der Server-Operation ist fehlgeschlagen." + AFX_IDP_FAILED_TO_LAUNCH "Die Server-Anwendung konnte nicht gestartet werden." + AFX_IDS_APP_TITLE_INPLACE "%1 in %2" + AFX_IDS_UPDATING_ITEMS "Aktualisiere OLE-Objekte." + AFX_IDP_FAILED_TO_CONVERT "Das OLE-Objekt konnte nicht umgewandelt werden." + AFX_IDP_ASK_TO_DISCARD "OLE-Objekte können nicht beim Beenden von Windows gespeichert werden!\nSollen alle Änderungen an %1 verworfen werden?" + + AFX_IDS_METAFILE_FORMAT "Bild (Metadatei)\nein Bild" + AFX_IDS_DIB_FORMAT "Geräteunabhängige Bitmap\neine geräteunabhängige Bitmap" + AFX_IDS_BITMAP_FORMAT "Bitmap\neine Bitmap" + AFX_IDS_LINKSOURCE_FORMAT "%s\n%s" + AFX_IDS_EMBED_FORMAT "%s\n%s" +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXOLECL_RC__ diff --git a/public/sdk/inc/mfc30/l.deu/afxolesv.rc b/public/sdk/inc/mfc30/l.deu/afxolesv.rc new file mode 100644 index 000000000..5533423ed --- /dev/null +++ b/public/sdk/inc/mfc30/l.deu/afxolesv.rc @@ -0,0 +1,53 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXOLESV_RC__ +#define __AFXOLESV_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< Cannot change standard MFC resources! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// OLE Server Resources + +// OLE strings +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDP_ASK_TO_UPDATE, "%1 vor dem Fortfahren aktualisieren?" + AFX_IDP_FAILED_TO_UPDATE, "Der Client konnte nicht aktualisiert werden." + + AFX_IDP_FAILED_TO_REGISTER, "Die Registrierung ist fehlgeschlagen. Die OLE-Funktionen arbeiten u.U. nicht richtig." + AFX_IDP_FAILED_TO_AUTO_REGISTER, "Die Aktualisierung der Systemregistrierung ist fehlgeschlagen.\nVersuchen Sie REGEDIT zu benutzen." +END + +STRINGTABLE PRELOAD +BEGIN + AFX_IDS_APP_TITLE_EMBEDDING, "%1 in %2" + AFX_IDS_OBJ_TITLE_INPLACE, "%1 - %2" + AFX_IDS_EXIT_MENU, "&Beenden und zu %1 zurückkehren" + AFX_IDS_UPDATE_MENU, "&Aktualisiere %1" + AFX_IDS_SAVEFILECOPY, "Kopie speichern unter" +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXOLESV_RC__ diff --git a/public/sdk/inc/mfc30/l.deu/afxprint.rc b/public/sdk/inc/mfc30/l.deu/afxprint.rc new file mode 100644 index 000000000..a2dbe7c88 --- /dev/null +++ b/public/sdk/inc/mfc30/l.deu/afxprint.rc @@ -0,0 +1,130 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXPRINT_RC__ +#define __AFXPRINT_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< Cannot change standard MFC resources! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// Printing Resources + +AFX_IDC_MAGNIFY CURSOR DISCARDABLE "res\\magnify.cur" + +#ifndef _MAC +AFX_IDD_PRINTDLG DIALOG DISCARDABLE 6, 18, 133, 95 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | 0x04 +#else +AFX_IDD_PRINTDLG DIALOG DISCARDABLE 6, 18, 133, 84 +STYLE DS_MODALFRAME | WS_POPUP +#endif +FONT 8, "MS Shell Dlg" +BEGIN + CTEXT "Drucke",IDC_STATIC,0,9,133,8 + CTEXT "",AFX_IDC_PRINT_DOCNAME,0,19,133,8 +#ifndef _MAC + CTEXT "auf",IDC_STATIC,0,29,133,8 + CTEXT "",AFX_IDC_PRINT_PRINTERNAME,0,39,133,8 + CTEXT "",AFX_IDC_PRINT_PORTNAME,0,49,133,8 + CTEXT "",AFX_IDC_PRINT_PAGENUM,0,59,133,8 + PUSHBUTTON "Abbrechen",IDCANCEL,46,74,40,14 +#else + CTEXT "",AFX_IDC_PRINT_PAGENUM,0,30,133,8 + PUSHBUTTON "Abbrechen",IDCANCEL,46,45,40,15 + CTEXT "Drücken Sie Cmd-. um abzubrechen.",IDC_STATIC,0,63,133,16 +#endif +END + +// Preview Toolbar Dialog +#ifndef _MAC +AFX_IDD_PREVIEW_TOOLBAR DIALOG PRELOAD DISCARDABLE 0, 0, 330, 16 +STYLE WS_CHILD | 0x04 +FONT 8, "MS Shell Dlg" +BEGIN + PUSHBUTTON "&Drucken...",AFX_ID_PREVIEW_PRINT,2,2,44,12 + PUSHBUTTON "&Nächste",AFX_ID_PREVIEW_NEXT,48,2,44,12 + PUSHBUTTON "&Vorherige",AFX_ID_PREVIEW_PREV,94,2,44,12 + PUSHBUTTON "",AFX_ID_PREVIEW_NUMPAGE,140,2,44,12 + PUSHBUTTON "Ver&größern",AFX_ID_PREVIEW_ZOOMIN,186,2,44,12 + PUSHBUTTON "Ver&kleinern",AFX_ID_PREVIEW_ZOOMOUT,232,2,44,12 + PUSHBUTTON "&Schließen",AFX_ID_PREVIEW_CLOSE,278,2,44,12 +END +#else +// standard toolbar for 14" and larger screens +// width *must* be 320 or less so that this is used on 640x480 screens +AFX_IDD_PREVIEW_TOOLBAR DIALOG PRELOAD DISCARDABLE 0, 0, 320, 19 +STYLE WS_CHILD | CBRS_TOP +BEGIN + PUSHBUTTON "&Drucken...",AFX_ID_PREVIEW_PRINT,1,2,44,15 + PUSHBUTTON "&Nächste",AFX_ID_PREVIEW_NEXT,46,2,44,15 + PUSHBUTTON "&Vorherige",AFX_ID_PREVIEW_PREV,91,2,44,15 + PUSHBUTTON "",AFX_ID_PREVIEW_NUMPAGE,136,2,44,15 + PUSHBUTTON "Ver&größern",AFX_ID_PREVIEW_ZOOMIN,181,2,44,15 + PUSHBUTTON "Ver&kleinern",AFX_ID_PREVIEW_ZOOMOUT,226,2,44,15 + PUSHBUTTON "&Schließen",AFX_ID_PREVIEW_CLOSE,271,2,44,15 +END + +// short toolbar for 9" and 12" screens +AFX_IDD_PREVIEW_SHORTTOOLBAR DIALOG PRELOAD DISCARDABLE 0, 0, 270, 19 +STYLE WS_CHILD | CBRS_TOP +BEGIN + PUSHBUTTON "&Drucken...",AFX_ID_PREVIEW_PRINT,1,2,44,15 + PUSHBUTTON "&Nächste",AFX_ID_PREVIEW_NEXT,46,2,29,15 + PUSHBUTTON "&Vorh.",AFX_ID_PREVIEW_PREV,76,2,29,15 + PUSHBUTTON "",AFX_ID_PREVIEW_NUMPAGE,106,2,44,15 + PUSHBUTTON "&Größer",AFX_ID_PREVIEW_ZOOMIN,151,2,29,15 + PUSHBUTTON "&Kleiner",AFX_ID_PREVIEW_ZOOMOUT,181,2,29,15 + PUSHBUTTON "&Schließen",AFX_ID_PREVIEW_CLOSE,211,2,44,15 +END +#endif + +// Printing strings +STRINGTABLE DISCARDABLE +BEGIN + // print progress dialog strings + AFX_IDS_PRINTONPORT, "auf %1" // for print output + AFX_IDS_ONEPAGE, "&Eine Seite" // for preview button + AFX_IDS_TWOPAGE, "&Zwei Seiten" // for preview button + AFX_IDS_PRINTPAGENUM, "Seite %u" // for print output + AFX_IDS_PREVIEWPAGEDESC, "Page %u\nPages %u-%u\n" + + // print to file dialog strings + AFX_IDS_PRINTDEFAULTEXT, "prn" // default extension + AFX_IDS_PRINTDEFAULT, "Output.prn" // default file + AFX_IDS_PRINTFILTER, + "Printer Files (*.prn)|*.prn|All Files (*.*)|*.*||" + AFX_IDS_PRINTCAPTION, "Print to File" // caption for browse dlg + AFX_IDS_PRINTTOFILE, "to %1" // to file +END + +// Print Preview Accelerator Table +AFX_IDR_PREVIEW_ACCEL ACCELERATORS LOADONCALL MOVEABLE +BEGIN + VK_NEXT, AFX_ID_PREVIEW_NEXT, VIRTKEY, NOINVERT + VK_PRIOR, AFX_ID_PREVIEW_PREV, VIRTKEY, NOINVERT + VK_ESCAPE, AFX_ID_PREVIEW_CLOSE, VIRTKEY, NOINVERT +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXPRINT_RC__ diff --git a/public/sdk/inc/mfc30/l.deu/afxres.aps b/public/sdk/inc/mfc30/l.deu/afxres.aps Binary files differnew file mode 100644 index 000000000..a21408b2f --- /dev/null +++ b/public/sdk/inc/mfc30/l.deu/afxres.aps diff --git a/public/sdk/inc/mfc30/l.deu/afxres.rc b/public/sdk/inc/mfc30/l.deu/afxres.rc new file mode 100644 index 000000000..56eeb46f1 --- /dev/null +++ b/public/sdk/inc/mfc30/l.deu/afxres.rc @@ -0,0 +1,177 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXRES_RC__ +#define __AFXRES_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< Cannot change standard MFC resources! >\0" +END +#endif //APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// Default resource description for MFC applications +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Strings + +STRINGTABLE +BEGIN + AFX_IDS_OPENFILE, "Öffnen" +#ifndef _MAC + AFX_IDS_SAVEFILE, "Speichern unter" + AFX_IDS_ALLFILTER, "Alle Dateien (*.*)" + AFX_IDS_UNTITLED, "Unbenannt" +#else + AFX_IDS_SAVEFILE, "Dokument speichern unter:" + AFX_IDS_ALLFILTER, "Alle Dateien" + AFX_IDS_UNTITLED, "unbenannt" + AFX_IDS_ABOUT, "Info " +#endif + + // General error prompts + AFX_IDP_INVALID_FILENAME, "Ungültiger Dateiname." + AFX_IDP_FAILED_TO_OPEN_DOC, "Das Öffnen des Dokuments ist fehlgeschlagen." + AFX_IDP_FAILED_TO_SAVE_DOC, "Das Speichern des Dokuments ist fehlgeschlagen." +#ifndef _MAC + AFX_IDP_ASK_TO_SAVE, "Änderungen in %1 speichern?" +#else + AFX_IDP_ASK_TO_SAVE, "Änderungen im %1-Dokument \042%2\042 speichern?" +#endif + AFX_IDP_FAILED_TO_CREATE_DOC, "Die Erzeugung eines leeren Dokuments ist fehlgeschlagen." + AFX_IDP_FILE_TOO_LARGE, "Die Datei ist zu groß zum Öffnen." + AFX_IDP_FAILED_TO_START_PRINT, "Der Druckauftrag konnte nicht gestartet werden." + AFX_IDP_FAILED_TO_LAUNCH_HELP, "Die Hilfe konnte nicht aufgerufen werden." + AFX_IDP_INTERNAL_FAILURE, "Interner Anwendungsfehler." + AFX_IDP_COMMAND_FAILURE, "Befehl fehlgeschlagen." + AFX_IDP_FAILED_MEMORY_ALLOC "Nicht genügend Speicher vorhanden, um Operation auszuführen." + AFX_IDP_GET_NOT_SUPPORTED, "Lesen ist wegen der Eigenschaft Nur-Schreiben nicht möglich." + AFX_IDP_SET_NOT_SUPPORTED, "Schreiben ist wegen der Eigenschaft Nur-Lesen nicht möglich." + + // CFile/CArchive error strings for user failure + AFX_IDP_FAILED_INVALID_FORMAT "Unerwartetes Dateiformat." +#ifndef _MAC + AFX_IDP_FAILED_INVALID_PATH "%1\nDiese Datei konnte nicht gefunden werden.\nÜberprüfen Sie, ob der korrekte Pfad und Dateiname angegeben wurde." + AFX_IDP_FAILED_DISK_FULL "Das Ziellaufwerk ist voll." +#else + AFX_IDP_FAILED_INVALID_PATH "Die Datei \042%1\042 konnte nicht gefunden werden. Überprüfen Sie, ob der korrekte Dateiname angegeben wurde." + AFX_IDP_FAILED_DISK_FULL "Das Zielvolume ist voll." +#endif + AFX_IDP_FAILED_ACCESS_READ "Lesen von %1 ist nicht möglich, da von jemand Anderem geöffnet." + AFX_IDP_FAILED_ACCESS_WRITE "Schreiben auf %1 ist nicht möglich, da schreibgeschützt oder von jemand Anderem geöffnet." + AFX_IDP_FAILED_IO_ERROR_READ "Beim Lesen von %1 ist ein unerwarteter Fehler aufgetreten." + AFX_IDP_FAILED_IO_ERROR_WRITE "Beim Schreiben von %1 ist ein unerwarteter Fehler aufgetreten." + + // Parsing error prompts + AFX_IDP_PARSE_INT, "Geben Sie bitte eine ganze Zahl ein." + AFX_IDP_PARSE_REAL, "Geben Sie bitte ein Zahl ein." + AFX_IDP_PARSE_INT_RANGE, "Geben Sie bitte eine ganze Zahl zwischen %1 und %2 ein." + AFX_IDP_PARSE_REAL_RANGE, "Geben Sie bitte eine Zahl zwischen %1 und %2 ein." + AFX_IDP_PARSE_STRING_SIZE, "Geben Sie bitte nicht mehr als %1 Zeichen ein." + AFX_IDP_PARSE_RADIO_BUTTON, "Wählen Sie bitte eine Schaltfläche." + AFX_IDP_PARSE_BYTE, "Bitte geben Sie einen ganzzahligen Wert zwischen 0 und 255 ein." + AFX_IDP_PARSE_UINT, "Bitte geben Sie einen positiven, ganzzahligen Wert ein." + +#ifndef _AFX_NO_PROPSHEET_RESOURCES + // Property Sheet button strings (Note: 50 is the X-axis button size) + AFX_IDS_PS_OK "OK\n50" + AFX_IDS_PS_CANCEL "Abbrechen\n50" + AFX_IDS_PS_APPLY_NOW "&Anwenden\n50" + AFX_IDS_PS_HELP "&Hilfe\n50" + AFX_IDS_PS_CLOSE "Schließen" +#endif //!_AFX_NO_PROPSHEET_RESOURCES + +#ifndef _AFX_NO_OLE_RESOURCES + // OLE strings required for both servers and containers + AFX_IDS_PASTELINKEDTYPE "Verknupft: %s" + AFX_IDS_UNKNOWNTYPE "Unbekannter Typ" +#ifndef _MAC + AFX_IDP_FAILED_TO_NOTIFY "%1\nRegistrierung des Dokuments nicht möglich.\nDas Dokument ist vielleicht schon geöffnet." +#else + AFX_IDP_FAILED_TO_NOTIFY "Registrierung des Dokuments \042%1\042 nicht möglich.\nDas Dokument ist vielleicht schon geöffnet." +#endif +#endif //!_AFX_NO_OLE_RESOURCES + +#ifndef _AFX_NO_MAPI_RESOURCES + // MAPI strings / error messages + AFX_IDP_FAILED_MAPI_LOAD "Mail System-Unterstützung kann nicht geladen werden." + AFX_IDP_INVALID_MAPI_DLL "Mail System-DLL ist ungültig." + AFX_IDP_FAILED_MAPI_SEND "Nachricht Senden versagte beim Senden der Nachricht." +#endif //!_AFX_NO_MAPI_RESOURCES +END + +///////////////////////////////////////////////////////////////////////////// +// Cursors + +AFX_IDC_CONTEXTHELP CURSOR DISCARDABLE "res\\help.cur" + +#ifndef _AFX_NO_SPLITTER_RESOURCES +AFX_IDC_SMALLARROWS CURSOR DISCARDABLE "res\\sarrows.cur" +AFX_IDC_HSPLITBAR CURSOR DISCARDABLE "res\\splith.cur" +AFX_IDC_VSPLITBAR CURSOR DISCARDABLE "res\\splitv.cur" +AFX_IDC_NODROPCRSR CURSOR DISCARDABLE "res\\nodrop.cur" +#endif //!_AFX_NO_SPLITTER_RESOURCES + +#ifndef _AFX_NO_TRACKER_RESOURCES +AFX_IDC_TRACKNWSE CURSOR DISCARDABLE "res\\trcknwse.cur" +AFX_IDC_TRACKNESW CURSOR DISCARDABLE "res\\trcknesw.cur" +AFX_IDC_TRACKNS CURSOR DISCARDABLE "res\\trckns.cur" +AFX_IDC_TRACKWE CURSOR DISCARDABLE "res\\trckwe.cur" +AFX_IDC_TRACK4WAY CURSOR DISCARDABLE "res\\trck4way.cur" +AFX_IDC_MOVE4WAY CURSOR DISCARDABLE "res\\move4way.cur" +#endif //!_AFX_NO_TRACKER_RESOURCES + +///////////////////////////////////////////////////////////////////////////// +// Standard Dialogs + +AFX_IDD_NEWTYPEDLG DIALOG DISCARDABLE 9, 26, 183, 70 +#ifndef _MAC +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | 0x04 +#else +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +#endif +CAPTION "Neu" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "&Neu",IDC_STATIC,6,5,123,8,NOT WS_GROUP + LISTBOX AFX_IDC_LISTBOX,6,15,125,49,WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "OK",IDOK,137,6,40,14 + PUSHBUTTON "Cancel",IDCANCEL,137,23,40,14 + PUSHBUTTON "&Help",ID_HELP,137,43,40,14 +END + +///////////////////////////////////////////////////////////////////////////// +// Property Sheet Bitmaps + +#ifndef _AFX_NO_PROPERTY_RESOURCES +AFX_IDB_SCROLL BITMAP DISCARDABLE "res\\psscroll.bmp" +#endif //!_AFX_NO_PROPERTY_RESOURCES + +///////////////////////////////////////////////////////////////////////////// +// CMiniFrameWnd Bitmap + +AFX_IDB_MINIFRAME_MENU BITMAP DISCARDABLE "res\\minifwnd.bmp" + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //!__AFXRES_RC__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/l.fra/afxdb.rc b/public/sdk/inc/mfc30/l.fra/afxdb.rc new file mode 100644 index 000000000..69ec3e8d0 --- /dev/null +++ b/public/sdk/inc/mfc30/l.fra/afxdb.rc @@ -0,0 +1,83 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992-1993 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXDB_RC__ +#define __AFXDB_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< Cannot change standard MFC resources! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// Database Resources + +// Database strings +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDP_SQL_CONNECT_FAIL + "Tentative infructueuse de connexion à la source de données" + AFX_IDP_SQL_RECORDSET_FORWARD_ONLY + "Le jeu d'enregistrements n'accepte que les déplacements vers l'avant." + AFX_IDP_SQL_EMPTY_COLUMN_LIST + "Tentative infructueuse d'ouverture de table - colonnes à extraire introuvables à l'endroit spécifié." + AFX_IDP_SQL_FIELD_SCHEMA_MISMATCH + "La requête a renvoyé des types de données de colonnes inattendus." + AFX_IDP_SQL_ILLEGAL_MODE "Tentative infructueuse de Mise à jour ou de Suppression." + AFX_IDP_SQL_MULTIPLE_ROWS_AFFECTED "Plusieurs lignes ont été mises à jour." + AFX_IDP_SQL_NO_CURRENT_RECORD "L'opération a échoué, pas d'enregistrement en cours" + AFX_IDP_SQL_NO_ROWS_AFFECTED + "Aucune ligne n'a été affectée par l'opération de mise à jour ou de suppression." + AFX_IDP_SQL_RECORDSET_READONLY "Le jeu d'enregistrements est en lecture seule" + AFX_IDP_SQL_SQL_NO_TOTAL + "Le pilote ODBC ne gère pas le modèle de donnée MFC LongBinary." + AFX_IDP_SQL_ODBC_LOAD_FAILED + "Tentative infructueuse de chargement de l'élément ODBC32.DLL." + AFX_IDP_SQL_DYNASET_NOT_SUPPORTED + "Le gestionnaire ODBC ne prend pas en charge les feuilles de réponses dynamiques." + AFX_IDP_SQL_SNAPSHOT_NOT_SUPPORTED + "Curseurs ODBC statiques requis pour la prise en charge des instantanés." + AFX_IDP_SQL_API_CONFORMANCE + "Gestionnaire ODBC incompatible avec les classes de bases de données MFC (API_CONFORMANCE >= SQL_OAC_LEVEL1 requis)." + AFX_IDP_SQL_SQL_CONFORMANCE + "Gestionnaire ODBC incompatible avec les classes de bases de données MFC (SQL_CONFORMANCE >= SQL_OSC_MINIMUM requis)." + AFX_IDP_SQL_NO_DATA_FOUND + "Tentative de défilement après la fin ou avant le début des données." + AFX_IDP_SQL_ROW_UPDATE_NOT_SUPPORTED + "Feuilles de réponses dynamiques non prises en charge par le gestionnaire ODBC." + AFX_IDP_SQL_ODBC_V2_REQUIRED + "Gestionnaire ODBC conforme Niveau 2 (Level 2) requis." + AFX_IDP_SQL_NO_POSITIONED_UPDATES + "Les mises à jour programmées ne sont pas prises en charge par le gestionnaire ODBC." + AFX_IDP_SQL_LOCK_MODE_NOT_SUPPORTED + "Le mode de verrouillage requis n'est pas accepté." + AFX_IDP_SQL_DATA_TRUNCATED + "Données tronquées." + AFX_IDP_SQL_ROW_FETCH + "Erreur pendant la recherhe d'un enregistrement." + AFX_IDP_SQL_INCORRECT_ODBC + "Un point d'entrée ODBC requis est introuvable. Vérifiez qu'ODBC est correctement installé." + AFX_IDP_SQL_UPDATE_DELETE_FAILED + "Une Mise à jour ou Suppression a echouée." +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXDB_RC__ diff --git a/public/sdk/inc/mfc30/l.fra/afxolecl.rc b/public/sdk/inc/mfc30/l.fra/afxolecl.rc new file mode 100644 index 000000000..94657e1e3 --- /dev/null +++ b/public/sdk/inc/mfc30/l.fra/afxolecl.rc @@ -0,0 +1,60 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXOLECL_RC__ +#define __AFXOLECL_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifndef _INC_DLGS +#include <dlgs.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< Cannot change standard MFC resources! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// OLE Client Resources + +///////////////////////////////////////////////////////////////////////////// +// OLE strings + +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDP_STATIC_OBJECT "Avertissement : Objet statique inattendu." + AFX_IDP_FAILED_TO_CONNECT "La connection a échoué. \nLa liaison est peut être rompue." + AFX_IDP_SERVER_BUSY "Impossible d'exécuter la commande, le serveur est occupé." + AFX_IDP_BAD_VERB "Erreur lors de l'exécution de l'opération par l'application serveur." + AFX_IDP_FAILED_TO_LAUNCH "Erreur lors du démarrage d'une application serveur." + AFX_IDS_APP_TITLE_INPLACE "%1 dans %2" + AFX_IDS_UPDATING_ITEMS "Mise à jour des objets OLE" + AFX_IDP_FAILED_TO_CONVERT "La conversion de l'objet OLE a échoué." + AFX_IDP_ASK_TO_DISCARD "Impossible d'enregistrer des objets OLE lorsque vous quittez Windows!\nSupprimer toutes les modifications apportées à %1?" + + AFX_IDS_METAFILE_FORMAT "Image (métafichier)\na image" + AFX_IDS_DIB_FORMAT "Image en mode point indépendante du périphérique\na image en mode point indépendante du périphérique" + AFX_IDS_BITMAP_FORMAT "Image en mode point\na image en mode point" + AFX_IDS_LINKSOURCE_FORMAT "%s\n%s" + AFX_IDS_EMBED_FORMAT "%s\n%s" +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXOLECL_RC__ diff --git a/public/sdk/inc/mfc30/l.fra/afxolesv.rc b/public/sdk/inc/mfc30/l.fra/afxolesv.rc new file mode 100644 index 000000000..ef54b5d8f --- /dev/null +++ b/public/sdk/inc/mfc30/l.fra/afxolesv.rc @@ -0,0 +1,53 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXOLESV_RC__ +#define __AFXOLESV_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< Cannot change standard MFC resources! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// OLE Server Resources + +// OLE strings +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDP_ASK_TO_UPDATE, "Mettre à jour %1 avant de continuer?" + AFX_IDP_FAILED_TO_UPDATE, "Impossible de mettre à jour le client." + + AFX_IDP_FAILED_TO_REGISTER, "L'enregistrement a échoué. Il se peut que les fonctions OLE ne fonctionnent pas correctement." + AFX_IDP_FAILED_TO_AUTO_REGISTER, "La mise à jour du registre du système a échoué. \nEssayez d'utiliser REGEDIT." +END + +STRINGTABLE PRELOAD +BEGIN + AFX_IDS_APP_TITLE_EMBEDDING, "%1 dans %2" + AFX_IDS_OBJ_TITLE_INPLACE, "%1 - %2" + AFX_IDS_EXIT_MENU, "&Quitter et retourner à %1" + AFX_IDS_UPDATE_MENU, "Mise à jo&ur de %1" + AFX_IDS_SAVEFILECOPY, "Enregistrer la copie sous" +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXOLESV_RC__ diff --git a/public/sdk/inc/mfc30/l.fra/afxprint.rc b/public/sdk/inc/mfc30/l.fra/afxprint.rc new file mode 100644 index 000000000..6b6b38b34 --- /dev/null +++ b/public/sdk/inc/mfc30/l.fra/afxprint.rc @@ -0,0 +1,130 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXPRINT_RC__ +#define __AFXPRINT_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< Cannot change standard MFC resources! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// Printing Resources + +AFX_IDC_MAGNIFY CURSOR DISCARDABLE "res\\magnify.cur" + +#ifndef _MAC +AFX_IDD_PRINTDLG DIALOG DISCARDABLE 6, 18, 133, 95 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | 0x04 +#else +AFX_IDD_PRINTDLG DIALOG DISCARDABLE 6, 18, 133, 84 +STYLE DS_MODALFRAME | WS_POPUP +#endif +FONT 8, "MS Shell Dlg" +BEGIN + CTEXT "Impression",IDC_STATIC,0,9,133,8 + CTEXT "",AFX_IDC_PRINT_DOCNAME,0,19,133,8 +#ifndef _MAC + CTEXT "sur",IDC_STATIC,0,29,133,8 + CTEXT "",AFX_IDC_PRINT_PRINTERNAME,0,39,133,8 + CTEXT "",AFX_IDC_PRINT_PORTNAME,0,49,133,8 + CTEXT "",AFX_IDC_PRINT_PAGENUM,0,59,133,8 + PUSHBUTTON "Annuler",IDCANCEL,46,74,40,14 +#else + CTEXT "",AFX_IDC_PRINT_PAGENUM,0,30,133,8 + PUSHBUTTON "Annuler",IDCANCEL,46,45,40,15 + CTEXT "Appuyer sur Cmd-. pour annuler l'impression.",IDC_STATIC,0,63,133,16 +#endif +END + +// Preview Toolbar Dialog +#ifndef _MAC +AFX_IDD_PREVIEW_TOOLBAR DIALOG PRELOAD DISCARDABLE 0, 0, 330, 16 +STYLE WS_CHILD | 0x04 +FONT 8, "MS Shell Dlg" +BEGIN + PUSHBUTTON "&Imprimer...",AFX_ID_PREVIEW_PRINT,2,2,44,12 + PUSHBUTTON "&Suivante",AFX_ID_PREVIEW_NEXT,48,2,44,12 + PUSHBUTTON "&Précédente",AFX_ID_PREVIEW_PREV,94,2,44,12 + PUSHBUTTON "",AFX_ID_PREVIEW_NUMPAGE,140,2,44,12 + PUSHBUTTON "Zoom ava&nt",AFX_ID_PREVIEW_ZOOMIN,186,2,44,12 + PUSHBUTTON "Zoom a&rrière",AFX_ID_PREVIEW_ZOOMOUT,232,2,44,12 + PUSHBUTTON "&Fermer",AFX_ID_PREVIEW_CLOSE,278,2,44,12 +END +#else +// standard toolbar for 14" and larger screens +// width *must* be 320 or less so that this is used on 640x480 screens +AFX_IDD_PREVIEW_TOOLBAR DIALOG PRELOAD DISCARDABLE 0, 0, 320, 19 +STYLE WS_CHILD | CBRS_TOP +BEGIN + PUSHBUTTON "&Imprimer...",AFX_ID_PREVIEW_PRINT,1,2,44,15 + PUSHBUTTON "&Suivante",AFX_ID_PREVIEW_NEXT,46,2,44,15 + PUSHBUTTON "&Précédente",AFX_ID_PREVIEW_PREV,91,2,44,15 + PUSHBUTTON "",AFX_ID_PREVIEW_NUMPAGE,136,2,44,15 + PUSHBUTTON "Ava&nt",AFX_ID_PREVIEW_ZOOMIN,181,2,44,15 + PUSHBUTTON "A&rrière",AFX_ID_PREVIEW_ZOOMOUT,226,2,44,15 + PUSHBUTTON "&Fermer",AFX_ID_PREVIEW_CLOSE,271,2,44,15 +END + +// short toolbar for 9" and 12" screens +AFX_IDD_PREVIEW_SHORTTOOLBAR DIALOG PRELOAD DISCARDABLE 0, 0, 270, 19 +STYLE WS_CHILD | CBRS_TOP +BEGIN + PUSHBUTTON "&Imprimer...",AFX_ID_PREVIEW_PRINT,1,2,44,15 + PUSHBUTTON "&Suivant",AFX_ID_PREVIEW_NEXT,46,2,29,15 + PUSHBUTTON "&Précédent",AFX_ID_PREVIEW_PREV,76,2,29,15 + PUSHBUTTON "",AFX_ID_PREVIEW_NUMPAGE,106,2,44,15 + PUSHBUTTON "&Avant",AFX_ID_PREVIEW_ZOOMIN,151,2,29,15 + PUSHBUTTON "A&rrière",AFX_ID_PREVIEW_ZOOMOUT,181,2,29,15 + PUSHBUTTON "&Fermer",AFX_ID_PREVIEW_CLOSE,211,2,44,15 +END +#endif + +// Printing strings +STRINGTABLE DISCARDABLE +BEGIN + // print progress dialog strings + AFX_IDS_PRINTONPORT, "on %1" // for print output + AFX_IDS_ONEPAGE, "&Une page" // for preview button + AFX_IDS_TWOPAGE, "&Deux pages" // for preview button + AFX_IDS_PRINTPAGENUM, "Page %u" // for print output + AFX_IDS_PREVIEWPAGEDESC, "Page %u\nPages %u-%u\n" + + // print to file dialog strings + AFX_IDS_PRINTDEFAULTEXT, "prn" // default extension + AFX_IDS_PRINTDEFAULT, "Output.prn" // default file + AFX_IDS_PRINTFILTER, + "Printer Files (*.prn)|*.prn|All Files (*.*)|*.*||" + AFX_IDS_PRINTCAPTION, "Print to File" // caption for browse dlg + AFX_IDS_PRINTTOFILE, "to %1" // to file +END + +// Print Preview Accelerator Table +AFX_IDR_PREVIEW_ACCEL ACCELERATORS LOADONCALL MOVEABLE +BEGIN + VK_NEXT, AFX_ID_PREVIEW_NEXT, VIRTKEY, NOINVERT + VK_PRIOR, AFX_ID_PREVIEW_PREV, VIRTKEY, NOINVERT + VK_ESCAPE, AFX_ID_PREVIEW_CLOSE, VIRTKEY, NOINVERT +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXPRINT_RC__ diff --git a/public/sdk/inc/mfc30/l.fra/afxres.rc b/public/sdk/inc/mfc30/l.fra/afxres.rc new file mode 100644 index 000000000..a815d401c --- /dev/null +++ b/public/sdk/inc/mfc30/l.fra/afxres.rc @@ -0,0 +1,177 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXRES_RC__ +#define __AFXRES_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< Cannot change standard MFC resources! >\0" +END +#endif //APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// Default resource description for MFC applications +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Strings + +STRINGTABLE +BEGIN + AFX_IDS_OPENFILE, "Ouvrir" +#ifndef _MAC + AFX_IDS_SAVEFILE, "Enregistrer sous" + AFX_IDS_ALLFILTER, "Tous les fichiers (*.*)" + AFX_IDS_UNTITLED, "Sans nom" +#else + AFX_IDS_SAVEFILE, "Enregistrer le document sous :" + AFX_IDS_ALLFILTER, "Tous les fichiers" + AFX_IDS_UNTITLED, "sans nom" + AFX_IDS_ABOUT, "A propos de" +#endif + + // General error prompts + AFX_IDP_INVALID_FILENAME, "Nom de fichier incorrect." + AFX_IDP_FAILED_TO_OPEN_DOC, "L'ouverture du document a échoué." + AFX_IDP_FAILED_TO_SAVE_DOC, "L'enregistrement du document a échoué." +#ifndef _MAC + AFX_IDP_ASK_TO_SAVE, "Enregistrer les modifications apportées à %1?" +#else + AFX_IDP_ASK_TO_SAVE, "Enregistrer les modifications apportées au document %1 \042%2\042?" +#endif + AFX_IDP_FAILED_TO_CREATE_DOC, "La création d'un document vide a échoué." + AFX_IDP_FILE_TOO_LARGE, "Le fichier est trop volumineux pour être ouvert." + AFX_IDP_FAILED_TO_START_PRINT, "Impossible de lancer l'impression." + AFX_IDP_FAILED_TO_LAUNCH_HELP, "Le démarrage de l'aide a échoué." + AFX_IDP_INTERNAL_FAILURE, "Erreur d'application interne." + AFX_IDP_COMMAND_FAILURE, "La commande a échoué." + AFX_IDP_FAILED_MEMORY_ALLOC "Mémoire insuffisante pour exécuter l'opération." + AFX_IDP_GET_NOT_SUPPORTED, "Impossible de lire une propriété en écriture seule." + AFX_IDP_SET_NOT_SUPPORTED, "Impossible d'écrire une propriété en lecture seule." + + // CFile/CArchive error strings for user failure + AFX_IDP_FAILED_INVALID_FORMAT "Format de fichier inattendu." +#ifndef _MAC + AFX_IDP_FAILED_INVALID_PATH "%1\nImpossible de trouver ce fichier. Vérifiez que le chemin et le nom du fichier sont corrects." + AFX_IDP_FAILED_DISK_FULL "Le lecteur de disque de destination est plein." +#else + AFX_IDP_FAILED_INVALID_PATH "Impossible de trouver le fichier \042%1.\042. Vérifiez que le nom du fichier est correct." + AFX_IDP_FAILED_DISK_FULL "Le disque de destination est plein." +#endif + AFX_IDP_FAILED_ACCESS_READ "Impossible de lire à partir de %1, il est en cours d'utilisation." + AFX_IDP_FAILED_ACCESS_WRITE "Impossible d'écrire sur %1, il est en lecture seule ou en cours d'utilisation." + AFX_IDP_FAILED_IO_ERROR_READ "Une erreur inattendue s'est produite lors de la lecture de %1." + AFX_IDP_FAILED_IO_ERROR_WRITE "Une erreur inattendue s'est produite lors de l'écriture sur %1." + + // Parsing error prompts + AFX_IDP_PARSE_INT, "Tapez un nombre entier." + AFX_IDP_PARSE_REAL, "Tapez un nombre." + AFX_IDP_PARSE_INT_RANGE, "Tapez un nombre entier compris entre %1 et %2." + AFX_IDP_PARSE_REAL_RANGE, "Tapez un nombre compris entre %1 et %2." + AFX_IDP_PARSE_STRING_SIZE, "Tapez %1 caractères au maximum." + AFX_IDP_PARSE_RADIO_BUTTON, "Choisissez un bouton." + AFX_IDP_PARSE_BYTE, "Veuillez entrer un entier entre 0 et 255." + AFX_IDP_PARSE_UINT, "Veuillez entrer un entier positif." + +#ifndef _AFX_NO_PROPSHEET_RESOURCES + // Property Sheet button strings (Note: 50 is the X-axis button size) + AFX_IDS_PS_OK "OK\n50" + AFX_IDS_PS_CANCEL "Annuler\n50" + AFX_IDS_PS_APPLY_NOW "&Appliquer\n50" + AFX_IDS_PS_HELP "&Aide\n50" + AFX_IDS_PS_CLOSE "Fermer" +#endif //!_AFX_NO_PROPSHEET_RESOURCES + +#ifndef _AFX_NO_OLE_RESOURCES + // OLE strings required for both servers and containers + AFX_IDS_PASTELINKEDTYPE "%s lié(e)" + AFX_IDS_UNKNOWNTYPE "Type inconnu" +#ifndef _MAC + AFX_IDP_FAILED_TO_NOTIFY "%1\nImpossible d'enregistrer le document. \nLe document est peut-être déjà ouvert." +#else + AFX_IDP_FAILED_TO_NOTIFY "Impossible d'enregistrer le document \042%1.\042. Le document est peut-être déjà ouvert." +#endif +#endif //!_AFX_NO_OLE_RESOURCES + +#ifndef _AFX_NO_MAPI_RESOURCES + // MAPI strings / error messages + AFX_IDP_FAILED_MAPI_LOAD "Impossible de charger le système de support du courrier." + AFX_IDP_INVALID_MAPI_DLL "La DLL système du courrier n'est aps valide." + AFX_IDP_FAILED_MAPI_SEND "Le système de courrier n'a pas pu envoyer le message." +#endif //!_AFX_NO_MAPI_RESOURCES +END + +///////////////////////////////////////////////////////////////////////////// +// Cursors + +AFX_IDC_CONTEXTHELP CURSOR DISCARDABLE "res\\help.cur" + +#ifndef _AFX_NO_SPLITTER_RESOURCES +AFX_IDC_SMALLARROWS CURSOR DISCARDABLE "res\\sarrows.cur" +AFX_IDC_HSPLITBAR CURSOR DISCARDABLE "res\\splith.cur" +AFX_IDC_VSPLITBAR CURSOR DISCARDABLE "res\\splitv.cur" +AFX_IDC_NODROPCRSR CURSOR DISCARDABLE "res\\nodrop.cur" +#endif //!_AFX_NO_SPLITTER_RESOURCES + +#ifndef _AFX_NO_TRACKER_RESOURCES +AFX_IDC_TRACKNWSE CURSOR DISCARDABLE "res\\trcknwse.cur" +AFX_IDC_TRACKNESW CURSOR DISCARDABLE "res\\trcknesw.cur" +AFX_IDC_TRACKNS CURSOR DISCARDABLE "res\\trckns.cur" +AFX_IDC_TRACKWE CURSOR DISCARDABLE "res\\trckwe.cur" +AFX_IDC_TRACK4WAY CURSOR DISCARDABLE "res\\trck4way.cur" +AFX_IDC_MOVE4WAY CURSOR DISCARDABLE "res\\move4way.cur" +#endif //!_AFX_NO_TRACKER_RESOURCES + +///////////////////////////////////////////////////////////////////////////// +// Standard Dialogs + +AFX_IDD_NEWTYPEDLG DIALOG DISCARDABLE 9, 26, 183, 70 +#ifndef _MAC +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | 0x04 +#else +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +#endif +CAPTION "Nouveau" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "&Nouveau",IDC_STATIC,6,5,123,8,NOT WS_GROUP + LISTBOX AFX_IDC_LISTBOX,6,15,125,49,WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "OK",IDOK,137,6,40,14 + PUSHBUTTON "Annuler",IDCANCEL,137,23,40,14 + PUSHBUTTON "&Aide",ID_HELP,137,43,40,14 +END + +///////////////////////////////////////////////////////////////////////////// +// Property Sheet Bitmaps + +#ifndef _AFX_NO_PROPERTY_RESOURCES +AFX_IDB_SCROLL BITMAP DISCARDABLE "res\\psscroll.bmp" +#endif //!_AFX_NO_PROPERTY_RESOURCES + +///////////////////////////////////////////////////////////////////////////// +// CMiniFrameWnd Bitmap + +AFX_IDB_MINIFRAME_MENU BITMAP DISCARDABLE "res\\minifwnd.bmp" + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //!__AFXRES_RC__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/l.jpn/afxdb.rc b/public/sdk/inc/mfc30/l.jpn/afxdb.rc new file mode 100644 index 000000000..426c881d3 --- /dev/null +++ b/public/sdk/inc/mfc30/l.jpn/afxdb.rc @@ -0,0 +1,83 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992-1993 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXDB_RC__ +#define __AFXDB_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< •W€ MFC Ø¿°½‚Ì•ÏX‚Í‚Å‚«‚Ü‚¹‚ñ! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// Database Resources + +// Database strings +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDP_SQL_CONNECT_FAIL + "ÃÞ°À¿°½‚Ö‚ÌÚ‘±‚ÉŽ¸”s‚µ‚Ü‚µ‚½B" + AFX_IDP_SQL_RECORDSET_FORWARD_ONLY + "Úº°ÄÞ¾¯Ä‚ł̈ړ®‚͇•ûŒü‚Ì‚Ý»Îß°Ä‚³‚ê‚Ä‚¢‚Ü‚·B" + AFX_IDP_SQL_EMPTY_COLUMN_LIST + "ŒŸõ‚·‚é—ñ‚ªŽw’肳‚ê‚Ä‚¢‚È‚¢‚½‚ßAðÌÞÙ‚ðŠJ‚¯‚Ü‚¹‚ñ‚Å‚µ‚½B" + AFX_IDP_SQL_FIELD_SCHEMA_MISMATCH + "¸´Ø°‚Å—\Šú‚¹‚Ê—ñ‚ÌÃÞ°À À²Ìß‚ª•Ô‚³‚ê‚Ü‚µ‚½B" + AFX_IDP_SQL_ILLEGAL_MODE "XV‚Ü‚½‚Í휂Ɏ¸”s‚µ‚Ü‚µ‚½B" + AFX_IDP_SQL_MULTIPLE_ROWS_AFFECTED "•¡”‚Ìs‚ªXV‚³‚ê‚Ü‚µ‚½B" + AFX_IDP_SQL_NO_CURRENT_RECORD "¶ÚÝÄ Úº°ÄÞ‚ª‚È‚¢‚½‚ßA‘€ì‚ÉŽ¸”s‚µ‚Ü‚µ‚½B" + AFX_IDP_SQL_NO_ROWS_AFFECTED + "XV‚Ü‚½‚Í휑€ì‚ÌŒ‹‰ÊA•ÏX‚ð‚¤‚¯‚½s‚Í‚ ‚è‚Ü‚¹‚ñB" + AFX_IDP_SQL_RECORDSET_READONLY "Úº°ÄÞ¾¯Ä‚Íã‘‚«‹ÖŽ~‚Å‚·B" + AFX_IDP_SQL_SQL_NO_TOTAL + "ODBC ÄÞײÊÞ‚Í MFC LongBinary ÃÞ°À ÓÃÞÙ‚ðˆµ‚¦‚Ü‚¹‚ñB" + AFX_IDP_SQL_ODBC_LOAD_FAILED + "ODBC32.DLL ‚ÌÛ°ÄÞ‚ÉŽ¸”s‚µ‚Ü‚µ‚½B" + AFX_IDP_SQL_DYNASET_NOT_SUPPORTED + "ODBC ÄÞײÊÞ‚ÍÀ޲ž¯Ä‚ðˆµ‚¦‚Ü‚¹‚ñB" + AFX_IDP_SQL_SNAPSHOT_NOT_SUPPORTED + "ODBC ½À诸 ¶°¿Ù‚ɂͽůÌß¼®¯Ä‚Ì»Îß°Ä‚ª•K—v‚Å‚·B" + AFX_IDP_SQL_API_CONFORMANCE + "ODBC ÄÞײÊÞ‚Í MFC ÃÞ°ÀÍÞ°½ ¸×½‚ƌ݊·«‚ª‚ ‚è‚Ü‚¹‚ñ (API_CONFORMANCE >= SQL_OAC_LEVEL1 ‚ª•K—v‚Å‚·)B" + AFX_IDP_SQL_SQL_CONFORMANCE + "ODBC ÄÞײÊÞ‚Í MFC ÃÞ°ÀÍÞ°½ ¸×½‚ƌ݊·«‚ª‚ ‚è‚Ü‚¹‚ñ (SQL_CONFORMANCE >= SQL_OSC_MINIMUM ‚ª•K—v‚Å‚·)B" + AFX_IDP_SQL_NO_DATA_FOUND + "ÃÞ°À‚ÌI’[‚Ü‚½‚Í擪‚ð’´‚¦‚Ľ¸Û°Ù‚µ‚悤‚Æ‚µ‚Ä‚¢‚Ü‚·B" + AFX_IDP_SQL_ROW_UPDATE_NOT_SUPPORTED + "À޲ž¯Ä‚Í ODBC ÄÞײÊÞ‚Å»Îß°Ä‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB" + AFX_IDP_SQL_ODBC_V2_REQUIRED + "ODBC Level 2 ‚É€‹’‚µ‚½ÄÞײÊÞ‚ª•K—v‚Å‚·B" + AFX_IDP_SQL_NO_POSITIONED_UPDATES + "“Á’è‚̈ʒu‚ÌXV‚Í ODBC ÄÞײÊÞ‚Å»Îß°Ä‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB" + AFX_IDP_SQL_LOCK_MODE_NOT_SUPPORTED + "—v‹‚µ‚½Û¯¸ Ó°ÄÞ‚Í»Îß°Ä‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB" + AFX_IDP_SQL_DATA_TRUNCATED + "ÃÞ°À‚ÍØ‚èŽÌ‚Ä‚ç‚ê‚Ü‚µ‚½B" + AFX_IDP_SQL_ROW_FETCH + "Úº°ÄÞ‚ÌŒŸõ´×°B" + AFX_IDP_SQL_INCORRECT_ODBC + "—v‹‚µ‚½ ODBC ´ÝÄØ° Îß²ÝÄ‚ÍŒ©‚‚©‚è‚Ü‚¹‚ñBODBC ÄÞײÊÞ‚ª³‚µ‚²Ý½Ä°Ù‚³‚ꂽ‚©Šm”F‚µ‚Ä‚‚¾‚³‚¢B" + AFX_IDP_SQL_UPDATE_DELETE_FAILED + "XV–”‚Í휑€ì‚ÍŽ¸”s‚µ‚Ü‚µ‚½B" +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXDB_RC__ diff --git a/public/sdk/inc/mfc30/l.jpn/afxolecl.rc b/public/sdk/inc/mfc30/l.jpn/afxolecl.rc new file mode 100644 index 000000000..2e7d937d1 --- /dev/null +++ b/public/sdk/inc/mfc30/l.jpn/afxolecl.rc @@ -0,0 +1,60 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXOLECL_RC__ +#define __AFXOLECL_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifndef _INC_DLGS +#include <dlgs.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< •W€ MFC Ø¿°½‚Ì•ÏX‚Í‚Å‚«‚Ü‚¹‚ñ! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// OLE Client Resources + +///////////////////////////////////////////////////////////////////////////// +// OLE strings + +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDP_STATIC_OBJECT "Œx: —\Šú‚µ‚È‚¢½À诸 µÌÞ¼Þª¸Ä‚Å‚·B" + AFX_IDP_FAILED_TO_CONNECT "Ú‘±‚ÉŽ¸”s‚µ‚Ü‚µ‚½B\nØݸ‚ª‰ó‚ê‚Ä‚¢‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B" + AFX_IDP_SERVER_BUSY "ºÏÝÄÞ‚ðŽÀs‚Å‚«‚Ü‚¹‚ñB»°ÊÞ°‚ªËÞ¼Þ°‚Å‚·B" + AFX_IDP_BAD_VERB "»°ÊÞ°‚Ì‘€ì‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + AFX_IDP_FAILED_TO_LAUNCH "»°ÊÞ° ±Ìßع°¼®Ý‚ð‹N“®‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + AFX_IDS_APP_TITLE_INPLACE "%2 “à‚Ì %1" + AFX_IDS_UPDATING_ITEMS "OLE µÌÞ¼Þª¸Ä‚ðXV‚µ‚Ä‚¢‚Ü‚·" + AFX_IDP_FAILED_TO_CONVERT "OLE µÌÞ¼Þª¸Ä‚Ì•ÏŠ·‚ÉŽ¸”s‚µ‚Ü‚µ‚½B" + AFX_IDP_ASK_TO_DISCARD "Windows ‚ÌI—¹Žž‚É OLE µÌÞ¼Þª¸Ä‚ð•Û‘¶‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñB\n%1 ‚Ö‚Ì‚·‚ׂĂ̕ÏX‚ð”pŠü‚µ‚Ü‚·‚©H" + + AFX_IDS_METAFILE_FORMAT "Ë߸Á¬ (ÒÀ̧²Ù)\nË߸Á¬" + AFX_IDS_DIB_FORMAT "ÃÞÊÞ²½‚Ɉˑ¶‚µ‚È‚¢ËÞ¯ÄϯÌß\nÃÞÊÞ²½”ñˆË‘¶ËÞ¯ÄϯÌß" + AFX_IDS_BITMAP_FORMAT "ËÞ¯ÄϯÌß\nËÞ¯ÄϯÌß" + AFX_IDS_LINKSOURCE_FORMAT "%s\n%s" + AFX_IDS_EMBED_FORMAT "%s\n%s" +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXOLECL_RC__ diff --git a/public/sdk/inc/mfc30/l.jpn/afxolesv.rc b/public/sdk/inc/mfc30/l.jpn/afxolesv.rc new file mode 100644 index 000000000..2e561e357 --- /dev/null +++ b/public/sdk/inc/mfc30/l.jpn/afxolesv.rc @@ -0,0 +1,53 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXOLESV_RC__ +#define __AFXOLESV_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< •W€ MFC Ø¿°½‚Ì•ÏX‚Í‚Å‚«‚Ü‚¹‚ñ! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// OLE Server Resources + +// OLE strings +STRINGTABLE DISCARDABLE +BEGIN + AFX_IDP_ASK_TO_UPDATE, "æ‚É %1 ‚ðXV‚µ‚Ü‚·‚©H" + AFX_IDP_FAILED_TO_UPDATE, "¸×²±ÝÄ‚ðXV‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + + AFX_IDP_FAILED_TO_REGISTER, "“o˜^‚ÉŽ¸”s‚µ‚Ü‚µ‚½BOLE ‚Ì‹@”\‚ͳí‚É“®ì‚µ‚È‚¢‰Â”\«‚ª‚ ‚è‚Ü‚·B" + AFX_IDP_FAILED_TO_AUTO_REGISTER, "¼½ÃÑ Ú¼Þ½ÄØ‚ÌXV‚ÉŽ¸”s‚µ‚Ü‚µ‚½B\nREGEDIT ‚ðŽg—p‚µ‚ÄXV‚µ‚Ä‚‚¾‚³‚¢B" +END + +STRINGTABLE PRELOAD +BEGIN + AFX_IDS_APP_TITLE_EMBEDDING, "%2 “à‚Ì %1" + AFX_IDS_OBJ_TITLE_INPLACE, "%1 - %2" + AFX_IDS_EXIT_MENU, "I—¹‚µ‚Ä %1 ‚É–ß‚é(&X)" + AFX_IDS_UPDATE_MENU, "%1 ‚ðXV(&U)" + AFX_IDS_SAVEFILECOPY, "–¼‘O‚ð•t‚¯‚Ä•Û‘¶" +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXOLESV_RC__ diff --git a/public/sdk/inc/mfc30/l.jpn/afxprint.rc b/public/sdk/inc/mfc30/l.jpn/afxprint.rc new file mode 100644 index 000000000..ac52a30b4 --- /dev/null +++ b/public/sdk/inc/mfc30/l.jpn/afxprint.rc @@ -0,0 +1,130 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXPRINT_RC__ +#define __AFXPRINT_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< •W€ MFC Ø¿°½‚Ì•ÏX‚Í‚Å‚«‚Ü‚¹‚ñ! >\0" +END +#endif // APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// Printing Resources + +AFX_IDC_MAGNIFY CURSOR DISCARDABLE "res\\magnify.cur" + +#ifndef _MAC +AFX_IDD_PRINTDLG DIALOG DISCARDABLE 6, 18, 133, 95 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | 0x04 +#else +AFX_IDD_PRINTDLG DIALOG DISCARDABLE 6, 18, 133, 84 +STYLE DS_MODALFRAME | WS_POPUP +#endif +FONT 8, "System" +BEGIN + CTEXT "ˆóü’†",IDC_STATIC,0,9,133,8 + CTEXT "",AFX_IDC_PRINT_DOCNAME,0,19,133,8 +#ifndef _MAC + CTEXT "‚ð",IDC_STATIC,0,29,133,8 + CTEXT "",AFX_IDC_PRINT_PRINTERNAME,0,39,133,8 + CTEXT "",AFX_IDC_PRINT_PORTNAME,0,49,133,8 + CTEXT "",AFX_IDC_PRINT_PAGENUM,0,59,133,8 + PUSHBUTTON "·¬Ý¾Ù",IDCANCEL,46,74,40,14 +#else + CTEXT "",AFX_IDC_PRINT_PAGENUM,0,30,133,8 + PUSHBUTTON "·¬Ý¾Ù",IDCANCEL,46,45,40,15 + CTEXT "<Cmd>-. ·°‚ð‰Ÿ‚·‚Æ·¬Ý¾Ù‚µ‚Ü‚·B",IDC_STATIC,0,63,133,16 +#endif +END + +// Preview Toolbar Dialog +#ifndef _MAC +AFX_IDD_PREVIEW_TOOLBAR DIALOG PRELOAD DISCARDABLE 0, 0, 330, 16 +STYLE WS_CHILD | 0x04 +FONT 8, "System" +BEGIN + PUSHBUTTON "ˆóü(&P)...",AFX_ID_PREVIEW_PRINT,2,2,44,12 + PUSHBUTTON "ŽŸÍß°¼Þ(&N)",AFX_ID_PREVIEW_NEXT,48,2,44,12 + PUSHBUTTON "‘OÍß°¼Þ(&V)",AFX_ID_PREVIEW_PREV,94,2,44,12 + PUSHBUTTON "",AFX_ID_PREVIEW_NUMPAGE,140,2,44,12 + PUSHBUTTON "½Þ°Ñ ²Ý(&I)",AFX_ID_PREVIEW_ZOOMIN,186,2,44,12 + PUSHBUTTON "½Þ°Ñ ±³Ä(&O)",AFX_ID_PREVIEW_ZOOMOUT,232,2,44,12 + PUSHBUTTON "•Â‚¶‚é(&C)",AFX_ID_PREVIEW_CLOSE,278,2,44,12 +END +#else +// standard toolbar for 14" and larger screens +// width *must* be 320 or less so that this is used on 640x480 screens +AFX_IDD_PREVIEW_TOOLBAR DIALOG PRELOAD DISCARDABLE 0, 0, 320, 19 +STYLE WS_CHILD | CBRS_TOP +BEGIN + PUSHBUTTON "ˆóü(&P)...",AFX_ID_PREVIEW_PRINT,1,2,44,15 + PUSHBUTTON "ŽŸÍß°¼Þ(&N)",AFX_ID_PREVIEW_NEXT,46,2,44,15 + PUSHBUTTON "‘OÍß°¼Þ(&V)",AFX_ID_PREVIEW_PREV,91,2,44,15 + PUSHBUTTON "",AFX_ID_PREVIEW_NUMPAGE,136,2,44,15 + PUSHBUTTON "½Þ°Ñ ²Ý(&I)",AFX_ID_PREVIEW_ZOOMIN,181,2,44,15 + PUSHBUTTON "½Þ°Ñ ±³Ä(&O)",AFX_ID_PREVIEW_ZOOMOUT,226,2,44,15 + PUSHBUTTON "•Â‚¶‚é(&C)",AFX_ID_PREVIEW_CLOSE,271,2,44,15 +END + +// short toolbar for 9" and 12" screens +AFX_IDD_PREVIEW_SHORTTOOLBAR DIALOG PRELOAD DISCARDABLE 0, 0, 270, 19 +STYLE WS_CHILD | CBRS_TOP +BEGIN + PUSHBUTTON "ˆóü(&P)...",AFX_ID_PREVIEW_PRINT,1,2,44,15 + PUSHBUTTON "ŽŸ(&N)",AFX_ID_PREVIEW_NEXT,46,2,29,15 + PUSHBUTTON "‘O(&V)",AFX_ID_PREVIEW_PREV,76,2,29,15 + PUSHBUTTON "",AFX_ID_PREVIEW_NUMPAGE,106,2,44,15 + PUSHBUTTON "²Ý(&I)",AFX_ID_PREVIEW_ZOOMIN,151,2,29,15 + PUSHBUTTON "±³Ä(&O)",AFX_ID_PREVIEW_ZOOMOUT,181,2,29,15 + PUSHBUTTON "•Â‚¶‚é(&C)",AFX_ID_PREVIEW_CLOSE,211,2,44,15 +END +#endif + +// Printing strings +STRINGTABLE DISCARDABLE +BEGIN + // print progress dialog strings + AFX_IDS_PRINTONPORT, "%1 ‚Öo—Í’†" // for print output + AFX_IDS_ONEPAGE, "1 Íß°¼Þ(&O)" // for preview button + AFX_IDS_TWOPAGE, "2 Íß°¼Þ(&T)" // for preview button + AFX_IDS_PRINTPAGENUM, "Íß°¼Þ %u" // for print output + AFX_IDS_PREVIEWPAGEDESC, "Íß°¼Þ %u\nÍß°¼Þ %u-%u\n" + + // print to file dialog strings + AFX_IDS_PRINTDEFAULTEXT, "prn" // default extension + AFX_IDS_PRINTDEFAULT, "Output.prn" // default file + AFX_IDS_PRINTFILTER, + "Printer Files (*.prn)|*.prn|All Files (*.*)|*.*||" + AFX_IDS_PRINTCAPTION, "Print to File" // caption for browse dlg + AFX_IDS_PRINTTOFILE, "to %1" // to file +END + +// Print Preview Accelerator Table +AFX_IDR_PREVIEW_ACCEL ACCELERATORS LOADONCALL MOVEABLE +BEGIN + VK_NEXT, AFX_ID_PREVIEW_NEXT, VIRTKEY, NOINVERT + VK_PRIOR, AFX_ID_PREVIEW_PREV, VIRTKEY, NOINVERT + VK_ESCAPE, AFX_ID_PREVIEW_CLOSE, VIRTKEY, NOINVERT +END + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //__AFXPRINT_RC__ diff --git a/public/sdk/inc/mfc30/l.jpn/afxres.aps b/public/sdk/inc/mfc30/l.jpn/afxres.aps Binary files differnew file mode 100644 index 000000000..31ec2f278 --- /dev/null +++ b/public/sdk/inc/mfc30/l.jpn/afxres.aps diff --git a/public/sdk/inc/mfc30/l.jpn/afxres.rc b/public/sdk/inc/mfc30/l.jpn/afxres.rc new file mode 100644 index 000000000..6ca9b7f0d --- /dev/null +++ b/public/sdk/inc/mfc30/l.jpn/afxres.rc @@ -0,0 +1,177 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +#ifndef __AFXRES_RC__ +#define __AFXRES_RC__ + +#ifndef __AFXRES_H__ +#include <afxres.h> +#endif + +#ifdef APSTUDIO_INVOKED +// This will prevent the VC++ Resource Editor user from saving this file +1 TEXTINCLUDE DISCARDABLE +BEGIN +"< •W€ MFC Ø¿°½‚Ì•ÏX‚Í‚Å‚«‚Ü‚¹‚ñ! >\0" +END +#endif //APSTUDIO_INVOKED + +#ifndef _AFXDLL + +///////////////////////////////////////////////////////////////////////////// +// Default resource description for MFC applications +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// Strings + +STRINGTABLE +BEGIN + AFX_IDS_OPENFILE, "ŠJ‚" +#ifndef _MAC + AFX_IDS_SAVEFILE, "–¼‘O‚ð•t‚¯‚Ä•Û‘¶" + AFX_IDS_ALLFILTER, "‚·‚ׂĂÌ̧²Ù (*.*)" + AFX_IDS_UNTITLED, "Untitled" +#else + AFX_IDS_SAVEFILE, "ÄÞ·ÒÝÄ‚É–¼‘O‚ð•t‚¯‚Ä•Û‘¶:" + AFX_IDS_ALLFILTER, "‚·‚ׂĂÌ̧²Ù" + AFX_IDS_UNTITLED, "untitled" + AFX_IDS_ABOUT, "ÊÞ°¼Þ®Ýî•ñ " +#endif + + // General error prompts + AFX_IDP_INVALID_FILENAME, "–³Œø‚Ȩ̀²Ù–¼‚Å‚·B" + AFX_IDP_FAILED_TO_OPEN_DOC, "ÄÞ·ÒÝĂ̵°ÌßÝ‚ÉŽ¸”s‚µ‚Ü‚µ‚½B" + AFX_IDP_FAILED_TO_SAVE_DOC, "ÄÞ·ÒÝÄ‚Ì•Û‘¶‚ÉŽ¸”s‚µ‚Ü‚µ‚½B" +#ifndef _MAC + AFX_IDP_ASK_TO_SAVE, "%1 ‚Ö‚Ì•ÏX‚ð•Û‘¶‚µ‚Ü‚·‚©H" +#else + AFX_IDP_ASK_TO_SAVE, "%1 ÄÞ·ÒÝÄ \042%2\042 ‚Ö‚Ì•ÏX‚ð•Û‘¶‚µ‚Ü‚·‚©H" +#endif + AFX_IDP_FAILED_TO_CREATE_DOC, "‹ó‚ÌÄÞ·ÒÝÄ‚Ì쬂Ɏ¸”s‚µ‚Ü‚µ‚½B" + AFX_IDP_FILE_TOO_LARGE, "̧²Ù‚ª‘å‚«‚·‚¬‚ÄŠJ‚¯‚Ü‚¹‚ñB" + AFX_IDP_FAILED_TO_START_PRINT, "ˆóü‚ðŠJŽn‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B" + AFX_IDP_FAILED_TO_LAUNCH_HELP, "ÍÙÌß‚Ì‹N“®‚ÉŽ¸”s‚µ‚Ü‚µ‚½B" + AFX_IDP_INTERNAL_FAILURE, "±Ìßع°¼®Ý‚Ì“à•”´×°‚Å‚·B" + AFX_IDP_COMMAND_FAILURE, "ºÏÝÄÞ‚ÌŽÀs‚ÉŽ¸”s‚µ‚Ü‚µ‚½B" + AFX_IDP_FAILED_MEMORY_ALLOC "ŽÀs‚·‚邽‚ß‚ÌÒÓØ‚ª‘«‚è‚Ü‚¹‚ñB" + AFX_IDP_GET_NOT_SUPPORTED, "‘‚«ž‚Ýê—p‚ÌÌßÛÊßè‚©‚ç“Ç‚Ýo‚µ‚Ís‚¦‚Ü‚¹‚ñB" + AFX_IDP_SET_NOT_SUPPORTED, "“Ç‚Ýo‚µê—p‚ÌÌßÛÊßè‚É‘‚«ž‚Ý‚Ís‚¦‚Ü‚¹‚ñB" + + // CFile/CArchive error strings for user failure + AFX_IDP_FAILED_INVALID_FORMAT "—\Šú‚µ‚È‚¢Ì§²ÙŒ`Ž®‚Å‚·B" +#ifndef _MAC + AFX_IDP_FAILED_INVALID_PATH "%1\n‚±‚Ì̧²Ù‚ªŒ©‚‚©‚è‚Ü‚¹‚ñB\n³‚µ‚¢ÃÞ¨Ú¸ÄØ‚Æ̧²Ù–¼‚ðŠm”F‚µ‚Ä“ü—Í‚µ‚Ä‚‚¾‚³‚¢B" + AFX_IDP_FAILED_DISK_FULL "o—Íæ‚ÌÃÞ¨½¸ ÄÞײÌÞ‚ª‚¢‚Á‚Ï‚¢‚Å‚·B" +#else + AFX_IDP_FAILED_INVALID_PATH "̧²Ù \042%1.\042 ‚ªŒ©‚‚©‚è‚Ü‚¹‚ñB\n³‚µ‚¢Ì§²Ù–¼‚ðŠm”F‚µ‚Ä“ü—Í‚µ‚Ä‚‚¾‚³‚¢B" + AFX_IDP_FAILED_DISK_FULL "o—Íæ‚ÌÃÞ¨½¸‚ª‚¢‚Á‚Ï‚¢‚Å‚·B" +#endif + AFX_IDP_FAILED_ACCESS_READ "%1 ‚©‚ç“Ç‚Ýž‚ß‚Ü‚¹‚ñB‘¼‚̱Ìßع°¼®Ý‚É‚æ‚Á‚ÄŠJ‚©‚ê‚Ä‚¢‚Ü‚·B" + AFX_IDP_FAILED_ACCESS_WRITE "%1 ‚É‘‚«ž‚ß‚Ü‚¹‚ñB‘¼‚̱Ìßع°¼®Ý‚É‚æ‚Á‚ÄŠJ‚©‚ê‚Ä‚¢‚Ü‚·B" + AFX_IDP_FAILED_IO_ERROR_READ "%1 ‚Ì“Ç‚Ýž‚Ý’†‚É—\Šú‚µ‚È‚¢´×°‚ª”¶‚µ‚Ü‚µ‚½B" + AFX_IDP_FAILED_IO_ERROR_WRITE "%1 ‚Ì‘‚«ž‚Ý’†‚É—\Šú‚µ‚È‚¢´×°‚ª”¶‚µ‚Ü‚µ‚½B" + + // Parsing error prompts + AFX_IDP_PARSE_INT, "®”‚ð“ü—Í‚µ‚Ä‚‚¾‚³‚¢B" + AFX_IDP_PARSE_REAL, "”’l‚ð“ü—Í‚µ‚Ä‚‚¾‚³‚¢B" + AFX_IDP_PARSE_INT_RANGE, "%1 ‚©‚ç %2 –˜‚Ì®”‚ð“ü—Í‚µ‚Ä‚‚¾‚³‚¢B" + AFX_IDP_PARSE_REAL_RANGE, "%1 ‚©‚ç %2 –˜‚Ì”’l‚ð“ü—Í‚µ‚Ä‚‚¾‚³‚¢B" + AFX_IDP_PARSE_STRING_SIZE, "%1 •¶ŽšˆÈ“à‚Å“ü—Í‚µ‚Ä‚‚¾‚³‚¢B" + AFX_IDP_PARSE_RADIO_BUTTON, "ÎÞÀÝ‚ð‘I‘ð‚µ‚Ä‚‚¾‚³‚¢B" + AFX_IDP_PARSE_BYTE, "0 ‚©‚ç 255 ‚Ü‚Å‚Ì®”‚ð“ü—Í‚µ‚Ä‚‚¾‚³‚¢B" + AFX_IDP_PARSE_UINT, "³‚Ì®”‚ð“ü—Í‚µ‚Ä‚‚¾‚³‚¢B" + +#ifndef _AFX_NO_PROPSHEET_RESOURCES + // Property Sheet button strings (Note: 50 is the X-axis button size) + AFX_IDS_PS_OK "OK\n50" + AFX_IDS_PS_CANCEL "·¬Ý¾Ù\n50" + AFX_IDS_PS_APPLY_NOW "“K—p(&A)\n50" + AFX_IDS_PS_HELP "ÍÙÌß(&H)\n50" + AFX_IDS_PS_CLOSE "•Â‚¶‚é0" +#endif //!_AFX_NO_PROPSHEET_RESOURCES + +#ifndef _AFX_NO_OLE_RESOURCES + // OLE strings required for both servers and containers + AFX_IDS_PASTELINKEDTYPE "%s ‚ðØݸ‚µ‚Ü‚µ‚½" + AFX_IDS_UNKNOWNTYPE "Unknown Type" +#ifndef _MAC + AFX_IDP_FAILED_TO_NOTIFY "%1\nÄÞ·ÒÝÄ‚ð“o˜^‚Å‚«‚Ü‚¹‚ñB\nÄÞ·ÒÝÄ‚Í‚·‚Å‚ÉŠJ‚©‚ê‚Ä‚¢‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B" +#else + AFX_IDP_FAILED_TO_NOTIFY "ÄÞ·ÒÝÄ \042%1.\042 ‚ð“o˜^‚Å‚«‚Ü‚¹‚ñB\nÄÞ·ÒÝÄ‚Í‚·‚Å‚ÉŠJ‚©‚ê‚Ä‚¢‚é‰Â”\«‚ª‚ ‚è‚Ü‚·B" +#endif +#endif //!_AFX_NO_OLE_RESOURCES + +#ifndef _AFX_NO_MAPI_RESOURCES + // MAPI strings / error messages + AFX_IDP_FAILED_MAPI_LOAD "Ò°Ù ¼½ÃÑ‚ÌÛ°ÄÞ‚ª‚Å‚«‚Ü‚¹‚ñB" + AFX_IDP_INVALID_MAPI_DLL "Ò°Ù ¼½ÃÑ DLL‚ª•s³‚Å‚·B" + AFX_IDP_FAILED_MAPI_SEND "Ò°Ù‚Ì‘—M‚ÉŽ¸”s‚µ‚Ü‚µ‚½B" +#endif //!_AFX_NO_MAPI_RESOURCES +END + +///////////////////////////////////////////////////////////////////////////// +// Cursors + +AFX_IDC_CONTEXTHELP CURSOR DISCARDABLE "res\\help.cur" + +#ifndef _AFX_NO_SPLITTER_RESOURCES +AFX_IDC_SMALLARROWS CURSOR DISCARDABLE "res\\sarrows.cur" +AFX_IDC_HSPLITBAR CURSOR DISCARDABLE "res\\splith.cur" +AFX_IDC_VSPLITBAR CURSOR DISCARDABLE "res\\splitv.cur" +AFX_IDC_NODROPCRSR CURSOR DISCARDABLE "res\\nodrop.cur" +#endif //!_AFX_NO_SPLITTER_RESOURCES + +#ifndef _AFX_NO_TRACKER_RESOURCES +AFX_IDC_TRACKNWSE CURSOR DISCARDABLE "res\\trcknwse.cur" +AFX_IDC_TRACKNESW CURSOR DISCARDABLE "res\\trcknesw.cur" +AFX_IDC_TRACKNS CURSOR DISCARDABLE "res\\trckns.cur" +AFX_IDC_TRACKWE CURSOR DISCARDABLE "res\\trckwe.cur" +AFX_IDC_TRACK4WAY CURSOR DISCARDABLE "res\\trck4way.cur" +AFX_IDC_MOVE4WAY CURSOR DISCARDABLE "res\\move4way.cur" +#endif //!_AFX_NO_TRACKER_RESOURCES + +///////////////////////////////////////////////////////////////////////////// +// Standard Dialogs + +AFX_IDD_NEWTYPEDLG DIALOG DISCARDABLE 9, 26, 183, 70 +#ifndef _MAC +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | 0x04 +#else +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION +#endif +CAPTION "V‹K" +FONT 8, "System" +BEGIN + LTEXT "V‹K(&N) ",IDC_STATIC,6,5,123,8,NOT WS_GROUP + LISTBOX AFX_IDC_LISTBOX,6,15,125,49,WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "OK",IDOK,137,6,40,14 + PUSHBUTTON "·¬Ý¾Ù",IDCANCEL,137,23,40,14 + PUSHBUTTON "ÍÙÌß(&H)",ID_HELP,137,43,40,14 +END + +///////////////////////////////////////////////////////////////////////////// +// Property Sheet Bitmaps + +#ifndef _AFX_NO_PROPERTY_RESOURCES +AFX_IDB_SCROLL BITMAP DISCARDABLE "res\\psscroll.bmp" +#endif //!_AFX_NO_PROPERTY_RESOURCES + +///////////////////////////////////////////////////////////////////////////// +// CMiniFrameWnd Bitmap + +AFX_IDB_MINIFRAME_MENU BITMAP DISCARDABLE "res\\minifwnd.bmp" + +///////////////////////////////////////////////////////////////////////////// + +#endif //!_AFXDLL +#endif //!__AFXRES_RC__ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/mapi.h b/public/sdk/inc/mfc30/mapi.h new file mode 100644 index 000000000..82d91be3f --- /dev/null +++ b/public/sdk/inc/mfc30/mapi.h @@ -0,0 +1,175 @@ +/* + * m a p i . h + * + * Messaging Applications Programming Interface. + * + * Copyright (c) 1992, Microsoft Corporation. All rights reserved. + * + * Purpose: + * This file defines the structures and constants used by + * that subset of the messaging applications programming + * interface which will be supported under Windows by + * Microsoft Mail for PC Networks vesion 3.0. + */ + +/* + * Types. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef unsigned long ULONG; +typedef unsigned long * LPULONG; +typedef unsigned long FLAGS; +typedef unsigned long LHANDLE, *LPLHANDLE; +#define lhSessionNull ((LHANDLE)0) + +#define MAPI_MESSAGEID_LENGTH 64 + +typedef struct { + ULONG ulReserved; // Reserved for future use (must be 0) + ULONG flFlags; // Flags + ULONG nPosition; // character in text to be replaced by attachment + LPSTR lpszPathName; // Full path name of attachment file + LPSTR lpszFileName; // Original file name (optional) + LPVOID UNALIGNED lpFileType; // Attachment file type (optional) +} MapiFileDesc; + +typedef MapiFileDesc UNALIGNED *lpMapiFileDesc; + +#define MAPI_OLE 0x00000001 +#define MAPI_OLE_STATIC 0x00000002 + +typedef struct { + ULONG ulReserved; // Reserved for future use + ULONG ulRecipClass; // Recipient class + // MAPI_TO, MAPI_CC, MAPI_BCC, MAPI_ORIG + LPSTR lpszName; // Recipient name + LPSTR lpszAddress; // Recipient address (optional) + ULONG ulEIDSize; // Count in bytes of size of pEntryID + LPVOID lpEntryID; // System-specific recipient reference +} MapiRecipDesc; + +typedef MapiRecipDesc UNALIGNED *lpMapiRecipDesc; + +#define MAPI_ORIG 0 // Recipient is message originator +#define MAPI_TO 1 // Recipient is a primary recipient +#define MAPI_CC 2 // Recipient is a copy recipient +#define MAPI_BCC 3 // Recipient is blind copy recipient + +typedef struct { + ULONG ulReserved; // Reserved for future use (M.B. 0) + LPSTR lpszSubject; // Message Subject + LPSTR lpszNoteText; // Message Text + LPSTR lpszMessageType; // Message Class + LPSTR lpszDateReceived; // in YYYY/MM/DD HH:MM format + LPSTR lpszConversationID; // conversation thread ID + FLAGS flFlags; // unread,return receipt + lpMapiRecipDesc lpOriginator; // Originator descriptor + ULONG nRecipCount; // Number of recipients + lpMapiRecipDesc lpRecips; // Recipient descriptors + ULONG nFileCount; // # of file attachments + lpMapiFileDesc lpFiles; // Attachment descriptors +} MapiMessage; + +typedef MapiMessage UNALIGNED *lpMapiMessage; + +#define MAPI_UNREAD 0x00000001 +#define MAPI_RECEIPT_REQUESTED 0x00000002 +#define MAPI_SENT 0x00000004 + +/* + * Entry points. + */ + +#define MAPI_LOGON_UI 0x00000001 // Display logon UI +#define MAPI_NEW_SESSION 0x00000002 // Do not use default. +#define MAPI_DIALOG 0x00000008 // Display a send note UI +#define MAPI_UNREAD_ONLY 0x00000020 // Only unread messages +#define MAPI_ENVELOPE_ONLY 0x00000040 // Only header information +#define MAPI_PEEK 0x00000080 // Do not mark as read. +#define MAPI_GUARANTEE_FIFO 0x00000100 // use date order +#define MAPI_BODY_AS_FILE 0x00000200 +#define MAPI_AB_NOMODIFY 0x00000400 // Don't allow mods of AB entries +#define MAPI_SUPPRESS_ATTACH 0x00000800 // header + body, no files +#define MAPI_FORCE_DOWNLOAD 0x00001000 // force download of new mail during MAPILogon + +ULONG MAPILogon(ULONG ulUIParam, LPSTR lpszName, LPSTR lpszPassword, + FLAGS flFlags, ULONG ulReserved, + LPLHANDLE lplhSession); + +ULONG MAPILogoff(LHANDLE lhSession, ULONG ulUIParam, FLAGS flFlags, + ULONG ulReserved); + +ULONG MAPISendMail(LHANDLE lhSession, ULONG ulUIParam, + lpMapiMessage lpMessage, FLAGS flFlags, + ULONG ulReserved); + +ULONG MAPISendDocuments(ULONG ulUIParam, LPSTR lpszDelimChar, + LPSTR lpszFilePaths, LPSTR lpszFileNames, + ULONG ulReserved); + +ULONG MAPIFindNext(LHANDLE lhSession, ULONG ulUIParam, + LPSTR lpszMessageType, LPSTR lpszSeedMessageID, + FLAGS flFlags, ULONG ulReserved, + LPSTR lpszMessageID); + +ULONG MAPIReadMail(LHANDLE lhSession, ULONG ulUIParam, + LPSTR lpszMessageID, FLAGS flFlags, + ULONG ulReserved, lpMapiMessage *lppMessageOut); + +ULONG MAPISaveMail(LHANDLE lhSession, ULONG ulUIParam, + lpMapiMessage pMessage, FLAGS flFlags, + ULONG ulReserved, LPSTR lpszMessageID); + +ULONG MAPIDeleteMail(LHANDLE lhSession, ULONG ulUIParam, + LPSTR lpszMessageID, FLAGS flFlags, + ULONG ulReserved); + +ULONG MAPIFreeBuffer( LPVOID pv ); + +ULONG MAPIAddress(LHANDLE lhSession, ULONG ulUIParam, + LPSTR plszCaption, ULONG nEditFields, + LPSTR lpszLabels, ULONG nRecips, + lpMapiRecipDesc lpRecips, FLAGS flFlags, ULONG ulReserved, + LPULONG lpnNewRecips, lpMapiRecipDesc *lppNewRecips); + +ULONG MAPIDetails(LHANDLE lhSession, ULONG ulUIParam, + lpMapiRecipDesc lpRecip, FLAGS flFlags, ULONG ulReserved); + +ULONG MAPIResolveName(LHANDLE lhSession, ULONG ulUIParam, + LPSTR lpszName, FLAGS flFlags, + ULONG ulReserved, lpMapiRecipDesc *lppRecip); + +#define SUCCESS_SUCCESS 0 +#define MAPI_USER_ABORT 1 +#define MAPI_E_FAILURE 2 +#define MAPI_E_LOGIN_FAILURE 3 +#define MAPI_E_DISK_FULL 4 +#define MAPI_E_INSUFFICIENT_MEMORY 5 +#define MAPI_E_ACCESS_DENIED 6 +#define MAPI_E_TOO_MANY_SESSIONS 8 +#define MAPI_E_TOO_MANY_FILES 9 +#define MAPI_E_TOO_MANY_RECIPIENTS 10 +#define MAPI_E_ATTACHMENT_NOT_FOUND 11 +#define MAPI_E_ATTACHMENT_OPEN_FAILURE 12 +#define MAPI_E_ATTACHMENT_WRITE_FAILURE 13 +#define MAPI_E_UNKNOWN_RECIPIENT 14 +#define MAPI_E_BAD_RECIPTYPE 15 +#define MAPI_E_NO_MESSAGES 16 +#define MAPI_E_INVALID_MESSAGE 17 +#define MAPI_E_TEXT_TOO_LARGE 18 +#define MAPI_E_INVALID_SESSION 19 +#define MAPI_E_TYPE_NOT_SUPPORTED 20 +#define MAPI_E_AMBIGUOUS_RECIPIENT 21 +#define MAPI_E_MESSAGE_IN_USE 22 +#define MAPI_E_NETWORK_FAILURE 23 +#define MAPI_E_INVALID_EDITFIELDS 24 +#define MAPI_E_INVALID_RECIPS 25 +#define MAPI_E_NOT_SUPPORTED 26 + +#ifdef __cplusplus +} +#endif diff --git a/public/sdk/inc/mfc30/ole2ansi.h b/public/sdk/inc/mfc30/ole2ansi.h new file mode 100644 index 000000000..03907993b --- /dev/null +++ b/public/sdk/inc/mfc30/ole2ansi.h @@ -0,0 +1,86 @@ +//+-------------------------------------------------------------------------- +// +// Copyright (C) 1994, Microsoft Corporation. All Rights Reserved. +// +// File: ole2ansi.h +// +// Contents: API include file for MFCANS32.DLL users. +// Provides direct access to the wrapper APIs. +// +// History: 25-Oct-94 deanm Created. +// +//--------------------------------------------------------------------------- + +#ifndef _OLE2ANSI_H_ +#define _OLE2ANSI_H_ + +// +// Ole2AnsiSetFlags +// +// This function affects per-task options for MFCANS32.DLL. It should +// be called at initialization before any OLE calls are made(if at all). +// The default flags are zero, and are that way for backward compatibility +// to previous versions of the DLL. +// +// OLE2ANSI_WRAPCUSTOM - Use if you wish custom interfaces to be wrapped. +// (Note: when a custom interface is wrapped its vtable must contain +// 128 or less vtable entries) +// By default this option is not on to avoid breaking applications +// that rely on the original non-wrapping of custom interfaces. +// +// OLE2ANSI_AGGREGATION - Use if you use aggregation in your application. +// Using this option "turns off" a couple of bugs in the original +// implementation where aggregation was not handled correctly. By default +// the library operates in a mode where this bug is not fixed, since +// applications may have worked around the bug in such a way that fixing +// it in the library itself breaks those applications. + +STDAPI Ole2AnsiSetFlags(DWORD dwFlags, DWORD* pdwOldFlags); +STDAPI_(DWORD) Ole2AnsiGetFlags(void); + +// Ole2AnsiSetFlags option flags +#define OLE2ANSI_WRAPCUSTOM 0x00000001L +#define OLE2ANSI_AGGREGATION 0x00000002L + +// +// Ole2AnsiSetHashSizes +// +// The MFCANS32.DLL uses a number of different hash tables to manage +// object and interface identity. The default size should handle most +// applications and should keep object searches down to a minumum. +// If your application creates a large number of objects managed by +// the MFCANS32.DLL, you might want to bump these values up. +// +// nHashSize - Determines the size of the hash tables used to map +// wrappers to native objects and native objects to wrappers. +// The default is 1021. +// +// nGuidSize - Determines the size of the hash table used to manage +// sets of custom GUIDs. This table is only used if you use +// automation dual interfaces or custom interfaces. The default +// is 71. +// +// It is best to use a prime number for both values. + +STDAPI Ole2AnsiSetHashSizes(int nHashSize, int nGuidSize); + +// +// Ole2AnsiAFromW +// Ole2AnsiWFromA +// +// These functions return either wide or ansi wrappers for a given +// interface. For any given interface, only one wrapper will ever +// be returned (ie. it is reference counted). In addition, a +// wrapper will never be "wrapped again", at least not in the same +// address space. +// +// Usually direct calls to these APIs are not necessary since the +// MFCANS32.DLL provides "thunking" entry-points for all the OLE +// APIs. Use these functions when you obtain interface pointers outside +// the documented OLE APIs. Commonly these functions are used in an +// ANSI inproc server in its DllGetClassObject. + +STDAPI Ole2AnsiAFromW(REFIID riid, LPUNKNOWN pWrappee, LPUNKNOWN * ppWrapper); +STDAPI Ole2AnsiWFromA(REFIID riid, LPUNKNOWN pWrappee, LPUNKNOWN * ppWrapper); + +#endif //_OLE2ANSI_H_ diff --git a/public/sdk/inc/mfc30/ole2ui.h b/public/sdk/inc/mfc30/ole2ui.h new file mode 100644 index 000000000..a4d30c2f0 --- /dev/null +++ b/public/sdk/inc/mfc30/ole2ui.h @@ -0,0 +1,1622 @@ +/*++ BUILD Version: 0001 Increment this if a change has global effects + +Copyright (c) 1993-1994, Microsoft Corporation + +Module Name: + + ole2ui.h + +Abstract: + + Include file for the OLE common dialogs. + The following dialog implementations are provided: + - Insert Object Dialog + - Convert Object Dialog + - Paste Special Dialog + - Change Icon Dialog + - Edit Links Dialog + - Update Links Dialog + - Change Source Dialog + - Busy Dialog + - User Error Message Dialog + - Object Properties Dialog + +--*/ + +#ifndef _OLE2UI_H_ +#define _OLE2UI_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __cplusplus + #define NONAMELESSUNION // use strict ANSI standard (for DVOBJ.H) +#endif + +// syncronize UNICODE options +#if defined(_UNICODE) && !defined(UNICODE) + #define UNICODE +#endif +#if defined(UNICODE) && !defined(_UNICODE) + #define _UNICODE +#endif + +// syncronize OLE2ANSI option w/ _UNICODE +#if !defined(_UNICODE) && !defined(OLE2ANSI) + #define OLE2ANSI +#endif + +#ifndef _WINDOWS_ +#include <windows.h> +#endif +#ifndef _INC_SHELLAPI +#include <shellapi.h> +#endif +#ifndef _INC_COMMDLG +#include <commdlg.h> +#endif +#ifndef _OLE2_H_ +#include <ole2.h> +#endif +#include <string.h> +#include <dlgs.h> // common dialog IDs +//#include <oledlgs.h> // OLE common dialog IDs +#include <tchar.h> + + +// Help Button Identifier +#define IDC_OLEUIHELP 99 + +// Insert Object Dialog identifiers +#define IDC_IO_CREATENEW 2100 +#define IDC_IO_CREATEFROMFILE 2101 +#define IDC_IO_LINKFILE 2102 +#define IDC_IO_OBJECTTYPELIST 2103 +#define IDC_IO_DISPLAYASICON 2104 +#define IDC_IO_CHANGEICON 2105 +#define IDC_IO_FILE 2106 +#define IDC_IO_FILEDISPLAY 2107 +#define IDC_IO_RESULTIMAGE 2108 +#define IDC_IO_RESULTTEXT 2109 +#define IDC_IO_ICONDISPLAY 2110 +#define IDC_IO_OBJECTTYPETEXT 2111 //{{NOHELP}} +#define IDC_IO_FILETEXT 2112 //{{NOHELP}} +#define IDC_IO_FILETYPE 2113 +#define IDC_IO_INSERTCONTROL 2114 +#define IDC_IO_ADDCONTROL 2115 +#define IDC_IO_CONTROLTYPELIST 2116 + +// Paste Special Dialog identifiers +#define IDC_PS_PASTE 500 +#define IDC_PS_PASTELINK 501 +#define IDC_PS_SOURCETEXT 502 +#define IDC_PS_PASTELIST 503 //{{NOHELP}} +#define IDC_PS_PASTELINKLIST 504 //{{NOHELP}} +#define IDC_PS_DISPLAYLIST 505 +#define IDC_PS_DISPLAYASICON 506 +#define IDC_PS_ICONDISPLAY 507 +#define IDC_PS_CHANGEICON 508 +#define IDC_PS_RESULTIMAGE 509 +#define IDC_PS_RESULTTEXT 510 + +// Change Icon Dialog identifiers +#define IDC_CI_GROUP 120 //{{NOHELP}} +#define IDC_CI_CURRENT 121 +#define IDC_CI_CURRENTICON 122 +#define IDC_CI_DEFAULT 123 +#define IDC_CI_DEFAULTICON 124 +#define IDC_CI_FROMFILE 125 +#define IDC_CI_FROMFILEEDIT 126 +#define IDC_CI_ICONLIST 127 +#define IDC_CI_LABEL 128 //{{NOHELP} +#define IDC_CI_LABELEDIT 129 +#define IDC_CI_BROWSE 130 +#define IDC_CI_ICONDISPLAY 131 + +// Convert Dialog identifiers +#define IDC_CV_OBJECTTYPE 150 +#define IDC_CV_DISPLAYASICON 152 +#define IDC_CV_CHANGEICON 153 +#define IDC_CV_ACTIVATELIST 154 +#define IDC_CV_CONVERTTO 155 +#define IDC_CV_ACTIVATEAS 156 +#define IDC_CV_RESULTTEXT 157 +#define IDC_CV_CONVERTLIST 158 +#define IDC_CV_ICONDISPLAY 165 + +// Edit Links Dialog identifiers +#define IDC_EL_CHANGESOURCE 201 +#define IDC_EL_AUTOMATIC 202 +#define IDC_EL_CANCELLINK 209 +#define IDC_EL_UPDATENOW 210 +#define IDC_EL_OPENSOURCE 211 +#define IDC_EL_MANUAL 212 +#define IDC_EL_LINKSOURCE 216 +#define IDC_EL_LINKTYPE 217 +#define IDC_EL_LINKSLISTBOX 206 +#define IDC_EL_COL1 220 //{{NOHELP}} +#define IDC_EL_COL2 221 //{{NOHELP}} +#define IDC_EL_COL3 222 //{{NOHELP}} + +// Busy dialog identifiers +#define IDC_BZ_RETRY 600 +#define IDC_BZ_ICON 601 +#define IDC_BZ_MESSAGE1 602 //{{NOHELP}} +#define IDC_BZ_SWITCHTO 604 + +// Update Links dialog identifiers +#define IDC_UL_METER 1029 //{{NOHELP}} +#define IDC_UL_STOP 1030 //{{NOHELP}} +#define IDC_UL_PERCENT 1031 //{{NOHELP}} +#define IDC_UL_PROGRESS 1032 //{{NOHELP}} + +// User Prompt dialog identifiers +#define IDC_PU_LINKS 900 //{{NOHELP}} +#define IDC_PU_TEXT 901 //{{NOHELP}} +#define IDC_PU_CONVERT 902 //{{NOHELP}} +#define IDC_PU_ICON 908 //{{NOHELP}} + +// General Properties identifiers +#define IDC_GP_OBJECTNAME 1009 +#define IDC_GP_OBJECTTYPE 1010 +#define IDC_GP_OBJECTSIZE 1011 +#define IDC_GP_CONVERT 1013 +#define IDC_GP_OBJECTICON 1014 //{{NOHELP}} +#define IDC_GP_OBJECTLOCATION 1022 + +// View Properties identifiers +#define IDC_VP_PERCENT 1000 +#define IDC_VP_CHANGEICON 1001 +#define IDC_VP_EDITABLE 1002 +#define IDC_VP_ASICON 1003 +#define IDC_VP_RELATIVE 1005 +#define IDC_VP_SPIN 1006 +#define IDC_VP_SCALETXT 1034 +#define IDC_VP_ICONDISPLAY 1021 +#define IDC_VP_RESULTIMAGE 1033 + +// Link Properties identifiers +#define IDC_LP_OPENSOURCE 1006 +#define IDC_LP_UPDATENOW 1007 +#define IDC_LP_BREAKLINK 1008 +#define IDC_LP_LINKSOURCE 1012 +#define IDC_LP_CHANGESOURCE 1015 +#define IDC_LP_AUTOMATIC 1016 +#define IDC_LP_MANUAL 1017 +#define IDC_LP_DATE 1018 +#define IDC_LP_TIME 1019 + +// Dialog Identifiers as passed in Help messages to identify the source. +#define IDD_INSERTOBJECT 1000 +#define IDD_CHANGEICON 1001 +#define IDD_CONVERT 1002 +#define IDD_PASTESPECIAL 1003 +#define IDD_EDITLINKS 1004 +#define IDD_BUSY 1006 +#define IDD_UPDATELINKS 1007 +#define IDD_CHANGESOURCE 1009 +#define IDD_INSERTFILEBROWSE 1010 +#define IDD_CHANGEICONBROWSE 1011 +#define IDD_CONVERTONLY 1012 +#define IDD_CHANGESOURCE4 1013 +#define IDD_GNRLPROPS 1100 +#define IDD_VIEWPROPS 1101 +#define IDD_LINKPROPS 1102 + +// The following Dialogs are message dialogs used by OleUIPromptUser API +#define IDD_CANNOTUPDATELINK 1008 +#define IDD_LINKSOURCEUNAVAILABLE 1020 +#define IDD_SERVERNOTFOUND 1023 +#define IDD_OUTOFMEMORY 1024 +#define IDD_SERVERNOTREGW 1021 +#define IDD_LINKTYPECHANGEDW 1022 +#define IDD_SERVERNOTREGA 1025 +#define IDD_LINKTYPECHANGEDA 1026 +#ifdef UNICODE +#define IDD_SERVERNOTREG IDD_SERVERNOTREGW +#define IDD_LINKTYPECHANGED IDD_LINKTYPECHANGEDW +#else +#define IDD_SERVERNOTREG IDD_SERVERNOTREGA +#define IDD_LINKTYPECHANGED IDD_LINKTYPECHANGEDA +#endif + +#ifndef RC_INVOKED + +#pragma pack(push, 8) + +#ifndef EXPORT + #define EXPORT +#endif + +// Delimeter used to separate ItemMoniker pieces of a composite moniker +#ifdef _MAC + #define OLESTDDELIM ":" +#else + #define OLESTDDELIM TEXT("\\") +#endif + +// Hook type used in all structures. +typedef UINT (CALLBACK *LPFNOLEUIHOOK)(HWND, UINT, WPARAM, LPARAM); + +// Strings for registered messages +#define SZOLEUI_MSG_HELP TEXT("OLEUI_MSG_HELP") +#define SZOLEUI_MSG_ENDDIALOG TEXT("OLEUI_MSG_ENDDIALOG") +#define SZOLEUI_MSG_BROWSE TEXT("OLEUI_MSG_BROWSE") +#define SZOLEUI_MSG_CHANGEICON TEXT("OLEUI_MSG_CHANGEICON") +#define SZOLEUI_MSG_CLOSEBUSYDIALOG TEXT("OLEUI_MSG_CLOSEBUSYDIALOG") +#define SZOLEUI_MSG_CONVERT TEXT("OLEUI_MSG_CONVERT") +#define SZOLEUI_MSG_CHANGESOURCE TEXT("OLEUI_MSG_CHANGESOURCE") +#define SZOLEUI_MSG_ADDCONTROL TEXT("OLEUI_MSG_ADDCONTROL") +#define SZOLEUI_MSG_BROWSE_OFN TEXT("OLEUI_MSG_BROWSE_OFN") + +// Identifiers for SZOLEUI_MSG_BROWSE_OFN (in wParam) +#define ID_BROWSE_CHANGEICON 1 +#define ID_BROWSE_INSERTFILE 2 +#define ID_BROWSE_ADDCONTROL 3 +#define ID_BROWSE_CHANGESOURCE 4 + +// Standard success/error definitions +#define OLEUI_FALSE 0 +#define OLEUI_SUCCESS 1 // No error, same as OLEUI_OK +#define OLEUI_OK 1 // OK button pressed +#define OLEUI_CANCEL 2 // Cancel button pressed + +#define OLEUI_ERR_STANDARDMIN 100 +#define OLEUI_ERR_STRUCTURENULL 101 // Standard field validation +#define OLEUI_ERR_STRUCTUREINVALID 102 +#define OLEUI_ERR_CBSTRUCTINCORRECT 103 +#define OLEUI_ERR_HWNDOWNERINVALID 104 +#define OLEUI_ERR_LPSZCAPTIONINVALID 105 +#define OLEUI_ERR_LPFNHOOKINVALID 106 +#define OLEUI_ERR_HINSTANCEINVALID 107 +#define OLEUI_ERR_LPSZTEMPLATEINVALID 108 +#define OLEUI_ERR_HRESOURCEINVALID 109 + +#define OLEUI_ERR_FINDTEMPLATEFAILURE 110 // Initialization errors +#define OLEUI_ERR_LOADTEMPLATEFAILURE 111 +#define OLEUI_ERR_DIALOGFAILURE 112 +#define OLEUI_ERR_LOCALMEMALLOC 113 +#define OLEUI_ERR_GLOBALMEMALLOC 114 +#define OLEUI_ERR_LOADSTRING 115 +#define OLEUI_ERR_OLEMEMALLOC 116 + +#define OLEUI_ERR_STANDARDMAX 117 // Start here for specific errors. + +// Miscellaneous utility functions. +STDAPI_(BOOL) OleUIAddVerbMenuW(LPOLEOBJECT lpOleObj, LPCWSTR lpszShortType, + HMENU hMenu, UINT uPos, UINT uIDVerbMin, UINT uIDVerbMax, + BOOL bAddConvert, UINT idConvert, HMENU FAR *lphMenu); +STDAPI_(BOOL) OleUIAddVerbMenuA(LPOLEOBJECT lpOleObj, LPCSTR lpszShortType, + HMENU hMenu, UINT uPos, UINT uIDVerbMin, UINT uIDVerbMax, + BOOL bAddConvert, UINT idConvert, HMENU FAR *lphMenu); +#ifdef UNICODE +#define OleUIAddVerbMenu OleUIAddVerbMenuW +#else +#define OleUIAddVerbMenu OleUIAddVerbMenuA +#endif + +///////////////////////////////////////////////////////////////////////////// +// INSERT OBJECT DIALOG + +typedef struct tagOLEUIINSERTOBJECTW +{ + // These IN fields are standard across all OLEUI dialog functions. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: Flags + HWND hWndOwner; // Owning window + LPCWSTR lpszCaption; // Dialog caption bar contents + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + HINSTANCE hInstance; // Instance for customized template name + LPCWSTR lpszTemplate; // Customized template name + HRSRC hResource; // Customized template handle + + // Specifics for OLEUIINSERTOBJECT. + CLSID clsid; // OUT: Return space for class ID + LPWSTR lpszFile; // IN-OUT: Filename for inserts or links + UINT cchFile; // IN: Size of lpszFile buffer: MAX_PATH + UINT cClsidExclude; // IN: CLSIDs in lpClsidExclude + LPCLSID lpClsidExclude; // IN: List of CLSIDs to exclude from listing. + + // Specific to create objects if flags say so + IID iid; // IN: Requested interface on creation. + DWORD oleRender; // IN: Rendering option + LPFORMATETC lpFormatEtc; // IN: Desired format + LPOLECLIENTSITE lpIOleClientSite; // IN: Site to be use for the object. + LPSTORAGE lpIStorage; // IN: Storage used for the object + LPVOID FAR *ppvObj; // OUT: Where the object is returned. + SCODE sc; // OUT: Result of creation calls. + HGLOBAL hMetaPict; // OUT: metafile aspect (METAFILEPICT) + +} OLEUIINSERTOBJECTW, *POLEUIINSERTOBJECTW, FAR *LPOLEUIINSERTOBJECTW; +typedef struct tagOLEUIINSERTOBJECTA +{ + // These IN fields are standard across all OLEUI dialog functions. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: Flags + HWND hWndOwner; // Owning window + LPCSTR lpszCaption; // Dialog caption bar contents + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + HINSTANCE hInstance; // Instance for customized template name + LPCSTR lpszTemplate; // Customized template name + HRSRC hResource; // Customized template handle + + // Specifics for OLEUIINSERTOBJECT. + CLSID clsid; // OUT: Return space for class ID + LPSTR lpszFile; // IN-OUT: Filename for inserts or links + UINT cchFile; // IN: Size of lpszFile buffer: MAX_PATH + UINT cClsidExclude; // IN: CLSIDs in lpClsidExclude + LPCLSID lpClsidExclude; // IN: List of CLSIDs to exclude from listing. + + // Specific to create objects if flags say so + IID iid; // IN: Requested interface on creation. + DWORD oleRender; // IN: Rendering option + LPFORMATETC lpFormatEtc; // IN: Desired format + LPOLECLIENTSITE lpIOleClientSite; // IN: Site to be use for the object. + LPSTORAGE lpIStorage; // IN: Storage used for the object + LPVOID FAR *ppvObj; // OUT: Where the object is returned. + SCODE sc; // OUT: Result of creation calls. + HGLOBAL hMetaPict; // OUT: metafile aspect (METAFILEPICT) + +} OLEUIINSERTOBJECTA, *POLEUIINSERTOBJECTA, FAR *LPOLEUIINSERTOBJECTA; + +STDAPI_(UINT) OleUIInsertObjectW(LPOLEUIINSERTOBJECTW); +STDAPI_(UINT) OleUIInsertObjectA(LPOLEUIINSERTOBJECTA); + +#ifdef UNICODE +#define tagOLEUIINSERTOBJECT tagOLEUIINSERTOBJECTW +#define OLEUIINSERTOBJECT OLEUIINSERTOBJECTW +#define POLEUIINSERTOBJECT POLEUIINSERTOBJECTW +#define LPOLEUIINSERTOBJECT LPOLEUIINSERTOBJECTW +#define OleUIInsertObject OleUIInsertObjectW +#else +#define tagOLEUIINSERTOBJECT tagOLEUIINSERTOBJECTA +#define OLEUIINSERTOBJECT OLEUIINSERTOBJECTA +#define POLEUIINSERTOBJECT POLEUIINSERTOBJECTA +#define LPOLEUIINSERTOBJECT LPOLEUIINSERTOBJECTA +#define OleUIInsertObject OleUIInsertObjectA +#endif + +// Insert Object flags +#define IOF_SHOWHELP 0x00000001L +#define IOF_SELECTCREATENEW 0x00000002L +#define IOF_SELECTCREATEFROMFILE 0x00000004L +#define IOF_CHECKLINK 0x00000008L +#define IOF_CHECKDISPLAYASICON 0x00000010L +#define IOF_CREATENEWOBJECT 0x00000020L +#define IOF_CREATEFILEOBJECT 0x00000040L +#define IOF_CREATELINKOBJECT 0x00000080L +#define IOF_DISABLELINK 0x00000100L +#define IOF_VERIFYSERVERSEXIST 0x00000200L +#define IOF_DISABLEDISPLAYASICON 0x00000400L +#define IOF_HIDECHANGEICON 0x00000800L +#define IOF_SHOWINSERTCONTROL 0x00001000L +#define IOF_SELECTCREATECONTROL 0x00002000L + +// Insert Object specific error codes +#define OLEUI_IOERR_LPSZFILEINVALID (OLEUI_ERR_STANDARDMAX+0) +#define OLEUI_IOERR_LPSZLABELINVALID (OLEUI_ERR_STANDARDMAX+1) +#define OLEUI_IOERR_HICONINVALID (OLEUI_ERR_STANDARDMAX+2) +#define OLEUI_IOERR_LPFORMATETCINVALID (OLEUI_ERR_STANDARDMAX+3) +#define OLEUI_IOERR_PPVOBJINVALID (OLEUI_ERR_STANDARDMAX+4) +#define OLEUI_IOERR_LPIOLECLIENTSITEINVALID (OLEUI_ERR_STANDARDMAX+5) +#define OLEUI_IOERR_LPISTORAGEINVALID (OLEUI_ERR_STANDARDMAX+6) +#define OLEUI_IOERR_SCODEHASERROR (OLEUI_ERR_STANDARDMAX+7) +#define OLEUI_IOERR_LPCLSIDEXCLUDEINVALID (OLEUI_ERR_STANDARDMAX+8) +#define OLEUI_IOERR_CCHFILEINVALID (OLEUI_ERR_STANDARDMAX+9) + +///////////////////////////////////////////////////////////////////////////// +// PASTE SPECIAL DIALOG + +// The OLEUIPASTEFLAG enumeration is used by the OLEUIPASTEENTRY structure. +// +// OLEUIPASTE_ENABLEICON: If the container does not specify this flag for +// the entry in the OLEUIPASTEENTRY array passed as input to +// OleUIPasteSpecial, the DisplayAsIcon button will be unchecked and +// disabled when the the user selects the format that corresponds to +// the entry. +// +// OLEUIPASTE_PASTEONLY: Indicates that the entry in the OLEUIPASTEENTRY +// array is valid for pasting only. +// +// OLEUIPASTE_PASTE: Indicates that the entry in the OLEUIPASTEENTRY array +// is valid for pasting. It may also be valid for linking if any of +// the following linking flags are specified. +// +// If the entry in the OLEUIPASTEENTRY array is valid for linking, the +// following flags indicate which link types are acceptable by OR'ing +// together the appropriate OLEUIPASTE_LINKTYPE<#> values. +// +// These values correspond as follows to the array of link types passed to +// OleUIPasteSpecial: +// +// OLEUIPASTE_LINKTYPE1 = arrLinkTypes[0] +// OLEUIPASTE_LINKTYPE2 = arrLinkTypes[1] +// OLEUIPASTE_LINKTYPE3 = arrLinkTypes[2] +// OLEUIPASTE_LINKTYPE4 = arrLinkTypes[3] +// OLEUIPASTE_LINKTYPE5 = arrLinkTypes[4] +// OLEUIPASTE_LINKTYPE6 = arrLinkTypes[5] +// OLEUIPASTE_LINKTYPE7 = arrLinkTypes[6] +// OLEUIPASTE_LINKTYPE8 = arrLinkTypes[7] +// +// where, +// UINT arrLinkTypes[8] is an array of registered clipboard formats for +// linking. A maximium of 8 link types are allowed. + +typedef enum tagOLEUIPASTEFLAG +{ + OLEUIPASTE_ENABLEICON = 2048, // enable display as icon + OLEUIPASTE_PASTEONLY = 0, + OLEUIPASTE_PASTE = 512, + OLEUIPASTE_LINKANYTYPE = 1024, + OLEUIPASTE_LINKTYPE1 = 1, + OLEUIPASTE_LINKTYPE2 = 2, + OLEUIPASTE_LINKTYPE3 = 4, + OLEUIPASTE_LINKTYPE4 = 8, + OLEUIPASTE_LINKTYPE5 = 16, + OLEUIPASTE_LINKTYPE6 = 32, + OLEUIPASTE_LINKTYPE7 = 64, + OLEUIPASTE_LINKTYPE8 = 128 +} OLEUIPASTEFLAG; + +// OLEUIPASTEENTRY structure +// +// An array of OLEUIPASTEENTRY entries is specified for the PasteSpecial +// dialog box. Each entry includes a FORMATETC which specifies the +// formats that are acceptable, a string that is to represent the format +// in the dialog's list box, a string to customize the result text of the +// dialog and a set of flags from the OLEUIPASTEFLAG enumeration. The +// flags indicate if the entry is valid for pasting only, linking only or +// both pasting and linking. + +typedef struct tagOLEUIPASTEENTRYW +{ + FORMATETC fmtetc; // Format that is acceptable. + LPCWSTR lpstrFormatName;// String that represents the format + // to the user. %s is replaced by the + // full user type name of the object. + LPCWSTR lpstrResultText;// String to customize the result text + // of the dialog when the user + // selects the format correspoding to + // this entry. Any %s in this string + // is replaced by the the application + // name or FullUserTypeName of the + // object on the clipboard. + DWORD dwFlags; // Values from OLEUIPASTEFLAG enum + DWORD dwScratchSpace; // Scratch space used internally. + +} OLEUIPASTEENTRYW, *POLEUIPASTEENTRYW, FAR *LPOLEUIPASTEENTRYW; +typedef struct tagOLEUIPASTEENTRYA +{ + FORMATETC fmtetc; // Format that is acceptable. + LPCSTR lpstrFormatName;// String that represents the format + // to the user. %s is replaced by the + // full user type name of the object. + LPCSTR lpstrResultText;// String to customize the result text + // of the dialog when the user + // selects the format correspoding to + // this entry. Any %s in this string + // is replaced by the the application + // name or FullUserTypeName of the + // object on the clipboard. + DWORD dwFlags; // Values from OLEUIPASTEFLAG enum + DWORD dwScratchSpace; // Scratch space used internally. + +} OLEUIPASTEENTRYA, *POLEUIPASTEENTRYA, FAR *LPOLEUIPASTEENTRYA; +#ifdef UNICODE +#define tagOLEUIPASTEENTRY tagOLEUIPASTEENTRYW +#define OLEUIPASTEENTRY OLEUIPASTEENTRYW +#define POLEUIPASTEENTRY POLEUIPASTEENTRYW +#define LPOLEUIPASTEENTRY LPOLEUIPASTEENTRYW +#else +#define tagOLEUIPASTEENTRY tagOLEUIPASTEENTRYA +#define OLEUIPASTEENTRY OLEUIPASTEENTRYA +#define POLEUIPASTEENTRY POLEUIPASTEENTRYA +#define LPOLEUIPASTEENTRY LPOLEUIPASTEENTRYA +#endif + +// Maximum number of link types +#define PS_MAXLINKTYPES 8 + +typedef struct tagOLEUIPASTESPECIALW +{ + // These IN fields are standard across all OLEUI dialog functions. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: Flags + HWND hWndOwner; // Owning window + LPCWSTR lpszCaption; // Dialog caption bar contents + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + HINSTANCE hInstance; // Instance for customized template name + LPCWSTR lpszTemplate; // Customized template name + HRSRC hResource; // Customized template handle + + // Specifics for OLEUIPASTESPECIAL. + LPDATAOBJECT lpSrcDataObj; // IN-OUT: Source IDataObject* on the clipboard + // If lpSrcDataObj is NULL when OleUIPasteSpecial is called, then + // OleUIPasteSpecial will attempt to retrieve a pointer to an + // IDataObject from the clipboard. If OleUIPasteSpecial succeeds + // then it is the caller's responsibility to free the IDataObject + // returned in lpSrcDataObj. + LPOLEUIPASTEENTRYW arrPasteEntries;// IN: Array of acceptable formats + int cPasteEntries; // IN: No. of OLEUIPASTEENTRY array entries + UINT FAR* arrLinkTypes; // IN: List of acceptable link types + int cLinkTypes; // IN: Number of link types + UINT cClsidExclude; // IN: Number of CLSIDs in lpClsidExclude + LPCLSID lpClsidExclude; // IN: List of CLSIDs to exclude from list. + int nSelectedIndex; // OUT: Index that the user selected + BOOL fLink; // OUT: Indicates if Paste or PasteLink + HGLOBAL hMetaPict; // OUT: Handle to Metafile containing icon + SIZEL sizel; // OUT: size of object/link in its source + // may be 0,0 if different display + // aspect is chosen. + +} OLEUIPASTESPECIALW, *POLEUIPASTESPECIALW, FAR *LPOLEUIPASTESPECIALW; +typedef struct tagOLEUIPASTESPECIALA +{ + // These IN fields are standard across all OLEUI dialog functions. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: Flags + HWND hWndOwner; // Owning window + LPCSTR lpszCaption; // Dialog caption bar contents + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + HINSTANCE hInstance; // Instance for customized template name + LPCSTR lpszTemplate; // Customized template name + HRSRC hResource; // Customized template handle + + // Specifics for OLEUIPASTESPECIAL. + LPDATAOBJECT lpSrcDataObj; // IN-OUT: Source IDataObject* on the clipboard + // If lpSrcDataObj is NULL when OleUIPasteSpecial is called, then + // OleUIPasteSpecial will attempt to retrieve a pointer to an + // IDataObject from the clipboard. If OleUIPasteSpecial succeeds + // then it is the caller's responsibility to free the IDataObject + // returned in lpSrcDataObj. + LPOLEUIPASTEENTRYA arrPasteEntries;// IN: Array of acceptable formats + int cPasteEntries; // IN: No. of OLEUIPASTEENTRY array entries + UINT FAR* arrLinkTypes; // IN: List of acceptable link types + int cLinkTypes; // IN: Number of link types + UINT cClsidExclude; // IN: Number of CLSIDs in lpClsidExclude + LPCLSID lpClsidExclude; // IN: List of CLSIDs to exclude from list. + int nSelectedIndex; // OUT: Index that the user selected + BOOL fLink; // OUT: Indicates if Paste or PasteLink + HGLOBAL hMetaPict; // OUT: Handle to Metafile containing icon + SIZEL sizel; // OUT: size of object/link in its source + // may be 0,0 if different display + // aspect is chosen. + +} OLEUIPASTESPECIALA, *POLEUIPASTESPECIALA, FAR *LPOLEUIPASTESPECIALA; +#ifdef UNICODE + +#define tagOLEUIPASTESPECIAL tagOLEUIPASTESPECIALW +#define OLEUIPASTESPECIAL OLEUIPASTESPECIALW +#define POLEUIPASTESPECIAL POLEUIPASTESPECIALW +#define LPOLEUIPASTESPECIAL LPOLEUIPASTESPECIALW +#else +#define tagOLEUIPASTESPECIAL tagOLEUIPASTESPECIALA +#define OLEUIPASTESPECIAL OLEUIPASTESPECIALA +#define POLEUIPASTESPECIAL POLEUIPASTESPECIALA +#define LPOLEUIPASTESPECIAL LPOLEUIPASTESPECIALA +#endif + +STDAPI_(UINT) OleUIPasteSpecialW(LPOLEUIPASTESPECIALW); +STDAPI_(UINT) OleUIPasteSpecialA(LPOLEUIPASTESPECIALA); +#ifdef UNICODE +#define OleUIPasteSpecial OleUIPasteSpecialW +#else +#define OleUIPasteSpecial OleUIPasteSpecialA +#endif + +// Paste Special specific flags +#define PSF_SHOWHELP 0x00000001L +#define PSF_SELECTPASTE 0x00000002L +#define PSF_SELECTPASTELINK 0x00000004L +#define PSF_CHECKDISPLAYASICON 0x00000008L +#define PSF_DISABLEDISPLAYASICON 0x00000010L +#define PSF_HIDECHANGEICON 0x00000020L +#define PSF_STAYONCLIPBOARDCHANGE 0x00000040L +#define PSF_NOREFRESHDATAOBJECT 0x00000080L + +// Paste Special specific error codes +#define OLEUI_IOERR_SRCDATAOBJECTINVALID (OLEUI_ERR_STANDARDMAX+0) +#define OLEUI_IOERR_ARRPASTEENTRIESINVALID (OLEUI_ERR_STANDARDMAX+1) +#define OLEUI_IOERR_ARRLINKTYPESINVALID (OLEUI_ERR_STANDARDMAX+2) +#define OLEUI_PSERR_CLIPBOARDCHANGED (OLEUI_ERR_STANDARDMAX+3) +#define OLEUI_PSERR_GETCLIPBOARDFAILED (OLEUI_ERR_STANDARDMAX+4) + +///////////////////////////////////////////////////////////////////////////// +// EDIT LINKS DIALOG + +// IOleUILinkContainer interface +// +// This interface must be implemented by container applications that +// want to use the EditLinks dialog. the EditLinks dialog calls back +// to the container app to perform the OLE functions to manipulate +// the links within the container. + +#undef INTERFACE +#define INTERFACE IOleUILinkContainerW + +DECLARE_INTERFACE_(IOleUILinkContainerW, IUnknown) +{ + // *** IUnknown methods *** // + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // *** IOleUILinkContainer *** // + STDMETHOD_(DWORD,GetNextLink) (THIS_ DWORD dwLink) PURE; + STDMETHOD(SetLinkUpdateOptions) (THIS_ DWORD dwLink, + DWORD dwUpdateOpt) PURE; + STDMETHOD(GetLinkUpdateOptions) (THIS_ DWORD dwLink, + DWORD FAR* lpdwUpdateOpt) PURE; + STDMETHOD(SetLinkSource) (THIS_ DWORD dwLink, LPWSTR lpszDisplayName, + ULONG lenFileName, ULONG FAR* pchEaten, BOOL fValidateSource) PURE; + STDMETHOD(GetLinkSource) (THIS_ DWORD dwLink, + LPWSTR FAR* lplpszDisplayName, ULONG FAR* lplenFileName, + LPWSTR FAR* lplpszFullLinkType, LPWSTR FAR* lplpszShortLinkType, + BOOL FAR* lpfSourceAvailable, BOOL FAR* lpfIsSelected) PURE; + STDMETHOD(OpenLinkSource) (THIS_ DWORD dwLink) PURE; + STDMETHOD(UpdateLink) (THIS_ DWORD dwLink, + BOOL fErrorMessage, BOOL fReserved) PURE; + STDMETHOD(CancelLink) (THIS_ DWORD dwLink) PURE; +}; + +typedef IOleUILinkContainerW FAR* LPOLEUILINKCONTAINERW; + +#undef INTERFACE +#define INTERFACE IOleUILinkContainerA + +DECLARE_INTERFACE_(IOleUILinkContainerA, IUnknown) +{ + // *** IUnknown methods *** // + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // *** IOleUILinkContainer *** // + STDMETHOD_(DWORD,GetNextLink) (THIS_ DWORD dwLink) PURE; + STDMETHOD(SetLinkUpdateOptions) (THIS_ DWORD dwLink, + DWORD dwUpdateOpt) PURE; + STDMETHOD(GetLinkUpdateOptions) (THIS_ DWORD dwLink, + DWORD FAR* lpdwUpdateOpt) PURE; + STDMETHOD(SetLinkSource) (THIS_ DWORD dwLink, LPSTR lpszDisplayName, + ULONG lenFileName, ULONG FAR* pchEaten, BOOL fValidateSource) PURE; + STDMETHOD(GetLinkSource) (THIS_ DWORD dwLink, + LPSTR FAR* lplpszDisplayName, ULONG FAR* lplenFileName, + LPSTR FAR* lplpszFullLinkType, LPSTR FAR* lplpszShortLinkType, + BOOL FAR* lpfSourceAvailable, BOOL FAR* lpfIsSelected) PURE; + STDMETHOD(OpenLinkSource) (THIS_ DWORD dwLink) PURE; + STDMETHOD(UpdateLink) (THIS_ DWORD dwLink, + BOOL fErrorMessage, BOOL fReserved) PURE; + STDMETHOD(CancelLink) (THIS_ DWORD dwLink) PURE; +}; + +typedef IOleUILinkContainerA FAR* LPOLEUILINKCONTAINERA; + +#ifdef UNICODE +#define IOleUILinkContainer IOleUILinkContainerW +#define IOleUILinkContainerVtbl IOleUILinkContainerWVtbl +#define LPOLEUILINKCONTAINER LPOLEUILINKCONTAINERW +#else +#define IOleUILinkContainer IOleUILinkContainerA +#define IOleUILinkContainerVtbl IOleUILinkContainerAVtbl +#define LPOLEUILINKCONTAINER LPOLEUILINKCONTAINERA +#endif + +typedef struct tagOLEUIEDITLINKSW +{ + // These IN fields are standard across all OLEUI dialog functions. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: Flags + HWND hWndOwner; // Owning window + LPCWSTR lpszCaption; // Dialog caption bar contents + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + HINSTANCE hInstance; // Instance for customized template name + LPCWSTR lpszTemplate; // Customized template name + HRSRC hResource; // Customized template handle + + // Specifics for OLEUIEDITLINKS. + LPOLEUILINKCONTAINERW lpOleUILinkContainer; // IN: Interface to manipulate + // links in the container + +} OLEUIEDITLINKSW, *POLEUIEDITLINKSW, FAR *LPOLEUIEDITLINKSW; + +typedef struct tagOLEUIEDITLINKSA +{ + // These IN fields are standard across all OLEUI dialog functions. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: Flags + HWND hWndOwner; // Owning window + LPCSTR lpszCaption; // Dialog caption bar contents + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + HINSTANCE hInstance; // Instance for customized template name + LPCSTR lpszTemplate; // Customized template name + HRSRC hResource; // Customized template handle + + // Specifics for OLEUIEDITLINKS. + LPOLEUILINKCONTAINERA lpOleUILinkContainer; // IN: Interface to manipulate + // links in the container + +} OLEUIEDITLINKSA, *POLEUIEDITLINKSA, FAR *LPOLEUIEDITLINKSA; + +#ifdef UNICODE +#define tagOLEUIEDITLINKS tagOLEUIEDITLINKSW +#define OLEUIEDITLINKS OLEUIEDITLINKSW +#define POLEUIEDITLINKS POLEUIEDITLINKSW +#define LPOLEUIEDITLINKS LPOLEUIEDITLINKSW +#else +#define tagOLEUIEDITLINKS tagOLEUIEDITLINKSA +#define OLEUIEDITLINKS OLEUIEDITLINKSA +#define POLEUIEDITLINKS POLEUIEDITLINKSA +#define LPOLEUIEDITLINKS LPOLEUIEDITLINKSA +#endif + +#define OLEUI_ELERR_LINKCNTRNULL (OLEUI_ERR_STANDARDMAX+0) +#define OLEUI_ELERR_LINKCNTRINVALID (OLEUI_ERR_STANDARDMAX+1) + +STDAPI_(UINT) OleUIEditLinksW(LPOLEUIEDITLINKSW); +STDAPI_(UINT) OleUIEditLinksA(LPOLEUIEDITLINKSA); + +#ifdef UNICODE +#define OleUIEditLinks OleUIEditLinksW +#else +#define OleUIEditLinks OleUIEditLinksA +#endif + +// Edit Links flags +#define ELF_SHOWHELP 0x00000001L +#define ELF_DISABLEUPDATENOW 0x00000002L +#define ELF_DISABLEOPENSOURCE 0x00000004L +#define ELF_DISABLECHANGESOURCE 0x00000008L +#define ELF_DISABLECANCELLINK 0x00000010L + +///////////////////////////////////////////////////////////////////////////// +// CHANGE ICON DIALOG + +typedef struct tagOLEUICHANGEICONW +{ + // These IN fields are standard across all OLEUI dialog functions. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: Flags + HWND hWndOwner; // Owning window + LPCWSTR lpszCaption; // Dialog caption bar contents + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + HINSTANCE hInstance; // Instance for customized template name + LPCWSTR lpszTemplate; // Customized template name + HRSRC hResource; // Customized template handle + + // Specifics for OLEUICHANGEICON. + HGLOBAL hMetaPict; // IN-OUT: Current and final image. + // Source of the icon is embedded in + // the metafile itself. + CLSID clsid; // IN: class used to get Default icon + WCHAR szIconExe[MAX_PATH]; // IN: exlicit icon source path + int cchIconExe; // IN: number of characters in szIconExe + +} OLEUICHANGEICONW, *POLEUICHANGEICONW, FAR *LPOLEUICHANGEICONW; + +typedef struct tagOLEUICHANGEICONA +{ + // These IN fields are standard across all OLEUI dialog functions. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: Flags + HWND hWndOwner; // Owning window + LPCSTR lpszCaption; // Dialog caption bar contents + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + HINSTANCE hInstance; // Instance for customized template name + LPCSTR lpszTemplate; // Customized template name + HRSRC hResource; // Customized template handle + + // Specifics for OLEUICHANGEICON. + HGLOBAL hMetaPict; // IN-OUT: Current and final image. + // Source of the icon is embedded in + // the metafile itself. + CLSID clsid; // IN: class used to get Default icon + CHAR szIconExe[MAX_PATH]; // IN: exlicit icon source path + int cchIconExe; // IN: number of characters in szIconExe + +} OLEUICHANGEICONA, *POLEUICHANGEICONA, FAR *LPOLEUICHANGEICONA; + +STDAPI_(UINT) OleUIChangeIconW(LPOLEUICHANGEICONW); +STDAPI_(UINT) OleUIChangeIconA(LPOLEUICHANGEICONA); + +#ifdef UNICODE +#define tagOLEUICHANGEICON tagOLEUICHANGEICONW +#define OLEUICHANGEICON OLEUICHANGEICONW +#define POLEUICHANGEICON POLEUICHANGEICONW +#define LPOLEUICHANGEICON LPOLEUICHANGEICONW +#define OleUIChangeIcon OleUIChangeIconW +#else +#define tagOLEUICHANGEICON tagOLEUICHANGEICONA +#define OLEUICHANGEICON OLEUICHANGEICONA +#define POLEUICHANGEICON POLEUICHANGEICONA +#define LPOLEUICHANGEICON LPOLEUICHANGEICONA +#define OleUIChangeIcon OleUIChangeIconA +#endif + +// Change Icon flags +#define CIF_SHOWHELP 0x00000001L +#define CIF_SELECTCURRENT 0x00000002L +#define CIF_SELECTDEFAULT 0x00000004L +#define CIF_SELECTFROMFILE 0x00000008L +#define CIF_USEICONEXE 0x00000010L + +// Change Icon specific error codes +#define OLEUI_CIERR_MUSTHAVECLSID (OLEUI_ERR_STANDARDMAX+0) +#define OLEUI_CIERR_MUSTHAVECURRENTMETAFILE (OLEUI_ERR_STANDARDMAX+1) +#define OLEUI_CIERR_SZICONEXEINVALID (OLEUI_ERR_STANDARDMAX+2) + +// Property used by ChangeIcon dialog to give its parent window access to +// its hDlg. The PasteSpecial dialog may need to force the ChgIcon dialog +// down if the clipboard contents change underneath it. if so it will send +// a IDCANCEL command to the ChangeIcon dialog. +#define PROP_HWND_CHGICONDLG TEXT("HWND_CIDLG") + +///////////////////////////////////////////////////////////////////////////// +// CONVERT DIALOG + +typedef struct tagOLEUICONVERTW +{ + // These IN fields are standard across all OLEUI dialog functions. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: Flags + HWND hWndOwner; // Owning window + LPCWSTR lpszCaption; // Dialog caption bar contents + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + HINSTANCE hInstance; // Instance for customized template name + LPCWSTR lpszTemplate; // Customized template name + HRSRC hResource; // Customized template handle + + // Specifics for OLEUICONVERT. + CLSID clsid; // IN: Class ID sent in to dialog: IN only + CLSID clsidConvertDefault; // IN: use as convert default: IN only + CLSID clsidActivateDefault; // IN: use as activate default: IN only + + CLSID clsidNew; // OUT: Selected Class ID + DWORD dvAspect; // IN-OUT: either DVASPECT_CONTENT or + // DVASPECT_ICON + WORD wFormat; // IN" Original data format + BOOL fIsLinkedObject;// IN: true if object is linked + HGLOBAL hMetaPict; // IN-OUT: metafile icon image + LPWSTR lpszUserType; // IN-OUT: user type name of original class. + // We'll do lookup if NULL. + // This gets freed on exit. + BOOL fObjectsIconChanged; // OUT: TRUE == ChangeIcon was called + LPWSTR lpszDefLabel; //IN-OUT: default label to use for icon. + // if NULL, the short user type name + // will be used. if the object is a + // link, the caller should pass the + // DisplayName of the link source + // This gets freed on exit. + + UINT cClsidExclude; //IN: No. of CLSIDs in lpClsidExclude + LPCLSID lpClsidExclude; //IN: List of CLSIDs to exclude from list + +} OLEUICONVERTW, *POLEUICONVERTW, FAR *LPOLEUICONVERTW; + +typedef struct tagOLEUICONVERTA +{ + // These IN fields are standard across all OLEUI dialog functions. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: Flags + HWND hWndOwner; // Owning window + LPCSTR lpszCaption; // Dialog caption bar contents + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + HINSTANCE hInstance; // Instance for customized template name + LPCSTR lpszTemplate; // Customized template name + HRSRC hResource; // Customized template handle + + // Specifics for OLEUICONVERT. + CLSID clsid; // IN: Class ID sent in to dialog: IN only + CLSID clsidConvertDefault; // IN: use as convert default: IN only + CLSID clsidActivateDefault; // IN: use as activate default: IN only + + CLSID clsidNew; // OUT: Selected Class ID + DWORD dvAspect; // IN-OUT: either DVASPECT_CONTENT or + // DVASPECT_ICON + WORD wFormat; // IN" Original data format + BOOL fIsLinkedObject;// IN: true if object is linked + HGLOBAL hMetaPict; // IN-OUT: metafile icon image + LPSTR lpszUserType; // IN-OUT: user type name of original class. + // We'll do lookup if NULL. + // This gets freed on exit. + BOOL fObjectsIconChanged; // OUT: TRUE == ChangeIcon was called + LPSTR lpszDefLabel; //IN-OUT: default label to use for icon. + // if NULL, the short user type name + // will be used. if the object is a + // link, the caller should pass the + // DisplayName of the link source + // This gets freed on exit. + + UINT cClsidExclude; //IN: No. of CLSIDs in lpClsidExclude + LPCLSID lpClsidExclude; //IN: List of CLSIDs to exclude from list + +} OLEUICONVERTA, *POLEUICONVERTA, FAR *LPOLEUICONVERTA; + +STDAPI_(UINT) OleUIConvertW(LPOLEUICONVERTW); +STDAPI_(UINT) OleUIConvertA(LPOLEUICONVERTA); + +#ifdef UNICODE +#define tagOLEUICONVERT tagOLEUICONVERTW +#define OLEUICONVERT OLEUICONVERTW +#define POLEUICONVERT POLEUICONVERTW +#define LPOLEUICONVERT LPOLEUICONVERTW +#define OleUIConvert OleUIConvertW +#else +#define tagOLEUICONVERT tagOLEUICONVERTA +#define OLEUICONVERT OLEUICONVERTA +#define POLEUICONVERT POLEUICONVERTA +#define LPOLEUICONVERT LPOLEUICONVERTA +#define OleUIConvert OleUIConvertA +#endif + +// Determine if there is at least one class that can Convert or ActivateAs +// the given clsid. +STDAPI_(BOOL) OleUICanConvertOrActivateAs( + REFCLSID rClsid, BOOL fIsLinkedObject, WORD wFormat); + +// Convert Dialog flags +#define CF_SHOWHELPBUTTON 0x00000001L +#define CF_SETCONVERTDEFAULT 0x00000002L +#define CF_SETACTIVATEDEFAULT 0x00000004L +#define CF_SELECTCONVERTTO 0x00000008L +#define CF_SELECTACTIVATEAS 0x00000010L +#define CF_DISABLEDISPLAYASICON 0x00000020L +#define CF_DISABLEACTIVATEAS 0x00000040L +#define CF_HIDECHANGEICON 0x00000080L +#define CF_CONVERTONLY 0x00000100L + +// Convert specific error codes +#define OLEUI_CTERR_CLASSIDINVALID (OLEUI_ERR_STANDARDMAX+1) +#define OLEUI_CTERR_DVASPECTINVALID (OLEUI_ERR_STANDARDMAX+2) +#define OLEUI_CTERR_CBFORMATINVALID (OLEUI_ERR_STANDARDMAX+3) +#define OLEUI_CTERR_HMETAPICTINVALID (OLEUI_ERR_STANDARDMAX+4) +#define OLEUI_CTERR_STRINGINVALID (OLEUI_ERR_STANDARDMAX+5) + +///////////////////////////////////////////////////////////////////////////// +// BUSY DIALOG + +typedef struct tagOLEUIBUSYW +{ + // These IN fields are standard across all OLEUI dialog functions. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: see below + HWND hWndOwner; // Owning window + LPCWSTR lpszCaption; // Dialog caption bar contents + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + HINSTANCE hInstance; // Instance for customized template name + LPCWSTR lpszTemplate; // Customized template name + HRSRC hResource; // Customized template handle + + // Specifics for OLEUIBUSY. + HTASK hTask; // IN: HTask which is blocking + HWND FAR * lphWndDialog; // IN: Dialog's HWND is placed here + +} OLEUIBUSYW, *POLEUIBUSYW, FAR *LPOLEUIBUSYW; + +typedef struct tagOLEUIBUSYA +{ + // These IN fields are standard across all OLEUI dialog functions. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: see below + HWND hWndOwner; // Owning window + LPCSTR lpszCaption; // Dialog caption bar contents + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + HINSTANCE hInstance; // Instance for customized template name + LPCSTR lpszTemplate; // Customized template name + HRSRC hResource; // Customized template handle + + // Specifics for OLEUIBUSY. + HTASK hTask; // IN: HTask which is blocking + HWND FAR * lphWndDialog; // IN: Dialog's HWND is placed here + +} OLEUIBUSYA, *POLEUIBUSYA, FAR *LPOLEUIBUSYA; + +STDAPI_(UINT) OleUIBusyW(LPOLEUIBUSYW); +STDAPI_(UINT) OleUIBusyA(LPOLEUIBUSYA); + +#ifdef UNICODE +#define tagOLEUIBUSY tagOLEUIBUSYW +#define OLEUIBUSY OLEUIBUSYW +#define POLEUIBUSY POLEUIBUSYW +#define LPOLEUIBUSY LPOLEUIBUSYW +#define OleUIBusy OleUIBusyW +#else +#define tagOLEUIBUSY tagOLEUIBUSYA +#define OLEUIBUSY OLEUIBUSYA +#define POLEUIBUSY POLEUIBUSYA +#define LPOLEUIBUSY LPOLEUIBUSYA +#define OleUIBusy OleUIBusyA +#endif + +// Flags for the Busy dialog +#define BZ_DISABLECANCELBUTTON 0x00000001L +#define BZ_DISABLESWITCHTOBUTTON 0x00000002L +#define BZ_DISABLERETRYBUTTON 0x00000004L + +#define BZ_NOTRESPONDINGDIALOG 0x00000008L + +// Busy specific error/return codes +#define OLEUI_BZERR_HTASKINVALID (OLEUI_ERR_STANDARDMAX+0) +#define OLEUI_BZ_SWITCHTOSELECTED (OLEUI_ERR_STANDARDMAX+1) +#define OLEUI_BZ_RETRYSELECTED (OLEUI_ERR_STANDARDMAX+2) +#define OLEUI_BZ_CALLUNBLOCKED (OLEUI_ERR_STANDARDMAX+3) + +///////////////////////////////////////////////////////////////////////////// +// CHANGE SOURCE DIALOG + +// Data to and from the ChangeSource dialog hook +typedef struct tagOLEUICHANGESOURCEW +{ + // These IN fields are standard across all OLEUI dialog functions. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: Flags + HWND hWndOwner; // Owning window + LPCWSTR lpszCaption; // Dialog caption bar contents + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + HINSTANCE hInstance; // Instance for customized template name + LPCWSTR lpszTemplate; // Customized template name + HRSRC hResource; // Customized template handle + + // INTERNAL ONLY: do not modify these members + OPENFILENAMEW* lpOFN; // pointer OPENFILENAME struct + DWORD dwReserved1[4]; // (reserved for future use) + + // Specifics for OLEUICHANGESOURCE. + LPOLEUILINKCONTAINERW lpOleUILinkContainer; // IN: used to validate link sources + DWORD dwLink; // IN: magic# for lpOleUILinkContainer + LPWSTR lpszDisplayName;// IN-OUT: complete source display name + ULONG nFileLength; // IN-OUT: file moniker part of lpszDisplayName + LPWSTR lpszFrom; // OUT: prefix of source changed from + LPWSTR lpszTo; // OUT: prefix of source changed to + +} OLEUICHANGESOURCEW, *POLEUICHANGESOURCEW, FAR *LPOLEUICHANGESOURCEW; + +typedef struct tagOLEUICHANGESOURCEA +{ + // These IN fields are standard across all OLEUI dialog functions. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: Flags + HWND hWndOwner; // Owning window + LPCSTR lpszCaption; // Dialog caption bar contents + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + HINSTANCE hInstance; // Instance for customized template name + LPCSTR lpszTemplate; // Customized template name + HRSRC hResource; // Customized template handle + + // INTERNAL ONLY: do not modify these members + OPENFILENAMEA* lpOFN; // pointer OPENFILENAME struct + DWORD dwReserved1[4]; // (reserved for future use) + + // Specifics for OLEUICHANGESOURCE. + LPOLEUILINKCONTAINERA lpOleUILinkContainer; // IN: used to validate link sources + DWORD dwLink; // IN: magic# for lpOleUILinkContainer + LPSTR lpszDisplayName;// IN-OUT: complete source display name + ULONG nFileLength; // IN-OUT: file moniker part of lpszDisplayName + LPSTR lpszFrom; // OUT: prefix of source changed from + LPSTR lpszTo; // OUT: prefix of source changed to + +} OLEUICHANGESOURCEA, *POLEUICHANGESOURCEA, FAR *LPOLEUICHANGESOURCEA; + +STDAPI_(UINT) OleUIChangeSourceW(LPOLEUICHANGESOURCEW); +STDAPI_(UINT) OleUIChangeSourceA(LPOLEUICHANGESOURCEA); + +#ifdef UNICODE +#define tagOLEUICHANGESOURCE tagOLEUICHANGESOURCEW +#define OLEUICHANGESOURCE OLEUICHANGESOURCEW +#define POLEUICHANGESOURCE POLEUICHANGESOURCEW +#define LPOLEUICHANGESOURCE LPOLEUICHANGESOURCEW +#define OleUIChangeSource OleUIChangeSourceW +#else +#define tagOLEUICHANGESOURCE tagOLEUICHANGESOURCEA +#define OLEUICHANGESOURCE OLEUICHANGESOURCEA +#define POLEUICHANGESOURCE POLEUICHANGESOURCEA +#define LPOLEUICHANGESOURCE LPOLEUICHANGESOURCEA +#define OleUIChangeSource OleUIChangeSourceA +#endif + +// Change Source Dialog flags +#define CSF_SHOWHELP 0x00000001L // IN: enable/show help button +#define CSF_VALIDSOURCE 0x00000002L // OUT: link was validated +#define CSF_ONLYGETSOURCE 0x00000004L // OUT: don't actually set it + +// Change Source Dialog errors +#define OLEUI_CSERR_LINKCNTRNULL (OLEUI_ERR_STANDARDMAX+0) +#define OLEUI_CSERR_LINKCNTRINVALID (OLEUI_ERR_STANDARDMAX+1) +#define OLEUI_CSERR_FROMNOTNULL (OLEUI_ERR_STANDARDMAX+2) +#define OLEUI_CSERR_TONOTNULL (OLEUI_ERR_STANDARDMAX+3) +#define OLEUI_CSERR_SOURCENULL (OLEUI_ERR_STANDARDMAX+4) +#define OLEUI_CSERR_SOURCEINVALID (OLEUI_ERR_STANDARDMAX+5) +#define OLEUI_CSERR_SOURCEPARSERROR (OLEUI_ERR_STANDARDMAX+6) +#define OLEUI_CSERR_SOURCEPARSEERROR (OLEUI_ERR_STANDARDMAX+7) + +///////////////////////////////////////////////////////////////////////////// +// OBJECT PROPERTIES DIALOG + +#undef INTERFACE +#define INTERFACE IOleUIObjInfoW + +DECLARE_INTERFACE_(IOleUIObjInfoW, IUnknown) +{ + // *** IUnknown methods *** // + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // *** extra for General Properties *** // + STDMETHOD(GetObjectInfo) (THIS_ DWORD dwObject, + DWORD FAR* lpdwObjSize, LPWSTR FAR* lplpszLabel, + LPWSTR FAR* lplpszType, LPWSTR FAR* lplpszShortType, + LPWSTR FAR* lplpszLocation) PURE; + STDMETHOD(GetConvertInfo) (THIS_ DWORD dwObject, + CLSID FAR* lpClassID, WORD FAR* lpwFormat, + CLSID FAR* lpConvertDefaultClassID, + LPCLSID FAR* lplpClsidExclude, UINT FAR* lpcClsidExclude) PURE; + STDMETHOD(ConvertObject) (THIS_ DWORD dwObject, REFCLSID clsidNew) PURE; + + // *** extra for View Properties *** // + STDMETHOD(GetViewInfo) (THIS_ DWORD dwObject, + HGLOBAL FAR* phMetaPict, DWORD* pdvAspect, int* pnCurrentScale) PURE; + STDMETHOD(SetViewInfo) (THIS_ DWORD dwObject, + HGLOBAL hMetaPict, DWORD dvAspect, + int nCurrentScale, BOOL bRelativeToOrig) PURE; +}; + +typedef IOleUIObjInfoW FAR* LPOLEUIOBJINFOW; + +#undef INTERFACE +#define INTERFACE IOleUIObjInfoA + +DECLARE_INTERFACE_(IOleUIObjInfoA, IUnknown) +{ + // *** IUnknown methods *** // + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // *** extra for General Properties *** // + STDMETHOD(GetObjectInfo) (THIS_ DWORD dwObject, + DWORD FAR* lpdwObjSize, LPSTR FAR* lplpszLabel, + LPSTR FAR* lplpszType, LPSTR FAR* lplpszShortType, + LPSTR FAR* lplpszLocation) PURE; + STDMETHOD(GetConvertInfo) (THIS_ DWORD dwObject, + CLSID FAR* lpClassID, WORD FAR* lpwFormat, + CLSID FAR* lpConvertDefaultClassID, + LPCLSID FAR* lplpClsidExclude, UINT FAR* lpcClsidExclude) PURE; + STDMETHOD(ConvertObject) (THIS_ DWORD dwObject, REFCLSID clsidNew) PURE; + + // *** extra for View Properties *** // + STDMETHOD(GetViewInfo) (THIS_ DWORD dwObject, + HGLOBAL FAR* phMetaPict, DWORD* pdvAspect, int* pnCurrentScale) PURE; + STDMETHOD(SetViewInfo) (THIS_ DWORD dwObject, + HGLOBAL hMetaPict, DWORD dvAspect, + int nCurrentScale, BOOL bRelativeToOrig) PURE; +}; + +typedef IOleUIObjInfoA FAR* LPOLEUIOBJINFOA; + +#ifdef UNICODE +#define IOleUIObjInfo IOleUIObjInfoW +#define IOleUIObjInfoVtbl IOleUIObjInfoWVtbl +#define LPOLEUIOBJINFO LPOLEUIOBJINFOW +#else +#define IOleUIObjInfo IOleUIObjInfoA +#define IOleUIObjInfoVtbl IOleUIObjInfoAVtbl +#define LPOLEUIOBJINFO LPOLEUIOBJINFOA +#endif + +#undef INTERFACE +#define INTERFACE IOleUILinkInfoW + +DECLARE_INTERFACE_(IOleUILinkInfoW, IOleUILinkContainerW) +{ + // *** IUnknown methods *** // + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // *** IOleUILinkContainer *** // + STDMETHOD_(DWORD,GetNextLink) (THIS_ DWORD dwLink) PURE; + STDMETHOD(SetLinkUpdateOptions) (THIS_ DWORD dwLink, + DWORD dwUpdateOpt) PURE; + STDMETHOD(GetLinkUpdateOptions) (THIS_ DWORD dwLink, + DWORD FAR* lpdwUpdateOpt) PURE; + STDMETHOD(SetLinkSource) (THIS_ DWORD dwLink, LPWSTR lpszDisplayName, + ULONG lenFileName, ULONG FAR* pchEaten, BOOL fValidateSource) PURE; + STDMETHOD(GetLinkSource) (THIS_ DWORD dwLink, + LPWSTR FAR* lplpszDisplayName, ULONG FAR* lplenFileName, + LPWSTR FAR* lplpszFullLinkType, LPWSTR FAR* lplpszShortLinkType, + BOOL FAR* lpfSourceAvailable, BOOL FAR* lpfIsSelected) PURE; + STDMETHOD(OpenLinkSource) (THIS_ DWORD dwLink) PURE; + STDMETHOD(UpdateLink) (THIS_ DWORD dwLink, + BOOL fErrorMessage, BOOL fReserved) PURE; + STDMETHOD(CancelLink) (THIS_ DWORD dwLink) PURE; + + // *** extra for Link Properties *** // + STDMETHOD(GetLastUpdate) (THIS_ DWORD dwLink, + FILETIME FAR* lpLastUpdate) PURE; +}; + +typedef IOleUILinkInfoW FAR* LPOLEUILINKINFOW; + +#undef INTERFACE +#define INTERFACE IOleUILinkInfoA + +DECLARE_INTERFACE_(IOleUILinkInfoA, IOleUILinkContainerA) +{ + // *** IUnknown methods *** // + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // *** IOleUILinkContainer *** // + STDMETHOD_(DWORD,GetNextLink) (THIS_ DWORD dwLink) PURE; + STDMETHOD(SetLinkUpdateOptions) (THIS_ DWORD dwLink, + DWORD dwUpdateOpt) PURE; + STDMETHOD(GetLinkUpdateOptions) (THIS_ DWORD dwLink, + DWORD FAR* lpdwUpdateOpt) PURE; + STDMETHOD(SetLinkSource) (THIS_ DWORD dwLink, LPSTR lpszDisplayName, + ULONG lenFileName, ULONG FAR* pchEaten, BOOL fValidateSource) PURE; + STDMETHOD(GetLinkSource) (THIS_ DWORD dwLink, + LPSTR FAR* lplpszDisplayName, ULONG FAR* lplenFileName, + LPSTR FAR* lplpszFullLinkType, LPSTR FAR* lplpszShortLinkType, + BOOL FAR* lpfSourceAvailable, BOOL FAR* lpfIsSelected) PURE; + STDMETHOD(OpenLinkSource) (THIS_ DWORD dwLink) PURE; + STDMETHOD(UpdateLink) (THIS_ DWORD dwLink, + BOOL fErrorMessage, BOOL fReserved) PURE; + STDMETHOD(CancelLink) (THIS_ DWORD dwLink) PURE; + + // *** extra for Link Properties *** // + STDMETHOD(GetLastUpdate) (THIS_ DWORD dwLink, + FILETIME FAR* lpLastUpdate) PURE; +}; + +typedef IOleUILinkInfoA FAR* LPOLEUILINKINFOA; + +#ifdef UNICODE +#define IOleUILinkInfo IOleUILinkInfoW +#define IOleUILinkInfoVtbl IOleUILinkInfoWVtbl +#define LPOLEUILINKINFO LPOLEUILINKINFOW +#else +#define IOleUILinkInfo IOleUILinkInfoA +#define IOleUILinkInfoVtbl IOleUILinkInfoAVtbl +#define LPOLEUILINKINFO LPOLEUILINKINFOA +#endif + +struct tagOLEUIOBJECTPROPSW; +struct tagOLEUIOBJECTPROPSA; + +typedef struct tagOLEUIGNRLPROPSW +{ + // These IN fields are standard across all OLEUI property pages. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: flags specific to general page + DWORD dwReserved1[2]; + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + DWORD dwReserved2[3]; + + struct tagOLEUIOBJECTPROPSW* lpOP; // (used internally) + +} OLEUIGNRLPROPSW, *POLEUIGNRLPROPSW, FAR* LPOLEUIGNRLPROPSW; + +typedef struct tagOLEUIGNRLPROPSA +{ + // These IN fields are standard across all OLEUI property pages. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: flags specific to general page + DWORD dwReserved1[2]; + LPFNOLEUIHOOK lpfnHook; // Hook callback + LPARAM lCustData; // Custom data to pass to hook + DWORD dwReserved2[3]; + + struct tagOLEUIOBJECTPROPSA* lpOP; // (used internally) + +} OLEUIGNRLPROPSA, *POLEUIGNRLPROPSA, FAR* LPOLEUIGNRLPROPSA; + +#ifdef UNICODE +#define tagOLEUIGNRLPROPS tagOLEUIGNRLPROPSW +#define OLEUIGNRLPROPS OLEUIGNRLPROPSW +#define POLEUIGNRLPROPS POLEUIGNRLPROPSW +#define LPOLEUIGNRLPROPS LPOLEUIGNRLPROPSW +#else +#define tagOLEUIGNRLPROPS tagOLEUIGNRLPROPSA +#define OLEUIGNRLPROPS OLEUIGNRLPROPSA +#define POLEUIGNRLPROPS POLEUIGNRLPROPSA +#define LPOLEUIGNRLPROPS LPOLEUIGNRLPROPSA +#endif + +typedef struct tagOLEUIVIEWPROPSW +{ + // These IN fields are standard across all OLEUI property pages. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: flags specific to view page + DWORD dwReserved1[2]; + LPFNOLEUIHOOK lpfnHook; // Hook callback (not used in this dialog) + LPARAM lCustData; // Custom data to pass to hook + DWORD dwReserved2[3]; + + struct tagOLEUIOBJECTPROPSW* lpOP; // (used internally) + + int nScaleMin; // scale range + int nScaleMax; + +} OLEUIVIEWPROPSW, *POLEUIVIEWPROPSW, FAR* LPOLEUIVIEWPROPSW; + +typedef struct tagOLEUIVIEWPROPSA +{ + // These IN fields are standard across all OLEUI property pages. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: flags specific to view page + DWORD dwReserved1[2]; + LPFNOLEUIHOOK lpfnHook; // Hook callback (not used in this dialog) + LPARAM lCustData; // Custom data to pass to hook + DWORD dwReserved2[3]; + + struct tagOLEUIOBJECTPROPSA* lpOP; // (used internally) + + int nScaleMin; // scale range + int nScaleMax; + +} OLEUIVIEWPROPSA, *POLEUIVIEWPROPSA, FAR* LPOLEUIVIEWPROPSA; + +#ifdef UNICODE +#define tagOLEUIVIEWPROPS tagOLEUIVIEWPROPSW +#define OLEUIVIEWPROPS OLEUIVIEWPROPSW +#define POLEUIVIEWPROPS POLEUIVIEWPROPSW +#define LPOLEUIVIEWPROPS LPOLEUIVIEWPROPSW +#else +#define tagOLEUIVIEWPROPS tagOLEUIVIEWPROPSA +#define OLEUIVIEWPROPS OLEUIVIEWPROPSA +#define POLEUIVIEWPROPS POLEUIVIEWPROPSA +#define LPOLEUIVIEWPROPS LPOLEUIVIEWPROPSA +#endif + +// Flags for OLEUIVIEWPROPS +#define VPF_SELECTRELATIVE 0x00000001L // IN: relative to orig +#define VPF_DISABLERELATIVE 0x00000002L // IN: disable relative to orig +#define VPF_DISABLESCALE 0x00000004L // IN: disable scale option + +typedef struct tagOLEUILINKPROPSW +{ + // These IN fields are standard across all OLEUI property pages. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: flags specific to links page + DWORD dwReserved1[2]; + LPFNOLEUIHOOK lpfnHook; // Hook callback (not used in this dialog) + LPARAM lCustData; // Custom data to pass to hook + DWORD dwReserved2[3]; + + struct tagOLEUIOBJECTPROPSW* lpOP; // (used internally) + +} OLEUILINKPROPSW, *POLEUILINKPROPSW, FAR* LPOLEUILINKPROPSW; + +typedef struct tagOLEUILINKPROPSA +{ + // These IN fields are standard across all OLEUI property pages. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: flags specific to links page + DWORD dwReserved1[2]; + LPFNOLEUIHOOK lpfnHook; // Hook callback (not used in this dialog) + LPARAM lCustData; // Custom data to pass to hook + DWORD dwReserved2[3]; + + struct tagOLEUIOBJECTPROPSA* lpOP; // (used internally) + +} OLEUILINKPROPSA, *POLEUILINKPROPSA, FAR* LPOLEUILINKPROPSA; + +#ifdef UNICODE +#define tagOLEUILINKPROPS tagOLEUILINKPROPSW +#define OLEUILINKPROPS OLEUILINKPROPSW +#define POLEUILINKPROPS POLEUILINKPROPSW +#define LPOLEUILINKPROPS LPOLEUILINKPROPSW +#else +#define tagOLEUILINKPROPS tagOLEUILINKPROPSA +#define OLEUILINKPROPS OLEUILINKPROPSA +#define POLEUILINKPROPS POLEUILINKPROPSA +#define LPOLEUILINKPROPS LPOLEUILINKPROPSA +#endif + +#if (WINVER >= 0x400) +// Under Windows 95 prsht.h is NOT a part of the normal Windows +// environment, so we explicitly include it here to be safe. +#include <prsht.h> + +#ifndef PSM_SETFINISHTEXTA +// We are building under Windows 95. +// +// Under Windows 95 there are no wide-character definitions +// for the property sheet code. +// +// Since the UNICODE version of our API is not implemented on Windows 95, +// this only creates a semantic problem. The entry points will still +// look the same and the code will still work the same if we define +// LPPROPSHEETHEADERW to be the narrow version of the structure. + +typedef struct _PROPSHEETHEADER FAR* LPPROPSHEETHEADERW; +typedef struct _PROPSHEETHEADER FAR* LPPROPSHEETHEADERA; + +#else +// We are building under Windows NT. + +// Go ahead and define LPPROPSHEETHEADERW as it should be defined! + +typedef struct _PROPSHEETHEADERW FAR* LPPROPSHEETHEADERW; +typedef struct _PROPSHEETHEADERA FAR* LPPROPSHEETHEADERA; + +#ifdef UNICODE +#define LPPROPSHEETHEADER LPPROPSHEETHEADERW +#else +#define LPPROPSHEETHEADER LPPROPSHEETHEADERA +#endif + +#endif // PSM_SETFINISHTEXTA + +#else // WINVER + +// If WINVER < 0x400, then PROPSHEETHEADER stuff isn't defined. +// The user won't be able to use the prop-sheet code, so we just define the +// necessary structures to be void pointers to enable to header file to +// at least compile correctly. + +//typedef void FAR* LPPROPSHEETHEADERW; +//typedef void FAR* LPPROPSHEETHEADERA; + +#ifdef UNICODE +#define LPPROPSHEETHEADER LPPROPSHEETHEADERW +#else +#define LPPROPSHEETHEADER LPPROPSHEETHEADERA +#endif + +#endif // WINVER + +typedef struct tagOLEUIOBJECTPROPSW +{ + // These IN fields are standard across all OLEUI property sheets. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: global flags for the sheet + + // Standard PROPSHEETHEADER used for extensibility + LPPROPSHEETHEADERW lpPS; // IN: property sheet header + + // Data which allows manipulation of the object + DWORD dwObject; // IN: identifier for the object + LPOLEUIOBJINFOW lpObjInfo; // IN: interface to manipulate object + + // Data which allows manipulation of the link + DWORD dwLink; // IN: identifier for the link + LPOLEUILINKINFOW lpLinkInfo; // IN: interface to manipulate link + + // Data specfic to each page + LPOLEUIGNRLPROPSW lpGP; // IN: general page + LPOLEUIVIEWPROPSW lpVP; // IN: view page + LPOLEUILINKPROPSW lpLP; // IN: link page + +} OLEUIOBJECTPROPSW, *POLEUIOBJECTPROPSW, FAR* LPOLEUIOBJECTPROPSW; + +typedef struct tagOLEUIOBJECTPROPSA +{ + // These IN fields are standard across all OLEUI property sheets. + DWORD cbStruct; // Structure Size + DWORD dwFlags; // IN-OUT: global flags for the sheet + + // Standard PROPSHEETHEADER used for extensibility + LPPROPSHEETHEADERA lpPS; // IN: property sheet header + + // Data which allows manipulation of the object + DWORD dwObject; // IN: identifier for the object + LPOLEUIOBJINFOA lpObjInfo; // IN: interface to manipulate object + + // Data which allows manipulation of the link + DWORD dwLink; // IN: identifier for the link + LPOLEUILINKINFOA lpLinkInfo; // IN: interface to manipulate link + + // Data specfic to each page + LPOLEUIGNRLPROPSA lpGP; // IN: general page + LPOLEUIVIEWPROPSA lpVP; // IN: view page + LPOLEUILINKPROPSA lpLP; // IN: link page + +} OLEUIOBJECTPROPSA, *POLEUIOBJECTPROPSA, FAR* LPOLEUIOBJECTPROPSA; + +STDAPI_(UINT) OleUIObjectPropertiesW(LPOLEUIOBJECTPROPSW); +STDAPI_(UINT) OleUIObjectPropertiesA(LPOLEUIOBJECTPROPSA); + +#ifdef UNICODE +#define tagOLEUIOBJECTPROPS tagOLEUIOBJECTPROPSW +#define OLEUIOBJECTPROPS OLEUIOBJECTPROPSW +#define POLEUIOBJECTPROPS POLEUIOBJECTPROPSW +#define LPOLEUIOBJECTPROPS LPOLEUIOBJECTPROPSW +#define OleUIObjectProperties OleUIObjectPropertiesW +#else +#define tagOLEUIOBJECTPROPS tagOLEUIOBJECTPROPSA +#define OLEUIOBJECTPROPS OLEUIOBJECTPROPSA +#define POLEUIOBJECTPROPS POLEUIOBJECTPROPSA +#define LPOLEUIOBJECTPROPS LPOLEUIOBJECTPROPSA +#define OleUIObjectProperties OleUIObjectPropertiesA +#endif + +// Flags for OLEUIOBJECTPROPS +#define OPF_OBJECTISLINK 0x00000001L +#define OPF_NOFILLDEFAULT 0x00000002L +#define OPF_SHOWHELP 0x00000004L +#define OPF_DISABLECONVERT 0x00000008L + +// Errors for OleUIObjectProperties +#define OLEUI_OPERR_SUBPROPNULL (OLEUI_ERR_STANDARDMAX+0) +#define OLEUI_OPERR_SUBPROPINVALID (OLEUI_ERR_STANDARDMAX+1) +#define OLEUI_OPERR_PROPSHEETNULL (OLEUI_ERR_STANDARDMAX+2) +#define OLEUI_OPERR_PROPSHEETINVALID (OLEUI_ERR_STANDARDMAX+3) +#define OLEUI_OPERR_SUPPROP (OLEUI_ERR_STANDARDMAX+4) +#define OLEUI_OPERR_PROPSINVALID (OLEUI_ERR_STANDARDMAX+5) +#define OLEUI_OPERR_PAGESINCORRECT (OLEUI_ERR_STANDARDMAX+6) +#define OLEUI_OPERR_INVALIDPAGES (OLEUI_ERR_STANDARDMAX+7) +#define OLEUI_OPERR_NOTSUPPORTED (OLEUI_ERR_STANDARDMAX+8) +#define OLEUI_OPERR_DLGPROCNOTNULL (OLEUI_ERR_STANDARDMAX+9) +#define OLEUI_OPERR_LPARAMNOTZERO (OLEUI_ERR_STANDARDMAX+10) + +#define OLEUI_GPERR_STRINGINVALID (OLEUI_ERR_STANDARDMAX+11) +#define OLEUI_GPERR_CLASSIDINVALID (OLEUI_ERR_STANDARDMAX+12) +#define OLEUI_GPERR_LPCLSIDEXCLUDEINVALID (OLEUI_ERR_STANDARDMAX+13) +#define OLEUI_GPERR_CBFORMATINVALID (OLEUI_ERR_STANDARDMAX+14) +#define OLEUI_VPERR_METAPICTINVALID (OLEUI_ERR_STANDARDMAX+15) +#define OLEUI_VPERR_DVASPECTINVALID (OLEUI_ERR_STANDARDMAX+16) +#define OLEUI_LPERR_LINKCNTRNULL (OLEUI_ERR_STANDARDMAX+17) +#define OLEUI_LPERR_LINKCNTRINVALID (OLEUI_ERR_STANDARDMAX+18) + +#define OLEUI_OPERR_PROPERTYSHEET (OLEUI_ERR_STANDARDMAX+19) +#define OLEUI_OPERR_OBJINFOINVALID (OLEUI_ERR_STANDARDMAX+20) +#define OLEUI_OPERR_LINKINFOINVALID (OLEUI_ERR_STANDARDMAX+21) + +// wParam used by PSM_QUERYSIBLINGS +#define OLEUI_QUERY_GETCLASSID 0xFF00 // override class id for icon +#define OLEUI_QUERY_LINKBROKEN 0xFF01 // after link broken + +///////////////////////////////////////////////////////////////////////////// +// PROMPT USER DIALOGS + +int EXPORT FAR CDECL OleUIPromptUserW(int nTemplate, HWND hwndParent, ...); +int EXPORT FAR CDECL OleUIPromptUserA(int nTemplate, HWND hwndParent, ...); + +#ifdef UNICODE +#define OleUIPromptUser OleUIPromptUserW +#else +#define OleUIPromptUser OleUIPromptUserA +#endif + +STDAPI_(BOOL) OleUIUpdateLinksW(LPOLEUILINKCONTAINERW lpOleUILinkCntr, + HWND hwndParent, LPWSTR lpszTitle, int cLinks); +STDAPI_(BOOL) OleUIUpdateLinksA(LPOLEUILINKCONTAINERA lpOleUILinkCntr, + HWND hwndParent, LPSTR lpszTitle, int cLinks); + +#ifdef UNICODE +#define OleUIUpdateLinks OleUIUpdateLinksW +#else +#define OleUIUpdateLinks OleUIUpdateLinksA +#endif + +///////////////////////////////////////////////////////////////////////////// + +#pragma pack(pop) + +#ifdef __cplusplus +} +#endif + +#endif // RC_INVOKED + +#endif //_OLE2UI_H_ + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/oledlgs.h b/public/sdk/inc/mfc30/oledlgs.h new file mode 100644 index 000000000..0142158e4 --- /dev/null +++ b/public/sdk/inc/mfc30/oledlgs.h @@ -0,0 +1,162 @@ +/*++ BUILD Version: 0001 Increment this if a change has global effects + +Copyright (c) 1993-1994, Microsoft Corporation + +Module Name: + + oledlgs.h + +Abstract: + + Resource ID identifiers for the OLE common dialog boxes. + +--*/ + +// Help Button Identifier +#define IDC_OLEUIHELP 99 + +// Insert Object Dialog identifiers +#define IDC_IO_CREATENEW 2100 +#define IDC_IO_CREATEFROMFILE 2101 +#define IDC_IO_LINKFILE 2102 +#define IDC_IO_OBJECTTYPELIST 2103 +#define IDC_IO_DISPLAYASICON 2104 +#define IDC_IO_CHANGEICON 2105 +#define IDC_IO_FILE 2106 +#define IDC_IO_FILEDISPLAY 2107 +#define IDC_IO_RESULTIMAGE 2108 +#define IDC_IO_RESULTTEXT 2109 +#define IDC_IO_ICONDISPLAY 2110 +#define IDC_IO_OBJECTTYPETEXT 2111 //{{NOHELP}} +#define IDC_IO_FILETEXT 2112 //{{NOHELP}} +#define IDC_IO_FILETYPE 2113 +#define IDC_IO_INSERTCONTROL 2114 +#define IDC_IO_ADDCONTROL 2115 +#define IDC_IO_CONTROLTYPELIST 2116 + +// Paste Special Dialog identifiers +#define IDC_PS_PASTE 500 +#define IDC_PS_PASTELINK 501 +#define IDC_PS_SOURCETEXT 502 +#define IDC_PS_PASTELIST 503 //{{NOHELP}} +#define IDC_PS_PASTELINKLIST 504 //{{NOHELP}} +#define IDC_PS_DISPLAYLIST 505 +#define IDC_PS_DISPLAYASICON 506 +#define IDC_PS_ICONDISPLAY 507 +#define IDC_PS_CHANGEICON 508 +#define IDC_PS_RESULTIMAGE 509 +#define IDC_PS_RESULTTEXT 510 + +// Change Icon Dialog identifiers +#define IDC_CI_GROUP 120 //{{NOHELP}} +#define IDC_CI_CURRENT 121 +#define IDC_CI_CURRENTICON 122 +#define IDC_CI_DEFAULT 123 +#define IDC_CI_DEFAULTICON 124 +#define IDC_CI_FROMFILE 125 +#define IDC_CI_FROMFILEEDIT 126 +#define IDC_CI_ICONLIST 127 +#define IDC_CI_LABEL 128 //{{NOHELP} +#define IDC_CI_LABELEDIT 129 +#define IDC_CI_BROWSE 130 +#define IDC_CI_ICONDISPLAY 131 + +// Convert Dialog identifiers +#define IDC_CV_OBJECTTYPE 150 +#define IDC_CV_DISPLAYASICON 152 +#define IDC_CV_CHANGEICON 153 +#define IDC_CV_ACTIVATELIST 154 +#define IDC_CV_CONVERTTO 155 +#define IDC_CV_ACTIVATEAS 156 +#define IDC_CV_RESULTTEXT 157 +#define IDC_CV_CONVERTLIST 158 +#define IDC_CV_ICONDISPLAY 165 + +// Edit Links Dialog identifiers +#define IDC_EL_CHANGESOURCE 201 +#define IDC_EL_AUTOMATIC 202 +#define IDC_EL_CANCELLINK 209 +#define IDC_EL_UPDATENOW 210 +#define IDC_EL_OPENSOURCE 211 +#define IDC_EL_MANUAL 212 +#define IDC_EL_LINKSOURCE 216 +#define IDC_EL_LINKTYPE 217 +#define IDC_EL_LINKSLISTBOX 206 +#define IDC_EL_COL1 220 //{{NOHELP}} +#define IDC_EL_COL2 221 //{{NOHELP}} +#define IDC_EL_COL3 222 //{{NOHELP}} + +// Busy dialog identifiers +#define IDC_BZ_RETRY 600 +#define IDC_BZ_ICON 601 +#define IDC_BZ_MESSAGE1 602 //{{NOHELP}} +#define IDC_BZ_SWITCHTO 604 + +// Update Links dialog identifiers +#define IDC_UL_METER 1029 //{{NOHELP}} +#define IDC_UL_STOP 1030 //{{NOHELP}} +#define IDC_UL_PERCENT 1031 //{{NOHELP}} +#define IDC_UL_PROGRESS 1032 //{{NOHELP}} + +// User Prompt dialog identifiers +#define IDC_PU_LINKS 900 //{{NOHELP}} +#define IDC_PU_TEXT 901 //{{NOHELP}} +#define IDC_PU_CONVERT 902 //{{NOHELP}} +#define IDC_PU_ICON 908 //{{NOHELP}} + +// General Properties identifiers +#define IDC_GP_OBJECTNAME 1009 +#define IDC_GP_OBJECTTYPE 1010 +#define IDC_GP_OBJECTSIZE 1011 +#define IDC_GP_CONVERT 1013 +#define IDC_GP_OBJECTICON 1014 //{{NOHELP}} +#define IDC_GP_OBJECTLOCATION 1022 + +// View Properties identifiers +#define IDC_VP_PERCENT 1000 +#define IDC_VP_CHANGEICON 1001 +#define IDC_VP_EDITABLE 1002 +#define IDC_VP_ASICON 1003 +#define IDC_VP_RELATIVE 1005 +#define IDC_VP_SPIN 1006 +#define IDC_VP_SCALETXT 1034 +#define IDC_VP_ICONDISPLAY 1021 +#define IDC_VP_RESULTIMAGE 1033 + +// Link Properties identifiers +#define IDC_LP_OPENSOURCE 1006 +#define IDC_LP_UPDATENOW 1007 +#define IDC_LP_BREAKLINK 1008 +#define IDC_LP_LINKSOURCE 1012 +#define IDC_LP_CHANGESOURCE 1015 +#define IDC_LP_AUTOMATIC 1016 +#define IDC_LP_MANUAL 1017 +#define IDC_LP_DATE 1018 +#define IDC_LP_TIME 1019 + +// Dialog Identifiers as passed in Help messages to identify the source. +#define IDD_INSERTOBJECT 1000 +#define IDD_CHANGEICON 1001 +#define IDD_CONVERT 1002 +#define IDD_PASTESPECIAL 1003 +#define IDD_EDITLINKS 1004 +#define IDD_BUSY 1006 +#define IDD_UPDATELINKS 1007 +#define IDD_CHANGESOURCE 1009 +#define IDD_INSERTFILEBROWSE 1010 +#define IDD_CHANGEICONBROWSE 1011 +#define IDD_CONVERTONLY 1012 +#define IDD_CHANGESOURCE4 1013 +#define IDD_GNRLPROPS 1100 +#define IDD_VIEWPROPS 1101 +#define IDD_LINKPROPS 1102 + +// The following Dialogs are message dialogs used by OleUIPromptUser API +#define IDD_CANNOTUPDATELINK 1008 +#define IDD_LINKSOURCEUNAVAILABLE 1020 +#define IDD_SERVERNOTREG 1021 +#define IDD_LINKTYPECHANGED 1022 +#define IDD_SERVERNOTFOUND 1023 +#define IDD_OUTOFMEMORY 1024 + +///////////////////////////////////////////////////////////////////////////// diff --git a/public/sdk/inc/mfc30/res/copy4way.cur b/public/sdk/inc/mfc30/res/copy4way.cur Binary files differnew file mode 100644 index 000000000..e0f41447d --- /dev/null +++ b/public/sdk/inc/mfc30/res/copy4way.cur diff --git a/public/sdk/inc/mfc30/res/help.cur b/public/sdk/inc/mfc30/res/help.cur Binary files differnew file mode 100644 index 000000000..217090e5b --- /dev/null +++ b/public/sdk/inc/mfc30/res/help.cur diff --git a/public/sdk/inc/mfc30/res/help.rsc b/public/sdk/inc/mfc30/res/help.rsc Binary files differnew file mode 100644 index 000000000..3e21661ee --- /dev/null +++ b/public/sdk/inc/mfc30/res/help.rsc diff --git a/public/sdk/inc/mfc30/res/magnify.cur b/public/sdk/inc/mfc30/res/magnify.cur Binary files differnew file mode 100644 index 000000000..d9a7042cf --- /dev/null +++ b/public/sdk/inc/mfc30/res/magnify.cur diff --git a/public/sdk/inc/mfc30/res/magnify.rsc b/public/sdk/inc/mfc30/res/magnify.rsc Binary files differnew file mode 100644 index 000000000..5d0c3813a --- /dev/null +++ b/public/sdk/inc/mfc30/res/magnify.rsc diff --git a/public/sdk/inc/mfc30/res/minifwnd.bmp b/public/sdk/inc/mfc30/res/minifwnd.bmp Binary files differnew file mode 100644 index 000000000..b5861c4f7 --- /dev/null +++ b/public/sdk/inc/mfc30/res/minifwnd.bmp diff --git a/public/sdk/inc/mfc30/res/move4way.cur b/public/sdk/inc/mfc30/res/move4way.cur Binary files differnew file mode 100644 index 000000000..545afa10d --- /dev/null +++ b/public/sdk/inc/mfc30/res/move4way.cur diff --git a/public/sdk/inc/mfc30/res/nodrop.cur b/public/sdk/inc/mfc30/res/nodrop.cur Binary files differnew file mode 100644 index 000000000..9fc75a562 --- /dev/null +++ b/public/sdk/inc/mfc30/res/nodrop.cur diff --git a/public/sdk/inc/mfc30/res/psscr.bmp b/public/sdk/inc/mfc30/res/psscr.bmp Binary files differnew file mode 100644 index 000000000..1819cd5d9 --- /dev/null +++ b/public/sdk/inc/mfc30/res/psscr.bmp diff --git a/public/sdk/inc/mfc30/res/psscr_l.bmp b/public/sdk/inc/mfc30/res/psscr_l.bmp Binary files differnew file mode 100644 index 000000000..388032d45 --- /dev/null +++ b/public/sdk/inc/mfc30/res/psscr_l.bmp diff --git a/public/sdk/inc/mfc30/res/psscr_ld.bmp b/public/sdk/inc/mfc30/res/psscr_ld.bmp Binary files differnew file mode 100644 index 000000000..c3398e0ad --- /dev/null +++ b/public/sdk/inc/mfc30/res/psscr_ld.bmp diff --git a/public/sdk/inc/mfc30/res/psscr_r.bmp b/public/sdk/inc/mfc30/res/psscr_r.bmp Binary files differnew file mode 100644 index 000000000..6eab0fd61 --- /dev/null +++ b/public/sdk/inc/mfc30/res/psscr_r.bmp diff --git a/public/sdk/inc/mfc30/res/psscr_rd.bmp b/public/sdk/inc/mfc30/res/psscr_rd.bmp Binary files differnew file mode 100644 index 000000000..da0c879d3 --- /dev/null +++ b/public/sdk/inc/mfc30/res/psscr_rd.bmp diff --git a/public/sdk/inc/mfc30/res/psscroll.bmp b/public/sdk/inc/mfc30/res/psscroll.bmp Binary files differnew file mode 100644 index 000000000..8598ded38 --- /dev/null +++ b/public/sdk/inc/mfc30/res/psscroll.bmp diff --git a/public/sdk/inc/mfc30/res/sarrows.cur b/public/sdk/inc/mfc30/res/sarrows.cur Binary files differnew file mode 100644 index 000000000..b4e601ef0 --- /dev/null +++ b/public/sdk/inc/mfc30/res/sarrows.cur diff --git a/public/sdk/inc/mfc30/res/split.rsc b/public/sdk/inc/mfc30/res/split.rsc Binary files differnew file mode 100644 index 000000000..8afb35a95 --- /dev/null +++ b/public/sdk/inc/mfc30/res/split.rsc diff --git a/public/sdk/inc/mfc30/res/splith.cur b/public/sdk/inc/mfc30/res/splith.cur Binary files differnew file mode 100644 index 000000000..bb03d7734 --- /dev/null +++ b/public/sdk/inc/mfc30/res/splith.cur diff --git a/public/sdk/inc/mfc30/res/splitv.cur b/public/sdk/inc/mfc30/res/splitv.cur Binary files differnew file mode 100644 index 000000000..1fd0d55c8 --- /dev/null +++ b/public/sdk/inc/mfc30/res/splitv.cur diff --git a/public/sdk/inc/mfc30/res/trck4way.cur b/public/sdk/inc/mfc30/res/trck4way.cur Binary files differnew file mode 100644 index 000000000..974d02017 --- /dev/null +++ b/public/sdk/inc/mfc30/res/trck4way.cur diff --git a/public/sdk/inc/mfc30/res/trcknesw.cur b/public/sdk/inc/mfc30/res/trcknesw.cur Binary files differnew file mode 100644 index 000000000..f92de6e68 --- /dev/null +++ b/public/sdk/inc/mfc30/res/trcknesw.cur diff --git a/public/sdk/inc/mfc30/res/trckns.cur b/public/sdk/inc/mfc30/res/trckns.cur Binary files differnew file mode 100644 index 000000000..49e558267 --- /dev/null +++ b/public/sdk/inc/mfc30/res/trckns.cur diff --git a/public/sdk/inc/mfc30/res/trcknwse.cur b/public/sdk/inc/mfc30/res/trcknwse.cur Binary files differnew file mode 100644 index 000000000..7a7d8820d --- /dev/null +++ b/public/sdk/inc/mfc30/res/trcknwse.cur diff --git a/public/sdk/inc/mfc30/res/trckwe.cur b/public/sdk/inc/mfc30/res/trckwe.cur Binary files differnew file mode 100644 index 000000000..a069140e7 --- /dev/null +++ b/public/sdk/inc/mfc30/res/trckwe.cur diff --git a/public/sdk/inc/mfc30/winres.h b/public/sdk/inc/mfc30/winres.h new file mode 100644 index 000000000..441789706 --- /dev/null +++ b/public/sdk/inc/mfc30/winres.h @@ -0,0 +1,305 @@ +// Microsoft Foundation Classes C++ library. +// Copyright (C) 1992 Microsoft Corporation, +// All rights reserved. + +// This source code is only intended as a supplement to the +// Microsoft Foundation Classes Reference and Microsoft +// QuickHelp and/or WinHelp documentation provided with the library. +// See these sources for detailed information regarding the +// Microsoft Foundation Classes product. + +// winres.h - Windows resource definitions +// extracted from WINDOWS.H +// Version 3.10 +// Copyright (c) 1985-1992, Microsoft Corp. All rights reserved. +// + +#define VS_VERSION_INFO 1 + +#ifdef APSTUDIO_INVOKED +#define APSTUDIO_HIDDEN_SYMBOLS // Ignore following symbols +#endif + +#define OBM_CLOSE 32754 +#define OBM_UPARROW 32753 +#define OBM_DNARROW 32752 +#define OBM_RGARROW 32751 +#define OBM_LFARROW 32750 +#define OBM_REDUCE 32749 +#define OBM_ZOOM 32748 +#define OBM_RESTORE 32747 +#define OBM_REDUCED 32746 +#define OBM_ZOOMD 32745 +#define OBM_RESTORED 32744 +#define OBM_UPARROWD 32743 +#define OBM_DNARROWD 32742 +#define OBM_RGARROWD 32741 +#define OBM_LFARROWD 32740 +#define OBM_MNARROW 32739 +#define OBM_COMBO 32738 +#define OBM_UPARROWI 32737 +#define OBM_DNARROWI 32736 +#define OBM_RGARROWI 32735 +#define OBM_LFARROWI 32734 +#define OBM_OLD_CLOSE 32767 +#define OBM_SIZE 32766 +#define OBM_OLD_UPARROW 32765 +#define OBM_OLD_DNARROW 32764 +#define OBM_OLD_RGARROW 32763 +#define OBM_OLD_LFARROW 32762 +#define OBM_BTSIZE 32761 +#define OBM_CHECK 32760 +#define OBM_CHECKBOXES 32759 +#define OBM_BTNCORNERS 32758 +#define OBM_OLD_REDUCE 32757 +#define OBM_OLD_ZOOM 32756 +#define OBM_OLD_RESTORE 32755 +#define OCR_NORMAL 32512 +#define OCR_IBEAM 32513 +#define OCR_WAIT 32514 +#define OCR_CROSS 32515 +#define OCR_UP 32516 +#define OCR_SIZE 32640 +#define OCR_ICON 32641 +#define OCR_SIZENWSE 32642 +#define OCR_SIZENESW 32643 +#define OCR_SIZEWE 32644 +#define OCR_SIZENS 32645 +#define OCR_SIZEALL 32646 +#define OCR_ICOCUR 32647 +#define OIC_SAMPLE 32512 +#define OIC_HAND 32513 +#define OIC_QUES 32514 +#define OIC_BANG 32515 +#define OIC_NOTE 32516 + +#define WS_OVERLAPPED 0x00000000L +#define WS_POPUP 0x80000000L +#define WS_CHILD 0x40000000L +#define WS_CLIPSIBLINGS 0x04000000L +#define WS_CLIPCHILDREN 0x02000000L +#define WS_VISIBLE 0x10000000L +#define WS_DISABLED 0x08000000L +#define WS_MINIMIZE 0x20000000L +#define WS_MAXIMIZE 0x01000000L +#define WS_CAPTION 0x00C00000L +#define WS_BORDER 0x00800000L +#define WS_DLGFRAME 0x00400000L +#define WS_VSCROLL 0x00200000L +#define WS_HSCROLL 0x00100000L +#define WS_SYSMENU 0x00080000L +#define WS_THICKFRAME 0x00040000L +#define WS_MINIMIZEBOX 0x00020000L +#define WS_MAXIMIZEBOX 0x00010000L +#define WS_GROUP 0x00020000L +#define WS_TABSTOP 0x00010000L + +// other aliases +#define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX) +#define WS_POPUPWINDOW (WS_POPUP | WS_BORDER | WS_SYSMENU) +#define WS_CHILDWINDOW (WS_CHILD) +#define WS_TILED WS_OVERLAPPED +#define WS_ICONIC WS_MINIMIZE +#define WS_SIZEBOX WS_THICKFRAME +#define WS_TILEDWINDOW WS_OVERLAPPEDWINDOW + +#define VK_LBUTTON 0x01 +#define VK_RBUTTON 0x02 +#define VK_CANCEL 0x03 +#define VK_MBUTTON 0x04 +#define VK_BACK 0x08 +#define VK_TAB 0x09 +#define VK_CLEAR 0x0C +#define VK_RETURN 0x0D +#define VK_SHIFT 0x10 +#define VK_CONTROL 0x11 +#define VK_MENU 0x12 +#define VK_PAUSE 0x13 +#define VK_CAPITAL 0x14 +#define VK_ESCAPE 0x1B +#define VK_SPACE 0x20 +#define VK_PRIOR 0x21 +#define VK_NEXT 0x22 +#define VK_END 0x23 +#define VK_HOME 0x24 +#define VK_LEFT 0x25 +#define VK_UP 0x26 +#define VK_RIGHT 0x27 +#define VK_DOWN 0x28 +#define VK_SELECT 0x29 +#define VK_PRINT 0x2A +#define VK_EXECUTE 0x2B +#define VK_SNAPSHOT 0x2C +#define VK_INSERT 0x2D +#define VK_DELETE 0x2E +#define VK_HELP 0x2F +#define VK_NUMPAD0 0x60 +#define VK_NUMPAD1 0x61 +#define VK_NUMPAD2 0x62 +#define VK_NUMPAD3 0x63 +#define VK_NUMPAD4 0x64 +#define VK_NUMPAD5 0x65 +#define VK_NUMPAD6 0x66 +#define VK_NUMPAD7 0x67 +#define VK_NUMPAD8 0x68 +#define VK_NUMPAD9 0x69 +#define VK_MULTIPLY 0x6A +#define VK_ADD 0x6B +#define VK_SEPARATOR 0x6C +#define VK_SUBTRACT 0x6D +#define VK_DECIMAL 0x6E +#define VK_DIVIDE 0x6F +#define VK_F1 0x70 +#define VK_F2 0x71 +#define VK_F3 0x72 +#define VK_F4 0x73 +#define VK_F5 0x74 +#define VK_F6 0x75 +#define VK_F7 0x76 +#define VK_F8 0x77 +#define VK_F9 0x78 +#define VK_F10 0x79 +#define VK_F11 0x7A +#define VK_F12 0x7B +#define VK_F13 0x7C +#define VK_F14 0x7D +#define VK_F15 0x7E +#define VK_F16 0x7F +#define VK_F17 0x80 +#define VK_F18 0x81 +#define VK_F19 0x82 +#define VK_F20 0x83 +#define VK_F21 0x84 +#define VK_F22 0x85 +#define VK_F23 0x86 +#define VK_F24 0x87 +#define VK_NUMLOCK 0x90 +#define VK_SCROLL 0x91 + +#define SC_SIZE 0xF000 +#define SC_MOVE 0xF010 +#define SC_MINIMIZE 0xF020 +#define SC_MAXIMIZE 0xF030 +#define SC_NEXTWINDOW 0xF040 +#define SC_PREVWINDOW 0xF050 +#define SC_CLOSE 0xF060 +#define SC_VSCROLL 0xF070 +#define SC_HSCROLL 0xF080 +#define SC_MOUSEMENU 0xF090 +#define SC_KEYMENU 0xF100 +#define SC_ARRANGE 0xF110 +#define SC_RESTORE 0xF120 +#define SC_TASKLIST 0xF130 +#define SC_SCREENSAVE 0xF140 +#define SC_HOTKEY 0xF150 + +#define DS_ABSALIGN 0x01L +#define DS_SYSMODAL 0x02L +#define DS_LOCALEDIT 0x20L +#define DS_SETFONT 0x40L +#define DS_MODALFRAME 0x80L +#define DS_NOIDLEMSG 0x100L + +#ifdef _MAC +#define DS_WINDOWSUI 0x8000L +#endif + +#define SS_LEFT 0x00000000L +#define SS_CENTER 0x00000001L +#define SS_RIGHT 0x00000002L +#define SS_ICON 0x00000003L +#define SS_BLACKRECT 0x00000004L +#define SS_GRAYRECT 0x00000005L +#define SS_WHITERECT 0x00000006L +#define SS_BLACKFRAME 0x00000007L +#define SS_GRAYFRAME 0x00000008L +#define SS_WHITEFRAME 0x00000009L +#define SS_SIMPLE 0x0000000BL +#define SS_LEFTNOWORDWRAP 0x0000000CL +#define SS_NOPREFIX 0x00000080L + +#define BS_PUSHBUTTON 0x00000000L +#define BS_DEFPUSHBUTTON 0x00000001L +#define BS_CHECKBOX 0x00000002L +#define BS_AUTOCHECKBOX 0x00000003L +#define BS_RADIOBUTTON 0x00000004L +#define BS_3STATE 0x00000005L +#define BS_AUTO3STATE 0x00000006L +#define BS_GROUPBOX 0x00000007L +#define BS_USERBUTTON 0x00000008L +#define BS_AUTORADIOBUTTON 0x00000009L +#define BS_OWNERDRAW 0x0000000BL +#define BS_LEFTTEXT 0x00000020L + +#define ES_LEFT 0x00000000L +#define ES_CENTER 0x00000001L +#define ES_RIGHT 0x00000002L +#define ES_MULTILINE 0x00000004L +#define ES_UPPERCASE 0x00000008L +#define ES_LOWERCASE 0x00000010L +#define ES_PASSWORD 0x00000020L +#define ES_AUTOVSCROLL 0x00000040L +#define ES_AUTOHSCROLL 0x00000080L +#define ES_NOHIDESEL 0x00000100L +#define ES_OEMCONVERT 0x00000400L +#define ES_READONLY 0x00000800L +#define ES_WANTRETURN 0x00001000L + +#define SBS_HORZ 0x0000L +#define SBS_VERT 0x0001L +#define SBS_TOPALIGN 0x0002L +#define SBS_LEFTALIGN 0x0002L +#define SBS_BOTTOMALIGN 0x0004L +#define SBS_RIGHTALIGN 0x0004L +#define SBS_SIZEBOXTOPLEFTALIGN 0x0002L +#define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L +#define SBS_SIZEBOX 0x0008L + +#define LBS_NOTIFY 0x0001L +#define LBS_SORT 0x0002L +#define LBS_NOREDRAW 0x0004L +#define LBS_MULTIPLESEL 0x0008L +#define LBS_OWNERDRAWFIXED 0x0010L +#define LBS_OWNERDRAWVARIABLE 0x0020L +#define LBS_HASSTRINGS 0x0040L +#define LBS_USETABSTOPS 0x0080L +#define LBS_NOINTEGRALHEIGHT 0x0100L +#define LBS_MULTICOLUMN 0x0200L +#define LBS_WANTKEYBOARDINPUT 0x0400L +#define LBS_EXTENDEDSEL 0x0800L +#define LBS_DISABLENOSCROLL 0x1000L +#define LBS_STANDARD (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER) + +#define CBS_SIMPLE 0x0001L +#define CBS_DROPDOWN 0x0002L +#define CBS_DROPDOWNLIST 0x0003L +#define CBS_OWNERDRAWFIXED 0x0010L +#define CBS_OWNERDRAWVARIABLE 0x0020L +#define CBS_AUTOHSCROLL 0x0040L +#define CBS_OEMCONVERT 0x0080L +#define CBS_SORT 0x0100L +#define CBS_HASSTRINGS 0x0200L +#define CBS_NOINTEGRALHEIGHT 0x0400L +#define CBS_DISABLENOSCROLL 0x0800L + +// operation messages sent to DLGINIT +#define WM_USER 0x0400 +#define LB_ADDSTRING (WM_USER+1) +#define CB_ADDSTRING (WM_USER+3) + +#ifdef APSTUDIO_INVOKED +#undef APSTUDIO_HIDDEN_SYMBOLS +#endif + +#define IDOK 1 +#define IDCANCEL 2 +#define IDABORT 3 +#define IDRETRY 4 +#define IDIGNORE 5 +#define IDYES 6 +#define IDNO 7 + +#ifdef IDC_STATIC +#undef IDC_STATIC +#endif +#define IDC_STATIC (-1) |