Я посмотрел на источник, который вы опубликовали, и он работает для меня. Вот код:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace PAUL.Allgemein.Seiten
{
/// <summary>
/// Interaktionslogik für Robbe.xaml
/// </summary>
public partial class Robbe : Window
{
#region The Classic Window API
//The SendMessage function sends a message to a window or windows.
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
//ReleaseCapture releases a mouse capture
[DllImportAttribute("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
public static extern bool ReleaseCapture();
//SetWindowLong lets you set a window style
[System.Runtime.InteropServices.DllImport("user32.dll")]
static extern int SetWindowLong(IntPtr hWnd, int nIndex, long dwNewLong);
#endregion
const int GWL_STYLE = -16;
const long WS_POPUP = 2147483648;
//private const int GWL_STYLE = -16;
//private const int WS_SYSMENU = 0x80000;
//[DllImport("user32.dll", SetLastError = true)]
//private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
//[DllImport("user32.dll")]
//private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
public Robbe()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
IntPtr hWnd = new System.Windows.Interop.WindowInteropHelper(this).Handle;
SetWindowLong(hWnd, GWL_STYLE, WS_POPUP);
}
}
}
и код Xaml:
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Robbe" Height="300" Width="300"
Loaded="Window_Loaded">
<Grid>
<!-- Creates the shadow on the right and bottom -->
<Border Focusable="False" BorderBrush="Gray"
BorderThickness="0,0,2,2"
CornerRadius="10"
Background="Beige" >
<WebBrowser Source="C:\Users\nicholas\Desktop\puale\PAUL\bin\Debug\robbe.swf" Margin="62,71,69,56"></WebBrowser>
</Border>
</Grid>