Author Topic: Cute toy to run files and apps on a network box.  (Read 662 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 9726
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Cute toy to run files and apps on a network box.
« on: December 29, 2021, 12:56:19 PM »
Elegant in its simplicity, if it fits in half a screen, it has to be OK.  :tongue:

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    include \masm32\include64\masm64rt.inc

    .data?
      hInstance dq ?

    .data
      ffilter db "All Files",0,"*.*",0,0            ; the file filter string
      pfilt dq ffilter                              ; pointer to filter string
      pName dq 0                                    ; pointer for retrieved filename
    .code

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

entry_point proc

    mov hInstance, rvcall(GetModuleHandle,0)

    invoke open_file_dialog,0,hInstance, \          ; file dialog
           "Select file to open",pfilt
    mov pName, rax                                  ; store the file data address
    cmp BYTE PTR [rax], 0                           ; test if its a zero (0)
    je @F                                           ; bypass action if zero
    invoke ShellExecute,0,"open",pName,0,0,SW_SHOW  ; try ShellExecute to run different file types
    .if rax { 33                                    ; if error
      exec pName                                    ; run CreateProcess()
    .endif
  @@:

    .exit

entry_point endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    end
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 9726
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Cute toy to run files and apps on a network box.
« Reply #1 on: December 31, 2021, 09:18:25 PM »
If you have your LAN set up correctly and share at least one partition, you can start this toy and enter the computer name in the form "\\MyBox", hit enter and you can navigate the shared partition or folder and run files in that folder.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy: