dcsimg

Creating a Round Dialog

WEBINAR:
On-Demand

Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame


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

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



This article was originally published on April 18th, 1999

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date