This commit is contained in:
Erich Willems 2019-07-18 23:23:31 +02:00
commit 733fadd44d
20 changed files with 5055 additions and 0 deletions

2848
TaskDialogEmu.h Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,913 @@
//DLU ist definiert als:
//DLUx := 4/CharBreite, also 4/BaseUnit.cx
//DLUy := 8/CharHöhe; also (/BaseUnit.cy
/*
bu/4 = pix/dlu==>
4/bu = dlu/pix
pix*4/bu =dlu
*/
#define TBU PixSize
struct ActBaseUnit
{static TBU& val(){static TBU x(0,0);
return x;
}
static void val(const PixSize& s){val().cx=s.cx;
val().cy=s.cy;
PixSize tst=val();
}
};
typedef struct tagDLURECT
{
LONG left;
LONG top;
LONG right;
LONG bottom;
} DLURECT, *PDLURECT, NEAR *NPDLURECT, FAR *LPDLURECT;
typedef const DLURECT FAR* LPCDLURECT;
typedef struct _DLURECTL /* rcl */
{
LONG left;
LONG top;
LONG right;
LONG bottom;
} DLURECTL, *PDLURECTL, *LPDLURECTL;
typedef const DLURECTL FAR* LPCDLURECTL;
typedef struct tagDLUPOINT
{
LONG x;
LONG y;
} DLUPOINT, *PDLUPOINT, NEAR *NPDLUPOINT, FAR *LPDLUPOINT;
typedef struct _DLUPOINTL /* ptl */
{
LONG x;
LONG y;
} DLUPOINTL, *PDLUPOINTL;
typedef struct tagDLUSIZE
{
LONG cx;
LONG cy;
} DLUSIZE, *PDLUSIZE, *LPDLUSIZE;
typedef DLUSIZE DLUSIZEL;
typedef DLUSIZE *PDLUSIZEL, *LPDLUSIZEL;
typedef struct tagDLUPOINTS
{
#ifndef _MAC
SHORT x;
SHORT y;
#else
SHORT y;
SHORT x;
#endif
} DLUPOINTS, *PDLUPOINTS, *LPDLUPOINTS;
class DLUSize;
class DLUPoint;
class DLURect;
struct xDlu
{LONG n;
operator xPix(){xPix erg;erg.n= MulDiv(n, ActBaseUnit().val().cx, 4);return erg;}
xPix pix(){return xPix(MulDiv(n, ActBaseUnit().val().cx, 4));}
xDlu& operator=(const xPix& x){n=MulDiv(x.n, 4,ActBaseUnit().val().cx);return *this;}
xDlu():n(0){}
explicit xDlu(LONG x):n(x){}
};
struct yDlu
{LONG n;
operator yPix(){yPix erg;erg.n= MulDiv(n, ActBaseUnit().val().cx, 8);return erg;}
yPix pix(){return yPix(MulDiv(n, ActBaseUnit().val().cx, 8));}
yDlu& operator=(const yPix& x){n=MulDiv(x.n, 8,ActBaseUnit().val().cx);return *this;}
yDlu():n(0){}
explicit yDlu(LONG x):n(x){}
};
class DLUSize : public DLUSIZE
{
public:typedef DLUSize Tp;
operator xDlu(){return xDlu(cx);}
xDlu dluX(){return xDlu(cx);}
operator yDlu(){return yDlu(cy);}
yDlu dluY(){return yDlu(cy);}
operator xPix(){return xDlu(cx);}
xPix pixX(){return xPix(pix().cx);}
operator yPix(){return yDlu(cy);}
yPix pixY(){return yPix(pix().cy);}
PixSize pix(){return *this;}
operator PixSize(){PixSize erg;erg.cx=MulDiv(cx, ActBaseUnit().val().cx, 4);
erg.cy=MulDiv(cy, ActBaseUnit().val().cy, 8);
return erg;
}
DLUSize& operator=(const PixSize& x){DLUSize erg;erg.cx=MulDiv(x.cx, 4,ActBaseUnit().val().cx);
erg.cy=MulDiv(x.cy, 8, ActBaseUnit().val().cy);
*this=erg;
return *this;
}
// Constructors
DLUSize& operator+=(const DLUSize& x){cx+=x.cx;
cy+=x.cy;
return *this;
}
DLUSize()
{
cx = 0;
cy = 0;
}
DLUSize(int initCX, int initCY)
{
cx = initCX;
cy = initCY;
}
DLUSize(DLUSIZE initSize)
{
*(DLUSIZE*)this = initSize;
}
DLUSize(DLUPOINT initPt)
{
*(DLUPOINT*)this = initPt;
}
DLUSize(DWORD dwSize)
{
cx = (short)LOWORD(dwSize);
cy = (short)HIWORD(dwSize);
}
// Operations
DLUSize& operator=(const DLURECT& r) {cx =r.right-r.left;return *this;}
DLUSize& operator=(LONG sz) {cx =sz;cy=sz ;return *this;}
BOOL operator ==(DLUSIZE size) const
{
return (cx == size.cx && cy == size.cy);
}
BOOL operator !=(DLUSIZE size) const
{
return (cx != size.cx || cy != size.cy);
}
void operator +=(DLUSIZE size)
{
cx += size.cx;
cy += size.cy;
}
void operator -=(DLUSIZE size)
{
cx -= size.cx;
cy -= size.cy;
}
void SetSize(int CX, int CY)
{
cx = CX;
cy = CY;
}
// Operators returning DLUSize values
DLUSize operator +(DLUSIZE size) const
{
return DLUSize(cx + size.cx, cy + size.cy);
}
DLUSize operator -(DLUSIZE size) const
{
return DLUSize(cx - size.cx, cy - size.cy);
}
DLUSize operator -() const
{
return DLUSize(-cx, -cy);
}
// Operators returning DLUPoint values
DLUPoint operator +(DLUPOINT point) const;
DLUPoint operator -(DLUPOINT point) const;
// Operators returning DLURect values
DLURect operator +(const DLURECT* lpRect) const;
DLURect operator -(const DLURECT* lpRect) const;
};
///////////////////////////////////////////////////////////////////////////////
// DLUPoint - Wrapper for Windows DLUPOINT structure.
class DLUPoint : public DLUPOINT
{
public:
PixPoint pix(){return *this;}
operator PixPoint(){PixPoint erg;erg.x=MulDiv(x, ActBaseUnit().val().cx, 4);
erg.y=MulDiv(y, ActBaseUnit().val().cy, 8);
return erg;
}
DLUPoint& operator=(const PixPoint& x){DLUPoint erg;erg.x=MulDiv(x.x, 4,ActBaseUnit().val().cx);
erg.y=MulDiv(x.y, 8, ActBaseUnit().val().cy);
*this=erg;
return *this;
}
// Constructors
DLUPoint& operator+=(const DLUSize& x){this->x+=x.cx;
this->y+=x.cy;
return *this;
}
// Constructors
DLUPoint(const DLUSize& a){x =a.cx;y=a.cy;}
DLUPoint()
{
x = 0;
y = 0;
}
DLUPoint(int initX, int initY)
{
x = initX;
y = initY;
}
DLUPoint(DLUPOINT initPt)
{
*(DLUPOINT*)this = initPt;
}
DLUPoint(DLUSIZE initSize)
{
*(DLUSIZE*)this = initSize;
}
DLUPoint(DWORD dwPoint)
{
x = (short)LOWORD(dwPoint);
y = (short)HIWORD(dwPoint);
}
// Operations
DLUPoint& operator=(const DLURECT& b) {x =b.left;y=b.top;return *this;}
void Offset(int xOffset, int yOffset)
{
x += xOffset;
y += yOffset;
}
void Offset(DLUPOINT point)
{
x += point.x;
y += point.y;
}
void Offset(DLUSIZE size)
{
x += size.cx;
y += size.cy;
}
BOOL operator ==(DLUPOINT point) const
{
return (x == point.x && y == point.y);
}
BOOL operator !=(DLUPOINT point) const
{
return (x != point.x || y != point.y);
}
void operator +=(DLUSIZE size)
{
x += size.cx;
y += size.cy;
}
void operator -=(DLUSIZE size)
{
x -= size.cx;
y -= size.cy;
}
void operator +=(DLUPOINT point)
{
x += point.x;
y += point.y;
}
void operator -=(DLUPOINT point)
{
x -= point.x;
y -= point.y;
}
void SetPoint(int X, int Y)
{
x = X;
y = Y;
}
// Operators returning DLUPoint values
DLUPoint operator +(DLUSIZE size) const
{
return DLUPoint(x + size.cx, y + size.cy);
}
DLUPoint operator -(DLUSIZE size) const
{
return DLUPoint(x - size.cx, y - size.cy);
}
DLUPoint operator -() const
{
return DLUPoint(-x, -y);
}
DLUPoint operator +(DLUPOINT point) const
{
return DLUPoint(x + point.x, y + point.y);
}
// Operators returning DLUSize values
DLUSize operator -(DLUPOINT point) const
{
return DLUSize(x - point.x, y - point.y);
}
// Operators returning DLURect values
DLURect operator +(const DLURECT* lpRect) const;
DLURect operator -(const DLURECT* lpRect) const;
};
///////////////////////////////////////////////////////////////////////////////
// DLURect - Wrapper for Windows DLURECT structure.
class DLURect : public DLURECT
{
public:
DLURect& adjust()const{const_cast<DLURect*>(this)->right =max(left,right);
const_cast<DLURect*>(this)->bottom=max(top ,bottom);
return *const_cast<DLURect*>(this);
}
PixRect pix(){adjust();return *this;}
operator PixRect(){adjust();
PixRect erg;erg.left=::MulDiv(left, ActBaseUnit().val().cx, 4);
erg.right=::MulDiv(right, ActBaseUnit().val().cx, 4);
erg.top=::MulDiv(top, ActBaseUnit().val().cy, 8);
erg.bottom=::MulDiv(bottom, ActBaseUnit().val().cy, 8);
return erg;
}
DLURect& operator=(const PixRect& x){DLURect erg;erg.left =::MulDiv(x.left, 4,ActBaseUnit().val().cx);
erg.right =::MulDiv(x.right, 4,ActBaseUnit().val().cx);
erg.top =::MulDiv(x.top, 8, ActBaseUnit().val().cy);
erg.bottom=::MulDiv(x.bottom, 8, ActBaseUnit().val().cy);
*this=erg;
return *this;
}
public:
// Constructors
DLUSize size(){adjust();
if(right < left) right=left;
if(bottom < top) bottom=top;
DLUSize s;
s.cx=right-left;
s.cy=bottom-top;
return s;
}
DLURect(const DLUSize& s){adjust();
*this =s;}
DLURect(const DLUPoint& x){*this =x;}
DLURect& sizeMax(const DLURect& plt ,const DLURect& prb)
{adjust();
plt.adjust();
prb.adjust();
DLUSize nsz=DLURect(plt.left,plt.top,prb.right,prb.bottom).size();
DLUSize sz =size();
DLUSize mx(max(nsz.cx,sz.cx)
,max(nsz.cy,sz.cy)
);
*this =mx;
return *this;
}
DLURect()
{
left = 0;
top = 0;
right = 0;
bottom = 0;
}
DLURect(int l, int t, int r, int b)
{
left = l;
top = t;
right = r;
bottom = b;
}
DLURect(DLURect& srDLURect)
{
srDLURect.adjust();
*this =srDLURect;//::CopyRect(this, (LPDLURECT)&srDLURect);
}
DLURect(const DLURECT& srDLURect)
{
*this =srDLURect;//::CopyRect(this, (LPDLURECT)&srDLURect);
adjust();
}
DLURect(LPCDLURECT lpSrDLURect)
{
*this=lpSrDLURect;//::CopyRect(this, lpSrDLURect);
adjust();
}
DLURect(DLUPOINT point, DLUSIZE size)
{
right = (left = point.x) + size.cx;
bottom = (top = point.y) + size.cy;
}
DLURect(DLUPOINT topLeft, DLUPOINT bottomRight)
{
left = topLeft.x;
top = topLeft.y;
right = bottomRight.x;
bottom = bottomRight.y;
}
// Attributes (in addition to DLURECT members)
int Width() const
{ adjust();
return right - left;
}
int Height() const
{
adjust();
return bottom - top;
}
DLUSize Size() const
{
adjust();
return DLUSize(right - left, bottom - top);
}
DLUPoint& TopLeft()
{
return *((DLUPoint*)this);
}
DLUPoint& point()
{
return *((DLUPoint*)this);
}
DLUPoint& BottomRight()
{
return *((DLUPoint*)this + 1);
}
const DLUPoint& TopLeft() const
{
return *((DLUPoint*)this);
}
const DLUPoint& BottomRight() const
{
adjust();
return *((DLUPoint*)this + 1);
}
DLUPoint CenterPoint() const
{
adjust();
return DLUPoint((left + right) / 2, (top + bottom) / 2);
}
// convert between DLURect and LPRECT/LPCRECT (no need for &)
operator LPDLURECT()
{
adjust();
return this;
}
operator LPCDLURECT() const
{
adjust();
return this;
}
BOOL IsRectEmpty() const
{
adjust();
return ::IsRectEmpty((RECT*)this);
}
BOOL IsRectNull() const
{
return (left == 0 && right == 0 && top == 0 && bottom == 0);
}
BOOL PtInRect(DLUPOINT point) const
{
adjust();
return ::PtInRect((RECT*)this, *((POINT*)&point));
}
// Operations
void SetRect(int x1, int y1, int x2, int y2)
{
::SetRect((RECT*)this, x1, y1, x2, y2);
}
void SetRect(DLUPOINT topLeft, DLUPOINT bottomRight)
{
::SetRect((RECT*)this, topLeft.x, topLeft.y, bottomRight.x, bottomRight.y);
}
void SetRectEmpty()
{
::SetRectEmpty((RECT*)this);
}
void CopyRect(LPCRECT lpSrDLURect)
{
adjust();
::CopyRect((RECT*)this, (RECT*)lpSrDLURect);
}
BOOL EqualRect(LPCRECT lpRect) const
{
adjust();
return ::EqualRect((RECT*)this, (RECT*)lpRect);
}
void InflateRect(int x, int y)
{
adjust();
::InflateRect((RECT*)this, x, y);
}
void InflateRect(DLUSIZE size)
{
adjust();
::InflateRect((RECT*)this, size.cx, size.cy);
}
void InflatDLURect(LPCRECT lpRect)
{
adjust();
left -= lpRect->left;
top -= lpRect->top;
right += lpRect->right;
bottom += lpRect->bottom;
}
void InflatDLURect(int l, int t, int r, int b)
{
adjust();
left -= l;
top -= t;
right += r;
bottom += b;
}
void DeflateRect(int x, int y)
{
adjust();
::InflateRect((RECT*)this, -x, -y);
}
void Deflateect(DLUSIZE size)
{
adjust();
::InflateRect((RECT*)this, -size.cx, -size.cy);
}
void DeflateRect(LPCRECT lpRect)
{
adjust();
left += lpRect->left;
top += lpRect->top;
right -= lpRect->right;
bottom -= lpRect->bottom;
}
void DeflateRect(int l, int t, int r, int b)
{
adjust();
left += l;
top += t;
right -= r;
bottom -= b;
}
void OffsetRect(int x, int y)
{
adjust();
::OffsetRect((RECT*)this, x, y);
}
void OffsetRect(DLUSIZE size)
{
adjust();
::OffsetRect((RECT*)this, size.cx, size.cy);
}
void OffsetRect(DLUPOINT point)
{
adjust();
::OffsetRect((RECT*)this, point.x, point.y);
}
void NormalizDLURect()
{
adjust();
int nTemp;
if (left > right)
{
nTemp = left;
left = right;
right = nTemp;
}
if (top > bottom)
{
nTemp = top;
top = bottom;
bottom = nTemp;
}
}
// absolute position of rectangle
void MoveToY(int y)
{
adjust();
bottom = Height() + y;
top = y;
}
void MoveToX(int x)
{
adjust();
right = Width() + x;
left = x;
}
void MoveToXY(int x, int y)
{
adjust();
MoveToX(x);
MoveToY(y);
}
void MoveToXY(DLUPOINT pt)
{
adjust();
MoveToX(pt.x);
MoveToY(pt.y);
}
// operations that fill '*this' with result
BOOL IntersectRect(LPCRECT lpRect1, LPCRECT lpRect2)
{
adjust();
return ::IntersectRect((RECT*)this, (RECT*)lpRect1, (RECT*)lpRect2);
}
BOOL UnionRect(LPCRECT lpRect1, LPCRECT lpRect2)
{
adjust();
return ::UnionRect((RECT*)this, (RECT*)lpRect1, (RECT*)lpRect2);
}
BOOL SubtractRect(LPCRECT lpRectSrc1, LPCRECT lpRectSrc2)
{
adjust();
return ::SubtractRect((RECT*)this, (RECT*)lpRectSrc1, (RECT*)lpRectSrc2);
}
// Additional Operations
DLURect& operator=(const DLUPOINT& p){left =p.x;top=p.y;return *this;}
DLURect& operator=(const DLUSIZE& s){right =left+s.cx; bottom=top+s.cy;return *this;}
void operator =(const DLURECT& srDLURect)
{
::CopyRect((RECT*)this, (RECT*)&srDLURect);
}
BOOL operator ==(const DLURECT& rect) const
{
adjust();
return ::EqualRect((RECT*)this, (RECT*)&rect);
}
BOOL operator !=(const DLURECT& rect) const
{
adjust();
return !::EqualRect((RECT*)this, (RECT*)&rect);
}
void operator +=(DLUPOINT point)
{
adjust();
::OffsetRect((RECT*)this, point.x, point.y);
}
void operator +=(DLUSIZE size)
{
adjust();
::OffsetRect((RECT*)this, size.cx, size.cy);
}
void operator +=(LPCRECT lpRect)
{
adjust();
InflatDLURect(lpRect);
}
void operator -=(DLUPOINT point)
{
adjust();
::OffsetRect((RECT*)this, -point.x, -point.y);
}
void operator -=(DLUSIZE size)
{
adjust();
::OffsetRect((RECT*)this, -size.cx, -size.cy);
}
void operator -=(LPCRECT lpRect)
{
adjust();
DeflateRect(lpRect);
}
void operator &=(const DLURECT& rect)
{
adjust();
::IntersectRect((RECT*)this, (RECT*)this, (RECT*)&rect);
}
void operator |=(const DLURECT& rect)
{
adjust();
::UnionRect((RECT*)this, (RECT*)this, (RECT*)&rect);
}
// Operators returning DLURect values
DLURect operator +(DLUPOINT pt) const
{
adjust();
DLURect rect(*this);
::OffsetRect((RECT*)&rect, pt.x, pt.y);
return rect;
}
DLURect operator -(DLUPOINT pt) const
{
adjust();
DLURect rect(*this);
::OffsetRect((RECT*)&rect, -pt.x, -pt.y);
return rect;
}
DLURect operator +(LPCRECT lpRect) const
{
adjust();
DLURect rect(this);
rect.InflatDLURect(lpRect);
return rect;
}
DLURect operator +(DLUSIZE size) const
{
adjust();
DLURect rect(*this);
::OffsetRect((RECT*)&rect, size.cx, size.cy);
return rect;
}
DLURect operator -(DLUSIZE size) const
{
adjust();
DLURect rect(*this);
::OffsetRect((RECT*)&rect, -size.cx, -size.cy);
return rect;
}
DLURect operator -(LPCRECT lpRect) const
{
adjust();
DLURect rect(this);
rect.DeflateRect(lpRect);
return rect;
}
DLURect operator &(const DLURECT& rect2) const
{
adjust();
DLURect rect;
::IntersectRect((RECT*)&rect, (RECT*)this, (RECT*)&rect2);
return rect;
}
DLURect operator |(const DLURECT& rect2) const
{
adjust();
DLURect rect;
::UnionRect((RECT*)&rect, (RECT*)this, (RECT*)&rect2);
return rect;
}
DLURect MulDiv(int nMultiplier, int nDivisor) const
{
adjust();
return DLURect(
::MulDiv(left, nMultiplier, nDivisor),
::MulDiv(top, nMultiplier, nDivisor),
::MulDiv(right, nMultiplier, nDivisor),
::MulDiv(bottom, nMultiplier, nDivisor));
}
};
// DLUSize implementation
inline DLUPoint DLUSize::operator +(DLUPOINT point) const
{ return DLUPoint(cx + point.x, cy + point.y); }
inline DLUPoint DLUSize::operator -(DLUPOINT point) const
{ return DLUPoint(cx - point.x, cy - point.y); }
inline DLURect DLUSize::operator +(const DLURECT* lpRect) const
{ return DLURect(lpRect) + *this; }
inline DLURect DLUSize::operator -(const DLURECT* lpRect) const
{ return DLURect(lpRect) - *this; }
// DLUPoint implementation
inline DLURect DLUPoint::operator +(const DLURECT* lpRect) const
{ return DLURect(lpRect) + *this; }
inline DLURect DLUPoint::operator -(const DLURECT* lpRect) const
{ return DLURect(lpRect) - *this; }
#if !defined(_WTL_NO_SIZE_SCALAR) && (!defined(_WTL_NO_WTYPES) || defined(__ATLTYPES_H__))
#ifndef __ATLMISC_H__
template <class Num>
inline DLUSize operator *(DLUSIZE s, Num n)
{
return DLUSize((int)(s.cx * n), (int)(s.cy * n));
};
template <class Num>
inline void operator *=(DLUSIZE & s, Num n)
{
s = s * n;
};
template <class Num>
inline DLUSize operator /(DLUSIZE s, Num n)
{
return DLUSize((int)(s.cx / n), (int)(s.cy / n));
};
template <class Num>
inline void operator /=(DLUSIZE & s, Num n)
{
s = s / n;
};
#endif
#endif
DLUSize size(const DLURect& plt ,const DLURect& prb) {return DLUSize()=DLURect(plt.left,plt.top,prb.right,prb.bottom);}

