topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Monday June 30, 2025, 1:20 pm
  • 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

Recent Posts

Pages: prev1 ... 122 123 124 125 126 [127] 128 129 130 131 132 ... 225next
3151
Post New Requests Here / Re: Turn a batch file into an AHK script.
« Last post by 4wd on May 22, 2013, 07:01 PM »
f I am not mistaken there is a 5 second delay before the icon appears once the VPN connects, could that be reduced to say 2 seconds?

The time the icon is displayed is within a second or so of VIndicator receiving the Event Norification, so this might come down to the host machine generating an absolute sh*tload of events for some reason.
I can try and make my Notification hook a bit more discriminatory but can you do VIndicator.exe /debug, do a connection then disconnection, wait 30 seconds, exit VIndicator and send me the log.

NOTE: Remove any password/username but please leave the line they appeared on.

EDIT: I've shortened the interval, (at least I think I have), so don't bother with the debug output.

It would be nice if there was a way for the program to close on VPN disconnect but not essential.

That's easy enough.

If you can get the icons to indicate activity it would be a bonus....

Discovered at 0200 last night...I really should stop taking the netbook to bed :)

The only thing I am not certain about is the log, it's picking up login details. Not something I would want lying about if there was more than one user on a computer.

Now that's just plain wrong.....your event texts must be different from what I get.  That it's apparently happening on Disconnect is even stranger as the password wasn't in any event I received.

Hmmm......maybe there's a difference when the connection is initiated via CLI.....have to check that but it still seems contrary to MS' MSDN docs unless I misread something, (wouldn't be the first time :D ).

EDIT: Mea culpa  :-[  Was getting wrong line on disconnect, however, password is never reported in disconnection event so I can only think that for some of your VPNs the password is the same as the username, (which I was mistakenly getting).

BTW, how is it you have a CPUScore of 9.9 ?

Maximum is supposed to be 7.9, have you been fudging the figures  >:(  ;D

UPDATE up there
Fix: Hopefully reports which connection was disconnected rather than username in the log now
Added: Menu item Quit on Disconnect added, setting is saved to .ini for subsequent starts - obviously the icon needs to be visible to select it
Added: Icon toggles if amount of data Rx/Tx changes, only does this every 500ms - any more often increases CPU load
Added: Tooltip shows data Rx/Tx and rate
Maybe: The event checking has been reduced to 2 seconds - CPU load increases the shorter the interval

About the only changes I'd make now, (barring bugs - that's squashing not adding), is refine the Tx/Rx icon toggling so it only happens after a set amount of data has been transferred and autoscale the data measurement, (ie. kB, MB, etc).
3152
Post New Requests Here / Re: Turn a batch file into an AHK script.
« Last post by 4wd on May 22, 2013, 06:43 AM »
There is something very weird about that registry key: {BA126AD7-2166-11D1-B1D0-00805FC1270E}
If I search for that in regedit it simply does not appear, if I search for it in a third party program it shows one entry under HKLM and if I tell it to go to the key it opens {BA126AD8-2166-11D1-B1D0-00805FC1270E} ?

I just did a search for the first group of characters:

2013-05-22 21_42_02-Registry Editor.png
3153
Post New Requests Here / Re: Turn a batch file into an AHK script.
« Last post by 4wd on May 22, 2013, 02:29 AM »
Okey dokey, back with an all new dang-fangled program that may or may not work.

VPN Indicator a.k.a. VIndicator

Works different to PPTPchek, instead of polling rasdial every so often it just sits back and waits to be told what's happening - a side benefit is virtually no processor usage, (>2% on my netbook).

Start it by just double-clicking on the icon, from that point it just runs in the background.  Works on x86 or x64.
If a PPTP/L2TP VPN is active an icon will show, on disconnect it gets hidden.

Stop it by running it again or choosing Exit from the icon menu when it's visible.

What it does:
1) When first run it checks for other instances of itself, if it finds any it tells it to exit and then exits itself.
2) It sets up a Notification Event on the EventLogs and then waits.
3) When an Event is signaled it fetches the data and if it matches the particular source, (RasClient), and EventIDs, (Vista+ = 20225/20226), it does all the icon-y things.

Because most of the time it spends sitting on its bum I'll look at finding where the network stats are hidden and poll them every 250ms or so, so if they change I can just toggle icons to show activity, (that's the theory anyway).

Haven't tested it on XP, (not really required), but it shouldn't do anything nasty - it'll either indicate something or it won't.

PS.

Code: Text [Select]
  1. devcon status "*DEV_001C*" | find /i "disabled" >NUL
  2. if errorlevel 1 goto running
  3.  
  4. rem Enable device
  5. goto alldone
  6.  
  7. :running
  8. rem disable device
  9.  
  10. :alldone

