private void btnGetDisplayedError_Click(object sender, EventArgs e) { this.Enabled = false; string DisplayedError = ""; // get the displayed error if (Handset.GetDisplayedError(ref DisplayedError) < 0) { MessageBox.Show("Could not get displayed error!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { // check if no error is displayed if (DisplayedError == "") { MessageBox.Show("no error is currently displayed.", "Displayed Error", MessageBoxButtons.OK); } // we have an error to display else { // show the displayed error in a message-box MessageBox.Show("Displayed Error: " + DisplayedError, "Displayed Error", MessageBoxButtons.OK); } } this.Enabled = true; }