MWWIN.H

//////////////////////////////////////////////////////////////////////////////// 
// mwwin.h
//
// Copyright (C) 1987-1997 By Microsoft Corp. All rights reserved.
// Copyright (C) 1997 Metawise Computing, Inc. All rights reserved.
//
////////////////////////////////////////////////////////////////////////////////


#include "cstring.h"

#ifndef _MWWIN_H_
#define _MWWIN_H_

////////////////////////////////////////////////////////////////////////////////

class CWnd
{
public:
// Constructor/Destructor
CWnd ();

public:
// Initialization
BOOL Attach (HWND hWnd);
HWND Detach ();

// Window Access Functions
HWND GetParent () const;

// Window State Functions
BOOL EnableWindow (BOOL bEnable = TRUE);

// Window Text Functions
void GetWindowText (CString& strText) const;
int GetWindowTextLength () const;
void SetWindowText (LPCTSTR lpszText);

// Window Message Functions
LRESULT SendMessage (UINT nMessage, WPARAM wParam = 0, LPARAM lParam = 0);

// Attributes
HWND m_hWnd;
};


class CButton : public CWnd
{
public:
// Constructor/Destructor
CButton ();

public:
// General Operations
int GetCheck () const;
void SetCheck (int nCheck);
};


class CComboBox : public CWnd
{
public:
// Constructor/Destructor
CComboBox ();

public:
// General Operations
int GetCount () const;
int GetCurSel () const;
int SetCurSel (int nIndex);
int GetLBText (int nIndex, LPTSTR lpszText) const;
void GetLBText (int nIndex, CString& strText) const;
int GetLBTextLen (int nIndex) const;

// String Operations
int AddString (LPCTSTR lpszItem);
int DeleteString (UINT nIndex);
void ResetContent ();
int FindString (int nStartAfter, LPCTSTR lpszItem) const;
int SelectString (int nStartAfter, LPCTSTR lpszItem);
};


class CEdit : public CWnd
{
public:
// Constructor/Destructor
CEdit ();

// General Operations
BOOL GetModify () const;
void SetLimitText (UINT nMaxBytes);
};


class CListBox : public CWnd
{
public:
// Constructor/Destructor
CListBox ();

public:
// General Operations
int GetCount () const;// return LB_ERR if error occurs
DWORD GetItemData (int nIndex) const;
int SetItemData (int nIndex, DWORD dwData);
int GetText (int nIndex, LPTSTR lpszText) const;
void GetText (int nIndex, CString& strText) const;
int GetTextLen (int nIndex) const;

// Single-Selection Operations
int GetCurSel () const;
int SetCurSel (int nIndex);// nIndex is 0-based

// String Operation
int AddString (LPCTSTR lpszItem);
int DeleteString (UINT nIndex);// nIndex is 0-based
int SelectString (int nStartAfter, LPCTSTR lpszItem);
};


class CStatic : public CWnd
{
public:
// Constructor/Destructor
CStatic ();
};


////////////////////////////////////////////////////////////////////////////////

#endif // _MWWIN_H_