Cwindow has the method SetRastermode, but doesÂÃ, not have a "GetRastermode" function for restoring the old rastermode.
(by the way, the windows API call SetROP2, which sets the rastermode, does return the previous value)
For those that are interested, I use the following function (I think it can be easily adapted to a cwindow descendant method):
sub getRasterOp(cwindow win),unsigned int
{
unsigned int res,hdc;
res=0;
if win !=null {
hdc=win.GetHDC();
res=getrop2(hdc);
win.ReleaseHdc(hdc);
}
return res;
}
To use it you need to declare first:
declare import, GetROP2(unsigned int hdc),unsigned int;
m_iROP2 is a member of the CWindow class.