#Include once "window9.bi"

Function SetStateMenu Alias "SetStateMenu" (ByVal menu As HMENU,ByVal Npos As Integer,ByVal State As Integer) As Integer Export
  If state=3 Or state=8 Then
    Return CheckMenuItem(menu,Npos,8)
  ElseIf state=1 then
    Return EnableMenuItem(menu,Npos,1)
  ElseIf state=2 then
    Return  EnableMenuItem(menu,Npos,2)
  Else
    CheckMenuItem(menu,Npos,0)
    Return  EnableMenuItem(menu,Npos,0)
  End If
End Function