View file

@ -0,0 +1,775 @@
class PixSize;
class PixPoint;
class PixRect;
struct xPix
{LONG n;
xPix():n(0){}
explicit xPix(LONG x):n(x){}
};
struct yPix
{LONG n;
yPix():n(0){}
explicit yPix(LONG x):n(x){}
};
class PixSize : public SIZE
{
public:
operator xPix(){return xPix(cx);}
operator yPix(){return yPix(cy);}
// Constructors
PixSize& operator+=(const PixSize& x){cx+=x.cx;
cy+=x.cy;
return *this;
}
PixSize()
{
cx = 0;
cy = 0;
}
PixSize(int initCX, int initCY)
{
cx = initCX;
cy = initCY;
}
PixSize(SIZE initSize)
{
*(SIZE*)this = initSize;
}
PixSize(POINT initPt)
{
*(POINT*)this = initPt;
}
PixSize(DWORD dwSize)
{
cx = (short)LOWORD(dwSize);
cy = (short)HIWORD(dwSize);
}
// Operations
PixSize& operator=(const RECT& r) {cx =r.right-r.left;return *this;}
PixSize& operator=(LONG sz) {cx =sz;cy=sz ;return *this;}
BOOL operator ==(SIZE size) const
{
return (cx == size.cx && cy == size.cy);
}
BOOL operator !=(SIZE size) const
{
return (cx != size.cx || cy != size.cy);
}
void operator +=(SIZE size)
{
cx += size.cx;
cy += size.cy;
}
void operator -=(SIZE size)
{
cx -= size.cx;
cy -= size.cy;
}
void SetSize(int CX, int CY)
{
cx = CX;
cy = CY;
}
// Operators returning PixSize values
PixSize operator +(SIZE size) const
{
return PixSize(cx + size.cx, cy + size.cy);
}
PixSize operator -(SIZE size) const
{
return PixSize(cx - size.cx, cy - size.cy);
}
PixSize operator -() const
{
return PixSize(-cx, -cy);
}
// Operators returning PixPoint values
PixPoint operator +(POINT point) const;
PixPoint operator -(POINT point) const;
// Operators returning PixRect values
PixRect operator +(const RECT* lpRect) const;
PixRect operator -(const RECT* lpRect) const;
};
///////////////////////////////////////////////////////////////////////////////
// PixPoint - Wrapper for Windows POINT structure.
class PixPoint : public POINT
{
public:
// Constructors
PixPoint(const PixSize& a){x =a.cx;y=a.cy;}
PixPoint()
{
x = 0;
y = 0;
}
PixPoint(int initX, int initY)
{
x = initX;
y = initY;
}
PixPoint(POINT initPt)
{
*(POINT*)this = initPt;
}
PixPoint(SIZE initSize)
{
*(SIZE*)this = initSize;
}
PixPoint(DWORD dwPoint)
{
x = (short)LOWORD(dwPoint);
y = (short)HIWORD(dwPoint);
}
// Operations
PixPoint& operator=(const RECT& b) {x =b.left;y=b.top;return *this;}
void Offset(int xOffset, int yOffset)
{
x += xOffset;
y += yOffset;
}
void Offset(POINT point)
{
x += point.x;
y += point.y;
}
void Offset(SIZE size)
{
x += size.cx;
y += size.cy;
}
BOOL operator ==(POINT point) const
{
return (x == point.x && y == point.y);
}
BOOL operator !=(POINT point) const
{
return (x != point.x || y != point.y);
}
void operator +=(SIZE size)
{
x += size.cx;
y += size.cy;
}
void operator -=(SIZE size)
{
x -= size.cx;
y -= size.cy;
}
void operator +=(POINT point)
{
x += point.x;
y += point.y;
}
void operator -=(POINT point)
{
x -= point.x;
y -= point.y;
}
void SetPoint(int X, int Y)
{
x = X;
y = Y;
}
// Operators returning PixPoint values
PixPoint operator +(SIZE size) const
{
return PixPoint(x + size.cx, y + size.cy);
}
PixPoint operator -(SIZE size) const
{
return PixPoint(x - size.cx, y - size.cy);
}
PixPoint operator -() const
{
return PixPoint(-x, -y);
}
PixPoint operator +(POINT point) const
{
return PixPoint(x + point.x, y + point.y);
}
// Operators returning PixSize values
PixSize operator -(POINT point) const
{
return PixSize(x - point.x, y - point.y);
}
// Operators returning PixRect values
PixRect operator +(const RECT* lpRect) const;
PixRect operator -(const RECT* lpRect) const;
};
///////////////////////////////////////////////////////////////////////////////
// PixRect - Wrapper for Windows RECT structure.
class PixRect : public RECT
{
public:
PixRect& adjust()const{const_cast<PixRect*>(this)->right =max(left,right);
const_cast<PixRect*>(this)->bottom=max(top ,bottom);
return *const_cast<PixRect*>(this);
}
// Constructors
PixSize size(){adjust();
if(right < left) right=left;
if(bottom < top) bottom=top;
PixSize s;
s.cx=right-left;
s.cy=bottom-top;
return s;
}
PixRect(const PixSize& s){*this =s;}
PixRect(const PixPoint& x){*this =x;}
PixRect& sizeMax(const PixRect& plt ,const PixRect& prb)
{adjust();
const_cast<PixRect&>(plt).adjust();
const_cast<PixRect&>(prb).adjust();
PixSize nsz=PixRect(plt.left,plt.top,prb.right,prb.bottom).size();
PixSize sz =size();
PixSize mx(max(nsz.cx,sz.cx)
,max(nsz.cy,sz.cy)
);
*this =mx;
return *this;
}
PixRect()
{
left = 0;
top = 0;
right = 0;
bottom = 0;
}
PixRect(int l, int t, int r, int b)
{
left = l;
top = t;
right = r;
bottom = b;
}
PixRect(const RECT& srERect)
{
::CopyRect(this, &srERect);
}
PixRect(LPCRECT lpSrERect)
{
::CopyRect(this, lpSrERect);
}
PixRect(POINT point, SIZE size)
{
right = (left = point.x) + size.cx;
bottom = (top = point.y) + size.cy;
}
PixRect(POINT topLeft, POINT bottomRight)
{
left = topLeft.x;
top = topLeft.y;
right = bottomRight.x;
bottom = bottomRight.y;
}
// Attributes (in addition to RECT members)
int Width() const
{
adjust();
return right - left;
}
int Height() const
{
adjust();
return bottom - top;
}
PixSize Size() const
{
adjust();
return PixSize(right - left, bottom - top);
}
PixPoint& TopLeft()
{
return *((PixPoint*)this);
}
PixPoint& point()
{
return *((PixPoint*)this);
}
PixPoint& BottomRight()
{
adjust();
return *((PixPoint*)this + 1);
}
const PixPoint& TopLeft() const
{
return *((PixPoint*)this);
}
const PixPoint& BottomRight() const
{
adjust();
return *((PixPoint*)this + 1);
}
PixPoint CenterPoint() const
{
adjust();
return PixPoint((left + right) / 2, (top + bottom) / 2);
}
// convert between PixRect and LPRECT/LPCRECT (no need for &)
operator LPRECT()
{
adjust();
return this;
}
operator LPCRECT() const
{
adjust();
return this;
}
BOOL IsRectEmpty() const
{
adjust();
return ::IsRectEmpty(this);
}
BOOL IsRectNull() const
{
return (left == 0 && right == 0 && top == 0 && bottom == 0);
}
BOOL PtInRect(POINT point) const
{
adjust();
return ::PtInRect(this, point);
}
// Operations
void SetRect(int x1, int y1, int x2, int y2)
{
::SetRect(this, x1, y1, x2, y2);
}
void SetRect(POINT topLeft, POINT bottomRight)
{
::SetRect(this, topLeft.x, topLeft.y, bottomRight.x, bottomRight.y);
}
void SetRectEmpty()
{
::SetRectEmpty(this);
}
void CopyRect(LPCRECT lpSrERect)
{
adjust();
::CopyRect(this, lpSrERect);
}
BOOL EqualRect(LPCRECT lpRect) const
{
adjust();
return ::EqualRect(this, lpRect);
}
void InflateRect(int x, int y)
{
adjust();
::InflateRect(this, x, y);
}
void InflateRect(SIZE size)
{
adjust();
::InflateRect(this, size.cx, size.cy);
}
void InflateRect(LPCRECT lpRect)
{
adjust();
left -= lpRect->left;
top -= lpRect->top;
right += lpRect->right;
bottom += lpRect->bottom;
}
void InflateRect(int l, int t, int r, int b)
{
adjust();
left -= l;
top -= t;
right += r;
bottom += b;
}
void DeflateRect(int x, int y)
{
adjust();
::InflateRect(this, -x, -y);
}
void DeflateRect(SIZE size)
{
adjust();
::InflateRect(this, -size.cx, -size.cy);
}
void DeflateRect(LPCRECT lpRect)
{
adjust();
left += lpRect->left;
top += lpRect->top;
right -= lpRect->right;
bottom -= lpRect->bottom;
}
void DeflateRect(int l, int t, int r, int b)
{
adjust();
left += l;
top += t;
right -= r;
bottom -= b;
}
void OffsetRect(int x, int y)
{
adjust();
::OffsetRect(this, x, y);
}
void OffsetRect(SIZE size)
{
adjust();
::OffsetRect(this, size.cx, size.cy);
}
void OffsetRect(POINT point)
{
adjust();
::OffsetRect(this, point.x, point.y);
}
void NormalizeRect()
{
adjust();
int nTemp;
if (left > right)
{
nTemp = left;
left = right;
right = nTemp;
}
if (top > bottom)
{
nTemp = top;
top = bottom;
bottom = nTemp;
}
}
// absolute position of rectangle
void MoveToY(int y)
{
adjust();
bottom = Height() + y;
top = y;
}
void MoveToX(int x)
{
adjust();
right = Width() + x;
left = x;
}
void MoveToXY(int x, int y)
{
adjust();
MoveToX(x);
MoveToY(y);
}
void MoveToXY(POINT pt)
{
adjust();
MoveToX(pt.x);
MoveToY(pt.y);
}
// operations that fill '*this' with result
BOOL IntersectRect(LPCRECT lpRect1, LPCRECT lpRect2)
{
adjust();
return ::IntersectRect(this, lpRect1, lpRect2);
}
BOOL UnionRect(LPCRECT lpRect1, LPCRECT lpRect2)
{
adjust();
return ::UnionRect(this, lpRect1, lpRect2);
}
BOOL SubtractRect(LPCRECT lpRectSrc1, LPCRECT lpRectSrc2)
{
adjust();
return ::SubtractRect(this, lpRectSrc1, lpRectSrc2);
}
// Additional Operations
PixRect& operator=(const POINT& p){left =p.x;top=p.y;return *this;}
PixRect& operator=(const SIZE& s){right =left+s.cx; bottom=top+s.cy;return *this;}
void operator =(const RECT& srERect)
{
::CopyRect(this, &srERect);
}
BOOL operator ==(const RECT& rect) const
{
adjust();
return ::EqualRect(this, &rect);
}
BOOL operator !=(const RECT& rect) const
{
adjust();
return !::EqualRect(this, &rect);
}
void operator +=(POINT point)
{
adjust();
::OffsetRect(this, point.x, point.y);
}
void operator +=(SIZE size)
{
adjust();
::OffsetRect(this, size.cx, size.cy);
}
void operator +=(LPCRECT lpRect)
{
adjust();
InflateRect(lpRect);
}
void operator -=(POINT point)
{
adjust();
::OffsetRect(this, -point.x, -point.y);
}
void operator -=(SIZE size)
{
adjust();
::OffsetRect(this, -size.cx, -size.cy);
}
void operator -=(LPCRECT lpRect)
{
adjust();
DeflateRect(lpRect);
}
void operator &=(const RECT& rect)
{
adjust();
::IntersectRect(this, this, &rect);
}
void operator |=(const RECT& rect)
{
adjust();
::UnionRect(this, this, &rect);
}
// Operators returning PixRect values
PixRect operator +(POINT pt) const
{
adjust();
PixRect rect(*this);
::OffsetRect(&rect, pt.x, pt.y);
return rect;
}
PixRect operator -(POINT pt) const
{
adjust();
PixRect rect(*this);
::OffsetRect(&rect, -pt.x, -pt.y);
return rect;
}
PixRect operator +(LPCRECT lpRect) const
{
adjust();
PixRect rect(this);
rect.InflateRect(lpRect);
return rect;
}
PixRect operator +(SIZE size) const
{
adjust();
PixRect rect(*this);
::OffsetRect(&rect, size.cx, size.cy);
return rect;
}
PixRect operator -(SIZE size) const
{
adjust();
PixRect rect(*this);
::OffsetRect(&rect, -size.cx, -size.cy);
return rect;
}
PixRect operator -(LPCRECT lpRect) const
{
adjust();
PixRect rect(this);
rect.DeflateRect(lpRect);
return rect;
}
PixRect operator &(const RECT& rect2) const
{
adjust();
PixRect rect;
::IntersectRect(&rect, this, &rect2);
return rect;
}
PixRect operator |(const RECT& rect2) const
{
adjust();
PixRect rect;
::UnionRect(&rect, this, &rect2);
return rect;
}
PixRect MulDiv(int nMultiplier, int nDivisor) const
{
adjust();
return PixRect(
::MulDiv(left, nMultiplier, nDivisor),
::MulDiv(top, nMultiplier, nDivisor),
::MulDiv(right, nMultiplier, nDivisor),
::MulDiv(bottom, nMultiplier, nDivisor));
}
};
// PixSize implementation
inline PixPoint PixSize::operator +(POINT point) const
{ return PixPoint(cx + point.x, cy + point.y); }
inline PixPoint PixSize::operator -(POINT point) const
{ return PixPoint(cx - point.x, cy - point.y); }
inline PixRect PixSize::operator +(const RECT* lpRect) const
{ return PixRect(lpRect) + *this; }
inline PixRect PixSize::operator -(const RECT* lpRect) const
{ return PixRect(lpRect) - *this; }
// PixPoint implementation
inline PixRect PixPoint::operator +(const RECT* lpRect) const
{ return PixRect(lpRect) + *this; }
inline PixRect PixPoint::operator -(const RECT* lpRect) const
{ return PixRect(lpRect) - *this; }
#if !defined(_WTL_NO_SIZE_SCALAR) && (!defined(_WTL_NO_WTYPES) || defined(__ATLTYPES_H__))
#ifndef __ATLMISC_H__
template <class Num>
inline PixSize operator *(SIZE s, Num n)
{
return PixSize((int)(s.cx * n), (int)(s.cy * n));
};
template <class Num>
inline void operator *=(SIZE & s, Num n)
{
s = s * n;
};
template <class Num>
inline PixSize operator /(SIZE s, Num n)
{
return PixSize((int)(s.cx / n), (int)(s.cy / n));
};
template <class Num>
inline void operator /=(SIZE & s, Num n)
{
s = s / n;
};
#endif
#endif
PixSize size(const PixRect& plt ,const PixRect& prb) {return PixSize()=PixRect(plt.left,plt.top,prb.right,prb.bottom);}

