Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 09-17-2005, 07:59 PM   #1
Beta Member
Join Date: Sep 2005
Posts: 1
Default BASIC Programming Quick Question.

How do I get something to happen once someone clicks on, lets say, the 'Start' button in the lower-left hand corner? Or maybe when someone accesses the internet, something will happen, like a notice or something.


Pharoah is offline   Reply With Quote
Old 09-23-2005, 12:16 AM   #2
Baseband Member
Join Date: Jul 2004
Posts: 23

Sorry to tell you but what you are requesting can't be done in QBasic. That's one of the biggest limitations of QBasic, it doesn't have file I/O and it can't reference system functions (such as functions found in the API). About the only thing you can use it for, concerning external events/programs, is to use the "Shell" command, which interupts your current QBasic program and allows you to run an exe, batch, or com file, then will resume your QB program. So in actuality you would have to write code for what you wanted into a completely different language and compile it to an exe for it to work w/ QBasic (which by that time QB will be completely useless to you). Or you could do something quick n' dirty with a batch file (batch programming is simple to learn just look up a few tutorials).

Actually, if I may make a suggestion, for refrences to things such as clicking on the start button I would try to use VBS (VBScript) to do it. VBS is very simple, its easier than HTML, and it is a subset of VisualBasic and VBA. And best of all it has a built in language support in windows (like HTML) and can be entered in notepad (like HTML). VBS can access the registry, and all you have to do it tell it to fetch a value from a certain registry location. You can either look online to find out how to do this or just goto "search" on the start menu and search for *.vbs and view some of the vbs files that are already on your computer (you're almost guaranteed to have atleast 1 vbs file if not several) and view the code. Some of them should have calls to registry values (which are distinguishable by the underscores between names such as HKEY_CLASSES_ROOT) that you can look at to reverse engineer a custom program. If you are new to VBS just enter a simple one-liner into notepad by typing msgbox "Hello world",vbinformation,"whatever" and do save as... "all file types": yourfilename.vbs. You'll pick up on it immediately.

In the case of the start menu just look on the internet for where the registry keys for the start menu values in the registry are (I know there is one, I've seen it before) and write some quick code in VBS for it.

Plus you really wouldn't want to write code for a popup notice in QB or batch programming. That would be a mess, as they are not object oriented languages (and Windows is an object oriented environment) and even if you could get it to work in QB or Batch you'd open up a DOS emulation window (which could or couldn't maximize on your screen) and either way you'd open a window not a convenient little popup box. Using the easy one-line msgbox VBS command in conjunction with the registry value for your Start button in your code, will produce a very nice result if you can pull it off.

Hope that helps,


The Master has spoken.

cybershark5886 is offline   Reply With Quote
Old 09-23-2005, 05:04 AM   #3
Site Team
root's Avatar
Join Date: Mar 2004
Posts: 8,065
Default Re: BASIC Programming Quick Question.

I think it says Quick question, not Quick basic...

Anyway, the answer stands the same...
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 09-23-2005, 12:14 PM   #4
Baseband Member
Join Date: Jul 2004
Posts: 23

I think it says Quick question, not Quick basic...

Hehe very funny.

P.S. I assumed BASIC meant QBasic. I hope he isn't using old BASIC (ya know, with the numbered lines). That has even less functionality than QBasic.
cybershark5886 is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 11:45 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0