Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3021

ShellExecute with x86asm

$
0
0
Hi.I tried to use ShellExecute with inline x86asm in VC++.
My code is here:
Code:

#include "stdafx.h"
#include <windows.h>
int Run(char * filename) {

__asm{
PUSH 5                                ; SW_SHOW = 5
PUSH 0                                ; DefDir = NULL
PUSH 0                                ; Parameters = NULL
PUSH filename          ; FileName = "http://www.google.com"
PUSH 0                                ; Operation = NULL
PUSH 0                                ; hWnd = NULL
CALL ShellExecute
PUSH 0                                ; ExitCode = 0
CALL ExitProcess

}



int main()
{
        Run("C:\\Ben.jpg");
        return 0;
}

But it taken this error:
http://tinypic.com/r/qs39g4/8

Thank you for your helps...

Viewing all articles
Browse latest Browse all 3021

Trending Articles