' check
'   设置一个复选框控件的选中状态。
'   hWndControl:  控件的句柄 (例如  HWND_FORM1_CHECK1)
'   nCheckState:  <> 0 to set checked, 0 to uncheck.
Sub FF_Control_SetCheck( ByVal hWndControl as HWnd, _
                         ByVal nCheckState as Integer ) 
    
    '检查窗口句柄是否有效
    If IsWindow(hWndControl) Then  
       
       ' Set the check state
         If nCheckState Then
            SendMessage hWndControl, BM_SETCHECK, BST_CHECKED, 0
         Else
            SendMessage hWndControl, BM_SETCHECK, BST_UNCHECKED, 0
         End If
            
    End If
       
End Sub

