Solved

basics......

Posted on 1998-08-28
5
120 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
countEvens challenge 2 112
post4 challenge 28 104
zeroFront challenge 7 112
sumHeights  challenge 17 74
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

838 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