ShellExecute
-
Hi, I am using Sumatra in my Visual Basic 6.0 like this Dim cmdline as string Dim ret as integer Dim hwnd As Long Dim gstrPathAndFilename as string gstrPathAndFilename="C:\test.pdf" hwnd = Picture1.hwnd cmdline = "C:\Program Files\SumatraPDF\SumatraPDF.exe -plugin " & hwnd & " " & gstrPathAndFilename ret = Shell(cmdline) The above code works perfectly in VB6. Now I am trying to convert the above code to Visual C/C++ 6.0 like this static HWND hwndPicture ; hwndPicture = GetDlgItem (hwnd, IDC_PIC) ; ShellExecute( hwndPicture, TEXT("open"), TEXT("C:\\Program Files\\SumatraPDF\\SumatraPDF.exe"), "d:\\Test\\test.pdf", TEXT(" d:\\ "), SW_SHOWNORMAL); It works but not inside the form and picture box, it opens a new window. Can someone help me, I new in Visual C++ Thanks, Russell
-
Hi, I am using Sumatra in my Visual Basic 6.0 like this Dim cmdline as string Dim ret as integer Dim hwnd As Long Dim gstrPathAndFilename as string gstrPathAndFilename="C:\test.pdf" hwnd = Picture1.hwnd cmdline = "C:\Program Files\SumatraPDF\SumatraPDF.exe -plugin " & hwnd & " " & gstrPathAndFilename ret = Shell(cmdline) The above code works perfectly in VB6. Now I am trying to convert the above code to Visual C/C++ 6.0 like this static HWND hwndPicture ; hwndPicture = GetDlgItem (hwnd, IDC_PIC) ; ShellExecute( hwndPicture, TEXT("open"), TEXT("C:\\Program Files\\SumatraPDF\\SumatraPDF.exe"), "d:\\Test\\test.pdf", TEXT(" d:\\ "), SW_SHOWNORMAL); It works but not inside the form and picture box, it opens a new window. Can someone help me, I new in Visual C++ Thanks, Russell
Well, for one thing, you're failing to pass the "-plugin" parameter on the command line in the C++ version.
The difficult we do right away... ...the impossible takes slightly longer.