View file

@ -0,0 +1,148 @@
#if _WIN32_WINNT < 0x0600 && !defined(TD_WARNING_ICON)
/////////////////////////////////////////////////////////////////////////
// /// _WIN32_WINNT < 0x0600 && !defined(TD_WARNING_ICON)
//
#ifdef _WIN32
#include <pshpack1.h>
#endif // _WIN32
typedef HRESULT (CALLBACK *PFTASKDIALOGCALLBACK)(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LONG_PTR lpRefData);
enum _TASKDIALOG_FLAGS
{
TDF_ENABLE_HYPERLINKS = 0x0001,
TDF_USE_HICON_MAIN = 0x0002,
TDF_USE_HICON_FOOTER = 0x0004,
TDF_ALLOW_DIALOG_CANCELLATION = 0x0008,
TDF_USE_COMMAND_LINKS = 0x0010,
TDF_USE_COMMAND_LINKS_NO_ICON = 0x0020,
TDF_EXPAND_FOOTER_AREA = 0x0040,
TDF_EXPANDED_BY_DEFAULT = 0x0080,
TDF_VERIFICATION_FLAG_CHECKED = 0x0100,
TDF_SHOW_PROGRESS_BAR = 0x0200,
TDF_SHOW_MARQUEE_PROGRESS_BAR = 0x0400,
TDF_CALLBACK_TIMER = 0x0800,
TDF_POSITION_RELATIVE_TO_WINDOW = 0x1000,
TDF_RTL_LAYOUT = 0x2000,
TDF_NO_DEFAULT_RADIO_BUTTON = 0x4000,
TDF_CAN_BE_MINIMIZED = 0x8000
};
typedef int TASKDIALOG_FLAGS;
typedef enum _TASKDIALOG_MESSAGES
{
TDM_NAVIGATE_PAGE = WM_USER + 101,
TDM_CLICK_BUTTON = WM_USER + 102,
TDM_SET_MARQUEE_PROGRESS_BAR = WM_USER + 103,
TDM_SET_PROGRESS_BAR_STATE = WM_USER + 104,
TDM_SET_PROGRESS_BAR_RANGE = WM_USER + 105,
TDM_SET_PROGRESS_BAR_POS = WM_USER + 106,
TDM_SET_PROGRESS_BAR_MARQUEE = WM_USER + 107,
TDM_SET_ELEMENT_TEXT = WM_USER + 108,
TDM_CLICK_RADIO_BUTTON = WM_USER + 110,
TDM_ENABLE_BUTTON = WM_USER + 111,
TDM_ENABLE_RADIO_BUTTON = WM_USER + 112,
TDM_CLICK_VERIFICATION = WM_USER + 113,
TDM_UPDATE_ELEMENT_TEXT = WM_USER + 114,
TDM_SET_BUTTON_ELEVATION_REQUIRED_STATE = WM_USER + 115,
TDM_UPDATE_ICON = WM_USER + 116
} TASKDIALOG_MESSAGES;
typedef enum _TASKDIALOG_NOTIFICATIONS
{
TDN_CREATED = 0,
TDN_NAVIGATED = 1,
TDN_BUTTON_CLICKED = 2,
TDN_HYPERLINK_CLICKED = 3,
TDN_TIMER = 4,
TDN_DESTROYED = 5,
TDN_RADIO_BUTTON_CLICKED = 6,
TDN_DIALOG_CONSTRUCTED = 7,
TDN_VERIFICATION_CLICKED = 8,
TDN_HELP = 9,
TDN_EXPANDO_BUTTON_CLICKED = 10
} TASKDIALOG_NOTIFICATIONS;
typedef struct _TASKDIALOG_BUTTON
{
int nButtonID;
PCWSTR pszButtonText;
}TASKDIALOG_BUTTON
;// //////////////////////////////////////////////////////
typedef enum _TASKDIALOG_ELEMENTS
{
TDE_CONTENT,
TDE_EXPANDED_INFORMATION,
TDE_FOOTER,
TDE_MAIN_INSTRUCTION
} TASKDIALOG_ELEMENTS;
typedef enum _TASKDIALOG_ICON_ELEMENTS
{
TDIE_ICON_MAIN,
TDIE_ICON_FOOTER
} TASKDIALOG_ICON_ELEMENTS;
#define TD_WARNING_ICON MAKEINTRESOURCEW(-1)
#define TD_ERROR_ICON MAKEINTRESOURCEW(-2)
#define TD_INFORMATION_ICON MAKEINTRESOURCEW(-3)
#define TD_SHIELD_ICON MAKEINTRESOURCEW(-4)
enum _TASKDIALOG_COMMON_BUTTON_FLAGS
{
TDCBF_OK_BUTTON = 0x0001, // selected control return value IDOK
TDCBF_YES_BUTTON = 0x0002, // selected control return value IDYES
TDCBF_NO_BUTTON = 0x0004, // selected control return value IDNO
TDCBF_CANCEL_BUTTON = 0x0008, // selected control return value IDCANCEL
TDCBF_RETRY_BUTTON = 0x0010, // selected control return value IDRETRY
TDCBF_CLOSE_BUTTON = 0x0020 // selected control return value IDCLOSE
};
typedef int TASKDIALOG_COMMON_BUTTON_FLAGS;
struct TASKDIALOGCONFIG
{
UINT cbSize;
HWND hwndParent;
HINSTANCE hInstance; // used for MAKEINTRESOURCE() strings
TASKDIALOG_FLAGS dwFlags; // TASKDIALOG_FLAGS (TDF_XXX) flags
TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons; // TASKDIALOG_COMMON_BUTTON (TDCBF_XXX) flags
PCWSTR pszWindowTitle; // string or MAKEINTRESOURCE()
union
{
HICON hMainIcon;
PCWSTR pszMainIcon;
};
PCWSTR pszMainInstruction;
PCWSTR pszContent;
UINT cButtons;
const TASKDIALOG_BUTTON *pButtons;
int nDefaultButton;
UINT cRadioButtons;
const TASKDIALOG_BUTTON *pRadioButtons;
int nDefaultRadioButton;
PCWSTR pszVerificationText;
PCWSTR pszExpandedInformation;
PCWSTR pszExpandedControlText;
PCWSTR pszCollapsedControlText;
union
{
HICON hFooterIcon;
PCWSTR pszFooterIcon;
};
PCWSTR pszFooter;
PFTASKDIALOGCALLBACK pfCallback;
LONG_PTR lpCallbackData;
UINT cxWidth;
}
;// //////////////////////////////////////////////////////
#ifdef _WIN32
#include <poppack.h>
#endif // _WIN32
//
// /// _WIN32_WINNT < 0x0600 && !defined(TD_WARNING_ICON)
/////////////////////////////////////////////////////////////////////////
#endif