Update: 0.3.0.30
Changed: No longer requires rasdial.exe to get initial connection
Changed: No longer relies on text within EventLog entry for information
Fixed: If the PC itself runs a VPN server, Event IDs 20267 and 20268 weren't reported.  Now uses Event IDs 20225/20226.
Added: Shows IP in ToolTip

UPDATE: v0.3.0.25
Changed: Logging disabled

v0.3.0.24
Changed: Refined Notification Event which hopefully will reduce load a little
Fixed: Small bug with Quit on Disconnect

v0.3.0.23
Changed: RAS stats polled every 100ms, icon reflects data direction
Changed: Tooltip auto-scales data kB -> PB, removed transfer rate
Removed: Debugging stuff
Added: Windows version check, doesn't run on less than Vista now
Added: Start with Windows option, (HKCU Run)
Added: Checks for Remote Access Service installation - required for MS PPTP/L2TP VPN connections

v0.3.0.20
Fix: Hopefully reports which connection was disconnected rather than username in the log now
Added: Menu item Quit on Disconnection added, setting is saved to .ini for subsequent starts - obviously the icon needs to be visible to select it
Added: Icon toggles if amount of data Rx/Tx changes, only does this every 500ms - any more often increases CPU load
Added: Tooltip shows data Rx/Tx and rate
Maybe: The event checking has been reduced to 2 seconds - CPU load increases the shorter the interval
3154
Living Room / Re: Geoguessr. I'm addicted.
« Last post by 4wd on May 21, 2013, 09:44 PM »
Here's one, 3 and 5 gave me the most trouble with 5 being a semi-accurate guess, (only 678km away).

Number 4 borders on the DUH!  ;D
3155
Living Room / Re: Geoguessr. I'm addicted.
« Last post by 4wd on May 21, 2013, 09:55 AM »
Just for interests sake on that last puzzle, don't look if you haven't done it:
Spoiler
A) There's a POI, (Place of Interest), sign up the road
B) There a sign with a phone number on the main road, area code + street names give it away
C) Shop names
D) Surf Life Saving Club rooms just up the road, (moment I saw the image I already knew what country) :D
E) There's a pretty obvious POI sign at the intersection

3156
Living Room / Re: Geoguessr. I'm addicted.
« Last post by 4wd on May 21, 2013, 07:33 AM »
so... have you like been everywhere :tellme: :P

Far from it but I kind of look at it the same way as the old TV program Through The Keyholew.

The clues are all there, (one of them I had to travel a fair few kilometers down the virtual road to get one), but it's asking the right questions, (in a search engine in this case), that'll get you a precise location.

It says to "figure out where you are" and I'm sitting in front of the best tool for the job, I'm pretty sure they expect me to use it.  I just look at it as an exercise in logic.
3157
Post New Requests Here / Re: Turn a batch file into an AHK script.
« Last post by 4wd on May 21, 2013, 02:40 AM »
If I create a shortcut to any PPTP/L2TP VPN, in 'properties' they all show the same 'target':
{BA126AD7-2166-11D1-B1D0-00805FC1270E}
I cannot find that anywhere, as a device ID, a file name, or a registry key, so what is it?

It's a CLSID, (Class Identifier), entry in the registry, (look under HKCR\CLSID), for Dial-up Connection Class, ie. the PPTP/L2TP connections are in the same class as dial-up modem connections.

In Network Connections under 'Device Name' all PPTP/L2TP VPN's show 'WAN Miniport'.
Is there a way to 'trigger' from that instead of rasdial?

I looked at that, as well as Network Performance data for the network but couldn't seem to separate out the VPN stuff from normal LAN connection traffic.

However, I have a new program I'm playing with that seems like it might work OK - it'll run all the time and just appear when a VPN connection is active, then hide again when it isn't.

Unfortunately, now my Win8 netbook doesn't want to make VPN connections, so the only things I'll have to test it against are WHS2011 and XP x86, (even though it won't be used on XP, it should still work).
3158
Living Room / Re: Geoguessr. I'm addicted.
« Last post by 4wd on May 21, 2013, 12:11 AM »
2) link

2013-05-21 15_09_36-GeoGuessr - Let's explore the world! - Pale Moon.png

Here's a new challenge -- beat my first try!

2013-05-21 16_19_10-GeoGuessr - Let's explore the world! - Pale Moon.png

I can see I'm going to have to ignore this thread  :-\  ;D

Dammit!!

Couldn't resist...

Challenge URL

