Hi Hilmar,
Just back from a few days holiday.
Thanks for your correspondence last week. I,ve made some progress.
I could load up my text files from the submenus using notepad.exe but still had problems with Wordpad.exe.
Since then My product development manager has decided that we should also allow images and excel documents to be picked up and run from the submenus. For Example depending on the type of file i.e report.xls, when selected should load Microsoft Excel and show this document.
Before When I was using only Notepad.exe, everthing was running fine. I would select the text file in the submenu and it loaded Notepad and showed the selected file.
Now after changing the code in my addmenu.prg and when I load the system, all the files open up one by one in Excel or Paint or Notepad etc, and after everyone is loaded I get a message ' Unregonised command verb'
Line 20 'On selection Bar i of keydoc &cCommand', I click Cancel and next one is loaded.
Attached below the code From my program.
I will appreciate any advice
Zaheed
*!* FUNCTION SHELLEXEC
*!* LPARAMETER lcLink, lcAction, lcParms, nWin
*!* vfp_handle = 0
*!* lcAction = IIF(EMPTY(lcAction),"Open",lcAction)
*!* lcParms = IIF(EMPTY(lcParms),"",lcParms)
*!* nShowWin = IIF(EMPTY(nWin),1,nWin)
*!* DECLARE INTEGER ShellExecute IN SHELL32.DLL ;
*!* INTEGER nWinHandle, STRING cOperation, STRING cFilename, ;
*!* STRING cParameters, STRING cDirectory, INTEGER nShowWindow
*!*
*!* RETURN Shellexecute(vfp_handle,lcAction, lcLink, lcParms, SYS(2023),nShowWin)
USE AsbDoc AGAIN in 0 share
SELECT AsbDoc
GO top
SET near on
SET order to menu
SET procedure to utilities additive && Function Shellexec above put in Utilities.prg
DEFINE BAR 1 OF asbestosre PROMPT "\DEFINE BAR 2 OF asbestosre PROMPT "\DEFINE BAR 3 OF asbestosre PROMPT "\
ON BAR 2 OF asbestosre activate popup keydoc
ON BAR 3 OF asbestosre ACTIVATE POPUP oth
DEFINE POPUP keydoc && First one equal to 'D'
SEEK('D')
i=1
DO while(AsbDoc.ad_menu='D')
DEFINE BAR i of keydoc PROMPT (Allt(AsbDoc.ad_label))
cPath = Allt(AsbDoc.ad_file)
*cCommand = "run /N Notepad.exe "
cCommand = SHELLEXEC(cPath)
ON SELECTION BAR i of keydoc &cCommand
i=i+1
Skip
ENDDO
DEFINE POPUP oth
SEEK('O')
i=1
DO while(AsbDoc.ad_menu='O')
DEFINE BAR i of oth PROMPT (ALLT(AsbDoc.ad_label))
*comm=alltrim(AsbDoc.ad_command)
cPath = Allt(AsbDoc.ad_file)
cCommand = "run /N notepad.exe "
cRun = cCommand + cPath
ON SELECTION BAR i of oth &cRun
*!* ON SELECTION BAR i of oth &comm
i=i+1
Skip
ENDDO
SELECT AsbDoc
USE
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement