Here's the current arrangement of my form: I have a form (Form1) with a frame (Fra1) on it. I'm using SetParent to insert a second form (Form2) into the frame.

Form1 > Fra1 >Form2

Now, I call TransparentBlt to transfer an image onto Form2. When I want to use ExtFloodFill to fill in a region of that picture, the function executes, returns TRUE, and I call Form2.Refresh, but no colors are updated on the screen. However, if I start Form2 by itself and try the TransparentBlt > ExtFloodFill > Form2.Refresh, everything works as expected.

Would there be a reason the setting the parent of the form is affecting the way it is colored/APIs affect it? If so, what are some possible solutions to this issue?

From Form2:
VB Code:
  1. Private Sub Form_Load()
  2.    
  3.     Dim hBitmap         As Long
  4.     Dim hdc             As Long
  5.     Dim hFraDc          As Long
  6.    
  7.     ' Preparing the image
  8.     hdc = CreateCompatibleDC(GetDC(0))
  9.    
  10.     hBitmap = LoadImage(App.hInstance, App.Path & "\Images\test01.bmp", IMAGE_BITMAP, 300, 200, LR_LOADFROMFILE)
  11.     SelectObject hdc, hBitmap
  12.     TransparentBlt Me.hdc, 10, 30, 300, 200, hdc, 0, 0, 300, 200, vbWhite
  13.    
  14.     Me.Refresh
  15.     DeleteObject hBitmap
  16.    
  17.     mBrush = CreateSolidBrush(crNewColor)
  18.     SelectObject Me.hdc, mBrush
  19.     Me.ScaleMode = vbPixels
  20.    
  21.     ' Showing in Frame, Don't need Me.Show
  22.     'Me.Show
  23.  
  24. End Sub
  25.  
  26. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  27.     'Floodfill...
  28.     ExtFloodFill Me.hdc, X, Y, GetPixel(Me.hdc, X, Y), FLOODFILLSURFACE
  29.     Me.Refresh
  30. End Sub
  31.  
  32. Private Sub Form_Unload(Cancel As Integer)
  33.     DeleteObject mBrush
  34. End Sub