I need a real pop-up in my WinUI application. A ContentDialog is not a solution because the window must be movable. Then I played with PINVOIKE and found a semi-solution. Unfortunately there are the following problems :
With a double click on the caption bar the window is maximised
The window size can be changed
The Close button is old style.
Does anyone know a solution for these problems?
Here ist my Coding:
var dpi = GetDpiForWindow(iHwnd);
float scalingFactor = (float)dpi / 96;
iLeft = (int)(iLeft scalingFactor);
iTop = (int)(iTop scalingFactor);
iHeight = (int)(iHeight * scalingFactor);
= SetWindowPos(iHwnd,
SpecialWindowHandles.HWND_TOPMOST, // --- Stay on Top
iLeft, iTop, iWidth, iHeight, // --- Koordinates
SetWindowPosFlags.SWP_NOMOVE);
= SetWindowLong(iHwnd, WindowLongIndexFlags.GWL_EXSTYLE, SetWindowLongFlags.WS_EX_TOOLWINDOW);
