нашел статью по созданию окон сложной произвольной формы( http://www.vbrussian.com/Article.asp?ID=74 ).Дошел до создания простых нестандартных окон. Сделал вроде всё как там, но неработает. Хелп плиз. Мой код:
'----------------------------------------------------
Public Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Public Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Public Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Public Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Public Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Public Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
Public Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Public Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Public Sub SetFormPosition(frmHandl As Long, TopPosition As Boolean)
If TopPosition Then
SetWindowPos frmHandl, HWND_TOPMOST, 0, 0, 0, 0, _
SWP_NOACTIVATE Or SWP_NOSIZE Or SWP_NOMOVE
Else
SetWindowPos frmHandl, HWND_NOTOPMOST, 0, 0, 0, 0, _
SWP_NOSIZE Or SWP_NOMOVE
End If
End Sub
Public Function lGetRegion(Pic As PictureBox, lBackColor As Long) As Long
Dim lRgn As Long
Dim lSkinRgn As Long
Dim lStart As Long
Dim lX As Long
Dim lY As Long
Dim lHeight As Long
Dim lWidth As Long
'ñîçäàåì ïóñòîé ðåãèîí, ñ êîòîðîãî íà÷íåì ðàáîòó
lSkinRgn = CreateRectRgn(0, 0, 0, 0)
With Pic
'ïîäñ÷èòàåì ðàçìåðû ðèñóíêà â Pixel
lHeight = .Height / Screen.TwipsPerPixelY
lWidth = .Width / Screen.TwipsPerPixelX
For lX = 0 To lHeight - 1
lY = 0
Do While lY < lWidth
'èùåì íóæíûé Pixel
Do While lY < lWidth And GetPixel(.hdc, lY, lX) = lBackColor
lY = lY + 1
Loop
If lY < lWidth Then
lStart = lY
Do While lY < lWidth And GetPixel(.hdc, lY, lX) <> lBackColor
lY = lY + 1
Loop
If lY > lWidth Then lY = lWidth
'íóæíûé Pixel íàéäåí, äîáàâèì åãî â ðåãèîí
lRgn = CreateRectRgn(lStart, lX, lY, lX + 1)
CombineRgn lSkinRgn, lSkinRgn, lRgn, RGN_OR
DeleteObject lRgn
End If
Loop
Next
End With
lGetRegion = lSkinRgn
End Function
Sub Main()
Dim lRgn As Long
Load Form1
Form1.Pic.Picture = LoadPicture("C:\Pictures\3\BtnClose.bmp")
lRgn = lGetRegion(Form1.Pic, vbWhite)
SetWindowRgn Form1.hwnd, lRgn, True
DeleteObject lRgn
Form1.Show
SetFormPosition Form1.hwnd, True
End Sub
Option Explicit
Private Declare Function CreateRoundRectRgn Lib "gdi32" _
 ByVal X1 As Long, ByVal Y1 As Long, _
ByVal X2 As Long, ByVal Y2 As Long, _
ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Declare Function SetWindowRgn _
Lib "user32" (ByVal hwnd As Long, _
ByVal hRgn As Long, _
ByVal bRedraw As Long) As Long
Private Declare Function CreatePolygonRgn _
Lib "gdi32" (lpPoint As Koor, _
ByVal nCount As Long, _
ByVal nPolyFillMode As Long) As Long
Private Type Koor
x As Long
y As Long
End Type
Private Sub Form_Load()
Dim MakeRegion As Long
MakeRegion = CreateRoundRectRgn(0 / Screen.TwipsPerPixelX, _
0 / Screen.TwipsPerPixelY, 2000 / Screen.TwipsPerPixelX, _
2000 / Screen.TwipsPerPixelY, 50, 50)
Call SetWindowRgn(Me.hwnd, MakeRegion, True)
End Sub
И еще вариант почти идентичный:
Option Explicit
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 Long) As Long
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As Koor, _
ByVal nCount As Long, ByValnPolyFillMode As Long) As Long
Private Type Koor
X As Long
Y As Long
End Type
Private Sub Form_Load()
Dim MakeCircle As String
MakeCircle = CreateEllipticRgn(100 / Screen.TwipsPerPixelX, _
100 / Screen.TwipsPerPixelY, 1400 / Screen.TwipsPerPixelX, _
400 / Screen.TwipsPerPixelY)
Call SetWindowRgn(Me.hWnd, MakeCircle, True)
End Sub