Comatose 290 Taboo Programmer Team Colleague

He's right. HTML Is static, it will require javascript. It's real easy though, in the input tag, it would be something like this:

<INPUT TYPE="TEXT" NAME="cool" onFocus="javascript:this.value = '';">
Comatose 290 Taboo Programmer Team Colleague

Granted, but all I'm saying is that a "how would you feel" about people stealing your programs, isn't necessarily a valid point. Granted someone "borrowing" or stealing your car is a good and valid point, but there are plenty of people who write programs for people to use and modify. I'm not advocating piracy here, but keep in mind that not every programmer has a problem with people using/copying their software.

Comatose 290 Taboo Programmer Team Colleague

I'll reverse the question / if you wrote a nifty piece of software and spent a lot of time and effort on it, would you appreciate someone stealing it?

Careful... I have made quite a few nifty piece's of software on multiple platforms. I have written programs as far and wide as an anti-spyware assistance program, to a web based sign up (CGI) package, for ISP's, complete with an optional Perl/Tk Administration Program, and released them all as open source.

Comatose 290 Taboo Programmer Team Colleague

Well, The main idea behind what you are trying to do is completely MDI. However, I'm going to treat you to a little gem, that, depending on the app (since you are using your own forms, it's no problem) can cause troubles. This is a ... technique of sorts, that is namely taboo. Here you go, Though.
In A Code Module, Add This:

Public Declare Function SetParent Lib "user32.dll" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

Dim oldhwnd As Long

Now, in your MAIN Form Load, you just simple add this (keep in mind, that you can add this anywhere that you want to in your main form... a menu, a button... whatever). This is the code to grab your form, and stick it inside your other form.

oldhwnd = SetParent(Form2.hWnd, MainForm.hWnd)

Now, make sure to replace Form2 with the name of the form that you want inside (or however many forms you want inside) of the main window. Change the name of MainForm, To the name of your main form (don't lose the .hWnd's that follow).

Comatose 290 Taboo Programmer Team Colleague

