Solved

basics......

Posted on 1998-08-28
5
117 Views
Last Modified: 2013-11-19
hello,

I am very new to c/c++/mfc programming.  I was wondering, can someone explain how to do the following things for me?

1) Display a basic message box.  It seems like there has to be a better way than creating a separate dialog box with a static member in it.

2) Show those icons that you have no doubt seen in the message box (the stop icon for example).

3) Lastly, is there a way to make a dialog box always on top?

Thanks for your patience with these simple questions.
0
Comment
Question by:child_prodigy
  • 4
5 Comments
 
LVL 6

Accepted Solution

by:
thresher_shark earned 200 total points
ID: 1321439
Answer coming...
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1321440
>> 1) Display a basic message box.  It seems like there has to be a better way than creating a separate dialog box with a static member in it.

Sure.  If you are using MFC, then use the MessageBox member function:

MessageBox ("Hello world!");

There is also a standard Windows API function called MessageBox that you need to use in non-window classes.

Continues...
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1321441
>> 2) Show those icons that you have no doubt seen in the message box (the stop icon for example).

Try this:
MessageBox ("Hello World", "Hi", MB_OK | MB_ICONSTOP);
- or -
MessageBox ("Hello World", "Hi", MB_OK | MB_ICONEXCLAMATION);
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1321442
>> 3) Lastly, is there a way to make a dialog box always on top?
Use:
SetWindowPos (&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

Remember, to learn all this faster, look up these functions in the online help.

If you have any questions, please ask.  Thanks!
0
 

Author Comment

by:child_prodigy
ID: 1321443
Thanks a ton!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now