lol, sorry.
It's probably easier if I post everything as it might be something else (although I don't see how) doing it..
Controls.h
Code:
#include <windows.h>
class MCCBase{
public:
MCCBase();
~MCCBase();
void SetMetrics(int,int,int,int);
void SetMetrics(LPRECT);
void SetCaption(LPSTR);
void GetMetrics(LPRECT);
void SetParentWnd(HWND*);
void EnableSubClass(BOOL,BOOL,BOOL,BOOL,BOOL,BOOL);
void OnCreate(LPCREATESTRUCT);
void OnSize(int,int);
void OnMove(int,int);
void OnPaint(HDC);
void OnDraw(UINT,LPDRAWITEMSTRUCT);
LRESULT CALLBACK CtrlProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
private:
int x,y,cx,cy,create,size,move,paint,draw;
DWORD style,exStyle;
char *className,label;
HWND ctrl,parent;
};
Controls.cpp
Code:
#include "controls.h"
MCCBase::MCCBase()
{
int x=0,y=0,cx=0,cy=0;
DWORD style=0,exStyle=0;
char *className="",*label="";
HWND ctrl=NULL,parent=NULL;
}
MCCBase::~MCCBase()
{
}
LRESULT CALLBACK MCCBase::CtrlProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
{
switch(message)
{
case WM_CREATE
default:
return DefWindowProc(hwnd,message,wParam,lParam);
}
return 0;
}
void MCCBase::EnableSubClass(BOOL cmd,BOOL create,BOOL size,BOOL move,BOOL draw,BOOL paint)
{
if(cmd == TRUE)
SetWindowLong(ctrl,GWL_WNDPROC,CtrlProc);
}