Let me break it down. A Server, is a program, that accepts a connection over a network. So, A Web Server, Accepts A Connection Over A Network, using port 80. An FTP Server is just a program that listens on port 21. The list goes on, and on. Now, I have actually messed up my windows box last night :(, but it should be functional soon, and I can code a skeleton server for you, with the idea's of how it's done.

Comatose 290 Taboo Programmer Team Colleague

Yikes! Sounds like the best thing you can do is to boot to the XP CD, and try a recovery console (or a complete reinstall)

Comatose 290 Taboo Programmer Team Colleague

you have to draw them onto the control. if you just double click it, it will stick it on the form (you could also, if you have the controls on the form, and want to stick them on a tab, highlight the control, and cut it... then make sure the tab control (the one that you want the controls to go on) is active, and the entire control is selected, then paste). This will have it work the way you expect.

Comatose 290 Taboo Programmer Team Colleague

Here Are A couple of links to get you started. The first one is an introduction and tutorial on ASP, what it does, and how it works. The next one, is a page that describes (a code snippit) on how to write to a text file on the server side with ASP. I hope these can be of some help.

http://www.w3schools.com/asp/asp_intro.asp
http://www.freevbcode.com/ShowCode.asp?ID=89

Comatose 290 Taboo Programmer Team Colleague

There should be a timer control (looks like a stop watch, I think). Set it's interval to 1000 (which is 1 second (1000 milliseconds)). Now, every second this timer event will fire. In Your declaration section of the form (where you declare form wide variables) add a public variable to keep track of the time, call it: timevariable. In The Form Load Event of your form, set the variable to the max amount of time (the number you want to start at). Then, in the timer event (every second), add this:

if timevariable = 0 then
     msgbox "game over"
     exit sub
end if

timevariable = timevariable - 1
Comatose 290 Taboo Programmer Team Colleague

Do it in ASP. There are certainly free ASP's on the web that can do what you want. You want them to be able to enter certain information (survey questions or whatever) and have them e-mailed to you? Or have them saved in a log file? ASP can do that, and there are hundreds of examples and free ASP scripts if you google it.

Comatose 290 Taboo Programmer Team Colleague

Well, CGI stands for "common gateway interface". Most of the time, when people refer to it, it is regarding the "Perl" programming language. This doesn't have to be the case... however. A Bash Script, or C program can be a CGI. A CGI is namely just a program that the web server runs, and then the program spits out web page information to the surfer. It can do a number of things, however. Such as sending you e-mail, saving log files.... etc, etc. ASP is the same thing, only it uses a visual basic type of syntax to do it's thing. Ask your ISP (or whoever your web page is being hosted by) what type of server side scripting they have available. They may give you a huge list, or they may say "oh, we just have PHP." Either way, we can give you a hand here at Daniweb.

Comatose 290 Taboo Programmer Team Colleague

Well, there are alternatives. You could use ASP, or PHP. I can code you a CGI that does it easily. You could use the javascript to open a mail window with their default mail client, with the information set up in the body of the e-mail (this is, however, frowned upon, as not all people actually use mail clients in favor of webmail).

Comatose 290 Taboo Programmer Team Colleague

After The Tick Count (The memory test at the begining... or after it says "press del (or whatever) to enter setup) in the very begining, start pumping F8. This will eventually drop you to a startup menu. Choose the option that says "start with last good configuration (the last settings that worked)" and hopefully that will load up correctly. If not, you could try the same process, but select "safe mode".

Comatose 290 Taboo Programmer Team Colleague

As far as I know, Javascript is a CLIENT side scripting language. You Can Not (in any way that I am aware of) use it to store things on the server side. If you want to do that, you might want to look into CGI, or PHP (or ASP).

Comatose 290 Taboo Programmer Team Colleague

I have moved this to the Legacy VB Thread. I will write and comment a server that listens on port 135, and warns the computer that a connection attempt has been made.

Comatose 290 Taboo Programmer Team Colleague

Yes I do. I don't have it while I'm here at work, but I do at home. If you want to add me, click my name, view public profile. My Msn Name is there.

Comatose 290 Taboo Programmer Team Colleague
Comatose 290 Taboo Programmer Team Colleague

I'm an advocate of VB6. I think it's a better structured system, and a better established system. I also suggest using socketwrench (http://www.catalyst.com) for the socket portion (socketwrench is an activeX control that is powerful, and pretty easy to use). The very best language to code something like this in, would Be A C language. By tradition, it's faster processing, but would require crazy amounts of code. This leads me to my suggestion of VB6 with socketwrench.

Comatose 290 Taboo Programmer Team Colleague

Sure. Have you chosen a language?

Comatose 290 Taboo Programmer Team Colleague

Are you typing that into your web browser!?!

Comatose 290 Taboo Programmer Team Colleague

Do you have a copy of VB6, or just VB.Net? They are the same basic syntax, but the languages are completely different. There is still arguments and fuss about which is better and if vb6 is phasing out. I am a VB6 Advocate, And I don't much care for .NET, that it requires an installation of an entire platform. A good google search of sockets and VB (whichever one you choose) will give you a whole lot of good info. I prefer to use the catalyst socketwrench control: http://www.catalyst.com. I have no problem coding a small server app in VB6 with comments if you choose the VB6 route. If VB.Net is your option (maybe due availability) I can find a ton of resources to help you out. Let me know.

Comatose 290 Taboo Programmer Team Colleague

Well, You will need to use sockets..., and build a server program that listens on that port. I can code such a program, in VB6, but I don't have .NET, nor do I use it enough to know how sockets work in it. But, I will tell you that creating a socket on that port for listening is the way to go about doing what you would like.

Comatose 290 Taboo Programmer Team Colleague

I'll give you any assistance that I can, but I have a lot on plate (by way of projects) at the moment that take a significant amount of my time. Let me know what you need help with, and I'll see what I can't do.

Comatose 290 Taboo Programmer Team Colleague

Well, I don't foresee it slowing down the server a whole lot (maybe after you take control of the workstation.... some). I see it being choppy, and fairly annoying to work with on the client machine. Bottleneck effects and all other kinds of crap. Now, the best way to do it is to use a UDP socket (the same kind that streams movies and video) for the recieving images portion, and a tcp socket for the control portion.

Comatose 290 Taboo Programmer Team Colleague

Well, it would be no problem creating a server (I'm hoping you would want it to require a password) that would take a snapshot of the screen, and send it back to you. The problem I'm looking at, is the speed of such a program, and the bandwidth of such a program. In order to write a program to actually take over the other computer (which can be done), you have to be able to monitor (in order to see on your screen what is happening on theirs) in real time. That's a lot of snapshots, and a lot of bandwidth. Could it be done? Sure. Are there going to be some issues with it....certainly.

Comatose 290 Taboo Programmer Team Colleague

because your or comparison is flawed. When you do a comparison, you have to give it multiple conditions, not multiple options of the same condition, so:

if text1.text = "hi" or "bye" then    ' <-- improper testing condition

However,

if text1.text = "hi" or text1.text = "bye" then    '<-- proper testing condition
Comatose 290 Taboo Programmer Team Colleague

I haven't built a fully graphical vnc type program, but I have built remote access programs... what do you need and/or what you are looking at? Text based? Full Vnc like capabilities, etc?

Comatose 290 Taboo Programmer Team Colleague
' /* Create Shell Object */
dim newurl
dim WSH
set WSH = createobject("WScript.Shell")

' /* Get The URL From The User */
newurl = inputbox("Please, Enter The New Home Page")

' /* If They Hit Cancel, Or Leave It Blank Then Exit Sub */
if newurl = "" then exit sub

' /* Set The Home Page To The New URL */
wsh.regwrite "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page", newurl

' /* Tell us It's Done */
msgbox "Done!"
Comatose 290 Taboo Programmer Team Colleague

I'm not sure what you mean by "clean" the registry key, but it's all too easy to write to the registry like this:

dim WSH
set WSH = createobject("WScript.Shell")
WSH.RegWrite "HKCU\Software\Microsoft\Internet Explorer\TypedURLs\url1", "http://www.google.com"

That will effectively replace the value in url1 to http://www.google.com. The most difficult Part of this will be to figure out how many url values are available. Here is a peice of code that will loop through all the registry values (urls) in that registry key, and replace them with "" (nothing).

' /* Create Shell Object */
dim WSH
set WSH = createobject("WScript.Shell")

' /* Set I To 1
I = 1

' / * Loop Without Conditions (Infinately) */
do 
	' /* If There is any kind of error, just keep processing */
	on error resume next

	' /* Read The String Value In The Registry Into the url Variable */
	url = WSH.RegRead("HKCU\Software\Microsoft\Internet Explorer\TypedURLs\url" & I)

	' /* If The Length Of What We Read From The Registry is 0, Then Break From The Loop */
	if len(url) = 0 then exit do

	' /* OverWrite The Current Value (current URL) with "" chr(34) is the character code for " */
	WSH.RegWrite "HKCU\Software\Microsoft\Internet Explorer\TypedURLs\url" & I, chr(34) & "" & chr(34)

	' /* Reset URL */
	url = ""

	' /* Add One To I (To get the next URL in the registry */
	I = I + 1
loop

' /* All Done */
msgbox "Complete!"
WScript.Quit
Comatose 290 Taboo Programmer Team Colleague

Since you are in VB.Net The System.Diagnostics namespace exposes a Process class:

Dim myProcess As Process = System.Diagnostics.Process.Start("c:\somepath\somefile.exe")

obviously, you will need to change "c:\somepath\somefile.exe" to the path of the program that you want to launch (in this case, your other program). That should effectively launch the exe. Now, just stick that in your form load... and whenever EXE 1 runs, it will launch EXE2 by default.

Comatose 290 Taboo Programmer Team Colleague

Thanks, but one more thing..."Now enter your code" which code is that? Like the code that opens both of them or what? Thanks.

Yes, it would be the code to launch each program. I actually think what he was trying to do is to have your project load two forms, instead of two exe's. You could just as easily have 1 of your exe's launch your other EXE on form load.

Comatose 290 Taboo Programmer Team Colleague

Here is a quick project, that does exactly that. In order to get the common dialog control... you need to right click on the toolbar, click on componants, and find "Microsoft Common Dialog Control" and put a check in it. Anyway, I've put together a project, that does what you ask. However, it does not take into consideration things such as picture size, or anything like that. It's, a very simple example.

Comatose 290 Taboo Programmer Team Colleague

Ok, Thanks for telling me that, and sorry these questions don't have anything to do with the topic but, what would I put in if I wanted my program to run when windows starts up? Thanks.

You can make your program edit the registry on form load.... and then call your EXE. It's a good idea to give the user this option in an option form, or msgbox, so they know you are going to do this (I hate when programs try to force startup on me...)

dim wsh
set wsh = createobject("WScript.Shell")
Wsh.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Run\MyProgName", "c:\path2yourprogram.exe"

Obviously You need to change 2 things in the last line... you need to change "MyProgName" to whatever the name of your application is.... and you need to change "c:\path2yourprogram.exe" to the path where your program is installed. That should have it load on startup.

Comatose 290 Taboo Programmer Team Colleague
Dim aButton As New System.Windows.Forms.Button()
FormName.Controls.Add(aButton) 'change FormName To Whatever You Named Your Form
Comatose 290 Taboo Programmer Team Colleague

Not that I know of.... Unless You are storing these in a file.

Comatose 290 Taboo Programmer Team Colleague

you can make it run in the background by merely hiding the form. If you stick a timer on the form, then you can have it cycle to do something every so often. In the form load's procedure just add:

me.visible = false
Comatose 290 Taboo Programmer Team Colleague

Yes, but it cuts a little of your bandwidth for each system using it. It will work to make all pc's involved (who can talk to the computer running the proxy) access to the net through it... but be advised that it will slow the connection.

Comatose 290 Taboo Programmer Team Colleague

I'm not sure what changes you'll have to make for use in .NET, but the basic code would be something like this:

In The Form Level Declarations:

' /* Dimension Variables */
Dim counter
Dim newItemText() As String 
Dim pilotname() as string
Dim planetype() as string

Then in your form load:

' /* Set counter to 0 (start of array) */
counter = 0

And In Your Click Event (Or wherever):

' /* Set The Indices Of The Array's To The Value Of counter */
redim newItemText(counter)
redim pilotname(counter)
redim planetype(counter)

' /* Set The Array's Current Indice To The Values In The Textbox's */
newItemText(counter) = txtAircraftID.Text
pilotname(counter) = text1.text
planetype(counter) = text2.text

' /* Add The Item To The ListBox */
Me.lstAircraftID.Items.Add(newItemText(counter))

' /* Increment (add one to) The Counter Variable (So We Don't Over-Write Our Array) */
counter = counter + 1

Then, Whenever You click inside the listbox

' /* Set The Values Of The Textbox's To The Array's Indices Of The Index Selected IN The listbox */
txtaircraftID.Text = newItemText(lstAircraftID.SelectedIndex)
text1.text = pilotname(lstAircraftID.SelectedIndex) 
text2.text = planetype(lstAircraftID.SelectedIndex)

Or Something Like that. Let me know if that works for you.

Comatose 290 Taboo Programmer Team Colleague

I would use a couple of arrays. I'd use 1 to store the ID, and however many others for each of the textbox's. So, if you have 3 text boxes, (not including the ID) you would have 4 arrays. 1 for each text box and 1 for the ID. Then, when they click the listbox, figure out which item was selected, and pull that up in the other arrays. Does, that make sense?

Comatose 290 Taboo Programmer Team Colleague

Yes, You can have multiple sub-routines call a function.

Comatose 290 Taboo Programmer Team Colleague

Do a google search for a free "proxy" server program. Wingate used to be a good one, don't know if it's still around though. Be Forewarned... sharing a dial up connection is a horrible idea anyway, since the bandwidth is so limited. It will slow your connection down noticeably.

Comatose 290 Taboo Programmer Team Colleague

I'm guessing zip is the external EXE file, and data(n) is the filename?
There are a ton of different method's to handle this kind of ideal. The easiest way to go about this, is to use a VbScript. There are others, with shellexecute, waitforsingleobject API's and others... but the easiest (and probably most effecient based on code readability) is as such:

dim WSH
set WSH = createobject("WScript.Shell")
WSH.Run "zip " & data(n), 0, 1

The WSH.Run method executes an external program, the first integer value, defines the visibility state of the window... 0 is hidden, so it doesn't show the DOS window, or ZIP program window to the screen. The trailing integer, set to 1, tells WSH's Run Method To Block (not return to program code execution) UNTIL the command or program being run by WSH's run method returns. It doesn't matter how it returns, either. Error, Success, or something in between. As long as it returns (the program finish's running), then it will move on. Not until then, however. Let me know how it turns for you.

Comatose 290 Taboo Programmer Team Colleague

It's my pleasure to help Elise. Don't hesitate to ask if you have further questions or need additional assistance, and certainly don't feel as though you are bother, since nothing is futher from the truth. Helping the I.T. Community is the best part of my day. I'm glad I could help you out. Hope to help you out again soon ;)

Comatose 290 Taboo Programmer Team Colleague

I've never messed with word macro's, but I know a little bit about VB. Can you add VB source code to a macro?

Comatose 290 Taboo Programmer Team Colleague

The Simple Answer: Yes.

for (i=0; i<100; i = i +1) {
     document.writeln(i + "<BR>");
}

Works (tested in firefox) just fine. The thing with that though... is that if you are concerned about programming speed and power, using var = var + 1 is NOT the way to go. As a matter of programming ethics, and as a matter code effeciency (on a very low level, it takes more time to process i = i + 1, than it does to process i++, but even at a low level, a bunch of i = i + 1's can add up). The best way to add one to a variable is to use ++. The only reason you shouldn't use ++, is if the programming language you are using doesn't support it (like visual basic).

Comatose 290 Taboo Programmer Team Colleague

K. So I probably should have split it up into a couple parts for that tutorial... like a section 1 and section 2 of part 1. Thanks for the advice.

Comatose 290 Taboo Programmer Team Colleague

Long and impresive some what cofusioning (spelling) at a glance. But I'm fine with gmail, looks extremly helpful though.

What made it seem confusing, and what can I do in part II to make it more clear and concise?

Comatose 290 Taboo Programmer Team Colleague

I have a feeling you are going to need to use API calls, or possibly sendkeys. If you post the code or attach the project, I'll take a look at it, and see if I can't find a way to accomplish it.

Comatose 290 Taboo Programmer Team Colleague

A Little Rant
I love ThunderBird, I really do. I only have one problem with it. I have not yet found an e-mail client as good as thunderbird, and every e-mail client that I have entertained have all come short of one specific attribute that I really like. You can set up just about any mail client to check your inbox for new messages at a given length of time, which is great, but the restriction that you have to leave the e-mail client open the whole time, gets under my skin.
I hate having a cluttered taskbar, with things open that don't really need to be. At least with the system tray, it's in a way, tucked aside and out of the way of other running tasks. Why should I be obligated to have my e-mail client cluttering up my task bar while I'm writing code, or surfing the web? The simple answer is... I shouldn't.

Step 1
The first step is making sure we can make our program talk to the mail server. We are going to use POP3 protocol, but, before we can start making our program get on the internet, we need a special control, called a socket. There are a couple of these, one which comes with windows, and is available to VB. This control doesn't offer as much power, as many options or as much flexibility as the control that I am going to use in this tutorial. …

Comatose 290 Taboo Programmer Team Colleague

And You Paste that whole thing into VB?