使用mfc的cbitmapbutton或者cbuttonst等类很容易在按钮上画出位图+文字的button.但是如果不使用mfc该怎么画呢?下面就是纯粹的sdk做的位图+文字的button:
#include "stdafx.h"#include "resource.h" 【程序编程相关:使用Tangram构造你自己的软件开发平】
// ownerdrawbtn.cpp : defines the entry point for the application.// 【推荐阅读:在pocketpc2003中如何回调bu】
static hinstance hinst; // current instancestatic hicon hicon = null; 【扩展信息:在使用浏览器控件的程序中判断HTTP错误】
#define icon_height 32#define icon_width 32
static void initializedialog(hwnd hwnd);static void drawtheicon(hwnd hbuttonwnd, hdc* dc, bool bhastitle, rect* rpitem, rect* rptitle, bool bispressed, bool bisdisabled);static void prepareimagerect(hwnd hbuttonwnd, bool bhastitle, rect* rpitem, rect* rptitle, bool bispressed, dword dwwidth, dword dwheight, rect* rpimage);
lresult callback dialogfunc(hwnd hwnd, uint message, wparam wparam, lparam lparam);
... 下一页