GetWindowRgn API is failed.
-
In My application, I have used the following code to get the region of a dialog.
HRGN hRgn = CreateRectRgn( 0, 0, 0, 0 );
int nRet = GetWindowRgn( hRgn );
if(ERROR == nRet)
{
DWORD dw= GetLastError();
//Log
}The problem is that, sometimes "GetWindowRgn" returns error "invalid handle" even if CreateRectRgn returns a non-null handle which is used for GetWindowRgn. I have set the region in onSize(). So dialog have region.Also after GetWindowRgn returns error, when i call GetWindowRgn() again, second call is working fine !!! Issue is reproduced only sometimes in a Windows 7 machine. Anyone already faced similar issue? Thanks, Arun
-
In My application, I have used the following code to get the region of a dialog.
HRGN hRgn = CreateRectRgn( 0, 0, 0, 0 );
int nRet = GetWindowRgn( hRgn );
if(ERROR == nRet)
{
DWORD dw= GetLastError();
//Log
}The problem is that, sometimes "GetWindowRgn" returns error "invalid handle" even if CreateRectRgn returns a non-null handle which is used for GetWindowRgn. I have set the region in onSize(). So dialog have region.Also after GetWindowRgn returns error, when i call GetWindowRgn() again, second call is working fine !!! Issue is reproduced only sometimes in a Windows 7 machine. Anyone already faced similar issue? Thanks, Arun