|
-
Aug 13th, 2012, 11:57 AM
#1
Thread Starter
Lively Member
VB6 Run As A Service (Windows 7)
Is that possible in vb6 in windows 7? I know it was possible in Windows NT.
-
Aug 13th, 2012, 12:52 PM
#2
Lively Member
Re: VB6 Run As A Service (Windows 7)
Of course it is possible i think.
Let me know it you need anything like a setup or something.
-
Aug 13th, 2012, 04:05 PM
#3
Thread Starter
Lively Member
Re: VB6 Run As A Service (Windows 7)
 Originally Posted by NiTrOwow
Of course it is possible i think.
Let me know it you need anything like a setup or something.
Really? Can you please provide me an example code please?
-
Aug 13th, 2012, 05:18 PM
#4
Re: VB6 Run As A Service (Windows 7)
Historically there were two main ways to do this.
One was a "quick and dirty" approach with some severe limitations, using a utility called srvany that came from one of the Resource Kits (NT 4.0? Win2k?). This is a wrapper process that becomes the actual Service but kicks off a VB6, etc. EXE as a child process in the Service context.
The other was a C++ OCX called ntsvc.ocx that could be added to the main Form of a carefully-written VB6 program. It provides the necessary Service Manager and related interfaces a Service must support. Microsoft never offered it except as C++ source because it was unsupported. There are precompiled versions of the code around, some strictly VB5-oriented and some better-bahaved modified versions for VB6. There are also some creaky/broken versions out there.
Using these two Microsoft approaches (or several 3rd party approaches) your programs need to be carefully crafted to operate properly as a Service. In the post-XP world even more care is required because modern versions of Windows lock down a lot more things. Look up "Windows Service Hardening."
This isn't something the shadetree coder will be able to pick up and run with from sample code snippets. It is fairly exotic and requires very good understanding of how VB6 really works, Apartment Threading details, etc. There are many things that have to be dealt with in order for such a program to be reliable. There are also special deployment considerations.
Often you don't really need a Service anyway.
Sometimes you can get by fine with a regular program that is auto-run via the Startup folder. If you insist you can also use the various auto-run registry keys.
Modern Windows versions also have an enhanced Scheduler that can be used to run a program on logon or even on boot (with nobody logging on).
The last scenario is really the only one that normally needs a Service anyway: a program that always runs after booting.
The real question is: Why do you think you want a Service? This might be rephrased as: What are you actually trying to accomplish?
-
Aug 13th, 2012, 06:13 PM
#5
Thread Starter
Lively Member
Re: VB6 Run As A Service (Windows 7)
hmmmmm you scarred me from even trying it....
bytheway my prog is a lil fun thing which i want to play with my friends, you can call it a trojan. but it won't steal their bank accounts etc just funny pranks
-
Aug 13th, 2012, 07:07 PM
#6
Re: VB6 Run As A Service (Windows 7)
 Originally Posted by ufo973
hmmmmm you scarred me from even trying it....
bytheway my prog is a lil fun thing which i want to play with my friends, you can call it a trojan. but it won't steal their bank accounts etc just funny pranks 
Be careful about what you say...
-
Aug 13th, 2012, 07:13 PM
#7
Re: VB6 Run As A Service (Windows 7)
Malwares are always malwares and will never be anything but malwares even if it's just installed on your friends computers as a "funny" prank.
I think your question about running a VB6 application as a service has been answered, with the possible exception that it's hard to play a "funny prank" on someone if you're service aren't allowed to access the users desktop.
This thread is now officially closed!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|