Groups | Blog | Home
all groups > dotnet compact framework > november 2004 >

dotnet compact framework : How to open an IE window in my applications?


rainlake
11/30/2004 9:26:59 PM
I want to open an IE window in my application in Compact Framework,how?

Thanks a lot!

Ginny Caughey [MVP]
11/30/2004 9:32:13 PM
One way is to use OpenNetCF Process.Start.
--
Ginny Caughey
..Net Compact Framework MVP



[quoted text, click to view]

rainlake
11/30/2004 9:47:53 PM
Ginny thank you very much.
do u have more solutions without using OpenNetCF?

"Ginny Caughey [MVP]" <ginny.caughey.online@wasteworks.com> дÈëÏûÏ¢ÐÂÎÅ:eg$M7301EHA.3000@TK2MSFTNGP15.phx.gbl...
[quoted text, click to view]

Tarh ik
12/1/2004 7:33:05 AM

Hi RainLake!!!

The following code works for me. I'm copying & pasting it with no
guaranties that it will work for you. In fact, you might also need to review
it. Why am I posting it then??? Because I also copied it for myself from
another posting about 3 months ago!!!! :)

Public oMyProcessInfo As ProcessInfo = Nothing
Public blnWasInternetExplorerLaunched As Boolean

'***** Windows Function Declarations... *****'
Declare Function CloseHandle Lib "CoreDll.dll" (ByVal Handle As IntPtr)
As Int32
Declare Function CreateProcess Lib "CoreDll.dll" (ByVal imageName As
String, _
ByVal cmdLine As
String, _
ByVal
lpProcessAttributes As IntPtr, _
ByVal
lpThreadAttributes As IntPtr, _
ByVal
boolInheritHandles As Int32, _
ByVal dwCreationFlags
As Int32, _
ByVal lpEnvironment As
IntPtr, _
ByVal lpszCurrentDir
As IntPtr, _
ByVal si As Byte(), _
ByVal pi As
ProcessInfo) As Integer
Declare Function GetLastError Lib "CoreDll.dll" () As Int32





'***** Routines... *****'
Public Function LaunchMSIE(ByVal strURL As String) As Boolean
Dim lngResult As Int32
Dim lngErrorCode As Int32
Dim si(128) As Byte
Dim WAIT_OBJECT_0 As Int32 = 0

Try
blnWasInternetExplorerLaunched = False
If (Not (oMyProcessInfo Is Nothing)) Then
CloseMSIE()
End If
oMyProcessInfo = New ProcessInfo

lngResult = CreateProcess("IExplore.exe", strURL, IntPtr.Zero,
IntPtr.Zero, 0, 0, IntPtr.Zero, IntPtr.Zero, si, oMyProcessInfo)
If (lngResult = 0) Then
lngResult = CreateProcess("IESample.exe", strURL,
IntPtr.Zero, IntPtr.Zero, 0, 0, IntPtr.Zero, IntPtr.Zero, si, oMyProcessInfo)
If (lngResult = 0) Then
lngErrorCode = GetLastError()
blnWasInternetExplorerLaunched = False
Else
blnWasInternetExplorerLaunched = True
End If
Else
blnWasInternetExplorerLaunched = True
End If

Catch ex As Exception

End Try

Return blnWasInternetExplorerLaunched
End Function




Public Sub CloseMSIE()
If ((Not (oMyProcessInfo Is Nothing)) And _
(blnWasInternetExplorerLaunched = True)) Then
Try
CloseHandle(oMyProcessInfo.hThread)
CloseHandle(oMyProcessInfo.hProcess)
Catch ex As Exception
End Try
oMyProcessInfo = Nothing
End If
End Sub


Hope it helps!!!

Tarh ik
PS: This posting has been posted "AS IS". As such, I'm not responsible for
this piece of code. Use it on your own.
Paul G. Tobey [eMVP]
12/1/2004 8:15:40 AM
And *please* check the archives before asking a new question. This one
comes up *very* frequently. Here's a starting point for your search:

http://groups.google.com/groups?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8&group=microsoft.public.dotnet.framework.compactframework

Paul T.

[quoted text, click to view]

Peter Foot [MVP]
12/1/2004 9:06:55 AM
You can download the source for the class (www.opennetcf.org/sourcebrowse)
or just p/invoke CreateProcess directly
http://www.opennetcf.org/forums/topic.asp?TOPIC_ID=63

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

[quoted text, click to view]

Paul G. Tobey [eMVP]
12/1/2004 9:44:22 AM
Huh? How does that response apply to *looking* for the answer to a question
before *asking* the question?!

If, as I suspect, you are talking about OpenNETCF, then *think* about what
you're saying before you say it. OpenNETCF has source available. You can
use just what you need, if you want to.

Paul T.

[quoted text, click to view]

rainlake
12/1/2004 11:39:13 AM
Thank u all about this .
but i want to reduce my application's size and memeory occuption
I just want to use the standerd cf
"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com> дÈëÏûÏ¢ÐÂÎÅ:OkiVUj71EHA.3816@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button