heres how i declare the ShellExecute() API function:
heres how i use it:
my problem is:
- or the declaration isn't correct;
- or my strings aren't incorrect:(
can anyone advice me?
Code:
Private Declare Function ShellExecute Lib "shell32" _
Alias "ShellExecuteA" (ByRef hwnd As Integer, ByVal Operation As String,
ByVal Filename As String, ByVal Parameters As String,
ByVal Directory As String, ByVal ShowCommand As Integer) _
As Integer
Code:
Private Sub btnConvertCode_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConvertCode.Click
Dim strCompilerName As String
Dim strCPPFonteName As String
Dim strEXEFileName As String
Dim App_Path As String
Dim strMainIcon As String
Dim strRC As String
Dim strResCompilerName As String
App_Path = Application.StartupPath
ConvertCode(rtbConvertedCode, rtbCode)
rtbConvertedCode.SaveFile(App_Path & "\test.cpp", RichTextBoxStreamType.PlainText)
strCompilerName = """" & App_Path & "\MinGW32\bin\g++.exe" & """"
strEXEFileName = """" & App_Path & "\test" & """"
strCPPFonteName = """" & App_Path & "\test.cpp"
strMainIcon = """" & App_Path & "\MainIcon.res" & """"
strRC = """" & App_Path & "\MainIcon.rc" & """"
strResCompilerName = """" & App_Path & "\MinGW32\bin\windres.exe" & """"
ShellExecute(Me.Handle, "open", strCompilerName, "-o " & strEXEFileName & " " & strCPPFonteName, App_Path & "\MinGW32\bin", 10)
End Sub
- or the declaration isn't correct;
- or my strings aren't incorrect:(
can anyone advice me?