|
@@ -3,6 +3,37 @@
|
|
#include "Global.h"
|
|
#include "Global.h"
|
|
#include "resource.h"
|
|
#include "resource.h"
|
|
|
|
|
|
|
|
+HBITMAP LoadImgFromFile(LPCTSTR lpPath)
|
|
|
|
+{
|
|
|
|
+ if (!PathFileExists(lpPath))
|
|
|
|
+ return NULL;
|
|
|
|
+
|
|
|
|
+ Bitmap *pBitmap = NULL;
|
|
|
|
+#ifdef UNICODE
|
|
|
|
+ *pBitmap = Bitmap::FromFile(lpPath);
|
|
|
|
+#else
|
|
|
|
+ BSTR strtmp = _bstr_t(lpPath);
|
|
|
|
+ pBitmap = Bitmap::FromFile(strtmp, TRUE);
|
|
|
|
+ SysFreeString(strtmp);
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+ HBITMAP hBitmap = NULL;
|
|
|
|
+ Status status = pBitmap->GetLastStatus();
|
|
|
|
+ if (Ok == status)
|
|
|
|
+ {
|
|
|
|
+ status = pBitmap->GetHBITMAP(Color(0, 0, 0), &hBitmap);
|
|
|
|
+ if (Ok == status)
|
|
|
|
+ {
|
|
|
|
+ // enjoy of bitmap;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (pBitmap)
|
|
|
|
+ delete pBitmap;
|
|
|
|
+
|
|
|
|
+ return hBitmap;
|
|
|
|
+}
|
|
|
|
+
|
|
TCHAR CWxMgr::m_szWeChatPath[MAX_PATH] = { 0 };
|
|
TCHAR CWxMgr::m_szWeChatPath[MAX_PATH] = { 0 };
|
|
CWxMgr::CWxMgr(CWnd *pMainWnd) :m_pMainWnd(pMainWnd)
|
|
CWxMgr::CWxMgr(CWnd *pMainWnd) :m_pMainWnd(pMainWnd)
|
|
{
|
|
{
|
|
@@ -140,7 +171,14 @@ VOID CWxMgr::AddMapItem(DWORD dwProcId, LPCTSTR lpItemName)
|
|
wxObjInfo.pWxButton->Create(lpItemName, WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX, CalcRect(), m_pMainWnd, GetFreeButtonId(dwProcId));
|
|
wxObjInfo.pWxButton->Create(lpItemName, WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX, CalcRect(), m_pMainWnd, GetFreeButtonId(dwProcId));
|
|
wxObjInfo.pWxButton->OffsetColor(CButtonST::BTNST_COLOR_BK_IN, 60);
|
|
wxObjInfo.pWxButton->OffsetColor(CButtonST::BTNST_COLOR_BK_IN, 60);
|
|
//wxObjInfo.pWxButton->DrawTransparent();
|
|
//wxObjInfo.pWxButton->DrawTransparent();
|
|
- wxObjInfo.pWxButton->SetIcon(ICON_CHECK);
|
|
|
|
|
|
+ //wxObjInfo.pWxButton->SetIcon(ICON_CHECK);
|
|
|
|
+#ifdef DEBUG
|
|
|
|
+ //HBITMAP hBitmapIn = (HBITMAP)::LoadImage(NULL, _T("E:\\bin\\WeChats2017\\image\\132.jpg"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
|
|
|
|
+ HBITMAP hBitmapIn = LoadImgFromFile(_T("E:\\bin\\WeChats2017\\image\\132.jpg"));
|
|
|
|
+ if (hBitmapIn)
|
|
|
|
+ wxObjInfo.pWxButton->SetBitmaps(hBitmapIn, COLORREF(0));
|
|
|
|
+#endif // DEBUG
|
|
|
|
+
|
|
wxObjInfo.pWxButton->ShowWindow(SW_SHOW);
|
|
wxObjInfo.pWxButton->ShowWindow(SW_SHOW);
|
|
wxObjInfo.pWxButton->SetCheck(FALSE);
|
|
wxObjInfo.pWxButton->SetCheck(FALSE);
|
|
|
|
|