问题1:
今天看了一个程序有些不太懂的地方,请各位高手指点一下:
void CZgGroupButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
// TODO: Add your code to draw the specified item
1 CRect rect = lpDrawItemStruct->rcItem;
2 CDC *pDC=CDC::FromHandle(lpDrawItemStruct->hDC);
3 UINT state = lpDrawItemStruct->itemState;
..............
}
想请问一下,第1行的lpDrawItemStruct->rcItem和第3行的lpDrawItemStruct->itemState值分别是多少?如何看?
问题2:
有查了一下"LPDRAWITEMSTRUCT"这个结构体:
typedef struct tagDRAWITEMSTRUCT {
UINT CtlType;
UINT CtlID;
UINT itemID;
UINT itemAction;
UINT itemState;
HWND hwndItem;
HDC hDC;
RECT rcItem;
ULONG_PTR itemData;
} DRAWITEMSTRUCT, NEAR *PDRAWITEMSTRUCT, FAR *LPDRAWITEMSTRUCT;
想请问一下在使用的过程中,是如何给该结构体里边各个成员赋值的?
今天看了一个程序有些不太懂的地方,请各位高手指点一下:
void CZgGroupButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
// TODO: Add your code to draw the specified item
1 CRect rect = lpDrawItemStruct->rcItem;
2 CDC *pDC=CDC::FromHandle(lpDrawItemStruct->hDC);
3 UINT state = lpDrawItemStruct->itemState;
..............
}
想请问一下,第1行的lpDrawItemStruct->rcItem和第3行的lpDrawItemStruct->itemState值分别是多少?如何看?
问题2:
有查了一下"LPDRAWITEMSTRUCT"这个结构体:
typedef struct tagDRAWITEMSTRUCT {
UINT CtlType;
UINT CtlID;
UINT itemID;
UINT itemAction;
UINT itemState;
HWND hwndItem;
HDC hDC;
RECT rcItem;
ULONG_PTR itemData;
} DRAWITEMSTRUCT, NEAR *PDRAWITEMSTRUCT, FAR *LPDRAWITEMSTRUCT;
想请问一下在使用的过程中,是如何给该结构体里边各个成员赋值的?
设置断点,调试进去看看就知道了。
问题2:
参考MSDN,DRAWITEMSTRUCT里面有说应该赋怎么样的值。
DRAWITEMSTRUCT各成员的值不是用来让用户设置的,而是由系统设置好供用户使用的。