I am writing an alarm program in C# that displays a system modal dialog with a user-specified message at a specified time. However, I can’t seem to find the C# equivalent of
MessageBoxA(HWND_DESKTOP, msg, "Alarm",
MB_OK | MB_ICONWARNING | MB_SYSTEMMODAL | MB_SETFOREGROUND);
Edit: I am trying to learn C# and the .NET libraries. I thought writing programs equivalent to some small programs that I have written in C or C++ would be a good place to start.
Something like this should work for you:
Find out more on MSDN: http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox.show.aspx
EDIT:
Just as alternative idea, this would create form of the size of your screen and show there message box by blocking everything else on the screen until you close that message box.
Just add following code on elapsing of your alarm timer:
Honestly I don’t like this solution, besides it won’t work as alarm for people who can kill process 🙂