|
-
Mar 15th, 2001, 06:54 PM
#1
Thread Starter
Junior Member
Hi,
Is there any API call, who help me to create Non-rect form. shall i create either circular or any other image shape's form using Win API?
-
Mar 15th, 2001, 08:01 PM
#2
-
Mar 16th, 2001, 01:02 AM
#3
simple quick answer with no code sample:
use CreateEllipticalRgn or CreatePolygonalRgn api calls to make forms of any shape. Other api calls can xor the regions together to put holes in them, etc. When you have the rgn, use setwindowrgn to change your window shape.
I am thinking of making a window with a shape that changes every second just to test the extent of the ability.
-
Mar 16th, 2001, 11:57 PM
#4
Addicted Member
private declare function CreateEllipticRgn Lib "Gdi32" _
(byval x1 as long,byval y1 as long,byval x2 as _
long,byval y2 as long) As long
private declare function SetWindowRgn Lib "User32" _
(byval hWnd As Long,byval hRgn As Long,byval _
bRedraw As Boolean) As Long
private sub form_load()
Dim hRgn As Long
hRgn = CreateEllipticRgn(0,0,me.Width/Screen.TwipsPerPixelX,me.Height/Screen.TwipsPerPixelY)
SetWindowRgn Me.hWnd,hRgn
End Sub
'Please EMail Me Incase Of Problems.
-
Mar 17th, 2001, 11:05 AM
#5
Fanatic Member
i have created a window that looks like a remote. the easies way i have found is to put shape controls on your form where you want the borders, then, scaling the twips to pixels, you can get the exact measurements. Create the regions as you see fit (using given code or any of the other region functions). Then join them together using a function. then delete the shapes and walla!
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|