Public Shared Sub UAC_EnableElevateIcon(ByVal button As System.Windows.Forms.Button)
Const BCM_SETSHIELD As UInteger = 5644
If button Is Nothing Then
Return
End If
button.Image = Nothing
button.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
button.FlatStyle = System.Windows.Forms.FlatStyle.System
' Send the BCM_SETSHIELD message to the button control
SendMessage(New HandleRef(button, button.Handle), BCM_SETSHIELD, IntPtr.Zero, New IntPtr(1))
End Sub
Remarque :
'Ce snippet appel la fonction SendMessage, voici sa déclaration:
_
Shared Function SendMessage(ByVal hWnd As HandleRef, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
End Function