You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.4 KiB
52 lines
1.4 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 01/01/2000
|
|
// Last modification: 08/10/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: ImageButton.cpp
|
|
// AUTHOR: Sergey Chizhevskiy
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Source file of ImageButton.cpp
|
|
//----------------------------------------------------------------------------
|
|
#include "stdafx.h"
|
|
#include "ImageButton.h"
|
|
#include "..\LgLib\Version.h"
|
|
|
|
CImageButton::CImageButton()
|
|
{
|
|
m_hWnd = NULL;
|
|
}
|
|
|
|
CImageButton::~CImageButton()
|
|
{
|
|
Destroy();
|
|
}
|
|
|
|
BOOL CImageButton::Create( UINT nCtrlID, DWORD dwStyle, HBITMAP hBitmap, LPCTSTR pName, HWND hParent, INT x, INT y, INT cx, INT cy )
|
|
{
|
|
HINSTANCE hInstance = (HINSTANCE)::GetWindowLong( hParent, GWL_HINSTANCE );
|
|
|
|
m_hWnd = ::CreateWindowEx( 0, "BUTTON", NULL, dwStyle | WS_CHILD, x, y, cx, cy, hParent, NULL, hInstance, this );
|
|
if( !m_hWnd )
|
|
return FALSE;
|
|
|
|
if( dwStyle & BS_BITMAP )
|
|
::SendMessage( m_hWnd, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap );
|
|
else
|
|
::SetWindowText( m_hWnd, pName );
|
|
|
|
::SetWindowLong( m_hWnd, GWL_ID, nCtrlID );
|
|
::ShowWindow( m_hWnd, SW_SHOW );
|
|
::UpdateWindow( m_hWnd );
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
void CImageButton::Destroy()
|
|
{
|
|
if( m_hWnd )
|
|
::DestroyWindow( m_hWnd );
|
|
}
|