Announcement

Collapse
No announcement yet.

Browser ruft URL nicht auf !?!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Browser ruft URL nicht auf !?!

    Hallo,

    ich möchte mit dem Compact Framework auf Win XP (oder 2000, etc.) aus dem C#-Programm eine URL im Browser aufrufen. Eigentlich weiß ich auch wie das geht, nur leider wird nur der Browser aufgerufen - die mitgelieferte URL wird scheinbar ignoriert.

    Wer sieht den Fehler? Oder wer kennt eine andere Variante?

    Hier mein Beispiel:

    ---

    [DllImport("kernel32.dll")]


    static extern bool CreateProcess(string lpApplicationName,string lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes, ref SECURITY_ATTRIBUTES lpThreadAttributes, bool bInheritHandles,uint dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory,[In] ref STARTUPINFO lpStartupInfo,out PROCESS_INFORMATION lpProcessInformation);

    // Internet Explorer starten (Übergabe URL)

    public void StartIE(string webaddress)
    {
    const uint NORMAL_PRIORITY_CLASS = 0x0020;
    bool retValue;
    string Application = "C://Programme/Internet Explorer/IEXPLORE.exe";
    string CommandLine = webaddress;



    PROCESS_INFORMATION pInfo = new PROCESS_INFORMATION();
    STARTUPINFO sInfo = new STARTUPINFO();
    SECURITY_ATTRIBUTES pSec = new SECURITY_ATTRIBUTES();
    SECURITY_ATTRIBUTES tSec = new SECURITY_ATTRIBUTES();

    retValue = CreateProcess(Application,CommandLine,ref pSec,ref tSec,false,NORMAL_PRIORITY_CLASS,IntPtr.Zero,null, ref sInfo,out pInfo);
    }

    ---

    Natürlich habe ich auch die "Structe" eingebaut:

    ---

    public struct SECURITY_ATTRIBUTES
    {
    public int nLength;
    public IntPtr lpSecurityDescriptor;
    public bool bInheritHandle;
    }

    public struct STARTUPINFO
    {
    public uint cb;
    public IntPtr lpReserved;
    public IntPtr lpDesktop;
    public IntPtr lpTitle;
    public uint dwX;
    public uint dwY;
    public uint dwXSize;
    public uint dwYSize;
    public uint dwXCountChars;
    public uint dwYCountChars;
    public uint dwFillAttribute;
    public uint dwFlags;
    public ushort wShowWindow;
    public ushort cbReserved2;
    public IntPtr lpReserved2;
    public IntPtr hStdInput;
    public IntPtr hStdOutput;
    public IntPtr hStdError;
    }

    public struct PROCESS_INFORMATION
    {
    public IntPtr hProcess;
    public IntPtr hThread;
    public uint dwProcessId;
    public uint dwThreadId;
    }

    ---

    Hoffe auf Hilfe,
    Danke im voraus!!!
    Gruß,
    ANDI

    P.S. Für WinCE (mit Einbindung der coredll.dll) funktioniert übrigens alles bestens!

  • #2
    Ciao

    Versuch es mal wie folgt:
    System.Diagnostics.Process.Start( "http://www.entwickler-forum.de" );

    Ausserdem ist das Compact Framework ausschliesslich für Windows CE Anwendungen gedacht.

    Grus

    Comment

    Working...
    X