registry and internet

I writing a program to detect and do a certain thing when user log on the internet.

First, I want to have a function that allow my program to automatically, hiddenly starts when windows starts. It just like putting my program in the startup folder but I dont want to do so. I think there is a way by adding it to the registry. I want to be able to enable and disable the start up option at choice by running my program. By the way, I dont want it to show its icon at the lower end of the windows where the clock appear, neither is on the task menu[ctr-alt-del]. But I want a tricky way to access to my program so no other users would be able to access to the program but me.

Second, how do I detect when user go to the internet. The user would use dial-up to connect to the internet. I noticed when user connect to the internet, a small two-lights computer appear at the bottom left of the screen.

Unless you want your background program to take a significant chunk of processing time, or can tie it into a windows call, so that an event fires off when your program needs to act, then the Sleep() method

AzraSound, I want to know right when an internect session begins(is that how you call when the dialup finished and the small computer appear at bottom right?). I want my program to execute the main statements when the internet first connected. Well how about this...when a internet is first establish, I want my program to run its main function...Otherwise it just sit there and wait....

I test the automacially start function and it "partially" works. However, here is my sub main:

Sub Main()
AutoRun eOnce
If MsgBox("hello", vbYesNo) = vbYes Then
Exit Sub
Else
AutoRun eNever
End If
End Sub
....
After startup the comp, the prog runs and display a hello message, if I click on yes, another hello message will appear, and it will keep appearing until I click no. Why is that happen?

After I click no, the program exit and windows begin to load it startmenu and so on. Then I run the program again, this time I click yes, the program exit...I restart the comp, program runs at start up, click yes on the message box, the msgbox appear again and again until I click no.

If you want to test out for yourself...have the class include. Set the let property of autorun into sub and block out the get property... See if you can help me out.

thats why i was asking...i only knew of a way to check if there was already a connection though I imagine there is another way with API. You can monitor the system and be notified upon certain events occurring though I am not quite certain how its done. But if you dont mind checking for a connection every few seconds with a timer control then I have the code that will do that.

youre program starts off calling SubMain from the module...so since you put that code in your module and you say "yes start my program" it will always call SubMain at the beginning. You need to put that code somewhere else. Perhaps in a formload event.

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

First of all, I main point in here is that I want to "block" my brother from going to the internet. Because he is quite good at computer (he is a college student in CS major) so it would be very hard do it. I want a program run in back ground and prevent him from going to the internet. I enventually will disable ctr-alt-del so he can't end my program, he still can enable it and re-call the function it[I believe he can]. so I will need to hide it so that it would not dispay in task list in case he enables Ctr-Alt-Del. Now, the next point is how will I do it so that I can use the internet myself but not him. And I dont want him to figure out that I up to the trick.

Second of all, this is a good practice for me because I dont familiar much with API call.

Did that answer your question? By the way, it would be nice if you answer me what you really thought I was up to... FAIR, right?

A word of caution in this though, add a switch to your program so that it only activates when you are around.. either that or don't stand under any open windows of the computer room whenever he gets on the machine and you are not around. Remember, everything of his is going to be be yours one day.. and hopefully the computer will still be in one piece like that Scooby Doo pass me down Lunchbox that you came to love.

Now, I want you to know.. what you are doing can get you thrown out of the League Of Justice Superhero Club. Batman, Superman, da Flash all kinda frown on this schtuff.. and don't be surprised if you do not get invited to their Chucky Cheese Pizza birthday parties and miss out on the singing mechanical bear there. Simply put, Superpowers are only to be used for "Good" and NOT "Evil".. I mean what if your Superpower should fall into the wrong hands? Well.. we would just have to go and bomb Iraq again.. Ok, I admit bombing Iraq is fun.. but you just gotta know some Mom in Iraq is really gonna get p*ssed.. when she can't get the shrapnel in the wall to shine up.. and well.. you know Moms.. she's gonna call you Mom and say it is all your fault.. and then your Mom is gonna jump on you and say.. "can't you act more like your older brother".. and once again you are going to feel left out. Being a Superhero with an older brother somedays can really be rough.. <sheesh>.

Anyhow.. good luck with your project.. and thank you for enduring my silliness.. <smile>.

Add a string entry in HKLM\Software\Microsoft\Windows\CurrentVersion\Run. The entry's name should be the name of your application (ex: MyApp). Its value must be the short path to your application (ex. C:\Windows\MyApp.exe).

Unless you want your background program to take a significant chunk of processing time, or can tie it into a windows call, so that an event fires off when your program needs to act, then the Sleep() method is usually used.

During the Sleep interval, your program won't use any significant CPU resources, allowing you to use your PC as normal. A DoEvents or other type of loop will use a significant chunk of processing time.

I'd bet that a 1 second interval between checks would be often enough for your purpose.

Featured Post

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.
What are they?
An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…

Background
What I'm presenting in this article is the result of 2 conditions in my work area:
We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…

As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…

This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code.
This l…