<Window X: class = "wpfapp. window1"
Xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml"
Windowstate = "maximized"
Topmost = "true"
Windowstyle = "NONE"
Allowstransparency = "true"
Title = "window1" Height = "300" width = "300">
<Grid>
</GRID>
</WINDOW>
Start the animation. The program runs slowly and the mouse moves slowly.
Solution:
In the window attribute of XAML, windowstyle retains its default value,
The Win32 API function is directly used in the window loading response function to modify the style of the window.
This is a temporary solution found on the Internet.
<Window X: class = "wpfapp. window1"
Xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml"
Windowstate = "maximized"
Topmost = "true"
Loaded = "onmainload"
Title = "window1" Height = "300" width = "300">
<Grid>
</GRID>
</WINDOW> Private void onmainload (Object sender, routedeventargs E)
{
Int nstyle = WIN32API. getwindowlong (New windowinterophelper (this). Handle;, WIN32API. gwl_style );
Nstyle & = ~ WIN32API. ws_caption;
WIN32API. setwindowlong (New windowinterophelper (this). Handle;, WIN32API. gwl_style, nstyle );
}
Public class WIN32API
{
[Dllimport ("user32.dll")]
Public static extern int setwindowlong (intptr hwnd, int nindex, int new );
[Dllimport ("user32.dll")]
Public static extern int getwindowlong (intptr hwnd, int nindex );
}
Public const int gwl_style =-16;
Public const int gwl_exstyle =-20;
Public const int ws_caption = 0x00c00000;