topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday April 26, 2024, 11:53 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - pilgrim [ switch to compact view ]

Pages: prev1 2 3 4 5 6 [7] 8 9 10 11 12 13next
151
General Software Discussion / Re: Advice needed on AHK script
« on: May 08, 2013, 05:24 AM »
Just tried the new version of CleanTray, it removed all 4 icons instantly, it left 4 empty spaces at the right hand end of the tray (with the Task Manager NOT running), it rearranged the icons. Basically it's doing the same as the previous version.

It would appear to be true that it is the taskkill command that is causing the icons to be left behind but I could not find anything else that would shut all 3 (XP) or 4 (7) programs down and remove the icons at the same time.

The program I put together from the script I found works, as I said above the way I put it together may not be very elegant but what surprised me was that I finished up with a 2kb script while the other 2 scripts I found at the same time are both 8kb.
Not only does it work but it has no unwanted side effects like leaving empty spaces or rearranging icons, anything else we came up with might be more elegant but it would not do a better job.

I think I'll leave this one as is and try to sort out the few other's I am working on. :)

152
Like using batch files, I could work that out but most of the people I am thinking of would have no more idea of how to create a scheduled task than they would of how to create a batch file.

Remember that I am lost when it comes to programming so what I am about to say may not be possible.

Network Activity Indicator works for the main network connection(s?) from my point of view it would have been nice if the icon was only visible when a connection was active (but that's just me).
I was thinking in terms of something that worked the same way but only for PPTP/L2TP.

(And no, the Task Scheduler in XP isn't intelligent enough to do this.  :) )

XP already has automatically appearing icons built in.

Sudden thought! How are the icons triggered in XP? Is it possible to translate that to 7?

153
4wd,

I've come back to this due to interest from elsewhere.

I am as happy as it is possible to be with creating batch files to run PPTPchek but I know a lot of people who would not be (able to).
Is there any way that it could be made non-specific, i.e. so that it would run when any PPTP/L2TP VPN is connected and thereby do away with the need for batch files?

As I said this not for me but I said I would ask you in case you felt like looking into it at some time.

154
General Software Discussion / Re: Advice needed on AHK script
« on: May 07, 2013, 09:55 AM »
The one question I have to ask is: What are you doing that leaves so many orphaned icons so often?

The answer to that is in the thread I linked to in reply 2 of this thread.
I have since added Network Activity Indicator to the list as I only need it running when connected, so every time I go offline I have 4 orphan icons.

Also, I'd be interested to know if the attached version of CleanTray works.

I'm on my Netbook at the moment, I'll try it out when I get back on my main PC.

AutoIt script, (original CleanTray), gets the number of icons in the tray then asks for the process that controls that icon.  If no process is returned the icon is removed - obviously in using the appropriate system calls to remove the icon, it also removes the positioning info.

The first AutoHK script moves the mouse over the icons but you need to specify a coordinate offset based on your screen parameters.  The second AutoHK script works the same as CleanTray by using system calls to detect icons without processes and then removing them.

I had a feeling that the difference was something along those lines but I didn't understand the scripts well enough to be sure. Thanks for telling me.

The new CleanTray works depending on the passed argument:
a) The original way, ie. just removes the icon if it has no background process.
b) Locates the tray, gets the number of icons, it then loops backwards through the list getting the icon' background process.  If an icon has no background process, the mouse is moved to it, Windows will then remove it, (as it usually does).  If an icon is removed it will exit the loop, get the new number of icons and start again, ie. it will recurse, (kind of), through the icon list until it gets to the point where no icons are removed.

That sounds involved. I was interested in your comment about the speed of the program.
When I ran the program I made yesterday on Windows 7 it was pretty quick, once the connection had shut down the NAI icon just had enough time to go grey (indicating no connection) before all 4 icons disappeared virtually together.
I added it to my Netbook earlier (XP) and it takes 2 or 3 seconds for everything to shut down and disappear with only 3 icons, there is of course a tremendous resource difference.

155
General Software Discussion / Re: Advice needed on AHK script
« on: May 06, 2013, 11:29 AM »
I think I'll cry.

4wd,

