Jump to content
  • Advertisement
Sign in to follow this  
CJWR

is there anyway for a program to tell windows that a user hit the F5 key?

This topic is 4840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

alright, here is what i'm trying to do: my ftp server kicks out users who aren't doing anything after a certain amount of time. i do not know of any way to fix this, and can't change the settings for my ftp server even if i wanted to as i'm away at school. so i want to write a program that has windows tell IE every minute or so, to refresh the ftp file page. this way i'll still be giving the server commands and won't get kicked off. is there anyway to do this? thank you for your time.

Share this post


Link to post
Share on other sites
Advertisement
sure.. create a web page with two frames .. name one frame "bottom" and have it navigate your ftp server. In the top frame add the following javascript.. and begin debuging :)


<script language="Javascript">
<!--
function reload() {
parent.bottom.location = "www.ftpserver.com/ftppage.html"
}

setTimeout("reload()", [[[50000]]]);
//-->
</script>



may need parent.bottom.window.location I cant remember.

DaveC

[Edited by - bobason456 on August 15, 2005 6:11:24 AM]

Share this post


Link to post
Share on other sites
A simple VBS script would cover it.

Refresh.vbs:

Dim WshShell
Set WshShell = CreateObject("Wscript.Shell")

If WshShell.AppActivate("Your FTP Window Title") = False Then
End
//Just die.
End if

While WshShell.AppActivate("Your FTP Window Title") = True
WshShell.Sendkeys("{F5}")
Wscript.Sleep(60000)
//Send the F5 key, sleep for 60 seconds, loop. Will exit when you close the program, theoretically.
Wend


That should work, although it's untested.

EDIT: That will obviously require IE to be the topmost window. You could probably do it with Internet Explorer's object - but I'm too lazy to check, I've got to run.

Share this post


Link to post
Share on other sites
Quote:
Original post by bobason456
sure.. create a web page with two frames .. name one frame "bottom" and have it navigate your ftp server. In the top frame add the following javascript.. and begin debuging :)

*** Source Snippet Removed ***
may need parent.bottom.window.location I cant remember.

DaveC


first off, i'd like to thank both of you for your help so far. this javascript way seems to be easy and will work. but how do i point the bottom frame of a webpage to an ftp server?

Share this post


Link to post
Share on other sites
you can navigate ftp servers in your browser (e.g. ftp://ftp.microsoft.com/). You should get prompted for user/pass on your own server, but you should only have to enter that once if the refresh is working.

Share this post


Link to post
Share on other sites
i really don't know anything about html, would it possible for one of you to show me how to do this?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!