|
I am writing an app where I need to monitor each machine on the network (realtime). I need MAC address, IP address, Machine name and description. And instant information when a machine enters/leaves the network (including wireless connectivity attempts).
I have found some samples on the net which gives me an idea on how to approach the problem, but they are incomplete and look quite complex . And there seem to be no realtime monitoring. Note that I do NOT have the possibility to install any software on any of the machines being monitored. One machine will run my app, and that's it.
Can anybody point me in the right direction? Is there an easy way?
Thank you in advance.
HS
|
|
|
|
|
er... read the WM_SIZE docs:-
CWnd::OnSize
afx_msg void OnSize( UINT nType, int cx, int cy );
Parameters
nType
Specifies the type of resizing requested. This parameter can be one of the following values:
SIZE_MAXIMIZED Window has been maximized.
SIZE_MINIMIZED Window has been minimized.
SIZE_RESTORED Window has been resized, but neither SIZE_MINIMIZED nor SIZE_MAXIMIZED applies.
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
Pretty simple - I use:
ShellExecute() to spawn another application. I use this function because it allows me to specify the directory for spawned application.
Now I need to wait for the application to terminate (In fact i would like to spawn it in synchronous mode because I just want to spawn it and wait for it's termination.
Is there any function that allows me to check if the application is still running using the HINSTANCE returned by ShellExecute ?
Or perhaps there is another, easy way to spawn an application in synchronous mode, that does not need any loops checking application's state? (that will eliminate senseless processor usage).
Thanks in advance for any suggestions.
[ CoY0te ]
Railgun is like a Gilette Mach 3 - it does the job with one, easy stroke.
|
|
|
|
|
Use ShellExecuteEx. It gives you back the handle of spawned process, ready to use with WaitForSingleObject.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Thank You. Easy as 1..2..3
[ CoY0te ]
Railgun is like a Gilette Mach 3 - it does the job with one, easy stroke.
|
|
|
|
|
On the same subject I have a question to ask. I have a parent application from which I would like to spawn other applications such that the other applications do not show up on the taskbar and that they can be terminated by the parent. I think the termination part maybe be easy but not sure about the taskbar part.
The spawned applications are not mine, so how they work is not under my control.
|
|
|
|
|
|
If the spawned apps do not need to be visible for the user and you are on NT, you could just run them on a different desktop. This is the way the system uses to ensure that service processes are not used interactive.
I have never tested it on myself, but AFAIK all you have to do is to pass a new desktop and maybe also a new window station name in the lpDesktop param of STARTUPINFO. If the desktop does not exist yet, the system creates it for you.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
May be, this example will help you. Sorry i have no time to explain what does it mean. I hope, you will get it
<br />
.....<br />
STARTUPINFO si={0};<br />
si.cb = sizeof(si);<br />
si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;<br />
si.wShowWindow = SW_HIDE; <<-------- Here we hide window<br />
si.hStdOutput = hWrite;<br />
si.hStdError = hWrite;<br />
PROCESS_INFORMATION pi;<br />
<br />
CreateProcess (szCompilerName,szCommandLine,<br />
NULL,NULL,true,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi)<br />
<br />
<br />
|
|
|
|
|
for simple applications or commands I use C's system() function. You can also look into the _exec* functions. But the system() function is generally good enough.
example:
system("notepad.exe");
system("copy c:\myfile.txt c:\backup\myfile.txt");
|
|
|
|
|
I'll keep that in mind.
These functions might be useful, allthough they do not allow You to specify the work directory for an application.
Thank You.
[ CoY0te ]
Railgun is like a Gilette Mach 3 - it does the job with one, easy stroke.
|
|
|
|
|
That is correct,
it defaults to the parent process's current directory. But I beleive u can do this:
system("CD c:\my-start-up-dir");
system("notepad test.txt");
this would open the file c:\my-start-up-dir\test.txt
|
|
|
|
|
Hi,
i'm working on the desing of my application and i would like to have my ListCtrls Headers in blue instead of the windows gray, how can i change it?
I checked the SetColumn function with the struct _LVCOLUMN, but i don't fit to my intents, should i use a appropriate class for the effect, maybe derived from CHeaderCtrl?
Thank you in advance
|
|
|
|
|
Header controls support custom draw. This is your chance...
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Well, thank you Tomasz but, i'm kind of new using ListCtrls and to VC++, how exactly should i do this?
|
|
|
|
|
You'll need to handle NM_CUSTOMDRAW notification for header control. For a start, check articles in listview section of CP - they demonstrate how to use custom draw for list itself. I've searched the articles for example of custom-drawn header, but it seems there aren't any yet.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
BTW: there's another technique you could use - owner draw. In this case, you'd have to subclass the header control and override the CHeaderCtrl::DrawItem method.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
I was out to luch, i'll try those, thank you very much
|
|
|
|
|
Hi,
I have some owner drawn buttons, for which the double click event is not working. I have a bitmap for the pushed event and another bitmap when the button is not pushed. So the pushed bitmap is displayed when the item state of my owner drawn button is ODS_SELECTED, and the other bitmap when it is not selected. I have used StretchBlt() function to display the bitmaps. The problem is, my button is not getting selected sometimes. Moreover double click is not working for my button. I have used only WIN API programming. Can anybody give me a solution for this using WIN API? Please dont give me the solution in MFC.
dummyname.
|
|
|
|
|
Can any one tell me about the scalability of Instant Messaging server running on a single machine. Just consider a machine with single processor nearby 1Ghz and 1GB RAM, or any other configuration you experienced.
I want to know the maximum number of clients feasible for the server to handle ????
|
|
|
|
|
You have to give us more information before we could even hope to give you a reasonable guestimate. The number of clients supported will depend on the OS, the application-level protocol (how fat the packets are), the transport protocol (i.e. whether UDP or TCP) and what kind of processing the backend will have to do.
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
Brian Azzopardi wrote:
The number of clients supported will depend on the OS,
Windows 2000
Brian Azzopardi wrote:
how fat the packets are
Infact Instant messaging server has small packets.
Brian Azzopardi wrote:
the transport protocol (i.e. whether UDP or TCP)
We use TCP
|
|
|
|
|
IM newbie developer wrote:
Windows 2000
Hehe! Good luck. If you insist on using Win2k use either Win2K Server or Win2K Advanced Server. Their net code (as the name implies) is tuned for server stuff.
IM newbie developer wrote:
Infact Instant messaging server has small packets
Not necesarily. Depends on what features you want to support. But generally yes the packets are small. Analyse the traffic patterns.
IM newbie developer wrote:
We use TCP
Bad idea. Use UDP as it consumes less bandwidth and also uses much less resources server-side. Using UDP you can support much more connections, the limiting factor being the CPU and the network pipe.
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
Hi Friends,
I'm facing some problem while creating a region from the path that is selected in the given device context.
I'm doing following steps
1. Getting the DC
2. Set the font size and background mode
3. Call beginpath
4. Call the text out method
5. Calling the endpath
6. making a call to CreateFromPath
Now if I use any other function like say rect or ellipse then CreateFromPath() gives me a valid region but if I use the textout it gives me a null region I'm unable to figure it out..
it would be great if anyone can help me out...
Thanks
Nilesh
|
|
|
|
|
Actually I can't understand what for you need to convert some text into a path But it seems to me that each letter of your text is a subpath and you should close each subpathwith the help of CloseFigure function. (Petzold "Programming Windows 95", Chapter 4)
Hope this helps
|
|
|
|