i wonder y this piece of code does not erase my rectangle drawn over the display dc. really annoying this stuffs, not works like specified when code :x)
ok friends, i have drawn a rectangle on the display dc as specified in the first post, assume drawn over the system tray area. so now i use the below code to erase it. the code is perfect. but winodws does not react to it
this was the successfull drawing part
hDisplay = CreateDCAsNull("DISPLAY", ByVal 0&, ByVal 0&, ByVal 0&)
hRgn = CreateRectRgn(rt.Left, rt.Top, rt.Right, rt.Bottom)
hBrush = CreateSolidBrush(vbRed)
FrameRgn hDisplay, hRgn, hBrush, 3, 3
so now the rectangle is drawn and perfect. now i am erasing...
hDesktop = GetDesktopWindow
lngresult = InvalidateRgn(hDesktop, hRgn, False)
* i though the above piece of code would be enough. since not working, i added the follwoing also.
RedrawWindow hDesktop, 0&, hRgn, RDW_INVALIDATE Or RDW_UPDATENOW
Not working friends.
Gus pls help
modified on Monday, August 25, 2008 10:36 AM