@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: This allows you to communicate with a print monitor !!!!C# Signature: [DllImport("winspool.drv", SetLastError=true)] static extern bool XcvData(IntPtr hXcv, [MarshalAs(UnmanagedType.LPWStr)] string pszDataName, IntPtr InputData, uint cbInputData, IntPtr OutputData, uint cbOutputData,out uint cbOutputNeeded,out uint dwStatus); !!!!VB Signature: Declare Function XcvData Lib "winspool.drv" (TODO) As TODO !!!!User-Defined Types: [PRINTER_DEFAULTS] !!!!Notes: None. !!!!Sample Code: const uint SERVER_ACCESS_ADMINISTER = 0x00000001; string szIPAddress=""; string xcvName = String.Format(",XcvPort {0}", portName); IntPtr buf= Marshal.AllocHGlobal(256); IntPtr hXcv = IntPtr.Zero; PRINTER_DEFAULTS Defaults = new PRINTER_DEFAULTS(); Defaults.pDatatype = 0 ; Defaults.pDevMode = 0; Defaults.DesiredAccess = SERVER_ACCESS_ADMINISTER; // Handle to a local machine if (OpenPrinter(xcvName,out hXcv, ref Defaults )) { uint cbOutputNeeded; uint dwStatus; // hXvc contains an Xcv data handle to a local TCPMON port if (XcvData(hXcv, "IPAddress", IntPtr.Zero, 0, buf, 256, out cbOutputNeeded, out dwStatus)) { szIPAddress= Marshal.PtrToStringAuto(buf); Console.Write(szRet); } } ClosePrinter(hXcv); if (buf != IntPtr.Zero) Marshal.FreeHGlobal(buf); Documentation: XcvData@msdn on MSDN Documentation: TCPMON Xcv Commands on MSDN http://msdn.microsoft.com/en-us/library/ms802169.aspx
Edit winspool.XcvData
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.