$INCLUDE "QFileAssociation.Inc"
$ESCAPECHARS ON
$TYPECHECK ON
$INCLUDE "RAPIDQ.INC"
$DEFINE JUMPOVER
DECLARE SUB OnClose_frmSetFileAssociation
DECLARE SUB OnClic_AnyMenu (Sender AS QMENUITEM)
CREATE frmSetFileAssociation AS QFORM
Center
Width = 1000
height = 1000
CAPTION = "frmSetFileAssociation"
AutoScroll = False
OnClose = OnClose_frmSetFileAssociation
CREATE rchWin AS QRICHEDIT
Align = 5
Font.Name = "courier new"
Font.Size = 12
Font.COLOR = &H800000
ReadOnly = True
WordWrap = False
ScrollBars = ssBoth
HideSelection = False
PlainText = True
Text = CHR$(10) & " *** NOTHING DONE YET ! USE THE MENU ITEMS ***"
END CREATE
CREATE mnuMain AS QMAINMENU
CREATE mnuSimpleSet AS QMENUITEM
CAPTION = "&SIMPLE_SET "
OnClick = OnClic_AnyMenu
END CREATE
CREATE mnuSetWithRestore AS QMENUITEM
CAPTION = " &SET_WITH_RESTORE "
OnClick = OnClic_AnyMenu
END CREATE
CREATE mnuRestore AS QMENUITEM
CAPTION = " &RESTORE "
OnClick = OnClic_AnyMenu
END CREATE
CREATE mnuShowRelatedKeysAndValues AS QMENUITEM
CAPTION = " &SHOW_RELATED_KEYS_AND_VALUES "
OnClick = OnClic_AnyMenu
END CREATE
CREATE mnuClear AS QMENUITEM
CAPTION = " &CLEAR "
OnClick = OnClic_AnyMenu
END CREATE
END CREATE
END CREATE
frmSetFileAssociation.Show
DIM myFA AS QFileAssociation
frmSetFileAssociation.Visible = False
frmSetFileAssociation.SHOWMODAL
SUB OnClose_frmSetFileAssociation
Application.Terminate
END
END SUB
SUB GPrint (sText AS STRING)
rchWin.Addstring (sText)
END SUB
SUB OnClic_AnyMenu (Sender)
DEFINT iResult
SELECT CASE Sender.Handle
CASE mnuSimpleSet.Handle
iResult = myFA.SetFileAssociation (".Bas", "C:\\Windows\\Notepad.Exe %1")
Gprint (myFA.GetFileAssociationErrorAsString (iResult))
GPrint ("\n *** SIMPLE SET FINISHED ***\n")
CASE mnuSetWithRestore.Handle
myFA.NewDefaultDescriptorValue = "BAS_JFE"
myFA.BU_Prefix = "YOUR_MARK"
iResult = myFA.SetFileAssociationAndSaveOld (".bas", "C:\\Rapid-Q\\JFE\\JFE.EXE %1")
Gprint (myFA.GetFileAssociationErrorAsString (iResult))
GPrint ("\n *** SET FINISHED ***\n")
CASE mnuRestore.Handle
myFA.BU_Prefix = "YOUR_MARK"
iResult = myFA.RestoreOldFA (".Bas")
Gprint (myFA.GetFileAssociationErrorAsString (iResult))
GPrint ("\n *** RESTORE FINISHED ***\n")
CASE mnuShowRelatedKeysAndValues.Handle
GPrint (myFA.ShowRelatedKeysAndValues (".Bas"))
GPrint ("\n *** SHOW FINISHED ***\n")
CASE mnuClear.Handle
rchWin.Clear
END SELECT
END SUB
|