Hey everyone,
I am making this program that can have different themes. One of the themes is windows xp, and i want to make the upper two corners rounded... but it is not working. I am using the configs stored in a file and depending on that I load the theme image. I am using the following code:

VB Code:
  1. Option Explicit
  2. 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
  3. Private Declare Function SetWindowRgn Lib "user32" _
  4. (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
  5.  
  6. Private Sub MakeRound(frm As Form)
  7. Dim lngNewWnd As Long
  8. Dim lngNewRgn As Long
  9. Dim lngWidth As Long
  10. Dim lngHeight As Long
  11. ' Calculate the current width
  12. lngWidth = frm.Width / Screen.TwipsPerPixelX
  13. ' Calculate the current height
  14. lngHeight = frm.Height / Screen.TwipsPerPixelY
  15. ' Create the new region
  16. lngNewWnd = CreateRoundRectRgn(0, 0, Me.Width, Me.Height, 2, 2)
  17. lngNewRgn = SetWindowRgn(frm.hWnd, lngNewWnd, True)
  18. '/ Screen.TwipsPerPixelX + 1
  19. '  / Screen.TwipsPerPixelY + 1
  20. End Sub
  21.  
  22. Private Sub Form_Load()
  23.     lblComponent(0).BackColor = lngMenuColor
  24.     MakeRound Me
  25.     frmMain.Width = frmMain.imgBackGround.Width
  26.     frmMain.Height = frmMain.imgBackGround.Height
  27. End Sub

The image in imgBackground is being loaded in frmFlash. I was wondering if anyone could suggest anything... I tried loading the image on the form itslef and also loading the image on imgBackground, which imgBackground.Visible = False and setting the form width, but then only a part of the form is visible. If I have the form visible, the white at the upper two corners is visible. Is there possibly any way to fix this.

Any suggestions would be appreciated,
Thank you in advance,
Khanjan