Hell again ASM community,
I have searched the forums for a very long time, and seen many examples on how to use the ShellExecute command, but I don't know why my code doesn't work!
Here is the important code:
No matter what I cannot get cmd to execute! I tried it as the lpOperation as well with no luck. All the examples I have found are using the same syntax! Why isn't mine working? Can anyone tell me.
Thanks in advance.
-felon
I have searched the forums for a very long time, and seen many examples on how to use the ShellExecute command, but I don't know why my code doesn't work!
Here is the important code:
.data
cmd db "cmd.exe /k",0
DlgProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam: LPARAM
.if uMsg== WM_INITDIALOG
invoke LoadIcon,hInstance,barcode
invoke GetDlgItem,hWnd,1002
invoke SetFocus,eax
.elseif uMsg==WM_COMMAND
mov eax,wParam
.if eax == 1003
invoke GetDlgItemText,hWnd,1002,addr directory,256
invoke ShellExecute,NULL,NULL,addr cmd,NULL,addr directory,SW_SHOWNORMAL
invoke SetDlgItemText,hWnd,1004,addr newdir
.endif
.elseif uMsg==WM_CLOSE
invoke EndDialog,hWnd,0
.endif
xor eax, eax
Ret
DlgProc EndP
No matter what I cannot get cmd to execute! I tried it as the lpOperation as well with no luck. All the examples I have found are using the same syntax! Why isn't mine working? Can anyone tell me.
Thanks in advance.
-felon
You haven't specified a verb, try this:
szOpen DB "open",0
cmd DB "cmd.exe",0
invoke ShellExecute,NULL,OFFSET szOpen, OFFSET cmd,NULL,OFFSET directory,SW_SHOW