How can you open a file with the program associated with its file extension?

前端 未结 6 1549
半阙折子戏
半阙折子戏 2020-12-24 13:50

Is there a simple way to open a file by its associated program in windows? (like double clicking it in windows explorer but done automatically with my code)

For exam

6条回答
  •  孤独总比滥情好
    2020-12-24 14:23

    If lpFile specifies a document file, the flag is simply passed to the associated application

    So you need to substitute "c:\\windows\\notepad.exe" with the actual file you want to open and leave lpParameters null.

提交回复
热议问题