#include "simplecontrol.h"
#include "ressources.h"

SimpleControl::SimpleControl(HWND hwndParent, int id)
{
    if(id == ID_MAIN)
        _hwnd = hwndParent;
    else
        _hwnd = GetDlgItem(hwndParent, id);
}

SimpleControl::SimpleControl(const SimpleControl &rhs):
    _hwnd(rhs._hwnd)
{}

SimpleControl::~SimpleControl()
{}

SimpleControl &SimpleControl::operator=(const SimpleControl &rhs)
{
    if(&rhs != this)
      _hwnd = rhs._hwnd;
    return (*this);
}

void SimpleControl::SetFocus()
{
    ::SetFocus(_hwnd);
}

HWND SimpleControl::Hwnd() const
{
    return _hwnd;
}
