in Search
     
Latest post 03-19-2007 2:16 AM by dee-u. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-15-2007 5:32 AM

    • dee-u
    • Top 25 Contributor
    • Joined on 12-06-2005
    • Pasay and Candon City, I.S.
    • Posts 82
    • Points 1,415

    Make a little app for me pls.?

    Here is a simple VB6.0 code:

    retval = ShellExecute(Form1.hWnd, "print", "C:\Project\picture.bmp", "", "C:\Project\", _
      SW_MINIMIZE)

    If you guys have time could you make up a simple asm for that would accept as command line argument the name of th file to be printed then execute it from there? I have actually made a C# one for this but I think (not sure) one that is made of assembly won't need any installation or the .Net framework in order to run.

    Thanks guys for any help. Suggestion are welcome but I'll let you know I know NOTHING of assembly so pls. be gentle to me... :-)

    • Post Points: 20
  • 03-16-2007 2:25 AM In reply to

    • cvega
    • Top 10 Contributor
    • Joined on 11-25-2005
    • Posts 497
    • Points 8,455

    Re: Make a little app for me pls.?

    Answer
    Try this:

    .386
    .model flat, stdcall

    option casemap:none
    option proc:private

    include windows.inc

    include kernel32.inc
    includelib kernel32.lib

    include shell32.inc
    includelib shell32.lib

    include msvcrt.inc
    includelib msvcrt.lib

    include masm32.inc
    includelib masm32.lib

    include /masm32/macros/macros.asm

    .data
        oper        db "print", 0
        filename    db 256 dup(0)
    .code
    console:
        
        invoke     GetCL, 1, addr filename
        cmp        byte ptr [filename], 0
        jz        @f
        invoke    ShellExecute, 0, addr oper, addr filename, NULL, NULL, SW_SHOW
        @@:
        exit

        end console


    You need MASM32 to compile it: http://www.masm32.com

    Regards,

    -chris
    Chris Vega This posting is provided "AS IS" with no warranties, and confers no rights My Weblog|Visit MSDN Community
    • Post Points: 20
  • 03-19-2007 2:16 AM In reply to

    • dee-u
    • Top 25 Contributor
    • Joined on 12-06-2005
    • Pasay and Candon City, I.S.
    • Posts 82
    • Points 1,415

    Re: Make a little app for me pls.?

    Cool, thanks master or taking time... :-)
    • Post Points: 5
Page 1 of 1 (3 items)