[DllImport("user32.dll")] private static extern IntPtr SendMessage(HandleRef hWnd, uint Msg, IntPtr wParam, IntPtr lParam); /////////////////////////////////////////////////////////////////////// /// /// Enables the elevated shield icon on the given button control /// /// /// Button control to enable the elevated shield icon on. /// /////////////////////////////////////////////////////////////////////// private void EnableElevateIcon_BCM_SETSHIELD(Button ThisButton) { // Input validation, validate that ThisControl is not null if (ThisButton == null) { return; } // Define BCM_SETSHIELD locally, declared originally in Commctrl.h uint BCM_SETSHIELD = 0x0000160C; // Set button style to the system style ThisButton.FlatStyle = FlatStyle.System; // Send the BCM_SETSHIELD message to the button control SendMessage(new HandleRef(ThisButton, ThisButton.Handle), BCM_SETSHIELD, new IntPtr(0), new IntPtr(1)); }