News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

programer in MASM32

Started by 03.jose, July 25, 2012, 02:22:39 AM

Previous topic - Next topic

03.jose

hello!!!!
I wanted to ask if they can help on a task in MASM32, I am a student and my teacher left me a task I have to use the program. the task is I'm doing for windows 32-bit and consists of:
1 - read the contents of a folder and display, this folder contains files or txt asm. txt files are in a folder called "problems" and asm files in a folder called "solutions"
2 - I have listed the files that you can select one to open up and you can select to copy its contents (similar to what is done to open a pdf), the problem I have in this part is that if the file is very large I put a scroll bar to see the rest of the content, do not know how to select and copy text to clipboard
3 - there is a folder called "executable" which contains exe files, which is not how do you run?

jj2007

No problem, just zip your code, attach it, and we'll have a look.

03.jose

ok this is the code as it took until now, the file is read to the static but I did not know how to make them dynamic

jj2007

mov tvis.item.pszText, chr$("You need a file name here, get it with FindFirstFile/FindNextFile")
invoke SendMessage, hTVOptions, TVM_INSERTITEM, 0, addr tvis


In short: you need a WIN32_FIND_DATA structure to receive filenames, once an invoke FindFirstFile..., then a loop ending with FindNextFile that exits if no further matching files are found.

LOCAL wfs:WIN32_FIND_DATA, hFF
; ...
invoke FindFirstFile, chr$("problemas\*.*"), addr wfs
mov hFF, eax
.While eax
lea eax, wfs.cFileName ; get filename for treeview
.if byte ptr [eax]!="." ; no folders, please
mov tvis.item.pszText, eax
invoke SendMessage, hTVOptions, TVM_INSERTITEM, 0, addr tvis
.endif
invoke FindNextFile, hFF, addr wfs
.Endw
invoke FindClose, hFF


Good work - I love "PutFruitOnDaTree proc"  :badgrin:

03.jose

hey thanks its working!!!  :t
and you can helpme  with the other 2 questions??

i want to thank you so much

now i wish you answerme the problems 2 and 3 because i don't know how to do it,  i need the solucions please

jj2007

Quote from: 03.jose on July 26, 2012, 09:06:27 AM
and you can helpme  with the other 2 questions??

No time right now, sorry, but check ShellExecute and WinExec...

Gunner

Nice to see your using code from my Tutorial here: http://www.dreamincode.net/forums/topic/254479-masm-creating-a-treeview-with-option-buttons/  That proc name "PutFruitOnDaTree" sure sounded familiar!
~Rob

03.jose

yes Gunner that's where I draw to make, but the icons no showme.

can you helpme with other questions? the number 2 and 3

mywan

On #2 you might check out "Clipboard Functions" in "\masm32\help\masmlib.chm"
hh.exe C:\masm32\help\masmlib.chm::/Clipboard%20Functions.htm

On #3 I would look at the shell functions under "Misc" in "\masm32\help\masmlib.chm"
hh.exe \masm32\help\masmlib.chm::/Misc.htm

03.jose

thanks!!! i can call the exe, but not as a call to the selected file, so I called him to test static