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. Managed C++/CLI
  4. Accessing a menu from a Console App ??

Accessing a menu from a Console App ??

Scheduled Pinned Locked Moved Managed C++/CLI
c++helpquestion
2 Posts 2 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.
  • F Offline
    F Offline
    Fritzables
    wrote on last edited by
    #1

    G'Day to all, I am in the process of creating a console application using Visual C++ 2005. This application will start NOTEPAD.EXE then will need to simulate keyboard strokes to access the menu options. I have been able to create the process and run NOTEPAD from my console app but unsure how I now access the menu options. I have started the process by: Process^ p = gcnew Process(); p->StartInfo->FileName = "NOTEPAD.EXE"; p->StartInfo->UseShellExecute = true; p->Start(); I would now assume I would have to use the following namespace: using namespace System::Windows::Forms; But come compile time the above namespace is rejected: error C3083: 'Windows': the symbol to the left of a '::' must be a type Am I on the right track here or is there a better way to achieve what I am trying to do to access an applications menus ?

    L 1 Reply Last reply
    0
    • F Fritzables

      G'Day to all, I am in the process of creating a console application using Visual C++ 2005. This application will start NOTEPAD.EXE then will need to simulate keyboard strokes to access the menu options. I have been able to create the process and run NOTEPAD from my console app but unsure how I now access the menu options. I have started the process by: Process^ p = gcnew Process(); p->StartInfo->FileName = "NOTEPAD.EXE"; p->StartInfo->UseShellExecute = true; p->Start(); I would now assume I would have to use the following namespace: using namespace System::Windows::Forms; But come compile time the above namespace is rejected: error C3083: 'Windows': the symbol to the left of a '::' must be a type Am I on the right track here or is there a better way to achieve what I am trying to do to access an applications menus ?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      G'day mate you need to add a reference to System.Windows.Forms to your project Right click the project in VS and select References.... Like I said to you the other day, you can get a HWND from the process object and use Win32 or MFC to send WM_* messages to the notepad window

      System.IO.Path.IsPathRooted() does not behave as I would expect

      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