The MASM Forum

General => The Campus => Topic started by: Force on January 19, 2015, 08:52:49 AM

Title: File association
Post by: Force on January 19, 2015, 08:52:49 AM
Hello how can i open asm and inc files with qeditor.exe ?
i found an example code in old forum  http://www.masmforum.com/board/index.php?topic=6561.0  (http://www.masmforum.com/board/index.php?topic=6561.0)
but it does not worrk on win 7 32 bit ... Is there another example about it ?

Thanks

Force
Title: Re: File association
Post by: sinsi on January 19, 2015, 09:01:03 AM
Right-click file, open with, choose default program, browse for qeditor.
Title: Re: File association
Post by: Gunther on January 23, 2015, 09:33:59 PM
What a mess: A new spam bot.

Go away, leave your garbage elsewhere.

Gunther
Title: Re: File association
Post by: Force on January 28, 2015, 03:22:56 AM
Huh !...

bot ?   :icon_eek:


i didn't ask about virus codes or hacking tools.It was just a normal question
i asked same question in c forum .They replied with code kindly
i don't know what's wrong here ?
i think leaving this forum is better ....
Title: Re: File association
Post by: fearless on January 28, 2015, 03:50:43 AM
There was a spam post by a bot, but its deleted now. He wasnt referring to your original post.
Title: Re: File association
Post by: Gunther on January 28, 2015, 05:07:57 AM
Hi Force,

my reply had nothing to do with your original post. There was a spam producer in your thread, but Hutch did clean the mess. Go forward and best greatings.

Gunther
Title: Re: File association
Post by: Force on January 28, 2015, 06:25:53 AM
Sorry friends    i did not see it  so i missunderstood
Title: Re: File association
Post by: jj2007 on January 28, 2015, 09:20:16 AM
Hi Force,

You wanted code - here is what I hacked together tonight, see attachment (pure Masm32):

include \masm32\include\masm32rt.inc
include Associate.asm
uselib advapi32
.code
start:
  Associate "asmsrc", "C:\Masm32\qEditor.exe"      ; you must supply a valid drive letter
  mov ebx, fcreate("test.AsmSrc")
  .if ebx!=INVALID_HANDLE_VALUE
      fprintc ebx, "Just a test\nMasm32 is great"
      fclose ebx
      .if rv(ShellExecute, 0, 0, "test.AsmSrc", 0, 0, SW_RESTORE)<=32
            MsgBox 0, LastError$(), "No luck:", MB_OK
      .endif
  .endif
  exit
end start

Tested on Win7-64 and Win XP. You might need admin rights, but test yourself.
EDIT: Please download again - the stack was not balanced. Associate.zip is the correct version.
Title: Re: File association
Post by: Force on January 28, 2015, 09:55:28 AM
Thank you jj2007

i think i need  to include  manifest xml file for admin right

i found this but i didnt test yet

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
        <security>
            <requestedPrivileges>
                <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
            </requestedPrivileges>
        </security>
    </trustInfo>
</assembly>