Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I Need A Hand With C++ And File Menu's 1

Status
Not open for further replies.

RwWarwick

Programmer
Sep 20, 2004
4
CA
I have screenshot i took of what I mean. I want to make a training manual program for my company. I want to do this in C++ because flash and java... I don't like honestly. Plus I want to learn C++ and I figured this was a good program to start with.

How Do I make
\/ \/ \/ appear?
CreatingFileLinks.bmp


I'm not looking for source (but i'll take it) i'm looking for terms to search for and other things like that, i want to be able to create drop down menu's.

Help?
 
create an MFC dialog application, add a menu to the dialog.

download MSDN examples if neet be?

 
okay, thanks, how do I make it so that when I click a menu item, It opens a .html document within the same window, without giving you the title bar?

And a last question, how do I launch a .bat file from a menu item?

Thanks a lot ahead of time!
 
do you know how to handle menu events?

If not, you need to add event handlers to your menu items, this will create code that occurs when you activate a menu item?

1. How do you want to display your html page? Do you have an activeX control build into your application that can handle html (i'm thinking of a DHTML control here - that would work), or do you simply want to load an html into IE (or similar)??

If you have a DHTML activeX object you can use the load functionality to load the html into your object. You need to put the DHTML object within your dialog application, you can hide it when not in use, and by making it the same size as your dialog you can load up the html and view it in full(it has no title bar).

Otherwise you can use WinExec or CreateProcess to execute the html document which will load up an IE (or you equivalent default html browser) - you'll need to modify the html to get rid of the titlebar.

2. the bat file can be launched in the same way as the html using WinExec or CreateProcess (your computer will need to know what to load the bat file into if you execute the bat file directly, otherwise you can load an application and feed the bat file into it (Example below which loads a file into notepad).

Code:
  PROCESS_INFORMATION pi;   [green]// Create an external process [/green]
  ZeroMemory( &pi, sizeof(pi) );
  STARTUPINFO si;
  ZeroMemory( &si, sizeof(si) );


  if ( CreateProcess ( NULL, "\"Notepad.exe\" C:\\Directory\\file.dat", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ) )



Hope this helps?
 
do I add your code to my "blah.cpp" folder or what?
 
I want to be able to click "Launch FoxPro!" and have it launch my foxpro.bat file which opens cmd.exe and goes to the foxpro program, but I don't wnat this to load in my program. I want it to load separetly.
 
My code is an example of how to launch Notepad with a file already loaded in Notepad - so if you want to do that then add it! However I dont think you do?

You need to add an event handler to "Lauch FoxPro" where you can add in code to launch your "foxpro.bat" file, which may be possible with CreateProcess?

explains CreateProcess (which in simple terms launches an external application)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top