Rename NativeConstants class
This commit is contained in:
parent
4d515d2a9e
commit
eff05bc15c
@ -51,9 +51,9 @@ namespace ShareX.HelpersLib
|
||||
{
|
||||
base.WndProc(ref m);
|
||||
|
||||
if (clickThrough && m.Msg == (int)WindowsMessages.MOUSEACTIVATE && m.Result == (IntPtr)NativeMethods.MA_ACTIVATEANDEAT)
|
||||
if (clickThrough && m.Msg == (int)WindowsMessages.MOUSEACTIVATE && m.Result == (IntPtr)NativeConstants.MA_ACTIVATEANDEAT)
|
||||
{
|
||||
m.Result = (IntPtr)NativeMethods.MA_ACTIVATE;
|
||||
m.Result = (IntPtr)NativeConstants.MA_ACTIVATE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ namespace ShareX.HelpersLib
|
||||
|
||||
if (NativeMethods.GetCursorInfo(out cursorInfo))
|
||||
{
|
||||
IsVisible = cursorInfo.flags == NativeMethods.CURSOR_SHOWING;
|
||||
IsVisible = cursorInfo.flags == NativeConstants.CURSOR_SHOWING;
|
||||
|
||||
if (IsVisible)
|
||||
{
|
||||
@ -102,7 +102,7 @@ namespace ShareX.HelpersLib
|
||||
if (IconHandle != IntPtr.Zero)
|
||||
{
|
||||
Point drawPosition = new Point(Position.X - cursorOffset.X, Position.Y - cursorOffset.Y);
|
||||
NativeMethods.DrawIconEx(hdcDest, drawPosition.X, drawPosition.Y, IconHandle, 0, 0, 0, IntPtr.Zero, NativeMethods.DI_NORMAL);
|
||||
NativeMethods.DrawIconEx(hdcDest, drawPosition.X, drawPosition.Y, IconHandle, 0, 0, 0, IntPtr.Zero, NativeConstants.DI_NORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -496,7 +496,7 @@ namespace ShareX.HelpersLib
|
||||
{
|
||||
if (textBox != null && textBox.IsHandleCreated && watermarkText != null)
|
||||
{
|
||||
NativeMethods.SendMessage(textBox.Handle, (int)NativeMethods.EM_SETCUEBANNER, showCueWhenFocus ? 1 : 0, watermarkText);
|
||||
NativeMethods.SendMessage(textBox.Handle, (int)NativeConstants.EM_SETCUEBANNER, showCueWhenFocus ? 1 : 0, watermarkText);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,12 +80,12 @@ namespace ShareX.HelpersLib
|
||||
POINT sourceLocation = new POINT(0, 0);
|
||||
POINT newLocation = new POINT(Left, Top);
|
||||
BLENDFUNCTION blend = new BLENDFUNCTION();
|
||||
blend.BlendOp = NativeMethods.AC_SRC_OVER;
|
||||
blend.BlendOp = NativeConstants.AC_SRC_OVER;
|
||||
blend.BlendFlags = 0;
|
||||
blend.SourceConstantAlpha = (byte)opacity;
|
||||
blend.AlphaFormat = NativeMethods.AC_SRC_ALPHA;
|
||||
blend.AlphaFormat = NativeConstants.AC_SRC_ALPHA;
|
||||
|
||||
NativeMethods.UpdateLayeredWindow(Handle, screenDc, ref newLocation, ref newSize, memDc, ref sourceLocation, 0, ref blend, NativeMethods.ULW_ALPHA);
|
||||
NativeMethods.UpdateLayeredWindow(Handle, screenDc, ref newLocation, ref newSize, memDc, ref sourceLocation, 0, ref blend, NativeConstants.ULW_ALPHA);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
namespace ShareX.HelpersLib
|
||||
{
|
||||
public static partial class NativeMethods
|
||||
public static class NativeConstants
|
||||
{
|
||||
public const int GCL_HICONSM = -34;
|
||||
public const int GCL_HICON = -14;
|
||||
|
@ -122,15 +122,15 @@ namespace ShareX.HelpersLib
|
||||
{
|
||||
IntPtr iconHandle;
|
||||
|
||||
SendMessageTimeout(handle, (int)WindowsMessages.GETICON, ICON_SMALL2, 0, SendMessageTimeoutFlags.SMTO_ABORTIFHUNG, 1000, out iconHandle);
|
||||
SendMessageTimeout(handle, (int)WindowsMessages.GETICON, NativeConstants.ICON_SMALL2, 0, SendMessageTimeoutFlags.SMTO_ABORTIFHUNG, 1000, out iconHandle);
|
||||
|
||||
if (iconHandle == IntPtr.Zero)
|
||||
{
|
||||
SendMessageTimeout(handle, (int)WindowsMessages.GETICON, ICON_SMALL, 0, SendMessageTimeoutFlags.SMTO_ABORTIFHUNG, 1000, out iconHandle);
|
||||
SendMessageTimeout(handle, (int)WindowsMessages.GETICON, NativeConstants.ICON_SMALL, 0, SendMessageTimeoutFlags.SMTO_ABORTIFHUNG, 1000, out iconHandle);
|
||||
|
||||
if (iconHandle == IntPtr.Zero)
|
||||
{
|
||||
iconHandle = GetClassLongPtrSafe(handle, GCL_HICONSM);
|
||||
iconHandle = GetClassLongPtrSafe(handle, NativeConstants.GCL_HICONSM);
|
||||
|
||||
if (iconHandle == IntPtr.Zero)
|
||||
{
|
||||
@ -151,11 +151,11 @@ namespace ShareX.HelpersLib
|
||||
{
|
||||
IntPtr iconHandle;
|
||||
|
||||
SendMessageTimeout(handle, (int)WindowsMessages.GETICON, ICON_BIG, 0, SendMessageTimeoutFlags.SMTO_ABORTIFHUNG, 1000, out iconHandle);
|
||||
SendMessageTimeout(handle, (int)WindowsMessages.GETICON, NativeConstants.ICON_BIG, 0, SendMessageTimeoutFlags.SMTO_ABORTIFHUNG, 1000, out iconHandle);
|
||||
|
||||
if (iconHandle == IntPtr.Zero)
|
||||
{
|
||||
iconHandle = GetClassLongPtrSafe(handle, GCL_HICON);
|
||||
iconHandle = GetClassLongPtrSafe(handle, NativeConstants.GCL_HICON);
|
||||
}
|
||||
|
||||
if (iconHandle != IntPtr.Zero)
|
||||
|
@ -46,7 +46,7 @@ namespace ShareX.ScreenCaptureLib
|
||||
|
||||
public Rectangle ClientRectangle => NativeMethods.GetClientRect(Handle);
|
||||
|
||||
public WindowStyles Styles => (WindowStyles)NativeMethods.GetWindowLong(Handle, NativeMethods.GWL_STYLE);
|
||||
public WindowStyles Styles => (WindowStyles)NativeMethods.GetWindowLong(Handle, NativeConstants.GWL_STYLE);
|
||||
|
||||
public Icon Icon => NativeMethods.GetApplicationIcon(Handle);
|
||||
|
||||
|
@ -274,7 +274,7 @@ namespace ShareX.ScreenCaptureLib
|
||||
tsMain.GripMouseDown += (sender, e) =>
|
||||
{
|
||||
NativeMethods.ReleaseCapture(tsMain.Handle);
|
||||
NativeMethods.DefWindowProc(menuForm.Handle, (uint)WindowsMessages.SYSCOMMAND, (UIntPtr)NativeMethods.MOUSE_MOVE, IntPtr.Zero);
|
||||
NativeMethods.DefWindowProc(menuForm.Handle, (uint)WindowsMessages.SYSCOMMAND, (UIntPtr)NativeConstants.MOUSE_MOVE, IntPtr.Zero);
|
||||
};
|
||||
|
||||
tsMain.SuspendLayout();
|
||||
|
@ -109,7 +109,7 @@ namespace ShareX
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
NativeMethods.ReleaseCapture();
|
||||
NativeMethods.SendMessage(Handle, (uint)WindowsMessages.NCLBUTTONDOWN, (IntPtr)NativeMethods.HT_CAPTION, IntPtr.Zero);
|
||||
NativeMethods.SendMessage(Handle, (uint)WindowsMessages.NCLBUTTONDOWN, (IntPtr)NativeConstants.HT_CAPTION, IntPtr.Zero);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user