Announcement

Collapse
No announcement yet.

Edit killed script

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Edit killed script

    OK..I give up...

    I took a perfectly running script and TRIED to change the target program and it keeps saying that it doesn't like the "\" in the adddress...well how do I put in the program address with no "\"s

    this is a modified IEPopup script.
    It first looks to see if there is an instance already running, otherwise it opens it...

    I marked in RED what I think it is objecting to...


    #USING System.Diagnostics
    #USING System.Runtime.InteropServices

    [DllImport("user32.dll", SetLastError = true)]
    static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

    [DllImport("user32.dll")]
    [return: MarshalAs(UnmanagedType.Bool)]
    static extern bool SetForegroundWindow(IntPtr hWnd);

    void Main( object param )
    {
    IntPtr hWnd = FindWindow(null,"Redwall1 (SXVGA) TOSHIBA Network Camera - IK-WB15A. - Windows Internet Explorer");
    if( hWnd == IntPtr.Zero )
    {
    ProcessStartInfo processStartInfo = new ProcessStartInfo();
    processStartInfo.FileName = "VideoLAN\VLC\vlc.exe";
    processStartInfo.Arguments = param.ToString();
    processStartInfo.WindowStyle = ProcessWindowStyle.Maximized;
    Process.Start( processStartInfo );
    }
    else
    {
    SetForegroundWindow( hWnd );
    }
    }

    #2
    \ is a special char in all c based languages

    If you want to put a \ in a string, you have to double it \\

    "Videolan\\vlc\\vlc.exe"
    --
    stipus

    Comment

    Working...
    X