Solved

basics......

Posted on 1998-08-28
5
116 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
Comment Utility
Answer coming...
0
 
LVL 6

Expert Comment

by:thresher_shark
Comment Utility
>> 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
Comment Utility
>> 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
Comment Utility
>> 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
Comment Utility
Thanks a ton!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Error on moodle after upgrade 3 105
deburging in oracle form 12 76
fizzArray  challenge 1 47
Thin secure Windows 10 5 46
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 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

13 Experts available now in Live!

Get 1:1 Help Now