Powerbasic Museum 2020-B

IT-Consultant: Patrice Terrier => Useful TIPS => Topic started by: Theo Gottwald on October 06, 2011, 03:56:33 PM

Title: Undocumented flag for "GetDCEx"
Post by: Theo Gottwald on October 06, 2011, 03:56:33 PM
GetDCEx can be used to retrieve the device context for a window during processing of %WM_NCPAINT.
The documentation states that this is achieved by using

GetDCEx(hwnd, hrgn, %DCX_WINDOW | %DCX_INTERSECTRGN)


However, this call never works, because there is an undocumented flag to include which is not mentioned anywhere.

And this is how it works:

GetDCEx(hwnd, hrgn, DCX_WINDOW | DCX_INTERSECTRGN | 0x10000)

Source: Catch22.net (http://www.catch22.net/tuts/tips#UndocumentedGetDCEx)