⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 movdlg.cpp

📁 一个简单的WINCE下的LISTBOX图片显示程序
💻 CPP
字号:
// movDlg.cpp : implementation file
//

#include "stdafx.h"
#include "mov.h"
#include "movDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMovDlg dialog

CMovDlg::CMovDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CMovDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CMovDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CMovDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMovDlg)
	DDX_Control(pDX, IDC_LIST1, m_list);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CMovDlg, CDialog)
	//{{AFX_MSG_MAP(CMovDlg)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMovDlg message handlers

BOOL CMovDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	CenterWindow(GetDesktopWindow());	// center to the hpc screen

	

m_list.InsertColumn(1,L"zhong",LVCFMT_LEFT,50);

for(int j=0;j<30;j++)
	{
	int i;
	i=m_list.InsertItem(0,L"dfd");
	}

	m_list.SetBkImage(IDB_IMAGES_BK);

	// TODO: Add extra initialization here

 	/*DWORD dwStyle = m_list.GetExtendedStyle();
	dwStyle |= LVS_EX_FULLROWSELECT | LVS_ALIGNTOP | WS_HSCROLL  ;

    ::SetWindowLong(m_list.m_hWnd,   GWL_STYLE,   dwStyle);

	m_list.SetExtendedStyle(dwStyle);

	//m_list.SetBkColor(ILD_TRANSPARENT);
	
	 m_list.SetTextBkColor(CLR_NONE);
	
	 m_list.SetBkImage(IDB_IMAGES_BK);*/
	return TRUE;  // return TRUE  unless you set the focus to a control
}



void CMovDlg::OnPaint() 
{
CPaintDC dc(this); // device context for painting
	
	if (IsIconic())
	{
		CPaintDC dc(this); // device context for painting

		//SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

		// Center icon in client rectangle
		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;

		// Draw the icon
		dc.DrawIcon(x, y, m_hIcon);
	}
	else
	{
		CDialog::OnPaint();
	}	
 
	
	// Do not call CDialog::OnPaint() for painting messages
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -