Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CeateProcess

CeateProcess

Scheduled Pinned Locked Moved C / C++ / MFC
testingtoolstutorial
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Imtiaz Murtaza
    wrote on last edited by
    #1

    Friends, I want to programatically launch MS-Word document say like c:\\MyFolder\\MyFile.doc. I am trying CreateProcess() but it is not working for me. I think i am doing something wrong while giving first and second parameters of this function. On client machine the word document can be present at any location of the drive and MS Word can be installed in any location. Plese tell me how to launch MS Word document when we know its fully qualified name. I dont want to use Automation Imtiaz

    S 1 Reply Last reply
    0
    • I Imtiaz Murtaza

      Friends, I want to programatically launch MS-Word document say like c:\\MyFolder\\MyFile.doc. I am trying CreateProcess() but it is not working for me. I think i am doing something wrong while giving first and second parameters of this function. On client machine the word document can be present at any location of the drive and MS Word can be installed in any location. Plese tell me how to launch MS Word document when we know its fully qualified name. I dont want to use Automation Imtiaz

      S Offline
      S Offline
      skornel
      wrote on last edited by
      #2

      I use this: { SHELLEXECUTEINFO ShExecInfo; ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); ShExecInfo.fMask = NULL; ShExecInfo.hwnd = NULL; ShExecInfo.lpVerb = 0; ShExecInfo.lpFile = DocName; ShExecInfo.lpParameters = NULL; ShExecInfo.lpDirectory = NULL; ShExecInfo.nShow = SW_MAXIMIZE; ShExecInfo.hInstApp = NULL; ShellExecuteEx(&ShExecInfo); } Just put your document's name in DocName and the system will find the program that handles the document. I have used it with a .rtf document and it loads MSWord on systems that have MSWord or it loads WordPad on the systems that don't have MSWord.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups