I am able to capture whole desktop using Windows GDI with the help of official example given at https://docs.microsoft.com/en-us/windows/win32/gdi/capturing-an-image