View file

@ -0,0 +1,172 @@
#if !defined(TASKDIALOGCONFIG_X_52DD9F63_F838_11D4_B292_444553540000)
#define TASKDIALOGCONFIG_X_52DD9F63_F838_11D4_B292_444553540000
/**Added by Erich Willems to support mixed pushnuttons(commandbuttons not only for common but also for cunstom pushbuttons*/
struct TASKDIALOGCONFIG_X : public TASKDIALOGCONFIG
{ typedef TASKDIALOGCONFIG_X Tp;
typedef TASKDIALOGCONFIG TpCtx;
UINT cbSize_X;
UINT SzPushButtons; //explicit pushbuttons also if command_link is set
const TASKDIALOG_BUTTON* PushButtons;
TASKDIALOGCONFIG_X() {
cbSize =sizeof(TASKDIALOGCONFIG);
hwndParent =0;
hInstance =0;
dwFlags =0;
dwCommonButtons =0;
pszWindowTitle =0;
hMainIcon =0;
pszMainInstruction =0;
pszContent =0;
cButtons =0;
pButtons =0;
nDefaultButton =0;
cRadioButtons =0;
pRadioButtons =0;
nDefaultRadioButton =0;
pszVerificationText =0;
pszExpandedInformation =0;
pszExpandedControlText =0;
pszCollapsedControlText =0;
hFooterIcon =0;
pszFooter =0;
pfCallback =0;
lpCallbackData =0;
cxWidth =0;
cbSize_X =sizeof(TASKDIALOGCONFIG_X);
SzPushButtons =0;
PushButtons =0;
}
TASKDIALOGCONFIG_X(const Tp& src) {
cbSize =(src.cbSize );
hwndParent =(src.hwndParent );
hInstance =(src.hInstance );
dwFlags =(src.dwFlags );
dwCommonButtons =(src.dwCommonButtons );
pszWindowTitle =(src.pszWindowTitle );
hMainIcon =(src.hMainIcon );
pszMainInstruction =(src.pszMainInstruction );
pszContent =(src.pszContent );
cButtons =(src.cButtons );
pButtons =(src.pButtons );
nDefaultButton =(src.nDefaultButton );
cRadioButtons =(src.cRadioButtons );
pRadioButtons =(src.pRadioButtons );
nDefaultRadioButton =(src.nDefaultRadioButton );
pszVerificationText =(src.pszVerificationText );
pszExpandedInformation =(src.pszExpandedInformation );
pszExpandedControlText =(src.pszExpandedControlText );
pszCollapsedControlText =(src.pszCollapsedControlText);
hFooterIcon =(src.hFooterIcon );
pszFooter =(src.pszFooter );
pfCallback =(src.pfCallback );
lpCallbackData =(src.lpCallbackData );
cxWidth =(src.cxWidth );
cbSize_X =(src.cbSize_X );
SzPushButtons =(src.SzPushButtons );
PushButtons =(src.PushButtons );
};
TASKDIALOGCONFIG_X(const TpCtx& src){
cbSize =(src.cbSize );
hwndParent =(src.hwndParent );
hInstance =(src.hInstance );
dwFlags =(src.dwFlags );
dwCommonButtons =(src.dwCommonButtons );
pszWindowTitle =(src.pszWindowTitle );
hMainIcon =(src.hMainIcon );
pszMainInstruction =(src.pszMainInstruction );
pszContent =(src.pszContent );
cButtons =(src.cButtons );
pButtons =(src.pButtons );
nDefaultButton =(src.nDefaultButton );
cRadioButtons =(src.cRadioButtons );
pRadioButtons =(src.pRadioButtons );
nDefaultRadioButton =(src.nDefaultRadioButton );
pszVerificationText =(src.pszVerificationText );
pszExpandedInformation =(src.pszExpandedInformation );
pszExpandedControlText =(src.pszExpandedControlText );
pszCollapsedControlText =(src.pszCollapsedControlText);
hFooterIcon =(src.hFooterIcon );
pszFooter =(src.pszFooter );
pfCallback =(src.pfCallback );
lpCallbackData =(src.lpCallbackData );
cxWidth =(src.cxWidth );
cbSize_X =(sizeof(Tp) );
SzPushButtons =(0 );
PushButtons =(NULL );
};
Tp& operator=(const Tp& src) {
cbSize =(src.cbSize );
hwndParent =(src.hwndParent );
hInstance =(src.hInstance );
dwFlags =(src.dwFlags );
dwCommonButtons =(src.dwCommonButtons );
pszWindowTitle =(src.pszWindowTitle );
hMainIcon =(src.hMainIcon );
pszMainInstruction =(src.pszMainInstruction );
pszContent =(src.pszContent );
cButtons =(src.cButtons );
pButtons =(src.pButtons );
nDefaultButton =(src.nDefaultButton );
cRadioButtons =(src.cRadioButtons );
pRadioButtons =(src.pRadioButtons );
nDefaultRadioButton =(src.nDefaultRadioButton );
pszVerificationText =(src.pszVerificationText );
pszExpandedInformation =(src.pszExpandedInformation );
pszExpandedControlText =(src.pszExpandedControlText );
pszCollapsedControlText =(src.pszCollapsedControlText);
hFooterIcon =(src.hFooterIcon );
pszFooter =(src.pszFooter );
pfCallback =(src.pfCallback );
lpCallbackData =(src.lpCallbackData );
cxWidth =(src.cxWidth );
cbSize_X =(src.cbSize_X );
SzPushButtons =(src.SzPushButtons );
PushButtons =(src.PushButtons );
return *this;
};
Tp& operator=(const TpCtx& src) {
cbSize =(src.cbSize );
hwndParent =(src.hwndParent );
hInstance =(src.hInstance );
dwFlags =(src.dwFlags );
dwCommonButtons =(src.dwCommonButtons );
pszWindowTitle =(src.pszWindowTitle );
hMainIcon =(src.hMainIcon );
pszMainInstruction =(src.pszMainInstruction );
pszContent =(src.pszContent );
cButtons =(src.cButtons );
pButtons =(src.pButtons );
nDefaultButton =(src.nDefaultButton );
cRadioButtons =(src.cRadioButtons );
pRadioButtons =(src.pRadioButtons );
nDefaultRadioButton =(src.nDefaultRadioButton );
pszVerificationText =(src.pszVerificationText );
pszExpandedInformation =(src.pszExpandedInformation );
pszExpandedControlText =(src.pszExpandedControlText );
pszCollapsedControlText =(src.pszCollapsedControlText);
hFooterIcon =(src.hFooterIcon );
pszFooter =(src.pszFooter );
pfCallback =(src.pfCallback );
lpCallbackData =(src.lpCallbackData );
cxWidth =(src.cxWidth );
cbSize_X =(sizeof(Tp) );
SzPushButtons =(0 );
PushButtons =(NULL );
return *this;
};
};
#endif // !defined(TASKDIALOGCONFIG_X_52DD9F63_F838_11D4_B292_444553540000)

