m7j4p7 Posted January 1, 2004 Posted January 1, 2004 Hi, Our Network Admins like to be able to see what students are doing whilst they are logged on. Using vb, can I write a program which will allow the Admins to be able to view on their screens what the student is viewing on theirs. I.E. The student opens Word and types 'Hello World.' At the same time, I want an Admin to be able to open a window which looks like the students. - Word opened with 'Hello World'. Do you get what I mean? The Admin is monitoring the student by seeing exactly what they see from their terminal? Sorry for more long-windedness (see some of my other posts!) Thanks, Quote :) Mike :) He who has a secret, must keep it secret he has a secret to keep......
AndreRyan Posted January 2, 2004 Posted January 2, 2004 You can use APIs to take a screenshot and then send it using a socket to the "Admin" computer. The APIs you'll need are:Declare Function GetDesktopWindow Lib "user32.dll" () As IntPtr Declare Function GetDC Lib "user32.dll" (ByVal hwnd As IntPtr) As IntPtr Declare Function ReleaseDC Lib "user32.dll" (ByVal hwnd As IntPtr, ByVal hdc As IntPtr) As Int32 Declare Function BitBlt Lib "gdi32.dll" (ByVal hDestDC As IntPtr, ByVal x As Int32, ByVal y As Int32, _ ByVal nWidth As Int32, ByVal nHeight As Int32, ByVal hSrcDC As IntPtr, ByVal xSrc As Int32, _ ByVal ySrc As Int32, ByVal dwRop As Int32) As Int32 I haven't got a working code sample at the moment, I can make one if you need it Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
m7j4p7 Posted January 2, 2004 Author Posted January 2, 2004 I haven't got a working code sample at the moment, I can make one if you need it Would you? I am a little bit miffed! Quote :) Mike :) He who has a secret, must keep it secret he has a secret to keep......
decrypt Posted January 4, 2004 Posted January 4, 2004 Wouldn't this be like a remote administrative tool? Quote
AndreRyan Posted January 5, 2004 Posted January 5, 2004 To get the screenshot using the APIs: Public Function GetDesktopScreenshot() As Bitmap Dim Desk, DeskDC, BitmapDC As IntPtr Dim Pic As Bitmap, PicDraw As Graphics 'Make a Bitmap the same size as the screen Pic = New Bitmap(Screen.Bounds.Width, Screen.Bounds.Height, PixelFormat.Format16bppRgb565) PicDraw = Graphics.FromImage(Pic) 'Get a Graphics Object BitmapDC = PicDraw.GetHdc() 'Get a hDC from the Graphics Object Desk = GetDesktopWindow() 'Get the desktop hWnd DeskDC = GetDC(Desk) 'Get a hDC for the desktop 'Copy the desktop to the picture BitBlt(BitmapDC, 0, 0, Screen.Bounds.Width, Screen.Bounds.Height, DeskDC, 0, 0, &HCC0020) ReleaseDC Desk, DeskDC 'Release the Desktop hDC PicDraw.ReleaseDC(BitmapDC) 'Release the Bitmap hDC PicDraw.Dispose() 'Dispose the Graphic object Return Pic End FunctionThe above code isn't tested so tell me if there doesn't work. The easiest way to send the picture would be to save it and read it in again as a string, but it uses less resources and can be reassembled faster at the other end if you just lock it and read the bitmap data in raw and send it. Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
m7j4p7 Posted January 11, 2004 Author Posted January 11, 2004 Wouldn't this be like a remote administrative tool? Yes, it is a remote admin. tool. Quote :) Mike :) He who has a secret, must keep it secret he has a secret to keep......
Administrators PlausiblyDamp Posted January 11, 2004 Administrators Posted January 11, 2004 Would it not be easier to use an existing tool like VNC? http://www.realvnc.com/ Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
m7j4p7 Posted January 16, 2004 Author Posted January 16, 2004 Good point! I would like, however, to integrate this with some other bits and pieces I am writing. However, the source of VNC might give me some starting points! ;) Quote :) Mike :) He who has a secret, must keep it secret he has a secret to keep......
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.