AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to detect or retrieve the default printer?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
edu



Joined: 12 Oct 2006
Posts: 88
Location: Canada

PostPosted: Fri Jan 04, 2008 7:28 pm    Post subject: how to detect or retrieve the default printer? Reply with quote

Hello forum,

I would like to improve this script:

Code:
#Persistent
SetTimer, printswitch, 5000
return

printswitch:
SetTitleMatchMode, 2
IfWinActive, Purolator,
   Run, RUNDLL32 PRINTUI.DLL `,PrintUIEntry /y /n "Lexmark Optra T610 PS"

IfWinActive, Create Shipment,
   Run, RUNDLL32 PRINTUI.DLL `,PrintUIEntry /y /n "BOCACAN"

IfWinNotExist, Create Shipment,
   Run, RUNDLL32 PRINTUI.DLL `,PrintUIEntry /y /n "Lexmark Optra T610 PS"
   return


!f10::Reload

The problem is that is that at every so many given seconds it runs rundll32 and sets Lexmark as the default printer. But I would like to know how to change this script so that if Lexmark is already the default printer, the script won't run this line again:
Run, RUNDLL32 PRINTUI.DLL `,PrintUIEntry /y /n "Lexmark Optra T610 PS"
Where is that information stored? I assume somewhere in the registry but I never did anything with Autohotkey and registry before. So I could you some help Rolling Eyes
_________________
The best things of life are free.
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6772
Location: Pacific Northwest, US

PostPosted: Fri Jan 04, 2008 7:59 pm    Post subject: Reply with quote

Direct answer
http://www.autohotkey.com/forum/viewtopic.php?t=18321

Indirect Answers
http://www.autohotkey.com/forum/viewtopic.php?t=14398
http://www.autohotkey.com/forum/viewtopic.php?t=18348
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
edu



Joined: 12 Oct 2006
Posts: 88
Location: Canada

PostPosted: Fri Jan 04, 2008 8:13 pm    Post subject: Reply with quote

Thanks, enguneer, I will work on that.

Edu
_________________
The best things of life are free.
Back to top
View user's profile Send private message
controlfreak



Joined: 13 Apr 2007
Posts: 7
Location: Unterschleißheim, BY, DE

PostPosted: Sat Feb 09, 2008 10:13 am    Post subject: Reply with quote

Hello,

I have written a similar script which presumably will hint you at a solution. You can find it here:

http://www.autohotkey.com/forum/viewtopic.php?p=115849#115849

Have fun!
Christian
_________________
On-on!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group