Sign in to follow this  
Followers 0
lonniec

Print que selection

2 posts in this topic

I have a project that I need some help with. I am somewhat new to the GUI part of AutoIt.

I have users in 13 different rooms and there computer name indicates their location.

I want to dislpay a list of printers available to that room and allow user to select the one that is closest to them and then just click the OK button to have it setup and be the default printer.

Has anyone got any ideas how to make a combo gui that is based on a section of an ini file.

Thanks

LonnieC

Let me share the small part I have done so far.

; ----------------------------------------------------------------------------

;

; AutoIt Version: 3.1.0

; Author: LonnieC

;

; Script Function:

; Allow user to select a printer to install choose from list based on computer name.

;

; ----------------------------------------------------------------------------

; Script Start - Add your code below here

;First get the computer name.

MsgBox(4096,"ComputerName", "Your computer name is: "& @ComputerName)

;Now get just the Office Code part of computer name.

$oc = StringMid(@ComputerName,8,3)

MsgBox(4096,"Office Code","Your office code is: " & $oc)

If $oc = "RI9" Then

MsgBox(4096, "Room Guess","Let me guess you are room 102")

ElseIf $oc = "RIM" Then

MsgBox(4096, "Room Guess","Don't tell me you are in room 124")

ElseIF $oc = "Z99" Then

MsgBox(4096, "Room Guess","I know your are somewhere in room 101")

EndIf

;Next get and display list of printers for this Office Code

#region --- GuiBuilder code Start ---

; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("Select-A-Printer", 296, 160,(@DesktopWidth-296)/2, (@DesktopHeight-160)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$List_1 = GuiCtrlCreateList("Print Que Number", 10, 10, 180, 45)

$Button_2 = GuiCtrlCreateButton("Install Now", 200, 10, 80, 40)

$Label_3 = GuiCtrlCreateLabel("Easy Instructions 1> Select the closest print que number 2> Click the Install Now button", 10, 70, 270, 80)

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case Else

;;;

EndSelect

WEnd

Exit

#endregion --- GuiBuilder generated code End ---

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Look up IniReadSection() and GuiCtrlSetData() in the helpfile.

P.S. I don't see a combo in your script. Did you mean list?

Edited by SolidSnake

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0