ClearTray.exe did absolutely nothing. While CleanTray.exe which you uploaded on another thread of mine a week ago works perfectly except for one thing, however many icons it deletes it leaves that number of empty spaces on the right hand end of the tray and rearranges any icons it closes the next time they start as well as the icons of any programs that happen to be open at the time.

I realise that AutoIt and AHK are two different languages but it seems that we have one script that removes ALL orphaned icons but plays havoc with icon location and a second script that only affects orphaned icons but will not remove more than 2 at a time. Putting aside the different languages they are written in what are they actually doing differently?


Sometime later:

This has got to be the worst idea for an AHK script that anybody ever came up with but it works:

I went back to the original script and copied it, then I pasted it below the original, I did the same thing until I had 4 copies one below the other and then saved it.
Guess what? It worked.


Sometime later still:

I think I've found the answer to empty spaces at the right hand end of the tray.
I have compiled the script and added it to my batch file where it works perfectly but if I have the Task Manager open when I run it then I get empty spaces in the tray, if I shut the Task Manager down everything in the tray moves to the right and the spaces disappear.
If the Task Manager is not open when I run the batch file, no spaces?

156
Site/Forum Features / Re: Forum Search query (or ideas)
« on: May 06, 2013, 09:45 AM »
I was just looking for a place to post about a search query and found this so whether it's in the wrong place or not here it is.

I have a number of threads on the go from the last few months that are in one way or another connected to each other and in a couple of the later ones I have linked back to the previous threads.
As I do not keep note of the thread's URL's that meant I had to run a search.
I found a link on my profile to 'show posts' but not one to 'started threads' which I was used to from elsewhere.
This meant that I had to go back several pages in each case to find the appropriate thread.
Am I missing something or is there no option to search for threads as opposed to posts?