View file

@ -0,0 +1,140 @@
/////////////////////////////////////////////////////////////////////////
// CDialogBaseUnits - Dialog helper
//
#if _WTL_VER < 0x0810
class CDialogBaseUnits
{
public:
SIZE m_sizeUnits;
// Constructors
CDialogBaseUnits()
{
// The base units of the out-dated System Font
LONG nDlgBaseUnits= ::GetDialogBaseUnits();
m_sizeUnits.cx = LOWORD(nDlgBaseUnits);
m_sizeUnits.cy = HIWORD(nDlgBaseUnits);
}
CDialogBaseUnits(HWND hWnd)
{
m_sizeUnits.cx = 0;
m_sizeUnits.cy = 0;
InitDialogBaseUnits(hWnd);
}
CDialogBaseUnits(HFONT hFont, HWND hWnd = NULL)
{
m_sizeUnits.cx = 0;
m_sizeUnits.cy = 0;
InitDialogBaseUnits(hFont, hWnd);
}
CDialogBaseUnits(LOGFONT lf, HWND hWnd = NULL)
{
m_sizeUnits.cx = 0;
m_sizeUnits.cy = 0;
InitDialogBaseUnits(lf, hWnd);
}
// Operations
BOOL InitDialogBaseUnits(HWND hWnd)
{
ATLASSERT(::IsWindow(hWnd));
RECT rc = { 0, 0, 4, 8 };
if( !::MapDialogRect(hWnd, &rc) ) return FALSE;
m_sizeUnits.cx = rc.right;
m_sizeUnits.cy = rc.bottom;
return TRUE;
}
BOOL InitDialogBaseUnits(LOGFONT lf, HWND hWnd = NULL)
{
CFont font;
font.CreateFontIndirect(&lf);
if( font.IsNull() ) return FALSE;
return InitDialogBaseUnits(font, hWnd);
}
BOOL InitDialogBaseUnits(HFONT hFont, HWND hWnd = NULL)
{ AE_(hFont != NULL);
CWindowDC dc = hWnd;
HFONT hFontOld = dc.SelectFont(hFont);
TEXTMETRIC tmText = { 0 };
dc.GetTextMetrics(&tmText);
m_sizeUnits.cy = tmText.tmHeight + tmText.tmExternalLeading;
SIZE sizeText = { 0 };
dc.GetTextExtent(_T("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"), 52, &sizeText);
m_sizeUnits.cx = (sizeText.cx + 26) / 52;
dc.SelectFont(hFontOld);
return TRUE;
}
SIZE GetDialogBaseUnits() const
{
return m_sizeUnits;
}
INT MapDialogPixelsX(INT x) const
{
return MulDiv(x, 4, m_sizeUnits.cx); // Pixels X to DLU
}
INT MapDialogPixelsY(INT y) const
{
return MulDiv(y, 8, m_sizeUnits.cy); // Pixels Y to DLU
}
POINT MapDialogPixels(POINT pt) const
{
POINT out = { MapDialogPixelsX(pt.x), MapDialogPixelsY(pt.y) };
return out;
}
SIZE MapDialogPixels(SIZE input) const
{
SIZE out = { MapDialogPixelsX(input.cx), MapDialogPixelsY(input.cy) };
return out;
}
RECT MapDialogPixels(RECT input) const
{
RECT out = { MapDialogPixelsX(input.left), MapDialogPixelsY(input.top), MapDialogPixelsX(input.right), MapDialogPixelsY(input.bottom) };
return out;
}
INT MapDialogUnitsX(INT x) const
{
return MulDiv(x, m_sizeUnits.cx, 4); // DLU to Pixels X
}
INT MapDialogUnitsY(INT y) const
{
return MulDiv(y, m_sizeUnits.cy, 8); // DLU to Pixels Y
}
POINT MapDialogUnits(POINT pt) const
{
POINT out = { MapDialogUnitsX(pt.x), MapDialogUnitsY(pt.y) };
return out;
}
SIZE MapDialogUnits(SIZE input) const
{
SIZE out = { MapDialogUnitsX(input.cx), MapDialogUnitsY(input.cy) };
return out;
}
RECT MapDialogUnits(RECT input) const
{
RECT out = { MapDialogUnitsX(input.left), MapDialogUnitsY(input.top), MapDialogUnitsX(input.right), MapDialogUnitsY(input.bottom) };
return out;
}
};
#endif // _WTL_VER