2013-05-21 17_20_02-GeoGuessr - Let's explore the world! - Pale Moon.png

This one wasn't too bad, got within 200 meters on all of them I think....definitely have too much free time.
3159
There's no better bushy-tailed tree rat than a dead bushy-tailed tree rat.

Yes there is  ;)

Spoiler
From a mid 20th century English cookbook:


                    SQUIRRELS

    The flesh of squirrels is light red or pink in colour and when young it can be cooked in many ways.  Older squirrels are inclined to be tough and are best pan-broiled.
    The carcase should be skinned and paunched and then cooked whole or cut into halves or smaller joints as desired.  When roasted whole it should be trussed like a rabbit.
   
            Fried Squirrel
    Cut the meat into joints and dip in seasoned flour.  Fry in butter or margarine till tender and well-browned.
   
            Grilled Squirrel
    Sqirrels can be grilled whole.  Split the carcase down from the neck to the tail and flatten on a meat block with a small mallet or rolling-pin.  Season with salt and pepper and brush with melted fat or olive oil.  Place under the hot grill, seal on both sides, and then cook again on both sides till well browned and tender.
   
            Roast Squirrel
    Wash and dress the squirrel, washing in plenty of water.  Brush with melted fat or oil and squeeze on a little lemon juice.  Leave to macerate for about an hour.  Then stuff with a chicken stuffing, to which a few mushrooms and a chopping of chives can be added if desired.  Sew and truss the carcase.
    Roast in a baking tin with a little fat and a rasher or two of bacon placed on the back.  Cook in a slow oven, frequently basting it well.  It should take about 1 to 1.5 hours to cook.
    Serve with thick gravy made with a little Port or Sherry to enrich it.
   
            Stewed Squirrel
    Joint the squirrel and simmer in salted water till the meat is tender.  Remove the flesh from the bones, then crack these and cook them a little longer in the liquid.  Meanwhile, cut the meat into neat pieces and dust with flour.
    Saute some diced celery, carrots and onions in butter and add them to the broth with some rice.  When cooked, add the meat and reheat for about 5 minutes.
   
            Squirrel Pie
    Cook the meat in a little water till it is tender and remove the bones.  Add sliced mushrooms and parsley and a squeeze of lemon juice, thicken the liquid with flour and season carefully.  Cook for 15 minutes.
    Place in a pie-dish, leave to cool and cover with short crust pastry.  Bake till brown, and serve hot.

3160
General Software Discussion / Re: Advice needed on AHK script
« Last post by 4wd on May 18, 2013, 08:42 PM »
I tried it with CleanTray and PPTPchek shut down every time. I then tried it with Terminator and it hung, went back to CleanTray and it was hanging with that as well.

OK, now that's just strange, I'll go back to seeing if I can find another way to check for PPTP/L2TP connections.

In the meantime, your batch file could do with a little rearrangement, (didn't really take notice before  :-[ ).  By rights you should be closing down in the opposite order to the setting up, so:

Code: Text [Select]
  1. netsh interface show interface "Router Connection" | find /i "disabled" >NUL
  2. if errorlevel 1 goto running
  3.  
  4. rem Turning Internet items ON
  5. start /D "C:\Program Files (x86)\D4" D4.exe
  6. start /D "C:\Program Files (x86)\network-activity-indicator" NetworkIndicator.exe
  7. start /D "C:\Program Files (x86)\Sandboxie" SbieCtrl.exe
  8. start /D "C:\Program Files (x86)\PeerBlock" peerblock.exe
  9.  
  10. netsh interface set interface "Router Connection" ENABLED
  11.  
  12. goto alldone
  13.  
  14. :running
  15. rem Internet is ON, turn it all OFF now
  16.  
  17. rasdial /disconnect
  18. netsh interface set interface "OpenVPN Adapter" DISABLED
  19. netsh interface set interface "Router Connection" DISABLED
  20.  
  21. terminator.exe /b peerblock.exe
  22. terminator.exe /c SbieCtrl.exe
  23. terminator.exe /m NetworkIndicator.exe
  24. terminator.exe /m D4.exe
  25.  
  26. :alldone

Also, if Terminator works there shouldn't be a need for CleanTray to be run, soooo, having the VPN disconnection first might be enough of a delay such that by the time Terminator runs, PPTPchek has already exited because the VPN no longer exists.

Anyways, back the PPTPchek drawing board...

3161
General Software Discussion / Re: Advice needed on AHK script
« Last post by 4wd on May 18, 2013, 07:11 AM »
There must be some strange timing issues on your computer, (which don't seem to appear on any of mine), for /m not to work with D4 and NAI occasionally.

I actually tried setting them all to /m before I tried /k but only the /k worked properly.

/m won't work on PeerBlock/SandBoxie because they won't allow other programs to close them, (security measure I presume), therefore it's context menu or just kill them.

No, it was purely cosmetic so that you do not actually see the icon moving.

Yes...well, given your systems fussiness towards things that are too fast....it's set at the second fastest setting.  At the fastest, the mouse gets teleported to the position - exactly what CleanTray does but your system didn't like that.

Oh, forgot, can you try Terminator.exe /c on PeerBlock/SandBoxie again - added a couple of small, (5ms or so), delays into the mix.
3162
General Software Discussion / Re: Advice needed on AHK script
« Last post by 4wd on May 17, 2013, 11:58 AM »
Try terminator.exe /k instead.

12 attempts, worked every time. :Thmbsup: :D

There must be some strange timing issues on your computer, (which don't seem to appear on any of mine), for /m not to work with D4 and NAI occasionally.

Question 1) Is it possible to hide the cursor from showing over the icons?

The cursor is moved over the icon so Windows can remove it, then it gets put back in it's original position, (at least I think I put that part in = I'll check when I wake up).

EDIT: Yep, it's in there - the mouse moves back to wherever it started before the program was invoked.

Are you saying that the mouse stays over the tray icon position after it's already killed the program?

If so, this might be the cause of the inconsistent results with CleanTray/Terminator - something eating mouse movements or the system being abnormally slow to respond, (although I can't think of much that's slower than my Win8Pro Atom N270 netbook with a 4200RPM HDD  :-\ ).

Question 2) Is it possible to create Terminator2 that leaves out NAI (not needed on XP)?

