CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2002
    Location
    india
    Posts
    142

    How to get the printer status

    hi all,

    Can anyone please tell me how to get the printer status.Whether it is connected or not etc.

  2. #2
    Join Date
    Jul 2005
    Location
    E: 120°.6, N: 31°.3′
    Posts
    795

    Re: How to get the printer status

    Try to use this function , just like this :
    Code:
    GetDeviceStatus(Identifier of your Device);

    Hope that helps.
    Cheers.

  3. #3
    Join Date
    Jun 2005
    Posts
    178

    Re: How to get the printer status

    do u want to see the settings of printer also??
    i mean page size and default printer attached and its port too??


    ProElite

  4. #4
    Join Date
    Sep 2002
    Location
    india
    Posts
    142

    Re: How to get the printer status

    No, only whether the printer is connected or not and also whether it is offline or not.

  5. #5
    Join Date
    May 2005
    Posts
    4,954

    Re: How to get the printer status

    did you try ::GetPrinter(..) ?

    Cheers
    If a post helped you dont forget to "Rate This Post"

    My Article: Capturing Windows Regardless of Their Z-Order

    Cheers

  6. #6
    Join Date
    Jul 2005
    Location
    E: 120°.6, N: 31°.3′
    Posts
    795

    Re: How to get the printer status

    Quote Originally Posted by ashwath_h
    No, only whether the printer is connected or not and also whether it is offline or not.
    Pls. Check out the prototype of EnumPrinters from MSDN , just like this :
    Code:
    BOOL EnumPrinters(
      DWORD Flags,         // types of printer objects to enumerate
      LPTSTR Name,         // name of printer object
      DWORD Level,         // specifies type of printer info structure
      LPBYTE pPrinterEnum, // pointer to buffer to receive printer info 
                           // structures
      DWORD cbBuf,         // size, in bytes, of the buffer
      LPDWORD pcbNeeded,   // pointer to variable with no. of bytes 
                           // copied (or required)
      LPDWORD pcReturned   // pointer to variable with no. of printer 
                           // info. structures copied
    );
    Also , can try this way mentioned by golanshahar guy.
    I am sure that will be able to realize your solutions.

    Cheers.
    Last edited by sunny_sz; December 23rd, 2005 at 02:47 AM.

  7. #7
    Join Date
    Sep 2002
    Location
    india
    Posts
    142

    Re: How to get the printer status

    I got it by using "GetPrinter".Thanks.

  8. #8
    Join Date
    Jul 2005
    Location
    E: 120°.6, N: 31°.3′
    Posts
    795

    Re: How to get the printer status

    You are welcome !
    Last edited by sunny_sz; December 23rd, 2005 at 04:09 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured