29Wx状态初始化
This commit is contained in:
1 parent
9fd5579fcd
commit
40c702883c
322 files changed
+155553
No files matched your search
@@ -0,0 +1,22 @@
|
||||
using CefSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Work.Helper
|
||||
{
|
||||
public class CEFHelper
|
||||
{
|
||||
public static string CefCookieToCookieStr(List<Cookie> cookies)
|
||||
{
|
||||
string cookieStr = "";
|
||||
foreach (var cookie in cookies)
|
||||
{
|
||||
cookieStr += cookie.Name + "=" + cookie.Value + ";";
|
||||
}
|
||||
return cookieStr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Work.Helper
|
||||
{
|
||||
public class Win32
|
||||
{
|
||||
#region Window Const
|
||||
|
||||
public const int WM_ERASEBKGND = 0x0014;
|
||||
public const int WM_LBUTTONDOWN = 0x0201;
|
||||
public const int WM_LBUTTONUP = 0x0202;
|
||||
public const int WM_LBUTTONDBLCLK = 0x0203;
|
||||
public const int WM_WINDOWPOSCHANGING = 0x46;
|
||||
public const int WM_PAINT = 0xF;
|
||||
public const int WM_CREATE = 0x0001;
|
||||
public const int WM_ACTIVATE = 0x0006;
|
||||
public const int WM_NCCREATE = 0x0081;
|
||||
public const int WM_NCCALCSIZE = 0x0083;
|
||||
public const int WM_NCPAINT = 0x0085;
|
||||
public const int WM_NCACTIVATE = 0x0086;
|
||||
public const int WM_NCLBUTTONDOWN = 0x00A1;
|
||||
public const int WM_NCLBUTTONUP = 0x00A2;
|
||||
public const int WM_NCLBUTTONDBLCLK = 0x00A3;
|
||||
public const int WM_NCMOUSEMOVE = 0x00A0;
|
||||
|
||||
public const int WM_NCHITTEST = 0x0084;
|
||||
|
||||
public const int HTLEFT = 10;
|
||||
public const int HTRIGHT = 11;
|
||||
public const int HTTOP = 12;
|
||||
public const int HTTOPLEFT = 13;
|
||||
public const int HTTOPRIGHT = 14;
|
||||
public const int HTBOTTOM = 15;
|
||||
public const int HTBOTTOMLEFT = 0x10;
|
||||
public const int HTBOTTOMRIGHT = 17;
|
||||
public const int HTCAPTION = 2;
|
||||
public const int HTCLIENT = 1;
|
||||
|
||||
public const int WM_FALSE = 0;
|
||||
public const int WM_TRUE = 1;
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public extern methods
|
||||
|
||||
[DllImport("gdi32.dll")]
|
||||
public static extern int CreateRoundRectRgn(int x1, int y1, int x2, int y2, int x3, int y3);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern int SetWindowRgn(IntPtr hwnd, int hRgn, Boolean bRedraw);
|
||||
|
||||
[DllImport("gdi32.dll", EntryPoint = "DeleteObject", CharSet = CharSet.Ansi)]
|
||||
public static extern int DeleteObject(int hObject);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool ReleaseCapture();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Work.Helper
|
||||
{
|
||||
public class WindowStyle
|
||||
{
|
||||
public static void SetFormRoundRectRgn(Control c, int rgnRadius)
|
||||
{
|
||||
int hRgn = 0;
|
||||
hRgn = Win32.CreateRoundRectRgn(0, 0, c.Width + 1, c.Height + 1, rgnRadius, rgnRadius);
|
||||
Win32.SetWindowRgn(c.Handle, hRgn, true);
|
||||
Win32.DeleteObject(hRgn);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user