Author Topic: programer in MASM32  (Read 3162 times)

03.jose

  • Guest
programer in MASM32
« on: July 25, 2012, 02:22:39 AM »
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

  • Member
  • *****
  • Posts: 7728
  • Assembler is fun ;-)
    • MasmBasic
Re: programer in MASM32
« Reply #1 on: July 25, 2012, 02:45:38 AM »
No problem, just zip your code, attach it, and we'll have a look.

03.jose

  • Guest
Re: programer in MASM32
« Reply #2 on: July 25, 2012, 01:41:06 PM »
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

  • Member
  • *****
  • Posts: 7728
  • Assembler is fun ;-)
    • MasmBasic
Re: programer in MASM32
« Reply #3 on: July 25, 2012, 06:19:14 PM »
Code: [Select]
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.

Code: [Select]
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

  • Guest
Re: programer in MASM32
« Reply #4 on: July 26, 2012, 09:06:27 AM »
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

  • Member
  • *****
  • Posts: 7728
  • Assembler is fun ;-)
    • MasmBasic
Re: programer in MASM32
« Reply #5 on: July 26, 2012, 09:18:44 AM »
and you can helpme  with the other 2 questions??

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

Gunner

  • Regular Member
  • *
  • Posts: 48
    • Gunners Software
Re: programer in MASM32
« Reply #6 on: July 26, 2012, 09:33:24 AM »
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

  • Guest
Re: programer in MASM32
« Reply #7 on: July 26, 2012, 10:00:20 AM »
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

  • Guest
Re: programer in MASM32
« Reply #8 on: July 26, 2012, 02:44:31 PM »
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

  • Guest
Re: programer in MASM32
« Reply #9 on: July 27, 2012, 07:26:03 AM »
thanks!!! i can call the exe, but not as a call to the selected file, so I called him to test static