The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => The Orphanage => Topic started by: skywalker on January 10, 2007, 01:29:07 AM

Title: Error_Access_Denied
Post by: skywalker on January 10, 2007, 01:29:07 AM
I am getting Error_Access_Denied when I run this.
Since it was written for Win98, do I need to set some type of permission first ?

Thanks.


  call  TestAppRunning     ; If Netscape is running show message and exit
                             
    invoke GetCL,1,ADDR buffer

    fn ShellExecute,0,"open",ADDR buffer,NULL,NULL,SW_SHOWNORMAL

; ShellExecute
;Activates and displays a window. If the window is minimized or maximized,
;Windows restores it to its original size and position. An application
;should specify this flag when displaying the window for the first time.

invoke ExitProcess,0

main endp

align 4

TestAppRunning    proc    syscall
    LOCAL Process:PROCESSENTRY32, SnapShot:DWORD

comment    * -----------------------------------------------------------------------------
            Test if application is already running. App name wanted and its length are
            coded in the .data section.

            On exit:
                EAX = 0 if not running or unsuccessful, else nonzero
            EBX/EBP/EDI/ESI are preserved.
            ----------------------------------------------------------------------------- *

        push    ebx
        push    edi
        push    esi

        invoke  CreateToolhelp32Snapshot, TH32CS_SNAPPROCESS, 0