Re: PaperSize not available when Run as Admin



is this a 32bit application?

--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/search/?adv=1

This posting is provided "AS IS" with no warranties, and confers no rights.

"robkeithd" <guest@xxxxxxxxxxxxxxxxx> wrote in message
news:e3a413d48d7036ec60340f977026c0f9@xxxxxxxxxxxxxxxxxxx

I've got a Windows app written in C# that errors out when it is Run as
Admin. I've boiled it down to setting the PaperSize on the printer.
I've got a test app consisting of single form with two textboxes and in
the Shown event I have the following code:

PrinterSettings ps = new PrinterSettings();
ps.PrinterName = "Microsoft XPS Document Writer";
textBox1.Text = ps.PrinterName;
textBox2.Text = ps.PaperSizes.Count.ToString();

When I run the app with a double click on the desktop icon I get the
expected 106 for the count. If I right click the icon and select Run as
Admin, the printer name is correct but the count is zero.

Part of my full app relies on reading the PaperSizes so the issue of
not finding any when running as admin is causing some problems. This
only seems to be an issue on 64 bit Vista. Have reproduced it on two 64
bit boxes but don't have the problem on a 32 bit Vista or XP 32 or XP
64.

Any help on this would be greatly appreciated

Thanks


--
robkeithd


.



Relevant Pages

  • Re: Problem with manifest file under vista basic home
    ... I'm getting my feet wet with Vista. ... manifest file to give our app Administrator privilages at run time. ... This is what it's supposed to do - even if you right-click and select 'Run as admin' instead of using a manifest file and even if the user is logged on to Windows as a user with admin rights. ...
    (microsoft.public.vb.general.discussion)
  • PaperSize not available when Run as Admin
    ... I've got a Windows app written in C# that errors out when it is Run as ... I've boiled it down to setting the PaperSize on the printer. ... Admin, the printer name is correct but the count is zero. ... bit boxes but don't have the problem on a 32 bit Vista or XP 32 or XP ...
    (microsoft.public.windows.vista.print_fax_scan)
  • Re: Vista Drag Drop
    ... My app allows the user to drag drop from windows explorer on to my app. ... Works in Win XP fine and used to work on Vista. ... admin. ...
    (microsoft.public.vb.general.discussion)
  • Re: How to suppress Vista security messages when copying files
    ... But I am not sure how does VFP9_sp2.exe handles this security in Vista. ... It does not cause any security problems when copying these SP2 dlls. ... your app runs less priviliged ... Even if you're logged in as admin you need ...
    (microsoft.public.fox.helpwanted)
  • Re: XP & W2K server User rights need help
    ... before did not install the apps as admin. ... >behaved app. ... >> server non of the users had accounts only the computers ...
    (microsoft.public.windowsxp.security_admin)