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. launching notepad.exe and reading the current date/time

launching notepad.exe and reading the current date/time

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
4 Posts 4 Posters 0 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.
  • M Offline
    M Offline
    Mahhouraaaaaa
    wrote on last edited by
    #1

    Hi want to know how to open a txt file in NotePad.exe using a button in my C++ app and i want to know how can i read the current time/date and put them in a CString Thans

    M H L 3 Replies Last reply
    0
    • M Mahhouraaaaaa

      Hi want to know how to open a txt file in NotePad.exe using a button in my C++ app and i want to know how can i read the current time/date and put them in a CString Thans

      M Offline
      M Offline
      Mark F
      wrote on last edited by
      #2

      Take a look at ShellExecute() for launching programs.

      ShellExecute(NULL, "open", "mytest.txt", NULL, NULL, SW_SHOWDEFAULT);
      

      Look at CTime class for data and time functions. An example of how you could use it:

      CTime curtime = CTime::GetCurrentTime();
      CString s = curtime.Format("%m/%d/%y %H:%M:%S p");
      

      Mark -- modified at 17:40 Tuesday 13th June, 2006

      1 Reply Last reply
      0
      • M Mahhouraaaaaa

        Hi want to know how to open a txt file in NotePad.exe using a button in my C++ app and i want to know how can i read the current time/date and put them in a CString Thans

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        See ShellExecute [^]_**


        **_

        whitesky


        1 Reply Last reply
        0
        • M Mahhouraaaaaa

          Hi want to know how to open a txt file in NotePad.exe using a button in my C++ app and i want to know how can i read the current time/date and put them in a CString Thans

          L Offline
          L Offline
          Laxman Auti
          wrote on last edited by
          #4

          Mahhouraaaaaa wrote:

          Hi want to know how to open a txt file in NotePad.exe using a button in my C++ app and i want to know how can i read the current time/date and put them in a CString

          See CreateProcess(...) API Knock out 't' from can't, You can if you think you can :cool:

          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