1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-09 06:15:49 +02:00

Add an extension method to add UAC shield to a button

This commit is contained in:
chylex 2016-10-18 16:21:08 +02:00
parent ae64573510
commit c7c9931f68
2 changed files with 8 additions and 0 deletions

View File

@ -1,6 +1,7 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using TweetDck.Core.Utils;
namespace TweetDck.Core.Controls{
static class ControlExtensions{
@ -35,6 +36,12 @@ public static void SetValueSafe(this TrackBar trackBar, int value){
}
}
public static void SetElevated(this Button button){
button.Text = " "+button.Text;
button.FlatStyle = FlatStyle.System;
NativeMethods.SendMessage(button.Handle, NativeMethods.BCM_SETSHIELD, 0, new IntPtr(1));
}
public static void EnableMultilineShortcuts(this TextBox textBox){
textBox.KeyDown += (sender, args) => {
if (args.Control && args.KeyCode == Keys.A){

View File

@ -15,6 +15,7 @@ static class NativeMethods{
public const int MOUSEEVENTF_RIGHTUP = 0x10;
public const int SB_HORZ = 0;
public const int BCM_SETSHIELD = 0x160C;
public const int WH_MOUSE_LL = 14;
public const int WH_MOUSEWHEEL = 0x020A;