8

Looking for some explanation on how going fullscreen mode with HWND window, I found this response Win32: full-screen and hiding taskbar

The chromium response code has this line:

saved_window_info_.maximized = !!::IsZoomed(hwnd_);

from this file https://src.chromium.org/viewvc/chrome/trunk/src/ui/views/win/fullscreen_handler.cc?revision=HEAD&view=markup on line 56

I read:

var bar equal not not of mother method

Is this correct ?

What this "!!::IsZoomed()" means ?

Why not just

saved_window_info_.maximized = CWnd::IsZoomed(hwnd_);

?

Community
  • 1
  • 1
Julien hadim
  • 101
  • 2

1 Answers1

10

The !! is simply ! and !, two negations. Double negation reduces to noop, but it casts the value to bool. So consider that an alternative syntax to (bool). It's advantage is that it:

  1. it works in C which did not have a separate bool type in C89 (forces the value of 0 or 1) and
  2. MSC++ does not generate the silly “performance warning” for it like it does for (bool).

And the rest is simply ::IsZoomed, i.e. function IsZoomed from top-level namespace.

Jan Hudec
  • 73,652
  • 13
  • 125
  • 172