|
///-////////////////////////////////////////////////////////////////////////////////////////////////
/// Autor: David Elias Flores Escalante
/// Company: TeleTracking SAC
/// URL: http://teletrackingsac.dnsalias.net
/// Date: 24/08/2008
/// File name: dWindow.cpp
/// License: Free, but autor and company must be mentioned.
///-////////////////////////////////////////////////////////////////////////////////////////////////
#include "dWindow.h"
#include "dFont.h"
HFONT EzCreateFont (HDC hdc,TCHAR * szFaceName, int iDeciPtHeight,
int iDeciPtWidth, int iAttributes, BOOL fLogRes);
dWindow::dWindow()
{
lstrcpy(Titulo,"");
}
BOOL dWindow::SetTitulo(LPCSTR szTitulo)
{
return(SetWindowText(hWnd,szTitulo));
}
LONG dWindow::GetId()
{
return (GetWindowLong(hWnd,GWL_ID));
}
HWND dWindow::GetHwnd()
{
return(hWnd);
}
HWND dWindow::GetPadre()
{
return(hParent);
}
int dWindow::GetHeight()
{
GetWindowRect(hWnd,&rect);
//GetClientRect(hWnd,&rect);
return(rect.bottom-rect.top);
}
int dWindow::GetWidth()
{
GetWindowRect(hWnd,&rect);
return(rect.right-rect.left);
}
HMENU dWindow::GetPopupMenu()
{
return (hPopUpMenu);
}
HINSTANCE dWindow::GetInstance()
{
return ((HINSTANCE)GetWindowLong(hWnd,GWL_HINSTANCE));
}
void dWindow::SetWindowFont(TCHAR* FontName,int size)
{
static HFONT hFont;
static HDC hdc;
hdc=GetDC(hWnd);
hFont = EzCreateFont ( hdc,FontName, size,0,0,TRUE) ;
SendMessage(hWnd,WM_SETFONT,(WPARAM) hFont,MAKELPARAM(TRUE, 0));
}
void dWindow::SetBKColor(COLORREF newColor)
{
SetClassLong(hWnd,GCL_HBRBACKGROUND,(LONG)CreateSolidBrush(newColor));
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.