Click here to Skip to main content
15,885,216 members
Home / Discussions / C#
   

C#

 
GeneralRe: Hide the command window Pin
Dave Kreskowiak25-Apr-05 8:25
mveDave Kreskowiak25-Apr-05 8:25 
GeneralRe: Hide the command window Pin
Sheela Krishnan25-Apr-05 11:20
Sheela Krishnan25-Apr-05 11:20 
GeneralAbout Resource File Pin
SAMURAI-MAN25-Apr-05 5:35
SAMURAI-MAN25-Apr-05 5:35 
GeneralOpening a specified folder; double-clickon system tray icon Pin
Anonymous25-Apr-05 5:33
Anonymous25-Apr-05 5:33 
GeneralRe: Opening a specified folder; double-clickon system tray icon Pin
Polis Pilavas25-Apr-05 8:53
Polis Pilavas25-Apr-05 8:53 
GeneralRe: Opening a specified folder; double-clickon system tray icon Pin
mav.northwind25-Apr-05 20:24
mav.northwind25-Apr-05 20:24 
GeneralExport generated data to database. Pin
StoneWolfSoft25-Apr-05 5:22
StoneWolfSoft25-Apr-05 5:22 
GeneralObject reference not set to an instance of an object. On Marshal.PtrToStructure Method Pin
mrxero25-Apr-05 4:44
mrxero25-Apr-05 4:44 
[StructLayout(LayoutKind.Sequential)]
public struct JOB_INFO_1
{
public long JobId;
[MarshalAs(UnmanagedType.LPTStr)]public string pPrinterName;
[MarshalAs(UnmanagedType.LPTStr)]public string pMachineName;
[MarshalAs(UnmanagedType.LPTStr)]public string pUserName;
[MarshalAs(UnmanagedType.LPTStr)]public string pDocument;
[MarshalAs(UnmanagedType.LPTStr)]public string pDatatype;
//public string pStatus;
[MarshalAs(UnmanagedType.LPTStr)] public string pStatus;
public long Status;
public long Priority;
public long Position;
public long TotalPages;
public long PagesPrinted;
public SYSTEMTIME Submitted;
}

[StructLayout(LayoutKind.Sequential)]
public struct SYSTEMTIME
{
public int wYear;
public int wMonth;
public int wDayOfWeek;
public int wDay;
public int wHour;
public int wMinute;
public int wSecond;
public int wMilliseconds;
}

[DllImport("winspool.drv", CharSet=CharSet.Auto)]
public static extern bool OpenPrinter( string pPrinterName, out IntPtr
phPrinter, IntPtr pDefault );

[DllImport("winspool.drv", CharSet=CharSet.Auto)]
public static extern bool ClosePrinter( IntPtr hPrinter);// handle to printer


[DllImport("winspool.drv", CharSet=CharSet.Auto)]
public static extern int EnumJobs( IntPtr hPrinter, int FirstJob, int
NoJobs, int Level, IntPtr pInfo, int cdBuf, out int pcbNeeded, out int
pcReturned);

[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)]
public void JobsInPrinter(string Printer)
{
IntPtr handle;
int FromJob = 0;
int ToJobs = 100;
int pcbNeeded;
int pcReturned;

// open printer
OpenPrinter (Printer, out handle, IntPtr.Zero );

// get num bytes required
EnumJobs ( handle, FromJob, ToJobs, 1, IntPtr.Zero, 0, out pcbNeeded, out pcReturned);

if(pcbNeeded > 0)
{
// allocate unmanaged memory
IntPtr pData = Marshal.AllocHGlobal ( pcbNeeded );

// get structs
EnumJobs ( handle, FromJob,ToJobs, 1, pData, pcbNeeded, out pcbNeeded, out pcReturned);

// create array of managed job structs
JOB_INFO_1 [] jobs = new JOB_INFO_1[pcReturned];

// marshal struct to managed
int pTemp = pData.ToInt32(); //start pointer

for (int i=0; i
GeneralSaving socket connection information Pin
CheckDude25-Apr-05 4:27
CheckDude25-Apr-05 4:27 
GeneralRe: Saving socket connection information Pin
S. Senthil Kumar26-Apr-05 2:31
S. Senthil Kumar26-Apr-05 2:31 
GeneralRe: Saving socket connection information Pin
CheckDude10-May-05 5:59
CheckDude10-May-05 5:59 
GeneralGet Button Pin
The underdog25-Apr-05 2:51
The underdog25-Apr-05 2:51 
GeneralRe: Get Button Pin
Ashok Dhamija25-Apr-05 3:29
Ashok Dhamija25-Apr-05 3:29 
GeneralRe: Get Button Pin
Le centriste25-Apr-05 3:46
Le centriste25-Apr-05 3:46 
GeneralRe: Get Button Pin
mav.northwind25-Apr-05 3:52
mav.northwind25-Apr-05 3:52 
GeneralRe: Get Button Pin
Luis Alonso Ramos25-Apr-05 5:49
Luis Alonso Ramos25-Apr-05 5:49 
GeneralDiferences between null,close and dispose Pin
Enishi25-Apr-05 1:48
Enishi25-Apr-05 1:48 
GeneralRe: Diferences between null,close and dispose Pin
S. Senthil Kumar25-Apr-05 3:32
S. Senthil Kumar25-Apr-05 3:32 
GeneralRe: Diferences between null,close and dispose Pin
turbochimp25-Apr-05 5:54
turbochimp25-Apr-05 5:54 
GeneralRe: Diferences between null,close and dispose Pin
S. Senthil Kumar25-Apr-05 19:22
S. Senthil Kumar25-Apr-05 19:22 
GeneralRe: Diferences between null,close and dispose Pin
mav.northwind25-Apr-05 20:27
mav.northwind25-Apr-05 20:27 
GeneralRe: Diferences between null,close and dispose Pin
S. Senthil Kumar26-Apr-05 0:33
S. Senthil Kumar26-Apr-05 0:33 
GeneralRe: Diferences between null,close and dispose Pin
turbochimp26-Apr-05 5:10
turbochimp26-Apr-05 5:10 
GeneralRe: Diferences between null,close and dispose Pin
S. Senthil Kumar26-Apr-05 19:17
S. Senthil Kumar26-Apr-05 19:17 
GeneralRe: Diferences between null,close and dispose Pin
turbochimp27-Apr-05 5:19
turbochimp27-Apr-05 5:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.