VB Code:
'assuming you already have the hDC
Dim x As Long, y As Long, blnFound As Boolean
blnFound = False
For x = 0 To (Screen.Width \ Screen.TwipsPerPixelX) - 1
For y = 0 To (Screen.Height \ Screen.TwipsPerPixelY) - 1
If GetPixel(hDC, x, y) = vbWhite Then
SetCursorPos x, y
blnFound = True
Exit For
End If
'the DoEvents isn't necessary, but it prevents the system from
'being hung up while it's searching pixels
DoEvents
Next y
If blnFound Then Exit For
Next x
I don't know where you got the declare for SetCursorPos, but I've never seen one that takes a pointer to a POINTAPI struct. That's the GetCursorPos that does. I've only seen SetCursorPos take the literal X and Y position. That might be the problem. You may want to use GetWindowDC as well, to ensure you get the entire window area, and not just the client portion that GetDC returns. If you use GetWindowDC though, be sure to use ReleaseDC on it when you're done.