Ejemplo n.º 1
0
        ///-------------------------------------------------------------------------------------------------
        /// <summary>   Gets caption text for the specified button. </summary>
        ///
        /// <param name="buttonCaption">    The button caption. </param>
        ///
        /// <returns>   The caption text. </returns>
        ///-------------------------------------------------------------------------------------------------
        public static string GetCaptionText(WindowsButtonCaption buttonCaption)
        {
            var handle = WinApi.LoadLibrary("user32.dll");

            var sb = new StringBuilder(1024);

            return(User32Api.LoadString(handle, (uint)buttonCaption, sb, 1024) > 0 ? sb.ToString() : string.Empty);
        }