Groups | Blog | Home
all groups > dotnet myservices > april 2005 >

dotnet myservices : From Application project to Service project



husamal_ahmadi NO[at]SPAM yahoo.com
4/9/2005 9:30:37 PM
Hi EveryBody:
This is the code for how can I let the internet ecplorer navigate in
the same window

Code:

Decleration:
<DllImport("shell32", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function ShellExecute(ByVal hwnd As IntPtr, ByVal
lpOperation As String, ByVal lpFile As String, ByVal lpParameters As
String, ByVal lpDirectory As String, ByVal nShowCmd As Integer) As
Integer
'
End Function
Public Const SW_SHOWDEFAULT As Long = 10

Under the button_Clicked :

Dim sFullPathToFile as string
sFullPathToFile = "http://www.msn.com/"
ShellExecute(hWnd, "open", sFullPathToFile, 0&, 0&, SW_SHOWDEFAULT)

I found this problem which I hope that some body give me a hint or
direction for it:

the previous code work very well in windows application project but
when I use it in service project it did not work at all

So any help will be appreciated

regard's

Husam
Andy Fish
4/27/2005 12:00:00 AM
a service is designed to do background processing with no user interface,
and not fire up windows on the user's desktop. Don't forget there may be
nobody logged in when your service is running (or in the case of windows
server, several people logged in).

there is a checkbox in the service properties called "allow service to
interact with desktop" that will allow this, but there are still some
caveats I believe (I have never used it because it's not recommended).

if you need to have something that runs in the background but can fire up
windows for the user, you probably need to have a systray application.

[quoted text, click to view]

AddThis Social Bookmark Button