Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8935745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:03:49+00:00 2026-06-15T10:03:49+00:00

If I use the System.Windows.Forms.MessageBox class’ show function to draw a message box, a

  • 0

If I use the System.Windows.Forms.MessageBox class’ show function to draw a message box, a window pops up. I would like to know where the actual code to draw this window is? Is it in some Win32 API or user32.dll etc.? Through reflector I am unable to see the definition of Show method.

Also, is .NET a wrapper around win32 api then? I know that when we compile .net code it generates IL which is converted to CPU specific instructions at run time and then our CPU executes those instructions. But I have a feeling that there is some common code in Windows OS that’s responsible for drawing a window (or reading from text file etc.). All these languages like C++, F#, C#, Java etc. eventually call that code from within the framework. But the question how can I go about finding it and verify it?

For example: in MFC or Win32 whichever function we called to draw a window on the screen, MessageBox.Show also calls the same function but its abstracted from us?

Then on the other hand we can inter operate between two languages.

So I am little confused here. Also I am reading CLR via C# these days so my brain is in super excited state 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:03:50+00:00Added an answer on June 15, 2026 at 10:03 am

    I think that you are on the right track. No matter the language or the framework, at the very bottom is the Operating System, so everything ends there, eventually: system calls.

    For example, to open a file in Windows the system call is CreateFile(), no matter if you used C fopen, C++ ifstream, C# System.IO.* or Java java.io.*.

    About your questions of System.Windows.Forms, they use the usual Win32 windows, so the windows are identified by HWND values, represented in the CLR as IntPtr.

    And about the function to show the window, your question is a bit misleading, as there are several functions involved, and several layers in the Win32 API.

    For example to create a window, you call CreateWindowEx(), to show it if hidden call ShowWindow(), and the paint itself will be handled when the window procedure (a callback you have to write) receives the WM_PAINT message. But in order to receive messages you have to write a message pump (GetMessagte() / DispatchMessage()).

    But to create a simple MessageBox() there is a function already available that does all that for you: MessageBox(), for which the System.Windows.Forms.MessageBox class is a direct wrapper.

    So now, what was the question? Ah, yes, can we interoperate between System.Windows.Forms and Win32? Yes!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a standard message box in WPF, like WinForms' System.Windows.Forms.MessageBox.Show() , or should
When I use System.Windows.Forms.Timer class and finish using it then I can't disable it..
I am working on a wpf application. Here I need to use System.Windows.Forms.FolderBrowserDialog in
I use this code to load a .Net assembly to PowerShell: [System.Reflection.Assembly]::Load(System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
I am using System.Windows; and System.Windows.Controls; so I can't use System.Windows.Forms; because there is
I have seen that Windows system use temporary files to increase the performance of
I'm trying to use the Rect structure from System.Windows in MonoDevelop, but I can't
Background I use JScript (Microsoft's ECMAScript implementation) for a lot of Windows system administration
I have a 64 bit windows operating system and I use VS2008 to write
What underlying rendering system does the Qt GUI toolkit use on Windows? (I'm assuming

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.