Windows

G

Guest

Greetings,

Is there anyway to creat a Window in XP that is not rectangular.... i.e.
oval, round, rounded corners.....

I've been challenged to take an old Win95 application and "give it a new
look".... one thought I had was getting away from the old fashioned
rectangular windows.

Any thoughts?
 
W

William DePalo [MVP VC++]

mike east said:
Is there anyway to creat a Window in XP that is not rectangular.... i.e.
oval, round, rounded corners.....

Yes, there is.
I've been challenged to take an old Win95 application and "give it a new
look".... one thought I had was getting away from the old fashioned
rectangular windows.

Any thoughts?

Check the docs for an overview of the concept of regions

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/regions_7ab7.asp?frame=true

and then CreateRoundedRectRgn() and SetWindowRgn() which should get you off
the ground.

You likely want to post follow-up in the GDI or UI groups

microsoft.public.win32.programmer.gdi
microsoft.public.win32.programmer.ui

respectively.

Regards,
Will
 
B

BlackCat_DNA_XY

You might be interested in reading Windows XP Theme... to give that
look to your application, you need a .manifest file and to add few
lines in your project... here it's a function I use...

#define IDS_UTIL_UXTHEME "UxTheme.dll"
#define IDS_UTIL_THEMETEXTURE "EnableThemeDialogTexture"
/////////////////////////////////////////////////////////////////////////////
void EnableThemeDialogTexture(HWND hwndDlg)
{
HINSTANCE
hDll=LoadLibrary(CString((LPCTSTR)IDS_UTIL_UXTHEME)); //
'UxTheme.dll'
if(hDll==NULL)
return; // the DLL won't be available on anything except Windows XP
ULONG (PASCAL *lpfnEnableTheme)(HWND, DWORD);
(FARPROC&)lpfnEnableTheme=GetProcAddress(hDll,CString((LPCTSTR)IDS_UTIL_THEMETEXTURE)); //
'EnableThemeDialogTexture'
if(lpfnEnableTheme)
lpfnEnableTheme(hwndDlg, 6); // ETDT_ENABLETAB = (ETDT_ENABLE |
ETDT_USETABTEXTURE) = (2|4) = 6
else ASSERT(FALSE);
FreeLibrary(hDll);
}

Otherwise, you can use Region and draw your own dialog with BitBlt
functions.. but I think with Windows Vista.. new way of creating GUI
will be available.. you might want to give a look by checking .NET
2005.

regards,
-bkc-
 
J

James

Hi,

Honestly I don't have much of a clue...
Try using the Transpency Key, somewhere in the Form's Properties.

If I were you, just use DirectX. Free SDK, free tutorials...


...how could anyone

not like it?

James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top