CodeGuru
Earthweb Search
Forums Wireless Jars Gamelan Developer.com
CodeGuru Navigation
RSS Feeds

RSSAll

RSSVC++/C++

RSS.NET/C#

RSSVB

See more EarthWeb Network feeds

follow us on Twitter

Member Sign In
User ID:
Password:
Remember Me:
Forgot Password?
Not a member?
Click here for more information and to register.

Become a Marketplace Partner

jobs.internet.com

internet.commerce
Partners & Affiliates
















Home >> Visual C++ / C++ >> Windows & Dialogs >> Dialog >> Miscellaneous


Creating a Round Dialog
Rating: none

Anthony D. Davis (view profile)
April 18, 1999

Environment: The code in this article was developed using Visual C++ 4.0
(continued)




This code is used to make a round dialog for various Apps. This could be good for use with an MP3 or CDPLAYER or any other. Surprisingly it's not that hard! [I looked but nobody had written anything for a round dialog. I had been trying to shape a dialog for some time. Then after playing with the Microsoft CD for a SetWindowRgn() for a window I tried to use it for a dialog. Viola! After Jumping around a few times after it compiled I sent it to the Code Guru.



[CRgn m_rgn;  // This is for the dialog area: It goes in your h. file


// This Gets the size of the Dialog: This goes under the OnInitDialog Function
Crect rcDialog
GetClientRect(rcDialog);


// This Creates area assigned to Dialog: This goes directly below the above in OnInitDialog
m_rgn.CreateEllipticRgn(0, 0, rcDialog.Width(), rcDialogHeight());
SetWindowRgn(GetSafeHwnd(), (HRGN) m_rgn, TRUE);]



Download demo project - 17 KB

Download source - 3 KB

Date Last Updated: April 18, 1999

Tools:
Add www.codeguru.com to your favorites
Add www.codeguru.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed







RATE THIS ARTICLE:   Excellent  Very Good  Average  Below Average  Poor  

(You must be signed in to rank an article. Not a member? Click here to register)

Latest Comments:
Very Very Good; Life Saver - Legacy CodeGuru (02/03/2003)
Hey - Legacy CodeGuru (08/27/2002)
High Hand! - Legacy CodeGuru (09/30/2000)
Good - but I have a question about the CAPTION. - Legacy CodeGuru (04/12/2000)
Multiple Regions - Legacy CodeGuru (01/13/2000)

View All Comments
Add a Comment:
Title:
Comment:
Pre-Formatted: Check this if you want the text to display with the formatting as typed (good for source code)



(You must be signed in to comment on an article. Not a member? Click here to register)