PDA

Click to See Complete Forum and Search --> : How come this only works with your own program's handle:


Bad5887
Jun 23rd, 2000, 08:29 AM
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?

smiffe
Jun 26th, 2000, 06:45 PM
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)