how come when i do this it works:
outline = CreateEllipticRgn(0, 0, 137, 157)
SetWindowRgn form1.hwnd, outline, True
DeleteObject outline
but if i use findwindow and pass a different windows handle it doesn't?
Printable View
how come when i do this it works:
outline = CreateEllipticRgn(0, 0, 137, 157)
SetWindowRgn form1.hwnd, outline, True
DeleteObject outline
but if i use findwindow and pass a different windows handle it doesn't?
if you put your sub in a module then call it from whatever form you want to change it works fine.
Public Sub Ellipse(hWnd As Long)
outline = CreateEllipticRgn(0, 0, 137, 157)
SetWindowRgn hWnd, outline, True
DeleteObject outline
End Sub
just call it from your form
Call Ellipse(Me.hWnd)