473,597 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.NET: Starting a Service and Refreshing the Desktop

Fatali
2 New Member
I found a bit of code here in the forums, that modified looked like it would do what I needed: start a Windows Service. The code said I would need to add :

Imports System.ServiceP rocess

So I go to add that above my Imports Windows.Win32 and I the 'ServiceProcess ' part is underlined and VB.NET tells me that it is invalid. So, without it I'm back at square one.

What I need is a way to start a Windows Service using code in VB.NET I've looked through the list of Imports available but none look like the right thing.. unless I'm missing something.

I also need a way of refreshing the Windows Desktop at the end of my code. Calling the 'F5' button key won't work since the VB program will have focus and not the desktop.
Nov 24 '06 #1
1 1283
Fatali
2 New Member
You can scratch the whole first part of my post. I only need to know how to refresh the desktop.
Nov 24 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
4928
by: Steve Long | last post by:
Hello, I hope this question isn't too fundamental. I have a feeling it is. I'm trying to start a winform app from a windows service written in C#. I created a class and used it from a windowsforms application and all was well. But when I try to use the class in the OnStart method of a windows service, the process I'm trying to start runs but the window never shows up. Like I said, this may be fundamentally impossible/illogical to do but...
29
3394
by: Ken Allen | last post by:
I have a number of services developed in C# (.Net), and they have been working fine for the most part. Recently someone reported that ipon occassion (originally rarely, but more frequently on some systems of late), there is an entry in the Event Log immediately after a boot indicating that the service failed to start after 30,000 milliseconds. Usually it starts fine when attempting manually after the boot. I instrumented the code to...
8
3139
by: Midnight Java Junkie | last post by:
Dear Colleagues: I feel that the dumbest questions are those that are never asked. I have been given the opportunity to get into .NET. Our organization has a subscription with Microsoft that basically entitled to us to just about every .Net development tool you can imagine. I cant even begin to mention them. To begin with, my background is not that of a programmer, but a systems engineer and the closest I have come to "programming"...
2
2247
by: Kevin R | last post by:
I'm trying to get asp.net 1.1 running on my home PC. When I try creating a new ASP.NET Web Application in 'Visual Studio .NET 2003' I get the following error: "Visual Studio .NET has detected that the specified Web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services" Thanks for any help in advance. Kevin ===============================
1
2086
by: kemp100 | last post by:
guys..i am having a hard time with this one.. i have created a service which works fine..except when i want to execute another program (notepad.exe)...i know how to execute itusing PROCESS.start() but the problem is ..i dont see it on the desktop..it is not interacting with the desktop...i know how to change it in the admin options but i need to know how to do it in the CODE...to have it run the service and run notepad.exe on the...
5
2864
by: Andrew | last post by:
Hey all, Requesting help from the VB.Net gurus in here. I was given a task to write a Windows Service (VB.Net) that would run an external program, and if that program closed for any reason (other than the service being stopped) it would restart it. I have written the service to do just this, and for testing purposes I am running the program Notepad. And I even have it making entries in the System Event Log. However, and this is my...
0
3012
by: Hernan Garber | last post by:
Hi, Attached, the installation log. Win 2k Server SP3 IE6SP1/SQL Server Installed Thanks Setup.exe: Setup.exe: ========== Logging started ==========
13
1935
by: NG | last post by:
Hi All I made a windows service in C#. Now I have a situation where I need to invoke an exe with some UI. Assuming that the computer running this service will always be logged in, can anyone please provide me a sample code to invoke an exe from windows service in .net. I tried a few methods that I found on the net but they seem to invoke something in the background which actually does not work. Any help is much appreciated. Thanks in...
6
4170
by: Arnie | last post by:
We're using the ServiceController class provided by the .NET Framework, programming in C#. We are using the Start() method to start a service from another service. This works fine most of the time, but occasionally after a system startup (where the service doing the starting of the other is automatically started by Windows XP) the ServiceController's Start() method fails to start the other service. It is probably throwing an...
5
1568
by: Lamis | last post by:
Hi, i have just created my first Windows service and it is working great.. my problem is that I need to start an application in my service: protected override void OnStart(string args) { eventLog1.WriteEntry("In OnStart"); this.frm = new Form1(); this.frm.Show(); }
0
7886
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8381
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8035
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8258
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5431
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3886
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3927
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1494
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1238
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.