I have very few posts in comparison to many on here and it was a pain in the **** for me, if I had been looking for a thread by a more prolific poster I would probably have given up.
If you have a specific something to look for it is probably not an issue but when you have trouble some days remembering the name of the site itself it is. :-[

157
General Software Discussion / Re: Advice needed on AHK script
« on: May 06, 2013, 09:04 AM »
Thanks for the links but no joy.

To start with, since I added the fourth program to my batch file the original script now removes 2 icons at a time.

Regarding the links:
The exe does not work, one of the posters in the link had the same trouble.
The script at the bottom of the page did not work either.
The script at the top of the page removed 2 icons the same as my original script now does but it is 8 times the size.

I have just spent the last hour trying different variations on the original script.
I tried altering the x numbers, nothing.
I tried pushing the loop as high as x20, nothing.

So I am back to the idea of running the script more than once.

158
IainB,

Thanks for the suggestion but.......
I am trying to avoid installing any extra software to do what I am trying to do. (AHK was an exception.)
Buying any software is not a consideration.

I have at most half a dozen more things to sort out and I will have achieved everything I am trying to do.
It's not a question of having more ways of doing things but of understanding those that I already have.
There are two main options available to me, AHK and batch files, between them they should cover anything I am likely to want to do.

AHK is like learning German, I know a very small number of words but putting them together into a sentence is largely beyond me.
Batch files are like learning French, I can usually make myself understood but the grammar and the punctuation are all over the place, so what comes out to begin with is not always what I had in mind.

That's where the good people on DC help me out, they can translate my ideas into commands that a computer can understand, which is more than I can sometimes do.

159
Post New Requests Here / Re: IDEA: Standalone colour blender.
« on: May 06, 2013, 05:13 AM »
Everything I left in the image I would use.

I just tried the update to PCB, I like the two small menu options and also the copy options.

I mentioned previously about window size when used on a 10" screen, I have incorporated the PCB update into my previous image and come up with the following which is smaller still.

Color Warlock.jpg

160
General Software Discussion / Re: Advice needed on AHK script
« on: May 06, 2013, 03:22 AM »
Thank you, I used your second option and learned two things, first the script probably worked when I originally tried it, second there is a problem, which is probably why I never realised it was working.
When I run this script it only removes one icon at a time, I need it to remove several. (I'm not sure if this is because it does not move far enough to catch anything other than the first orphaned icon.)

To put it in context, I want to add it to two batch files which are shown in replies 9 & 15 of THIS thread.
The first file for Windows 7 (reply 9) has since been modified and there are now 4 programs involved all of which leave icons behind.
So either I need to modify this script to sweep a wider area or I need a way of running it multiple times, either from within the script or from within the batch file.

The version for XP I will need to compile as neither of my XP computers has AHK installed.

Any suggestions will be much appreciated.

161
General Software Discussion / Advice needed on AHK script
« on: May 05, 2013, 09:12 AM »
I have been looking into ways of removing icons from the system tray that have been left behind by programs that have been 'killed' rather than closed normally.
I tried an app that was suggested on another thread I started on here but it had a side effect of rearranging other icons, so I've kept looking.

On the AHK forums I found an old thread that suggested using a script to move the cursor over the tray, which gets rid of the left over icons if you do it manually.
At the end of the thread was the following script which is supposed to work as it is on Windows 7 but I have tried it without success.
Would somebody who understands AHK cast their eye over it and see what they make of it please?

One thing I am uncertain about is the x/y coordinates, my screen resolution is 1920 x 1080 and the tray is in the default position of bottom right and takes up nearly half the width of the screen.


RefreshTray() {
   WM_MOUSEMOVE := 0x200

   ControlGetPos, xTray,, wTray,, ToolbarWindow321, ahk_class Shell_TrayWnd
   endX := xTray + wTray
   x := 5
   y := 12

   Loop
   {
      if (x > endX)
         break
      point := (y << 16) + x
      PostMessage, %WM_MOUSEMOVE%, 0, %point%, ToolbarWindow321, ahk_class Shell_TrayWnd
      x += 18
   }
}

162
Life

Have you ever looked at your life and added up the score?
Have you done something less when you could have done much more?

Have you ever stepped backwards or even to one side
When you could have gone forward and never even tried?

Have you ever passed another lying by the way,
And never stopped to realise it might be you some day?

163
Short term memory loss ?  ;)

Brain dead!
Actually I had exploratory brain surgery once.............but they never found anything. :D

The icon being out of sync happened a couple of times when I had a VPN connected and then clicked on another one without closing the first. (Having forgotten which one was connected. :o)
It was always with the icon missing when the next connection became active, clicking on the same shortcut a second time shut everything down, the third time put it back in sync.

I'll try the update later but if the tooltip now shows the connection name it does everything I want. (Unless of course you find a way to incorporate the other two netshell icons to indicate traffic flow.)

While VPN's are useful for the reason you mention I run one all the time, in my view it puts an extra layer between me and the connection's end point which can't be a bad thing.
When I first got interested in them I was in touch with a blogger whose site was all about online privacy and I am still in touch with one VPN provider who I helped with a couple of things when he was getting established.

164
Post New Requests Here / Re: IDEA: Standalone colour blender.
« on: May 05, 2013, 03:06 AM »
I've put together a composite image based on the parts of the two programs that I use and leaving out others, based on a single window.
I think the image will explain what I have in mind but if there is anything you want clarification on let me know.
I have shown the 'Blend' window because the 'Basic' and 'Screen' sections remain unchanged.

Color Warlock.jpg

165
Now that was the one we needed. :Thmbsup:

I changed the details in the script for one of my existing VPN's, created a shortcut and placed it in the PPTP toolbar - 1 click on, 1 click off.
The 2 command windows appear as before, the first one disappears almost immediately, the second one shows the changing status of the connection attempt (which is very useful) and disappears once it connects.

I left the cmdow.exe file in the System32 folder which is where I originally put it.

I have set up my 3 most used PPTP VPN's and the only problem I have is an 807 error on one of them, I don't think it's a port problem as all three are from the same provider so the server might be down at the moment.
Although I have not set it up permanently I ran a test with an L2TP connection and that worked fine as well.

Something I realised when I was changing VPN's is there is no indication as to which one is connected, the icon is showing 'PPTPcheck.exe' when I move the cursor over it.
To avoid any problems I have put a shortcut in the toolbar to the OFF batch file, it works for all PPTP connections (L2TP as well) and still only needs one click.
This is probably not necessary but sometimes I finished up with the PPTPcheck icon out of synch with the connection status, a couple of clicks on any ON icon sorts it out but this stops it happening.

As you said this latest script has considerably reduced the number of batch files needed.

If only MS had never removed the icons in the first place!


All the VPN's I use regularly I have accounts for (fortunately free) but I also have bookmarks for another 12 VPN's, 10 PPTP and 2 L2TP and I was surprised to see that the one you used wasn't amongst them.
When I first started using them there were hardly any about and few if any of them were free, now they are popping up all over the place although I'm not sure that I would trust the security of some of them.

166
The batch file I started with is this:

if exist pptp-running.txt goto running
rem prog is not running
copy NUL>pptp-running.txt
start /d "C:\Batch Files\PPTP ON-OFF" PPTP-US-ON.bat
start /d "C:\Batch Files\PPTP ON-OFF" PPTPcheck.bat
goto alldone
:running
rem prog is already running
del pptp-running.txt
start /d "C:\Batch Files\PPTP ON-OFF" PPTP-OFF.bat
:alldone

That is running the commands but leaving 2 cmd windows open on enable and 1 cmd window open on disable, so apart from the left-over windows it works.
As I said yesterday, if I run the individual batch files separately the cmd windows disappear as soon as a specific command completes.

Downloaded Cmdow and all my security software ignored it.
Substituted 'start /d', first with 'cmdow' then after looking up the options with 'cmdow /run', in both cases the cmd window flashed on and off, it created the text file but nothing else happened.

For the moment I have put a shortcut to PPTPcheck.bat into the PPTP toolbar so I can start it from there when a VPN is connected and it shuts down automatically when the VPN is disconnected.

I will have another go later, I also have to look into whether all this will work with L2TP given that it requires an additional piece of information in the form of a PSK.

167
I spoke too soon. :(

I've spent the last couple of hours trying to put the batch files together and no matter what I try when I combine the PPTPcheck file with the VPN command file I am getting two cmd windows left open every time.
It works alright if I use the separate VPN ON file then run the PPTPcheck file, running VPN OFF shuts everything down, anything beyond that I'm left with open cmd windows.

wr975,

I think you had the right thought, I've just downloaded that and had a look at the script, my first thought was 'I wonder if there's an English version?'


I've given up for the day.

168
After many false starts, I think my memory is degrading, it works as advertised, thank you.
The icon is also reappearing in the same location if I stop and then restart the connection.
I have swapped the icons around in the exe, after running it for a while I decided the darker icon (193) looks better most of the time and the brighter one (190) catches my attention more when it first connects.
All I need to do now is sort the batch files and the shortcuts out for individual VPN's.

You have made using my computer a little bit easier and saved me countless hours of trying to sort this out myself, at the end of which I would probably have given up.
Before I leave this subject I have one further question if you don't mind:

All it does is call rasdial.exe every 5 seconds, if the named connection no longer exists the program exits.

I have been trying for a long time to find a way to put an argument into a batch file that states: 'if PPTP is (not) connected then........'.
Can your idea be used in that way and if so how would it read?

169
File attached. I've resized the columns to fit the text, any columns that are missing were empty.

[attachmini=#][/attachmini]

170
Hmmm?

The icon appears (193) after delay it changes (190) and immediately disappears.
Tried it on several connections with the same result each time.

EDIT: Just tried it on OpenVPN Adapter and it works perfectly, had to add 'start' to get rid of cmd window.
         It works perfectly on the Router Connection as well, went back to PPTP, same as before.

171
If the VPN connection drops out the icon stays put, so there is no indication the the connection has dropped.

Half a dozen posts later it has all become clear - all you want is a network connection monitor, nothing to do with batch files at all really.  ;D

If I hover the cursor over the NetConnected icon there is a 'Left-click to execute file and exit' option, what actually happens when clicked is that the icon disappears but the VPN stays connected.

It's not an option, it's a ToolTip - what you're saying is that as soon as you hover over the icon you get the ToolTip and then the program exits without you doing anything further, (something it doesn't do on my machine).

Anyway, now that all that's required is a connection monitor it's back to the drawing board  ;)

Icon changed for NetConnected, download archive again.

Mea culpa, mea culpa, mea maxima culpa. It's what comes of trying to think of too many things at once when you don't understand most of them in the first place.  :-[

When I started this there were three things that I was missing, the first was the cmd line commands to turn a VPN on and off, those I finally found after much searching online. The second was a way to toggle the VPN on and off from a single hotkey/shortcut, the batch files solved that. The third was to have an icon to indicate the VPN state, originally I was thinking only in terms of whether it was on or off, it was only later that I considered the possibility of it indicating traffic.

Last night it suddenly occurred to me that there was an obvious answer right in front of me, running a second instance of Network Activity Indicator, the first to monitor the main connection, the second to monitor a VPN. Unfortunately it is only possible to run a single instance of it and that monitors all connections. I have sent the developer an email to see what he thinks of the idea.

The first part of your reply highlights something I have noticed repeatedly when searching for things, it's not just about what you are looking for but the words you use to describe it.
In the last two months I have amassed a considerable amount of information about things I had never heard of before, devcon, rasdial and numerous others.
Rather than just copy and paste everything into text files I have added explanations that I can understand, which is more than I can say about many of the sites that information came from.

Going back to something I said yesterday, I am still suffering from wandering icons, this happened before when I was playing with batch files.

172
4wd,

I have tried all 4 batch files in your last post and they all worked except for one thing which I have resolved.
In the NetConnected ON file I had to add 'start' to the beginning of line 11 or the cmd window stayed open.

The good:

Using NetConnected puts an icon in the tray (ON) and removes it (OFF). (Terrible icon. ;D)

The bad:

If I hover the cursor over the NetConnected icon there is a 'Left-click to execute file and exit' option, what actually happens is that the icon disappears but the VPN stays connected.

If the VPN connection drops out the icon stays put, so there is no indication the the connection has dropped.

Batch file X is a toggle, when it is removed I need 2 trigger points (hotkeys, shortcuts) as opposed to 1.
An extra batch file is far less of an issue for me than an extra click.


I've taken the liberty of changing the NetConnected icon to netshell_193.ico to match the one in Network Connection Indicator.
In NCI as well as by default in XP the 4 netshell.dll icons change in relation to the traffic, which in numerical order is, 190 - in & out, 191 - in, 192 - out, 193 - none.
Without getting overly complicated is there a way of incorporating this in NetConnected?

The only other thing that I have noticed is that if I have the icon showing in the system tray and disconnect, when I reconnect the icon reappears far left in the system tray (XP default) rather than where it was before (7 default).
(For some reason this appears to have resolved itself, I think it might have had something to do with which programs were running when I was switching NetConnected on and off.)

All the testing I have done so far has been in Windows 7 but I am confident that once I finalise the details it will work in both.


With what I have now I can put together a working solution to what I was looking for.
All the issues I have mentioned above are relatively trivial and can either be resolved (reinstating the X batch file) or ignored (changing icons).
If you, or anybody else, can suggest ways of tidying things up in any way let me know and I'll give it a try.

173
4wd,

I'll try the app and the batch file later but to pick up on some of your comments:

I unpaused the previous app but the VPN still showed no sign of connecting.

All my connections show up in the Network Connections window so I can connect/disconnect them from there and I can open that by right clicking on the icon for Network Activity Indicator which stays in the tray all the time, but I do not want to keep opening a window every time which is why I do not want an app with a GUI, nor does it provide an icon to show the VPN is connected.

Your idea about cutting out the X batch files makes sense to me and as I said I will try it later, remember that my understanding of these things is somewhat limited and I have been basically putting together various scripts that I have found online so it is almost certain that there is a more efficient way to do what I am trying to do.
It's like the question I asked at the end of Reply 7 in THIS thread, my only way of answering it will be by trial and error, at the moment each new type of batch file is taking me an average of 10 hours to sort out.

I have never tried to run a batch file with an already established connection but if I was trying to change connections in that way I would simply have to click it twice, the first time to disconnect the old connection (thats why I made the OFF file non-specific), the second time to connect the new one.

I already have a number of launchers for various things and I do not want to install another, the sole purpose of any additional program is to put an icon in the system tray to indicate the connection is active and then remove the icon when it is not.

I will try NetConnected as I said but if that leaves an icon in the tray when there is no VPN connected it is not what I want.
When there is no VPN running there should be nothing else associated with them running (i.e. an app) and nothing visible (i.e. an icon).


Target,

The ON files read as follows:

rasdial "VPN Name" "Username" "Password"


The image below shows the left hand end of my taskbar, the first 3 icons are in Quick Launch, the next 3 in an additional toolbar:

1.jpg

From left to right the shortcuts are as follows:

Quick Launch: Router Connection, TAP-Win32 adaptor, LAN.

Second Toolbar: EU VPN, UK VPN, US VPN. (All PPTP)

All I want to do is continue using the same PPTP shortcuts but with (A) the ability to toggle the connections, which I can now do with the batch files, and (B) put an icon in the system tray, (only) when a connection is 'on'.

I'll be back when I have tried out the latest suggestions.

Many thanks for the help by the way.

174
Post New Requests Here / Re: Turn a batch file into an AHK script.
« on: April 30, 2013, 11:48 AM »
Apologies for not working it out.

I just tried it again and the icon is flashing between different colours and a cross, I opened Network Connections and the VPN that this is set up for shows no indication of trying to connect.

I'll try and explain more clearly what I want to do, at the moment I have a batch file X that alternately triggers two other batch files ON and OFF.
The OFF file does not contain specific details so it will disconnect ANY PPTP/L2TP VPN that is connected when it is triggered.
The ON files contain the name of the VPN as well as username and password so each one is specific to a single VPN server, therefore I am going to need a different ON file for each VPN server, although I have no intention of creating files for all of them at the last count there were 40+.
This also means that I will need a separate X batch file for each one and that in turn means that I need separate scripts or apps to trigger the various X batch files as the path will be different for each one.

Moving on to icons, on XP both PPTP/L2TP VPN's use the same icon(s) as the main connection:

System32/netshell.dll

netshell_190.ico
netshell_191.ico
netshell_192.ico
netshell_193.ico

These icons are also in Windows 7 and they are the same ones as Network Activity Indicator uses, which I run in Windows 7 for the main connection.
The VPN icons need to be automatically removed from the system tray when not in use just as they are in XP.

At the moment I have shortcuts to the PPTP/L2TP VPN's that I most frequently use which make the connection but give no visible indication i.e. an icon.
Instead of pointing those shortcuts directly at the connections I want to be able to point them at individual apps that will trigger a specific VPN and put an icon in the system tray at the same time.
When I trigger them a second time I want the VPN to disconnect and the apps icon to disappear.
I do not want or need a GUI and the only option it would be useful to have in the icon would be to disconnect the VPN and exit the app at the same time without going back to the shortcut, which is not really necessary.
Except on very rare occasions whatever VPN I connect to when I start for the day I stay on so being able to switch between them is not a consideration while connecting/disconnecting them is.

If I can get a working AHK script that I can edit and compile I can change all the variables to suit the different VPN's myself.

Just to finish on your last point, all my OpenVPN VPN's come with their own software and none of them use the OpenVPN GUI, when I am not using any of them I disable the TAP-Win32 adaptor and there is nothing showing in the system tray.

The main issue for me from the beginning is that by default in Windows 7 there is no visible indication when a PPTP/L2TP VPN is connected, to have an icon in the system tray that is synchronised with the VPN: connected - icon visible, disconnected - icon not visible, is all I am really interested in and the only way that I can see to do that is with an app because the connections themselves have no icons.

175
Post New Requests Here / Re: Turn a batch file into an AHK script.
« on: April 29, 2013, 09:12 AM »
4wd,

Thanks for that.

I just tried the EXE but apart from an icon appearing nothing happened, I don't have AutoIt installed to modify the script.
Given my lack of programming understanding ('programmatically challenged is a good expression') I am trying to keep to AHK and batch files, they give me enough headaches. :(

My intention was to use a one of the Windows network icons and only have it show when the VPN is connected, the way it is on XP.
I could also vary it, perhaps by colour, depending on which VPN I was using.
In fact it just occurred to me that I could use the relevant country flag for each VPN's icon.

Pages: prev1 2 3 4 5 6 [7] 8 9 10 11 12 13next