C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Operating System »

user32.dll message box


Posted Date: 28 Aug 2009    Resource Type: Code Snippets    Category: Operating System
Author: Shunmuganathan MMember Level: Diamond    
Rating: 1 out of 5Points: 8



Description :


Normally we are using message boxes in windows.
The following code an example of message box
It is created from user32.dll

Namespace part

using System;
using System.Runtime.InteropServices;



This is the Main class for showing the message box

public class MyWinClass {
public static void Main() {
string MsgCaption = "My Message Title";
string MsgText = "This message is conformation of your database updation";
WINAPI.ShowMessage(0, MsgText, MsgCaption, 0);
}
}


Windows API for get the message box

public class WINAPI {
[DllImport("user32.dll", EntryPoint = "MessageBox")]
public static extern int ShowMessage(int hWnd,
string text, string caption, uint type);
}



Code Explanation

1. Create the WINAPI class
2. Get the message box
3. Show the WINAPI message box

The above output is very simple, But the main concept is get the message box from user32.dll

By
Nathan



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
User32.dll message box  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Get the OS version
Previous Resource: Display top 10 entries from the Event log
Return to Discussion Resource Index
Post New Resource
Category: Operating System


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use