Um, can't you just not have that line in your batch file?

Question 3) When you've answered question 1 any chance of a copy of the code so that I can see if I can translate it into AHK?

Can't wait to see that :D  When I've cleaned up the code a bit.

Question 4) I can edit the 2 AHK programs I put together with Resource Hacker, that doesn't work with Terminator (with the exception of the icons), would that be true of all AutoIt programs?

I have no idea, Terminator was compiled as a CLI program, wasn't designed to be run from the Windows interface.

There's an update to CleanTray and Terminator so try:

CleanTray.exe /pilgrim

and

Terminator.exe /m d4.exe
Terminator.exe /m networkindicator.exe

or

Terminator.exe /b <process>
3163
General Software Discussion / Re: 'Home' and 'End' and 'FN'.
« Last post by 4wd on May 17, 2013, 09:25 AM »
I am trying to avoid adding any extra software to my Netbook and curbing a previously held bad habit at the same time.

If you want to completely avoid running any extra software, your only option is to remap the keyboard, (as IainB has said), using remapkey or some other program, (I've used KeyTweak for years - attached below).

AFAIK, the Fn key on netbook keyboards, (my Aspire One in equivalent to your NC10), is hardware coded/wired within the keyboard - there's no way to get at it short of rewriting the keyboard BIOS or rewiring the keyboard.
3164
General Software Discussion / Re: Advice needed on AHK script
« Last post by 4wd on May 17, 2013, 06:36 AM »
Try terminator.exe /k instead.
3165
General Software Discussion / Re: Advice needed on AHK script
« Last post by 4wd on May 16, 2013, 05:44 AM »
OK, at this point you should de-fiddle your system because those things don't appear unless the mouse has been over the target icon for at least 400ms by default, so this implies you've dropped the delay to almost, (if not), 0.

I just tried manually moving the cursor over the USB SR icon and a 400ms delay seems about right.

Well, in that case I'm stumped as to why you'd be getting the tooltips appearing so quick, I've got Zentimo running and it's menu doesn't appear unless the mouse is stationary over the icon, (or moving very slowly - far slower than CleanTray moves it).

At this point because I can't replicate exactly what you're seeing on any of my machines, (XP x86, Win7 x64, Win8 x86, WHS2011 x64), I'll have to say there's not much more I can do with CleanTray unless someone else can provide a bit more insight.

Looking at the basic script I started from the only figure that I can see that could relate to a delay is the 200?

That's a question for our AHK specialists  ;)

I'll give the new version of Terminator a run and let you know.

Assuming it might work:

Code: Text [Select]
  1. netsh interface show interface "Router Connection" | find /i "disabled" >NUL
  2. if errorlevel 1 goto running
  3.  
  4. rem Turning Internet items ON
  5. start /D "C:\Program Files (x86)\D4" D4.exe
  6. start /D "C:\Program Files (x86)\Sandboxie" SbieCtrl.exe
  7. start /D "C:\Program Files (x86)\PeerBlock" peerblock.exe
  8. start /D "C:\Program Files (x86)\network-activity-indicator" NetworkIndicator.exe
  9.  
  10. netsh interface set interface "Router Connection" ENABLED
  11.  
  12. goto alldone
  13.  
  14. :running
  15. rem Internet is ON, turn it all OFF now
  16. terminator.exe /c peerblock.exe
  17. terminator.exe /c SbieCtrl.exe
  18. terminator.exe /m D4.exe
  19.  
  20. netsh interface set interface "Router Connection" DISABLED
  21.  
  22. netsh interface set interface "OpenVPN Adapter" DISABLED
  23.  
  24. rasdial /disconnect
  25.  
  26. terminator.exe /m NetworkIndicator.exe
  27.  
  28. :alldone

Just out of curiosity where do you put the exe, in the same folder as the batch file, System32?

Anywhere in a path or call it with the full path to it, if it was me I'd try to keep all "foreign" files out of System32 and just put it in the same directory as the batch files, (which you might need to add to the system path).
3166
General Software Discussion / Re: Advice needed on AHK script
« Last post by 4wd on May 15, 2013, 09:51 PM »
    Something I noticed yesterday which has probably been going on all the time is that my Windows 7 PC and my Netbook (XP) both have programs that produce pop-ups when you hold the cursor over the tray icons, on 7 it is USB Safely Remove, on XP it is Battery Monitor, when I run any of the tray cleaning programs the pop-ups appear.

    Although I know it's not you usual program of choice I am wondering if it is possible to prevent the pop-ups appearing when using the AHK script?

    OK, at this point you should de-fiddle your system because those things don't appear unless the mouse has been over the target icon for at least 400ms by default, so this implies you've dropped the delay to almost, (if not), 0.

    I've set mine to 30ms and they don't appear, CleanTray moves the mouse at the fastest speed AutoIt can which takes less than 10ms to traverse an area the width of your SysTray three times.  With the /debug switch it takes ~1.5 seconds to do it.

    Add to the fact that to remove 4 icons it will do a total of 5 cycles, that's 15 runs in total over that area in less than a second.

    Your icons are about 24x24 pixels by the looks, (tray height of 28), a total of about 26 icons: 630 pixels in ~3ms / 26 = ~0.11ms per icon.

    Even with the /debug switch it's ~20ms per icon.

    I set my taskbar the same, (as close as possible), a single row at the bottom with about 28 notification icons, and 4-6 orphaned at the left - in every case CleanTray worked no matter where the taskbar was located, (top, bottom, left, right), or whether it's hidden or not, (provided the icon had no background process).

    I am attaching the tray cleaning program .....

    Doesn't do a thing here, exits immediately.

    Addendum: Since you said Terminator worked for both D4 and NAI I've been playing with it a bit more and you can try this version out.

    Terminator: Terminate a program that has a SysTray icon

    Terminate.exe [/mess] [/context [/test]] [/kill] [/blitz] [/list] <process>
    Where: /mess    - sends a WM_CLOSE message to programs window
               /context - opens the programs SysTray context menu and chooses
                              the last entry (usually Exit/Quit)
               /kill       - kill the process and then remove the SysTray
                              icon
               /blitz     - tries everything
               /list       - list processes with SysTray icons
               /test      - opens the icon context menu and selects the
                              last item but doesn't activate it
                              (only valid with /context switch)

    The switches can be abbreviated to the first character, ie. /l, /t, /m, /c, /k

    If you put multiple methods on the command line it'll only do one in this order: message, context menu and finally kill.

    eg. Terminator.exe /kill /context peerblock.exe will use the context menu to try and close peerblock.exe

    NOTES:
    • Only works with programs that have a SysTray icon
    • Only works with programs that don't open a modal requester, (currently), ie. "Are you sure?"
    • Not sure if it will work for the hidden icon area in Vista+

    So in your case you could try:

    terminator.exe /m d4.exe
    terminator.exe /m networkindicator.exe
    terminator.exe /c peerblock.exe
    terminator.exe /c sbiectrl.exe

    It doesn't do anything that's OS unfriendly, (/k does the same thing as taskkill), tested it here on Win7 on various tray dwelling programs, (but only for D4, NAI and PeerBlock in your specific case), and it seemed to work OK - system didn't crash, all my drives still seem to be full of junk.

    I'm sure one of the other programmers here could come up with something a lot nicer  :D

    UPDATE:
    • Tries sending WM_CLOSE 5 times at 5ms intervals, (the Pilgrim factor)
    • Added /blitz option

    Source added to archive 20130523
    3167
    SoftPerfect Network Scanner

    C:\> netscan.exe /hide /auto:"c:\desktop\result.csv"

    As it says right in the docs ;)

    Just add it as a scheduled task to Windows.
    3168
    General Software Discussion / Re: Advice needed on AHK script
    « Last post by 4wd on May 13, 2013, 01:38 AM »
    I just possibly realised why both the AHK and my efforts weren't quite there.

    When the mouse runs over the icons Windows removes them if there's no underlying process, it then updates the following icon positions even though the display might not as yet changed.  So even though the mouse appears to run over a position where an icon is, it's not really in that position - it's been moved.

    Hey, it's a theory...it explains why both the AHK script and CleanTray need to run multiple times if they're just moving the mouse around.

    It also only seems to happen if the icons are situated next to each other, if they are separated by other non-orphaned icons then the slight delay as the cursor travels over them appears to be enough to allow the Notification Area to "settle" into it's new state after an icon removal.

    So it all comes down to a matter of timing....

    You can test this by doing CleanTray /once and CleanTray /debug /once, the /debug now adds a slight delay so you can watch the mouse move, (so I could check the movement borders), and the /once means it only runs through the cycle once.

    With /debug there's enough of a delay for everything to update so that everything completes in a single cycle, (at least on my Phenom x6).

    New version up there, default is it moves the mouse at fastest speed and multiple times if the number of icons reduces between runs.

    Could you give /m switch a try as no matter how many times I used it, it didn't lose icon positions and it's a lot faster if there's multiple icons to remove.

    Just as a matter of interest, I couldn't get the AHK script to work at all, (however it did generate some orphaned icons for me to nuke since I had to kill their tasks  ;D ).

    Now I'll go back to playing with Terminator since avoiding the problem in the first place is always a better solution ;)
    3169
    General Software Discussion / Re: Advice needed on AHK script
    « Last post by 4wd on May 12, 2013, 08:31 AM »
    Where, and how, do I get the debug results? :-[

    I tried it in the cmd window and it wasn't recognised.

    More and more I start to wonder about your system  :)

    You are using cleantray 0.1.0.0, (Properties on the executable) ?

    And if so, you should get something like:

    2013-05-12 23_27_46-Administrator_ C__Windows_system32_cmd.exe.png
    3170
    General Software Discussion / Re: Advice needed on AHK script
    « Last post by 4wd on May 12, 2013, 06:35 AM »
    What I did get was a lot of context menus left open including one for the next icon in line that is running all the time and one for the taskbar itself?

    Probably need to fine tune it's positioning.

    CleanTray.exe - Only removes the icon furthest to the left.

    cleantray /debug and attach the results thanks.
    3171
    General Software Discussion / Re: Trying to find icon location.
    « Last post by 4wd on May 12, 2013, 03:36 AM »
    It appears in C:\Windows\SysWOW64 in netcenter.dll and netshell.dll but when you go to view it in iconsext it changes.

    eg.

    2013-05-12 18_29_23-Select a file for icons extraction.png

    2013-05-12 18_29_43-IconsExtract_   C__Windows_SysWOW64_netcenter.dll.png

    Ah, it's a multi-image icon, just extract it and step through the various images within it.
    3172
    General Software Discussion / Re: Advice needed on AHK script
    « Last post by 4wd on May 11, 2013, 07:19 AM »
    "Arnie" never moved anything.  :(

    It doesn't "move" anything, all it does is send a WM_CLOSE message to the process, (which worked 100% of the time for D4 here), and if that failed it went to the tray icon, opened it's menu and chose the last item, (normally Exit/Quit - that had a ~95% success rate on the other two programs).  ie. You use it to end the processes instead of taskkill.

    I asked you before about how the various scripts were different, does the AHK script in reply 1 translate into AutoIt or is that what you have been trying?

    Tested on XP x86, Win7 x64 and Win8 x86, (medium, high and low spec hardware respectively).

    CLI use only.

    CleanTray: Clears orphaned icons from Notification Area

    CleanTray.exe [/debug] [/once] [/timer] [/mensa] [/nuke]
    Where: /debug - outputs debug information to the console
               /once  - only runs over the Notification Area once (only valid for default method)
               /timer - displays time taken at the end
               /mensa - only moves mouse to orphaned icons
               /nuke  - blitzes the tray using system calls (icon positions will be lost)
               /pilgrim - adds a 1ms delay between mouse movements

    Default method is to traverse the tray using the mouse.

    The default method is the slowest if there is more than one icon to remove and /mensa has priority over /nuke if you happen to enter both on the command line.

    Code: AutoIt [Select]
    1. #NoTrayIcon
    2. #region ;**** Directives created by AutoIt3Wrapper_GUI ****
    3. #AutoIt3Wrapper_UseUpx=n
    4. #AutoIt3Wrapper_Change2CUI=y
    5. #AutoIt3Wrapper_Res_Fileversion=0.2.0.20
    6. #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
    7. #endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
    8.  
    9. #include <Array.au3>
    10. #include <_SysTray.au3>
    11. #include <_OsVersionInfo.au3>
    12.  
    13. Global $debug = False, $once = False, $timer = False, $method = 0, $pilgrim = False
    14.  
    15. If $CmdLine[0] > 0 Then
    16.         For $i = 1 To $CmdLine[0]
    17.                 Switch StringLower(StringStripWS($CmdLine[$i], 8))
    18.                         Case "/debug", "/d"
    19.                                 $debug = True
    20.                         Case "/once", "/o"
    21.                                 $once = True
    22.                         Case "/timer", "/t"
    23.                                 $timer = True
    24.                         Case "/mensa", "/m"
    25.                                 $method = 1
    26.                         Case "/nuke", "/n"
    27.                                 If $method <> 1 Then $method = 2
    28.                         Case "/pilgrim", "/p"
    29.                                 $pilgrim = True
    30.                         Case Else
    31.                                 _DisplayUsage()
    32.                                 Exit
    33.                 EndSwitch
    34.         Next
    35.  
    36. Global $posTray = WinGetPos(_FindTrayToolbarWindow()) ; find the tray
    37. If $method <> 2 Then
    38.         $oldPos = MouseGetPos() ; save mouse position
    39.         MouseMove($posTray[0], $posTray[1], 0) ; move mouse to tray
    40.         WinWait("[CLASS:Shell_TrayWnd]", "", 5) ; wait for the tray to open if hidden
    41.  
    42. If $debug Then
    43.         ConsoleWrite("Desktop Width: " & @DesktopWidth & @CRLF & "Desktop Height: " & @DesktopHeight & @CRLF)
    44.         ConsoleWrite("Notification area dimensions: " & _ArrayToString($posTray, ",") & @CRLF)
    45.         $delay = 1
    46.         $delay = 0
    47.  
    48. If $timer Then $start = TimerInit()
    49. Switch $method
    50.         Case 0
    51.                 $count = 1
    52.                 $ret = 0
    53.                 $j = 0
    54.                 While $count <> $ret
    55.                         $j += 1
    56.                         $count = _SysTrayIconCount()
    57.                         $ret = _SeeYouNextYear()
    58.                         If $once Then ExitLoop
    59.                 WEnd
    60.         Case 1
    61.                 _TharHeIsGetIm()
    62.         Case 2
    63.                 _NukeEmAll()
    64.         Case Else
    65. If $timer Then ConsoleWrite("Time: " & Round(TimerDiff($start) / 1000, 2) & " seconds")
    66. If $method <> 2 Then MouseMove($oldPos[0], $oldPos[1], 0) ; move mouse back where it came from
    67.  
    68. Func _DisplayUsage()
    69.         Local $data = "CleanTray: Clears orphaned icons from Notification Area" & @CRLF & @CRLF & _
    70.                         "CleanTray.exe [/debug] [/once] [/timer] [/mensa] [/nuke]" & @CRLF & _
    71.                         "Where: /debug - outputs debug information to the console" & @CRLF & _
    72.                         "       /once  - only runs over the Notification Area once" & @CRLF & _
    73.                         "                (only valid for default method)" & @CRLF & _
    74.                         "       /timer - displays time taken at the end" & @CRLF & _
    75.                         "       /mensa - only moves mouse to orphaned icons" & @CRLF & _
    76.                         "       /nuke  - blitzes the tray using system calls" & @CRLF & _
    77.                         "                (icon positions will be lost)" & @CRLF & _
    78.                         "Default method is to traverse the tray using the mouse." & @CRLF
    79.         ConsoleWrite($data)
    80. EndFunc   ;==>_DisplayUsage
    81.  
    82. Func _SeeYouNextYear()
    83.         If $posTray[0] >= @DesktopWidth Then $posTray[0] = @DesktopWidth - $posTray[2]
    84.         If $posTray[1] >= @DesktopHeight Then $posTray[1] = @DesktopHeight - $posTray[3]
    85.         If $posTray[0] < 0 Then $posTray[0] = 0
    86.         If $posTray[1] < 0 Then $posTray[1] = 0
    87.         Local $y = $posTray[1]
    88.         While $y < $posTray[3] + $posTray[1]
    89.                 Local $x = $posTray[0]
    90.                 While $x < $posTray[2] + $posTray[0]
    91.                         MouseMove($x, $y, $delay)
    92.                         If $pilgrim Then Sleep(1)
    93.                         If $debug Then ConsoleWrite($x & ',' & $y & @CRLF)
    94.                         $x += 12
    95.                 WEnd
    96.                 $y += 12
    97.         WEnd
    98.         Return _SysTrayIconCount()
    99. EndFunc   ;==>_SeeYouNextYear
    100.  
    101. Func _TharHeIsGetIm()
    102.         $flag = False
    103.         Local $count = _SysTrayIconCount() ; get number of icons in tray
    104.         For $i = $count - 1 To 0 Step -1 ; step backwards through the list
    105.                 Local $handle = _SysTrayIconHandle($i) ; get handle of the icon
    106.                 Local $pid = WinGetProcess($handle) ; get process ID for ithe handle
    107.                 If $pid = -1 Then ; if no process then
    108.                         Local $iPos = _SysTrayIconPos($i) ; get icon position
    109.                         MouseMove($iPos[0], $iPos[1], $delay) ; move mouse there
    110.                         If $debug Then ConsoleWrite($iPos[0] & ',' & $iPos[1] & @CRLF)
    111.                         If _SysTrayIconCount() < $count Then ; if number of icons has reduced, set flag and exit for/next loop
    112.                                 $flag = True
    113.                                 ExitLoop
    114.                         EndIf
    115.                 EndIf
    116.         Next
    117.         If $flag Then _TharHeIsGetIm() ; if flag set call func again (a little pseudo-recursion)
    118.         MouseMove($oldPos[0], $oldPos[1], 0) ; move mouse back where it came from
    119. EndFunc   ;==>_TharHeIsGetIm
    120.  
    121. Func _NukeEmAll()
    122.         $count = _SysTrayIconCount()
    123.         For $i = $count - 1 To 0 Step -1
    124.                 $handle = _SysTrayIconHandle($i)
    125.                 $pid = WinGetProcess($handle)
    126.                 If $pid = -1 Then _SysTrayIconRemove($i)
    127.         Next
    128.  
    129.         If _OsVersionTest($VER_GREATER_EQUAL, 6, 1) Then
    130.                 $countwin7 = _SysTrayIconCount(2)
    131.                 For $i = $countwin7 - 1 To 0 Step -1
    132.                         $handle = _SysTrayIconHandle($i, 2)
    133.                         $pid = WinGetProcess($handle)
    134.                         If $pid = -1 Then _SysTrayIconRemove($i, 2)
    135.                 Next
    136.         EndIf
    137. EndFunc   ;==>_NukeEmAll
    3173
    Post New Requests Here / Re: Turn a batch file into an AHK script.
    « Last post by 4wd on May 11, 2013, 02:32 AM »
    Or perhaps right-click on the icon and select Exit?  ;)

    In spite of my fast approaching senility that was the first thing I looked at. :D  No context menu on the icon when this happens!
    I also tried a couple of the options we have come up with for cleaning the tray, nothing worked so it would seem the icon is not orphaned.

    Only thing I can think of is you happening to use rasdial, (to disconnect), at the same instant PPTPchek wants to use it.  I'll put a simple check in to delay PPTPchek if the radial.exe process exists, I've also changed the delay to 2 seconds.

    Give it a try and let me know, I'm still looking at another way to get PPTP VPN status that isn't so "hacky".

    I have used these connections for several years without a problem and nothing in my set up has been changed.
    If the router is passing other PPTP connections it can't be that and the same applies to the firewall and AV.

    Can you think of anything I've missed?

    Sorry, can't help you as I rarely use VPNs - closest I get is over a SSH tunnel to my VPS.
    No PPTP VPN will work on my Win7 machine currently, (time to reinstall), but a SSH tunnel is damn near bulletproof.

    That's why my testing is only on my WHS machine atm.
    3174
    Living Room / Re: Strange Pyramid
    « Last post by 4wd on May 11, 2013, 12:51 AM »
    The pyramid is an advanced bio-digester and therefore the cause of the methane gas pockets*.







    * And thus the cause of the depleted marine life.
    3175
    General Software Discussion / Re: Advice needed on AHK script
    « Last post by 4wd on May 09, 2013, 07:03 AM »
    I've given up - your system is just plain weird.  :D

    However, a little something for you to try just for the fun of it:

    In theory, no left over icons because the programs are cleanly shut down.

    I've only tested with those 3 programs so who knows what else can happen.

    BTW, why do you run a separate time service?

    You could just run w32tm /resync if you want to synchronise your system clock - one less program to kill badly :)
    Pages: prev1 ... 122 123 124 125 126 [127] 128 129 130 131 132 ... 225next