You'll need to use your language's implementation of P/Invoke to declare the function (C# code is given in the example below). For C# appsĭwmSetWindowAttribute is a native Win32 API and is not exposed directly to. For the second parameter, which specifies which attribute you are setting, pass the DWMWA_WINDOW_CORNER_PREFERENCE value defined in the DWMWINDOWATTRIBUTE enumeration. Round the corners if appropriate, with a small radius.Ī pointer to the appropriate value from this enum is passed to the third parameter of DwmSetWindowAttribute. Let the system decide whether or not to round window corners. You specify the corner rounding option you want for your app by passing a value of the DWM_WINDOW_CORNER_PREFERENCE enumeration (shown in the following table) to the DwmSetWindowAttribute function. If your app is not rounded by policy, you can optionally use these APIs to let your app opt-in to rounded corners. If your app does one of the following, it cannot be rounded:įor example, an app might use per-pixel alpha layering to draw transparent pixels around its main window to achieve a custom shadow effect, which makes the window no longer a rectangle and therefore the system cannot round it. These apps have no frame or borders, and typically have heavily customized UI. Note, however, that the API is a hint to the system and does not guarantee rounding, depending on the customizations.Īpps that cannot ever be rounded, even if they call the opt-in API. If you address these issues in your app or call the opt-in API, described in the following section, then it's possible for the system to round your app's window. Although we did try to round as many apps as possible with our system heuristics, there are some combinations of customizations that we can't predict so we provided a manual opt-in API for those cases.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |