Beispiel #1
0
 public void GetThemeStreamTest()
 {
     Application.EnableVisualStyles();
     using (var h = OpenThemeData(HWND.NULL, "DWMWINDOW"))
     {
         Assert.That(h.IsInvalid, Is.False);
         using (var hInstance = Kernel32.LoadLibraryEx(@"C:\Windows\resources\themes\Aero\Aero.msstyles", Kernel32.LoadLibraryExFlags.LOAD_LIBRARY_AS_DATAFILE))
         {
             var hr = UxTheme.GetThemeStream(h, 0, 0, 213, out var themeStream, out var streamSize, hInstance);
             Assert.That(hr.Succeeded);
             Assert.That(streamSize, Is.GreaterThan(0));
             Assert.That(() => themeStream.ToArray <byte>((int)streamSize), Throws.Nothing);
         }
     }
 }