ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: Wireless sensor

<< < (4/11) > >>

techidave:
4wd, I will look at the CNS in the morning.  I  actually have a laptop with a new XP install that I can try it on.  I can always reghost it if things go south on me.

Joker, I am not sure what your template is like but am willing to give it a whirl.

To answer a previous post, yes I can have it ping a firewall or whatever.

All of our laptops are on DHCP.

4wd:
techidave, could you tell me what OS' the laptops are running, (XP, Vista, Home, Pro, etc) ?

Getting it to actually display something on the logon screen might be a right b!tch  :wallbash:

Stoic Joker:
Joker, I am not sure what your template is like but am willing to give it a whirl.-techidave (December 16, 2010, 08:36 PM)
--- End quote ---

The template is just the source code for a roll-your-own Windows System Service. The compiled version in the download just beeps every X seconds (which isn't really useful in and of itself). But (it's a demo) the included source code is a complete (self installing & uninstalling) Windows service framework which is well commented to make it easy to modify for other purposes. Just replace the beep code and variables with the work & values needed, compile, and you're done.

Windows Service Template.rar (78.99 kB - downloaded 451 times.)

@4wd - IIRC, all the service will need is the interact with desktop right which is configurable (if need be) in Services.msc

4wd:
Thanks SJ, I was hoping not to have to make it a service and use the Group Policy Editor to specify a Startup script - which should mean it's running before a user logs in and is a bit nicer installation-wise.

Of course you need the Pro versions of Windows to get the Group Policy Editor and it seems to run OK this way except for a lack of SysTray icon when explorer.exe finally comes up.

EDIT: I've modified the AutoIt script above because my check for ARP output was too long, (only 20 chars output compared to wired), for wireless and it also includes a simple check for explorer.exe, which isn't running before logon, to swap between a Tooltip in the upper left corner and a SysTray icon.

It's had a name change to NetCheck.

Status at the moment:
1) Runs at Startup.
2) Displays a Tooltip on the logon screen with network status - I can't test whether it has connected since it doesn't connect until I've logged on here, (just a LAN network).
3) Hotkey exit, (currently Shift+Alt+\), which can be set in the ini file.
4) Detects whether Explorer.exe is running and turns off the Tooltip - ie. user has logged in.

The only thing left is trying to get the SysTray icon to turn on - maybe I need to put a delay in between detection of explorer.exe and turning it on?  Ideas anyone?

Just had a thought, I couldn't find anywhere after a quick search, what is set as the default directory when you run something from Group Policy Startup?  The directory where the executable is or something else?

Anyway, it looks favourable except for the icon at the moment, so if you can get by without it then I guess it can be considered working.  Although it's really going to urk me if I can't find the problem, (the technician coming to the fore  >:( ).

EDIT2: Argh!  The Tooltip doesn't come back when you log off  :wallbash:

Stoic Joker:
2) Displays a Tooltip on the logon screen with network status - I can't test whether it has connected since it doesn't connect until I've logged on here, (just a LAN network).-4wd (December 17, 2010, 04:54 PM)
--- End quote ---

I could be missing something, but couldn't you just start the comp with the network cable unpluged, then plug it in to see the status change? The media connection state change is (basically) the same wired vs. WiFi.

The only thing left is trying to get the SysTray icon to turn on - maybe I need to put a delay in between detection of explorer.exe and turning it on?  Ideas anyone?-4wd (December 17, 2010, 04:54 PM)
--- End quote ---

The following snippet is from T-Clock, it checks for a valid system tray/clock window handle before the hook is inserted. A stripped down version should be just what you're after:

--- Code: C++ ---// find the clock window  hwndChild = GetWindow(hwndBar, GW_CHILD);  while(hwndChild) {                GetClassName(hwndChild, classname, 80);                if(lstrcmpi(classname, "TrayNotifyWnd") == 0) {                   hwndChild = GetWindow(hwndChild, GW_CHILD);                   while(hwndChild) {                                 GetClassName(hwndChild, classname, 80);                                 if(lstrcmpi(classname, "TrayClockWClass") == 0) {                                        SendMessage(hwndChild, WM_NULL, 0, 0);                                        break;                                 }                   } break;                }         hwndChild = GetWindow(hwndChild, GW_HWNDNEXT);  }
Actually this might be the shorter way you need:

--- Code: C++ ---// refresh the taskbar  hwnd = FindWindow("Shell_TrayWnd", NULL);  if(hwnd) {         PostMessage(hwnd, WM_SIZE, SIZE_RESTORED, 0);         InvalidateRect(hwnd, NULL, TRUE);  }
...If tray handle is valid, you're gold.


Just had a thought, I couldn't find anywhere after a quick search, what is set as the default directory when you run something from Group Policy Startup?  The directory where the executable is or something else?-4wd (December 17, 2010, 04:54 PM)
--- End quote ---

Something tells me I should know that...  :-[ ...Just use full path in script as it tends to be safer anyhow.

EDIT2: Argh!  The Tooltip doesn't come back when you log off  :wallbash:-4wd (December 17, 2010, 04:54 PM)
--- End quote ---

Relaunch with logoff script?

Actually, after the machine has been logged on and then off, you really don't need a status indicator...If the users are told not to try logging in when the logon-not-available light is lit.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version