View file

@ -0,0 +1,59 @@
#if _WIN32_WINNT < 0x0501 //WinXP
/////////////////////////////////////////////////////////////////////////
// /// _WIN32_WINNT < 0x0501
//
#ifdef _WIN32
#include <pshpack1.h>
#endif // _WIN32
#define MAX_LINKID_TEXT 48
#define L_MAX_URL_LENGTH (2048 + 32 + sizeof("://"))
typedef struct tagLITEM
{
UINT mask;
int iLink;
UINT state;
UINT stateMask;
WCHAR szID[MAX_LINKID_TEXT];
WCHAR szUrl[L_MAX_URL_LENGTH];
} LITEM
,*PLITEM
; // //////////////////////////////////////////////////////
typedef struct tagNMLINK
{
NMHDR hdr;
LITEM item;
} NMLINK
,*PNMLINK
; // //////////////////////////////////////////////////////
class CLinkCtrl
{
public:
static LPCTSTR GetWndClassName() {return _T("SysLink");}
};// //////////////////////////////////////////////////////
#define BCM_FIRST 0x1600 // Button control messages
#define BCM_SETIMAGELIST (BCM_FIRST + 0x0002)
typedef struct
{
HIMAGELIST himl;
RECT margin;
UINT uAlign;
} BUTTON_IMAGELIST
,*PBUTTON_IMAGELIST
; // //////////////////////////////////////////////////////
#ifdef _WIN32
#include <poppack.h>
#endif // _WIN32
//
// ///END: _WIN32_WINNT < 0x0501
/////////////////////////////////////////////////////////////////////////
#endif

BIN
res/Error.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
res/Information.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
res/Question.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
res/Shield.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
res/ShieldError.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
res/ShieldOK.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
res/ShieldQuestion.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
res/ShieldWarning.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
res/TaskDlgArrowHot.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
res/TaskDlgArrowNormal.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
res/TaskDlgChevronLess.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
res/TaskDlgChevronMore.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
res/Warning.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB