The MASM Forum

General => The Campus => Topic started by: 03.jose on June 03, 2012, 02:30:00 PM

Title: open file
Post by: 03.jose on June 03, 2012, 02:30:00 PM
hello
I need to do a program in masm32 I open files with extention txt and let me copy their contents if the file is too long I put a scroll bar, so as does the acrobat with pdf (for example)

another question, using the theme, any know how to run an exe file from masm32?, I do not want to open it in binary
Title: Re: open file
Post by: dedndave on June 03, 2012, 04:05:09 PM
that's a lot to swallow for a new asm programmer   :P
opening the file and reading it is pretty easy
starting another program is pretty easy, too
displaying the text in a scroll window takes a little work

i suggest you start by installing the masm32 package
read the install page, first, though...
http://masm32.com/installation.htm (http://masm32.com/installation.htm)
http://masm32.com/masmdl.htm (http://masm32.com/masmdl.htm)

once you have it installed, there are many examples in the \masm32\examples folder
Title: Re: open file
Post by: Vortex on June 03, 2012, 06:34:56 PM
Quote from: 03.jose on June 03, 2012, 02:30:00 PM
another question, using the theme, any know how to run an exe file from masm32?, I do not want to open it in binary

Hi Jose,

Welcome to the forum.

Could you be a little more specific?
Title: Re: open file
Post by: hutch-- on June 03, 2012, 07:38:21 PM
Jose,

I get the idea that you do not have a background in low level programming and sad to say writing Windows applications in MASM is not entry level stuff but reasonably advance programming by people who already have experience in writing Windows software. To give you some chance of succeeding it would be better for you to learn a simpler language format with a compiler than to try and learn MASM as your first language.

If you need it later you can always return to it but at the moment you would not succeed as you don't know enough about writing ow level Windows code.
Title: Re: open file
Post by: dedndave on June 03, 2012, 11:00:46 PM
well - he may have prior experience - hard to say from his post
Iczelion's tutorials will get him through a scrolling text window
probably cover everything else he wants to do, too
but - there are something like 30 tutorials

if he understands bits and bytes, memory and registers, he can get there with some effort
Title: Re: open file
Post by: 03.jose on June 04, 2012, 10:35:37 AM
thanks for your answers, yes i can read/open the file txt but not can select the text in that file to the copy.

@hutch-- is true i don't have a background in low level programming, but I am a student and my teacher asked me in MASM32

@dedndave yes i have seen Iczelion's tutorials in which I have relied for my homework and i will review the examples of the program
Title: Re: open file
Post by: dedndave on June 04, 2012, 11:29:26 AM
as for opening another program...
CreateProcess
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx)

or, in some cases, ShellExecute
http://msdn.microsoft.com/en-us/library/windows/desktop/bb762153%28v=vs.85%29.aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/bb762153%28v=vs.85%29.aspx)