Bert Posted March 10, 2006 Share Posted March 10, 2006 I'm updating a script I made, and I came up with a idea I wanted to put in. The original script interacts with a application that runs in IE (Unicenter ServiceDesk) Here is the pseudo code:1. Script starts2. Script opens Internet Explorer window - This is the main window I will be interacting with. The I.E. window will have different title names depending on what Unicenter is running.3. Depending on what is displayed in Internet explorer, certain hotsetkeys will be active.(So far, I already have this working, so no script design is needed. What I wanted to add is inserted here)4. A toolbar using GUICreate is used to provide an alternative method to the hotsetkeys. The code I used to make the toolbar is as follows:Func _toolbar() ;=============================================== ;concept for tool window. This will put a tool window in the top left corner to allow ;for mouse clicks to run scripts. This toolbar will only work for Unicenter, not ; for other supported windows that have print support. $tooltray = guicreate("UNPlus 2.0", 570, 50, 5, 75, "", 0x00000008 + $WS_EX_TOOLWINDOW) $button1 = GUICtrlCreateButton ("Help",1, 1, 35, 27) $button2 = GUICtrlCreateButton (" Search Request",36, 1, 50, 27, 0x0300 + 0x2000 + 0x0C00) $button3 = GUICtrlCreateButton (" Search Incident",87, 1, 50, 27, 0x0300 + 0x2000 + 0x0C00) $button4 = GUICtrlCreateButton ("TreePaste",138, 1, 57, 27, 0x0300 + 0x2000 + 0x0C00) $button5 = GUICtrlCreateButton ("Refresh List",196, 1, 50, 27, 0x0300 + 0x2000 + 0x0C00) $button6 = GUICtrlCreateButton ("QuickPaste",247, 1, 67, 27, 0x0300 + 0x2000 + 0x0C00) $button7 = GUICtrlCreateButton ("Resolution",315, 1, 67, 27, 0x0300 + 0x2000 + 0x0C00) $button8 = GUICtrlCreateButton ("TimeStamp",383, 1, 67, 27, 0x0300 + 0x2000 + 0x0C00) $button9 = GUICtrlCreateButton (" Logout Unicenter",450, 1, 57, 27, 0x0300 + 0x2000 + 0x0C00) $button10 = GUICtrlCreateButton (" Hide Toolbar",508, 1, 57, 27, 0x0300 + 0x2000 + 0x0C00) GUISetState() Endfunc5. If a window other than the window I want to interact with (example a notepad window) is made active, the toolbar will be hidden. If then the Internet Explorer window is made active again, the toolbar will reappear. 6. Depending on what Internet Explorer window is active, only certain buttons will be shown, and the toolbar will be resized to fit. The toolbar will not be moved to the default location if the user has moved it when this happens. Here is my problem: A- I need to have the buttons work only when the correct window is active.B- Is it possible for the toolbar not to have focus so it wouldnt break the other parts of my script? What I mean by this is the hotsetkeys only work when a window is active, and I like to keep it that way. To put it another way, how do I have a toolbar that I can click a button, but not lose focus on the Internet Explorer window I want to interact with?C- I plan to use icons for buttons, but for right now, they are labeled for testing. D- Is it possible for the toolbar to change size or what buttons it shows depending on what Internet explorer window is active?For those who want to see the whole script, and possibly figure out how to solve it:(note: if you want to test it, you can make notepad files with the correct names. This is the method I use when I was devoloping the script.);Unicenter UNPlus tool 2.0.02 script;written by Volly;XXXXXXXXXXX 2006;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&AutoItSetOption("WinTitleMatchMode", 2) ;any part of the string can be used in a window's nameAutoItSetOption("TrayIconDebug", 1) ;debug is onBreak(1);This fixes the icon in the systemtray. 1 is on, 0 is offglobal $msg = GUIGetMsg()global $help_R;system tray functions#NoTrayIcon#Include <Constants.au3>#Include <GUIConstants.au3>#include <Date.au3>$current = "12:00:00 AM"Opt("WinDetectHiddenText",1)Opt("TrayAutoPause",0)Opt("TrayMenuMode", 1)$optiontray = TrayCreateItem("Options")$abouttray = TrayCreateItem("About")$helptray = TrayCreateItem("Help")TrayCreateItem("")$exittray = TrayCreateItem("Exit UNPlus")TraySetState();checks to see if UNPlus.exe is running$g_szVersion = "UNPlus.exe"If WinExists($g_szVersion) Then Exit; It's already running;Startup splash screenAutoItWinSetTitle($g_szVersion)SplashTextOn("Unicenter UNPlus", "Unicenter Plus 2.0.02 for ServiceDesk 6.0.", 550, 40, -1, -1, 0, "", 18)Sleep(1500)SplashOff();Checks to see if Unicenter is loaded. If not;it will start UnicenterIF WinExists("Unicenter ServicePlus Service Desk", "http://usdp/CAisd/pdmweb.exe") == 0 then run( "C:\Program Files\Internet Explorer\IEXPLORE.EXE -new [url="http://usdp/CAisd/pdmweb.exe""]http://usdp/CAisd/pdmweb.exe"[/url], "") WinWaitActive("Unicenter ServicePlus Service Desk", "http://usdp/CAisd/pdmweb.exe", 20)endifIF WinExists ("Unicenter ServicePlus Service Desk", "http://usdp/CAisd/pdmweb.exe" )== 1 then WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" )endifdim $keyAdim $keyB;-----------------------------------------------;These hotsetkeys will always be active. This is due to the nature of the function.$keySET = iniread("unplus.ini", "qkeys", "key", "{" & "F6" & "}")$keyA = HotKeySet($keySET, "_F6_Func");QuickPaste$keyB = HotKeySet("^!x", "_key1_Func");exit this script only - clrl + alt + x;------------------------------------------------;_toolbar();had error when trying to make func. Use this method for testing$tooltray = guicreate("UNPlus 2.0", 570, 50, 5, 75,"0x00000200" ) ;$WS_EX_TOOLWINDOW)$button1 = GUICtrlCreateButton("Help",1, 1, 35, 27) $button2 = GUICtrlCreateButton(" Search Request",36, 1, 50, 27, 0x0300 + 0x2000 + 0x0C00)$button3 = GUICtrlCreateButton(" Search Incident",87, 1, 50, 27, 0x0300 + 0x2000 + 0x0C00)$button4 = GUICtrlCreateButton("TreePaste",138, 1, 57, 27, 0x0300 + 0x2000 + 0x0C00)$button5 = GUICtrlCreateButton("Refresh List",196, 1, 50, 27, 0x0300 + 0x2000 + 0x0C00)$button6 = GUICtrlCreateButton("QuickPaste",247, 1, 67, 27, 0x0300 + 0x2000 + 0x0C00)$button7 = GUICtrlCreateButton("Resolution",315, 1, 67, 27, 0x0300 + 0x2000 + 0x0C00)$button8 = GUICtrlCreateButton("TimeStamp",383, 1, 67, 27, 0x0300 + 0x2000 + 0x0C00)$button9 = GUICtrlCreateButton(" Logout Unicenter",450, 1, 57, 27, 0x0300 + 0x2000 + 0x0C00)$button10 = GUICtrlCreateButton(" Hide Toolbar",508, 1, 57, 27, 0x0300 + 0x2000 + 0x0C00)GUISetState();end method noteWhile 1 $msg = TrayGetMsg() $msg1 = GUIGetMsg() sleep(2) ;--------------- ;test on toolbar Select Case $msg1 = $button1 if WinActive("Request Detail - Unicenter ServicePlus Service Desk")then _win1_func() if WinActive("Incident Detail - Unicenter ServicePlus Service Desk")then _win2_func() if WinActive("Problem Detail - Unicenter ServicePlus Service Desk")then _win3_func() case $msg1 = $button5 _F5A_Func endselect ;endtest ;-------------- Select Case $msg = $optiontray run("UNOption.exe") Case $msg = $helptray Msgbox(0, "Help", "On each window that UNPlus supports, you can " & _ "press the F1 key for a list of supported keys to use." & @CRLF _ &""& @CRLF _ &"Supported windows are:"& @CRLF _ &" Incident List and Request List." & @CRLF _ &" Incident Detail, Request Detail and Problem Detail." & @CRLF _ &" Incident Update, Request Update and Problem Update." & @CRLF _ &" New Incident, New Request, and New Problem."& @CRLF _ &""& @CRLF _ &"Extra functions include: "& @CRLF _ &" QuickPaste - A simple predefined clipboard tool to save keystrokes."& @CRLF _ &" Note: QuickPaste is available for use regardless of what window is active."& @CRLF _ &" You will quickly find many uses for QuickPaste in other applications."& @CRLF _ &" TreePaste - To help in the selection of configuration items."& @CRLF _ &" Refresh view on supported windows."& @CRLF _ &" Search Request and Search Incident."& @CRLF _ &" Resolution shortcut."& @CRLF _ &" Time stamper for Unicenter and Service Request."& @CRLF _ &" Logout shortcut."& @CRLF _ &" Print key support is added for any Incident, Request, or Problem."& @CRLF _ &" Extended print key support has been added for Service Request, Depot tickets and Outlook."& @CRLF _ &""& @CRLF _ &"Many of the options can be configured using the Options interface " & _ "located on the system tray icon menu.") Case $msg = $exittray exit Case $msg = $abouttray Msgbox(64,"about:","UNPlus 2.0 For Unicenter ServiceDesk"& @CRLF _ &""& @CRLF _ &" 2006 Suntrust Bank") Endselect sleep(1) select ;This section monitors if certain windows are open.;If they are, the hotkeysets for those windows are active.;<:::Keys for Request Detail::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/smile.png' class='bbc_emoticon' alt=':)' /> case WinActive("Request Detail - Unicenter ServicePlus Service Desk") _win1_func() select Case $msg1 = $button1 _F1A_Func endselect continueloop ;<:::Keys for Incident Detail::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/mellow.png' class='bbc_emoticon' alt=':mellow:' /> Case WinActive("Incident Detail - Unicenter ServicePlus Service Desk") _win2_func() continueloop ;<:::Keys for Problem Detail::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/smile.png' class='bbc_emoticon' alt=':)' /> Case WinActive("Problem Detail - Unicenter ServicePlus Service Desk") _win3_func() continueloop ;<:::Keys for Update Incident::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/ohmy.png' class='bbc_emoticon' alt=':o' /> Case WinActive("Update Incident - Unicenter ServicePlus Service Desk") _win4_func() continueloop ;<:::Keys for New Incident::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("New Incident") _win4a_func() continueloop ;<:::Keys for Update Request::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("Update Request - Unicenter ServicePlus Service Desk") _win5_func() continueloop ;<:::Keys for New Request::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("New Request") _win5a_func() continueloop ;<:::Keys for Update Problem::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("Update Problem - Unicenter ServicePlus Service Desk") _win6_func() continueloop ;<:::Keys for Update Problem::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("New Problem") _win6a_func() continueloop ; ;<:::Keys for Main Announcements Window::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("Unicenter ServicePlus Service Desk - Announcements", "http://usdp/CAisd/pdmweb.exe") _win7A_func() ;DO NOT CHANGE THIS LINE! continueloop ; ;<:::Keys for Main Request List Window::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("Unicenter ServicePlus Service Desk - Request List", "http://usdp/CAisd/pdmweb.exe") _win7B_func() ;DO NOT CHANGE THIS LINE! continueloop ; ;<:::Keys for Main Incident List Window::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("Unicenter ServicePlus Service Desk - Incident List", "http://usdp/CAisd/pdmweb.exe") _win7C_func() ;DO NOT CHANGE THIS LINE! continueloop ; ;<:::Keys for Main Incident Search Window::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("Unicenter ServicePlus Service Desk - Incident Search", "http://usdp/CAisd/pdmweb.exe") _win7D_func() ;DO NOT CHANGE THIS LINE! continueloop ; ;<:::Keys for Main Request Search Window::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("Unicenter ServicePlus Service Desk - Request Search", "http://usdp/CAisd/pdmweb.exe") _win7E_func() ;DO NOT CHANGE THIS LINE! continueloop ; ;<:::Keys for Service Request Window::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("Service Request", "equest.nsf") _win8_func() continueloop ; ;<:::Keys for Argis Web Change Window::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("Master Page", "http://dcam.stsc.suntrust.com/PageSetup/master_page.asp") _win9_func() continueloop ; ;<:::Keys for email - separate frame::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("Message (HTML)", "Menu Bar") _win10_func() continueloop ; ;<:::Keys for email - Outlook::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("Inbox - Microsoft Outlook") _win11_func() continueloop ; ;<:::Keys for Work Order Window::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("Work Order: Ad Hoc") _win8a_func() continueloop ; ;<:::Keys for Depot Order Window::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("Depot Ordering System - Order #") _win8b_func() continueloop ; ;<:::Keys for Create New Activity for::<img src='http://www.autoitscript.com/forum/public/style_emoticons/<#EMO_DIR#>/blush.png' class='bbc_emoticon' alt=':>' /> Case WinActive("Create New Activity for") _win8c_func() continueloop case _NowTime() = $current exit EndSelect wend;Functions-------------------------------;table of contents ;_win1_func(): Request Ticket keys ;_win2_func(): Incident Ticket keys ;_win3_func(): Problem Ticket keys ;_win4_func(): Update Incident keys ;_win5_func(): Update Request keys ;_win6_func(): Update Problem keys ;_win7_func(): Main Window keys ;F1 ; F1A: Help in Request Ticket view ; F1B: Help in Incident Ticket view ; F1C: Help in Problem Ticket view ; F1D: Help in Update Incident view ; F1E: Help in Update Request view ; F1F: Help in Update Problem view ; F1G: Help in Main Window view ;F2 ; F2: Search Request ;F3 ; F3: Search Incident ;F4 ; F4: TreePaste ;F5 ; F5B: Refresh ticket view ; F5B: Refresh Querry ;F6 ; F6: QuickPaste ; This function's key may be changed depending on UNPlus.ini ;F8 ;F8: Resolution field ;F9 ;F9A: Time Stamp ;F10 ; F10: Log out Unicenter ;-------------------------------------------Func _win1_func() HotKeySet("{F1}", "_F1A_Func");turns key on for help HotKeySet("{F5}", "_F5A_Func");turns key on for refresh ticket HotKeySet("{PRINTSCREEN}", "_key2a_Func"); Print ticket Do Sleep(10) Until Not WinActive("Request Detail - Unicenter ServicePlus Service Desk") _key_clean_1()EndFunc Func _win2_func() HotKeySet("{F1}", "_F1B_Func");turns key on for help HotKeySet("{F5}", "_F5A_Func");turns key on for refresh ticket HotKeySet("{PRINTSCREEN}", "_key2_Func"); Print ticket Do Sleep(10) Until Not WinActive("Incident Detail - Unicenter ServicePlus Service Desk") _key_clean_1()EndFunc Func _win3_func() HotKeySet("{F1}", "_F1C_Func");turns key on for help HotKeySet("{F5}", "_F5A_Func");turns key on for refresh ticket HotKeySet("{PRINTSCREEN}", "_key2_Func"); Print ticket Do Sleep(10) Until Not WinActive("Problem Detail - Unicenter ServicePlus Service Desk") _key_clean_1()EndFunc Func _win4_func() HotKeySet("{F1}", "_F1D_Func");turns key on for help HotKeySet("{F8}", "_F8_Func");turns key on for Resolution HotKeySet("{F4}", "_F4_Func");turns key on for TreePaste HotKeySet("{F9}", "_F9A_Func");Turns on key for TimeStamp Do Sleep(10) Until Not WinActive("Update Incident - Unicenter ServicePlus Service Desk") _key_clean_1()EndFuncFunc _win4a_func() HotKeySet("{F1}", "_F1Da_Func");turns key on for help HotKeySet("{F4}", "_F4_Func");turns key on for TreePaste HotKeySet("{F9}", "_F9A_Func");Turns on key for TimeStamp Do Sleep(10) Until Not WinActive("New Incident") _key_clean_1()EndFunc Func _win5_func() HotKeySet("{F1}", "_F1E_Func");turns key on for help HotKeySet("{F8}", "_F8_Func");turns key on for Resolution HotKeySet("{F4}", "_F4_Func");turns key on for TreePaste HotKeySet("{F9}", "_F9A_Func");Turns on key for TimeStamp Do Sleep(10) Until Not WinActive("Update Request - Unicenter ServicePlus Service Desk") _key_clean_1()EndFunc Func _win5a_func() HotKeySet("{F1}", "_F1Ea_Func");turns key on for help HotKeySet("{F4}", "_F4_Func");turns key on for TreePaste HotKeySet("{F9}", "_F9A_Func");Turns on key for TimeStamp Do Sleep(10) Until Not WinActive("New Request") _key_clean_1()EndFuncFunc _win6_func() HotKeySet("{F1}", "_F1F_Func");turns key on for help HotKeySet("{F8}", "_F8_Func");turns key on for Resolution HotKeySet("{F4}", "_F4_Func");turns key on for TreePaste HotKeySet("{F9}", "_F9A_Func");Turns on key for TimeStamp Do Sleep(10) Until Not WinActive("Update Problem - Unicenter ServicePlus Service Desk") _key_clean_1()EndFunc Func _win6a_func() HotKeySet("{F1}", "_F1Fa_Func");turns key on for help HotKeySet("{F4}", "_F4_Func");turns key on for TreePaste HotKeySet("{F9}", "_F9A_Func");Turns on key for TimeStamp Do Sleep(10) Until Not WinActive("New Problem") _key_clean_1()EndFuncFunc _win7A_func() HotKeySet("{F1}", "_F1G_Func");turns key on for help HotKeySet("{F2}", "_F2_Func");turns key on for Search Request HotKeySet("{F3}", "_F3_Func");turns key on for Search Incident HotKeySet("{F5}", "_F5B_Func");turns key on Refresh current querry HotKeySet("{F10}", "_F10_Func");turns key on for close Unicenter Do Sleep(10) Until Not WinActive("Unicenter ServicePlus Service Desk - Announcements", "http://usdp/CAisd/pdmweb.exe") _key_clean_1() EndFuncFunc _win7B_func() HotKeySet("{F1}", "_F1G_Func");turns key on for help HotKeySet("{F2}", "_F2_Func");turns key on for Search Request HotKeySet("{F3}", "_F3_Func");turns key on for Search Incident HotKeySet("{F5}", "_F5B_Func");turns key on Refresh current querry HotKeySet("{F10}", "_F10_Func");turns key on for close Unicenter Do Sleep(10) Until Not WinActive("Unicenter ServicePlus Service Desk - Request List ", "http://usdp/CAisd/pdmweb.exe") _key_clean_1()EndFunc Func _win7C_func() HotKeySet("{F1}", "_F1G_Func");turns key on for help HotKeySet("{F2}", "_F2_Func");turns key on for Search Request HotKeySet("{F3}", "_F3_Func");turns key on for Search Incident HotKeySet("{F5}", "_F5B_Func");turns key on Refresh current querry HotKeySet("{F10}", "_F10_Func");turns key on for close Unicenter Do Sleep(10) Until Not WinActive("Unicenter ServicePlus Service Desk - Incident List", "http://usdp/CAisd/pdmweb.exe") _key_clean_1()EndFunc Func _win7D_func() HotKeySet("{F1}", "_F1G_Func");turns key on for help HotKeySet("{F2}", "_F2_Func");turns key on for Search Request HotKeySet("{F3}", "_F3_Func");turns key on for Search Incident HotKeySet("{F5}", "_F5B_Func");turns key on Refresh current querry HotKeySet("{F10}", "_F10_Func");turns key on for close Unicenter Do Sleep(10) Until Not WinActive("Unicenter ServicePlus Service Desk - Incident Search", "http://usdp/CAisd/pdmweb.exe") _key_clean_1()EndFuncFunc _win7E_func() HotKeySet("{F1}", "_F1G_Func");turns key on for help HotKeySet("{F2}", "_F2_Func");turns key on for Search Request HotKeySet("{F3}", "_F3_Func");turns key on for Search Request HotKeySet("{F5}", "_F5B_Func");turns key on Refresh current querry HotKeySet("{F10}", "_F10_Func");turns key on for close Unicenter Do Sleep(10) Until Not WinActive("Unicenter ServicePlus Service Desk - Request Search", "http://usdp/CAisd/pdmweb.exe") _key_clean_1()EndFuncFunc _win8_func() HotKeySet("{PRINTSCREEN}", "_key3_Func"); Print Service Request HotKeySet("{F9}", "_F9A_Func");Turns on key for TimeStamp Do Sleep(10) Until Not WinActive("Service Request", "equest.nsf") _key_clean_1()EndFunc Func _win8a_func() HotKeySet("{PRINTSCREEN}", "_key3_Func"); Print Work Order HotKeySet("{F9}", "_F9A_Func");Turns on key for TimeStamp Do Sleep(10) Until Not WinActive("Work Order: Ad Hoc") _key_clean_1()EndFuncFunc _win8b_func() HotKeySet("{PRINTSCREEN}", "_key3_Func"); Print Depot order Do Sleep(10) Until Not WinActive("Depot Ordering System - Order #") _key_clean_1()EndFuncFunc _win8c_func() HotKeySet("{F9}", "_F9A_Func");Turns on key for TimeStamp Do Sleep(10) Until Not WinActive("Create New Activity for") _key_clean_1()EndFuncFunc _win9_func() HotKeySet("{PRINTSCREEN}", "_key4a_Func"); Print Argus Do Sleep(10) Until Not WinActive("Master Page", "http://dcam.stsc.suntrust.com/PageSetup/master_page.asp") _key_clean_1()EndFunc Func _win10_func() HotKeySet("{PRINTSCREEN}", "_key4_Func"); Print Email Do Sleep(10) Until Not WinActive("Message (HTML)", "Menu Bar") _key_clean_1()EndFunc Func _win11_func() HotKeySet("{PRINTSCREEN}", "_key5_Func"); Print Email Do Sleep(10) Until Not WinActive("Inbox - Microsoft Outlook") _key_clean_1()EndFunc ;F1 section - HelpFunc _F1A_Func();Help in Request Ticket view If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Elseif WInExists("Help in") then sleep(10) else $fkeyV = iniread("unplus.ini", "Qkeys", "msg", "") $help_R = GUICreate("Help in Request Ticket view", 445, 150,-1, -1, $WS_DLGFRAME) GUISetBkColor (0xE0FFFF) GUICtrlCreateLabel ("F1= Opens a help file showing the functions." & @CRLF _ & "F5= Refresh: This will refresh the current view." & @CRLF _ & "" & $fkeyV & "= Quick Paste: This will paste pre-determined text of your choice to fields." & @CRLF _ & "CTRL + ALT + X: Closes UNPlus, but leaves Unicenter ServiceDesk open" & @CRLF _ & "Print Scrn= Print Ticket: This will print your ticket to your default printer.", 5, 5, 440, 95) $button1 = GUICtrlCreateButton("OK", 185, 102, 60, 20) ; Run the GUI until it is closed GUISetState() While 2 $msg = GUIGetMsg() Select Case $msg = $button1 GuiDelete($help_R) exitloop EndSelect WEnd EndIfEndFunc ;==>_F1A_FuncFunc _F1B_Func();Help in Incident Ticket view If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Elseif WInExists("Help in") then sleep(10) else $fkeyV = iniread("unplus.ini", "Qkeys", "msg", "") $help_R = GUICreate("Help in Incident Ticket view", 445, 150, -1, -1, $WS_DLGFRAME) GUISetBkColor (0xE0FFFF) GUICtrlCreateLabel ("F1= Opens a help file showing the functions." & @CRLF _ & "F5= Refresh: This will refresh the current view." & @CRLF _ & "" & $fkeyV & "= Quick Paste: This will paste pre-determined text of your choice to fields." & @CRLF _ & "CTRL + ALT + X: Closes UNPlus, but leaves Unicenter ServiceDesk open" & @CRLF _ & "Print Scrn= Print Ticket: This will print your ticket to your default printer.", 5, 5, 440, 95) $button1 = GUICtrlCreateButton("OK", 185, 102, 60, 20) ; Run the GUI until it is closed GUISetState() While 3 local $msg $msg = GUIGetMsg() Select Case $msg = $button1 GuiDelete($help_R) exitloop EndSelect WEnd EndIfEndFunc ;==>_F1B_FuncFunc _F1C_Func();Help in Problem Ticket view If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Elseif WInExists("Help in") then sleep(10) else $fkeyV = iniread("unplus.ini", "Qkeys", "msg", "") $help_R = GUICreate("Help in Problem Ticket view", 445, 150, -1, -1, $WS_DLGFRAME) GUISetBkColor (0xE0FFFF) GUICtrlCreateLabel ("F1= Opens a help file showing the functions." & @CRLF _ & "F5= Refresh: This will refresh the current view." & @CRLF _ & "" & $fkeyV & "= Quick Paste: This will paste pre-determined text of your choice to fields." & @CRLF _ & "CTRL + ALT + X: Closes UNPlus, but leaves Unicenter ServiceDesk open" & @CRLF _ & "Print Scrn= Print Ticket: This will print your ticket to your default printer.", 5, 5, 440, 95) $button1 = GUICtrlCreateButton("OK", 185, 102, 60, 20, "", $WS_DLGFRAME) ; Run the GUI until it is closed GUISetState() While 4 $msg = GUIGetMsg() Select Case $msg = $button1 GuiDelete($help_R) exitloop EndSelect WEnd EndIfEndFunc ;==>_F1C_FuncFunc _F1D_Func();Help in Incident Ticket view If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Elseif WInExists("Help in") then sleep(10) else $fkeyV = iniread("unplus.ini", "Qkeys", "msg", "") $help_R = GUICreate("Help in Update Incident view", 445, 150, -1, -1, $WS_DLGFRAME) GUISetBkColor (0xE0FFFF) GUICtrlCreateLabel ("F1= Opens a help file showing the functions." & @CRLF _ & "F3= Resolution: This will change the view to the resolution field in edit mode." & @CRLF _ & "F4= TreePaste: This will open a GUI with a tree menu to allow the user to select the Configuration item desired." & @CRLF _ & "" & $fkeyV & "= Quick Paste: This will paste pre-determined text of your choice to fields." & @CRLF _ & "CTRL + ALT + X: Closes UNPlus, but leaves Unicenter ServiceDesk open" & @CRLF _ & "Print Scrn= Print Ticket: This will print your ticket to your default printer.", 5, 5, 440, 95) $button1 = GUICtrlCreateButton("OK", 185, 102, 60, 20) ; Run the GUI until it is closed GUISetState() While 5 $msg = GUIGetMsg() Select Case $msg = $button1 GuiDelete($help_R) exitloop EndSelect WEnd EndIfEndFunc ;==>_F1D_FuncFunc _F1Da_Func();Help in Incident Ticket view If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Elseif WInExists("Help in") then sleep(10) else $fkeyV = iniread("unplus.ini", "Qkeys", "msg", "") $help_R = GUICreate("Help in New Incident view", 445, 150, -1, -1, $WS_DLGFRAME) GUISetBkColor (0xE0FFFF) GUICtrlCreateLabel ("F1= Opens a help file showing the functions." & @CRLF _ & "F4= TreePaste: This will open a GUI with a tree menu to allow the user to select the Configuration item desired." & @CRLF _ & "" & $fkeyV & "= Quick Paste: This will paste pre-determined text of your choice to fields." & @CRLF _ & "CTRL + ALT + X: Closes UNPlus, but leaves Unicenter ServiceDesk open" & @CRLF _ & "Print Scrn= Print Ticket: This will print your ticket to your default printer.", 5, 5, 440, 95) $button1 = GUICtrlCreateButton("OK", 185, 102, 60, 20) ; Run the GUI until it is closed GUISetState() While 6 $msg = GUIGetMsg() Select Case $msg = $button1 GuiDelete($help_R) exitloop EndSelect WEnd EndIfEndFunc ;==>_F1D_FuncFunc _F1E_Func();Help in Request Ticket view If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Elseif WInExists("Help in") then sleep(10) else $fkeyV = iniread("unplus.ini", "Qkeys", "msg", "") $help_R = GUICreate("Help in Update Request view", 445, 150, -1, -1, $WS_DLGFRAME) GUISetBkColor (0xCCFFCC) GUICtrlCreateLabel ("F1= Opens a help file showing the functions." & @CRLF _ & "F3= Resolution: This will change the view to the resolution field in edit mode." & @CRLF _ & "F4= TreePaste: This will open a GUI with a tree menu to allow the user to select the Configuration item desired." & @CRLF _ & "" & $fkeyV & "= Quick Paste: This will paste pre-determined text of your choice to fields." & @CRLF _ & "CTRL + ALT + X: Closes UNPlus, but leaves Unicenter ServiceDesk open" & @CRLF _ & "Print Scrn= Print Ticket: This will print your ticket to your default printer.", 5, 5, 440, 95) $button1 = GUICtrlCreateButton("OK", 185, 102, 60, 20) ; Run the GUI until it is closed GUISetState() While 7 $msg = GUIGetMsg() Select Case $msg = $button1 GuiDelete($help_R) exitloop EndSelect WEnd EndIfEndFunc ;==>_F1E_FuncFunc _F1Ea_Func();Help in Request Ticket view If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Elseif WInExists("Help in") then sleep(10) else $fkeyV = iniread("unplus.ini", "Qkeys", "msg", "") $help_R = GUICreate("Help in New Request view", 445, 150, -1, -1, $WS_DLGFRAME) GUISetBkColor (0xCCFFCC) GUICtrlCreateLabel ("F1= Opens a help file showing the functions." & @CRLF _ & "F4= TreePaste: This will open a GUI with a tree menu to allow the user to select the Configuration item desired." & @CRLF _ & "" & $fkeyV & "= Quick Paste: This will paste pre-determined text of your choice to fields." & @CRLF _ & "CTRL + ALT + X: Closes UNPlus, but leaves Unicenter ServiceDesk open" & @CRLF _ & "Print Scrn= Print Ticket: This will print your ticket to your default printer.", 5, 5, 440, 95) $button1 = GUICtrlCreateButton("OK", 185, 102, 60, 20) ; Run the GUI until it is closed GUISetState() While 8 $msg = GUIGetMsg() Select Case $msg = $button1 GuiDelete($help_R) exitloop EndSelect WEnd EndIfEndFunc ;==>_F1E_FuncFunc _F1F_Func();Help in Update Problem view If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Elseif WInExists("Help in") then sleep(10) else $fkeyV = iniread("unplus.ini", "Qkeys", "msg", "") $help_R = GUICreate("Help in Update Problem view", 445, 150, -1, -1, $WS_DLGFRAME) GUISetBkColor (0xCCFFCC) GUICtrlCreateLabel ("F1= Opens a help file showing the functions." & @CRLF _ & "F3= Resolution: This will change the view to the resolution field in edit mode." & @CRLF _ & "F4= TreePaste: This will open a GUI with a tree menu to allow the user to select the Configuration item desired." & @CRLF _ & "" & $fkeyV & "= Quick Paste: This will paste pre-determined text of your choice to fields." & @CRLF _ & "CTRL + ALT + X: Closes UNPlus, but leaves Unicenter ServiceDesk open" & @CRLF _ & "Print Scrn= Print Ticket: This will print your ticket to your default printer.", 5, 5, 440, 95) $button1 = GUICtrlCreateButton("OK", 185, 102, 60, 20) ; Run the GUI until it is closed GUISetState() While 9 $msg = GUIGetMsg() Select Case $msg = $button1 GuiDelete($help_R) exitloop EndSelect WEnd EndIfEndFunc ;==>_F1F_FuncFunc _F1Fa_Func();Help in Update Problem view If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Elseif WInExists("Help in") then sleep(10) else $fkeyV = iniread("unplus.ini", "Qkeys", "msg", "") $help_R = GUICreate("Help in New Problem view", 445, 150, -1, -1, $WS_DLGFRAME) GUISetBkColor (0xCCFFCC) GUICtrlCreateLabel ("F1= Opens a help file showing the functions." & @CRLF _ & "F4= TreePaste: This will open a GUI with a tree menu to allow the user to select the Configuration item desired." & @CRLF _ & "" & $fkeyV & "= Quick Paste: This will paste pre-determined text of your choice to fields." & @CRLF _ & "CTRL + ALT + X: Closes UNPlus, but leaves Unicenter ServiceDesk open" & @CRLF _ & "Print Scrn= Print Ticket: This will print your ticket to your default printer.", 5, 5, 440, 95) $button1 = GUICtrlCreateButton("OK", 185, 102, 60, 20) ; Run the GUI until it is closed GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $button1 GuiDelete($help_R) exitloop EndSelect WEnd EndIfEndFunc ;==>_F1F_FuncFunc _F1G_Func();Help in main window view If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Elseif WinExists("Help in") then sleep(10) else $fkeyV = iniread("unplus.ini", "Qkeys", "msg", "") $help_R = GUICreate("Help in Main Window view", 445, 150, -1, -1, $WS_DLGFRAME) GUISetBkColor (0xFFC1C1) GUICtrlCreateLabel ("F1= Opens a help file showing the functions." & @CRLF _ & "F2= Search Request: This will search for Request tickets in a predefined bucket." & @CRLF _ & "F3= Search Incident: This will search for Incidents tickets in a predefined bucket." & @CRLF _ & "F5= Refresh: This will refresh the current list of tickets that are listed." & @CRLF _ & "" & $fkeyV & "= Quick Paste: This will paste pre-determined text of your choice to fields." & @CRLF _ & "F10= Logout: This will log you out of Unicenter", 5, 5, 440, 95) $button1 = GUICtrlCreateButton("OK", 185, 102, 60, 20) ; Run the GUI until it is closed GUISetState() While 8 $msg = GUIGetMsg() Select Case $msg = $button1 GuiDelete($help_R) exitloop EndSelect WEnd EndIfEndFunc ;==>_F1G_Func;---------------------------------;F2 Section: Search Request Func _F2_Func(); Search Request $INIre = INIread ("unplus.ini", "request", "speed", "") If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Elseif $INIre == "normal" then BlockInput(1) send("!e") sleep(5) send("!r") ;BlockInput(0) WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) WinWaitActive( "Unicenter ServicePlus Service Desk" , "Opening", 1) sleep(200) WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) WinWaitActive( "Unicenter ServicePlus Service Desk" , "Done", 1 ) sleep(500) WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) ;BlockInput(1) send("{TAB}") sleep(5) send("{TAB}") sleep(5) send("{TAB}") $search1 = iniread("unplus.ini", "request", "search", "") sleep(5) Send($search1) sleep(5) send("!s") BlockInput(0) Else BlockInput(1) send("!e") sleep(250) WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) send("!r") sleep(3500) WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) send("{TAB}") sleep(200) WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) send("{TAB}") sleep(50) WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) send("{TAB}") sleep(50) fileopen ("search.ini", 0) $note1 = FileReadLine ("search.ini") WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) Send($note1) send("!s") Blockinput(0) EndIfEndFunc ;==>_F2_Func;----------------------------------;F3 Section ; F3: Search Incident Func _F3_Func(); Search Incident $INIin = INIread ("unplus.ini", "incident", "speed", "") If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Elseif $INIin == "normal" then BlockInput(1) send("!e") sleep(3) send("!i") WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) BlockInput(1) WinWaitActive( "Unicenter ServicePlus Service Desk" , "Opening", 1 ) sleep(10) WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) WInWaitActive( "Unicenter ServicePlus Service Desk" , "Done", 1 ) sleep(10) WInWaitActive ( "Unicenter ServicePlus Service Desk - Incident Search" , "http://usdp/CAisd/pdmweb.exe", 5 ) WinActivate ( "Unicenter ServicePlus Service Desk - Incident Search" , "http://usdp/CAisd/pdmweb.exe" ) sleep(10) send("{TAB}") sleep(7) send("{TAB}") $search1 = iniread("unplus.ini", "incident", "search", "") WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) sleep(7) Send($search1) WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) sleep(5) send("!s") BlockInput(0) Else Blockinput(1) send("!e") sleep(300) WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) send("!i") sleep(3000) WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) send("{TAB}") WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) sleep(20) WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) send("{TAB}") WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) sleep(20) fileopen ("search.ini", 0) $note1 = FileReadLine ("search.ini") Send($note1) WinActivate ( "Unicenter ServicePlus Service Desk" , "http://usdp/CAisd/pdmweb.exe" ) send("!s") Blockinput(0) EndIfEndFunc ;==>_F3_Func;--------------------------;F4 SectionFunc _F4_Func(); TreePaste If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Else BlockInput(1) Send("^a") Sleep(50) Send("{DEL}") Sleep(50) BlockInput(0) RunWait("treepaste.exe", "") BlockInput(1) Sleep(500) Send("^v") BlockInput(0) EndIfEndFunc ;==>_F4_Func;-----------------------------;F5 Section ; F5A: Refresh TIcket ; F5B: Refresh List Func _F5A_Func(); Refresh Ticket If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Else BlockInput(1) Send("!v") Sleep(5) Send("f") BlockInput(0) EndIfEndFunc ;==>_F5A_FuncFunc _F5B_Func(); Refresh Querry If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Else BlockInput(1) Send("!v") Sleep(5) Send("!e") BlockInput(0) EndIfEndFunc ;==>_F5B_Func;----------------------------;F6 SectionFunc _F6_Func(); QuickPaste RunWait("quickpaste2_0.exe", "")EndFunc ;==>key6;----------------------------;F8 SectionFunc _F8_Func(); Resolution field If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Else Send("!4") Send("!9") EndIfEndFunc ;==>_F8_Func;F9 SectionFunc _F9A_Func(); TimeStamp $sLongDayName = _DateDayOfWeek( @WDAY ) $stamp = _NowTime() $stamp2 = _NowDate() send(@UserName& ": " &$sLongDayName & " " & $Stamp2 & ", " & $stamp & ": ") ;EndIfEndFunc ;==>key6;---------------------------;F10 SectionFunc _F10_Func(); Close Unicenter If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Else BlockInput(1) Send("!u") Send("!e") BlockInput(0) Exit EndIfEndFunc ;==>_F9_Func;----------------------------Func _key1_Func(); Closes UNPlus If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Else Exit EndIfEndFunc ;==>_key1_FuncFunc _key2_Func(); Print tickets If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Elseif WinExists ("CAisd report - indtl.rpt") then WinActivate("CAisd report - indtl.rpt") Send("!p") WInWaitActive("Print", "General", 15) Send("!p") else Winexists("Incident Detail - Unicenter ServicePlus Service Desk") WinActive("Incident Detail - Unicenter ServicePlus Service Desk") Send("!r") sleep(30) Send("d") sleep(1000) WinActivate("CAisd report - indtl.rpt") WinWaitActive("CAisd report - indtl.rpt", "Opening", 9) sleep(1000) WinWaitActive("CAisd report - indtl.rpt", "Opening", 7) sleep(1000) WinActivate("CAisd report - indtl.rpt") if winexists("CAisd report - indtl.rpt", "Incident")then msgbox(0,"","") sleep(3) Send("!p") WinWaitActive("Print", "General", 5) Send("!p") EndIfEndFunc ;==>_key2_FuncFunc _key2a_Func(); Print tickets If WinExists("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Then WinActivate("Microsoft Internet Explorer", "[239] Sorry, your session has timed out.") Elseif WinExists ("CAisd report - indtl.rpt") then WinActivate("CAisd report - indtl.rpt") Send("!p") WInWaitActive("Print", "General", 15) Send("!p") else Winexists("Request Detail - Unicenter ServicePlus Service Desk") WinActive("Request Detail - Unicenter ServicePlus Service Desk") Send("!p") sleep(30) Send("d") sleep(1000) WinActivate("CAisd report - indtl.rpt") WinWaitActive("CAisd report - indtl.rpt", "Opening", 9) sleep(1000) WinWaitActive("CAisd report - indtl.rpt", "Opening", 7) sleep(1000) WinActivate("CAisd report - indtl.rpt") if winexists("CAisd report - indtl.rpt", "Incident")then msgbox(0,"","") sleep(3) Send("!p") WinWaitActive("Print", "General", 5) Send("!p") EndIfEndFunc ;==>_key2a_FuncFunc _key3_Func(); Print Service request WinActivate("Service Request", "equest.nsf") Send("^p") sleep(100) WinWait("Print", "", 7) sleep(100) WinActivate("Print") sleep(150) Send("!p") EndFunc ;==>_key3_FuncFunc _key3a_Func(); Print Service request WinActivate("Depot Ordering System - Order #") Send("^p") sleep(100) WinWait("Print","", 7) sleep(100) WinActivate("Print") sleep(150) Send("!p") EndFunc ;==>_key3_FuncFunc _key4_Func(); Print email WinActivate("Message (HTML)", "Menu Bar") Send("!f") sleep(100) Send("p") WinWait("Print","", 7) sleep(100) WinActivate("Print") sleep(200) Send("!p") EndFunc ;==>_key4_FuncFunc _key4a_Func(); Print Argis WinActivate("Master Page", "http://dcam.stsc.suntrust.com/PageSetup/master_page.asp") Send("^p") sleep(100) WinWait("Print","", 7) sleep(100) WinActivate("Print") sleep(150) Send("!p") EndFunc ;==>_key4_FuncFunc _key5_Func(); Print email WinActivate("Inbox - Microsoft Outlook") Send("^p") sleep(100) WinWait("Print", "",15) sleep(50) WinActivate("Print") sleep(50) Send("{ENTER}") EndFunc ;==>_key4_FuncFunc _key_clean_1() ;Releases hotsetkeys HotKeySet("{F1}"); turns help off HotKeySet("{F2}"); turns Request off HotKeySet("{F3}"); turns Incident off HotKeySet("{F4}"); turns TreePaste off HotKeySet("{F5}"); turns refresh off HotKeySet("{F8}"); turns Resolution off HotKeySet("{F9}"); turns TimeStamp off HotKeySet("{PRINTSCREEN}"); Turns Print ticket offEndFunc ;==>_key_clean_1;===============================================;concept for tool window. This will put a tool window in the top left corner to allow ;for mouse clicks to run scripts. This toolbar will only work for Unicenter, not; for other supported windows that have print support.Func _toolbar()$tooltray = guicreate("UNPlus 2.0", 570, 50, 5, 75, "", 0x00000008 + $WS_EX_TOOLWINDOW)$button1 = GUICtrlCreateButton("Help",1, 1, 35, 27) $button2 = GUICtrlCreateButton(" Search Request",36, 1, 50, 27, 0x0300 + 0x2000 + 0x0C00)$button3 = GUICtrlCreateButton(" Search Incident",87, 1, 50, 27, 0x0300 + 0x2000 + 0x0C00)$button4 = GUICtrlCreateButton("TreePaste",138, 1, 57, 27, 0x0300 + 0x2000 + 0x0C00)$button5 = GUICtrlCreateButton("Refresh List",196, 1, 50, 27, 0x0300 + 0x2000 + 0x0C00)$button6 = GUICtrlCreateButton("QuickPaste",247, 1, 67, 27, 0x0300 + 0x2000 + 0x0C00)$button7 = GUICtrlCreateButton("Resolution",315, 1, 67, 27, 0x0300 + 0x2000 + 0x0C00)$button8 = GUICtrlCreateButton("TimeStamp",383, 1, 67, 27, 0x0300 + 0x2000 + 0x0C00)$button9 = GUICtrlCreateButton(" Logout Unicenter",450, 1, 57, 27, 0x0300 + 0x2000 + 0x0C00)$button10 = GUICtrlCreateButton(" Hide Toolbar",508, 1, 57, 27, 0x0300 + 0x2000 + 0x0C00)GUISetState()endfunc;================================================ The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Bert Posted March 10, 2006 Author Share Posted March 10, 2006 I did have a thought : I tried this:Func _win2_func() HotKeySet("{F1}", "_F1B_Func");turns key on for help HotKeySet("{F5}", "_F5A_Func");turns key on for refresh ticket HotKeySet("{PRINTSCREEN}", "_key2_Func"); Print ticket Do $pos = WinGetPos ("Incident Detail - Unicenter ServicePlus Service Desk") $tooltrayR = guicreate("UNPlus 2.0", 570, 50, $pos[0]+5, $pos[1]+75,0x00000200 , 0x00000008) $button1 = GUICtrlCreateButton("Help",1, 1, 35, 27) GUISetState(@SW_SHOW) winActivate("Incident Detail - Unicenter ServicePlus Service Desk") Sleep(10) Until Not WinActive("Incident Detail - Unicenter ServicePlus Service Desk") _key_clean_1() EndFunc It didn't work, for it kept making the window. I wanted it to follow the window if it got moved for the window usually isn't full sized. Any thoughts? The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 10, 2006 Share Posted March 10, 2006 To put it another way, how do I have a toolbar that I can click a button, but not lose focus on the Internet Explorer window I want to interact with?I think you are stuck on that very point. The message passing generated by clicking on anything depends on the focus going with it. Even when IE itself opens a dialog, the focus passes to the dialog and can't stay with the parent IE window, at least not if you want to activate any controls in that dialog. However, since you can determine the handle of the IE window before those buttons get clicked, you can put the focus back there quickly and easily with WinActivate(). Maybe even a background process for the tool bar that keeps track of the last IE window to have be active before the GUI was used.Is that anything like what you were thinking? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Bert Posted March 10, 2006 Author Share Posted March 10, 2006 Well, I tried this, and it didn't work either. It will show the toolbar, but when I change the focus, the toolbar remains. func _pos() $pos = WinGetPos ("Incident Detail - Unicenter ServicePlus Service Desk") endfunc Func _win2_func() $pos = WinGetPos ("Incident Detail - Unicenter ServicePlus Service Desk") HotKeySet("{F1}", "_F1B_Func");turns key on for help HotKeySet("{F5}", "_F5A_Func");turns key on for refresh ticket HotKeySet("{PRINTSCREEN}", "_key2_Func"); Print ticket $tooltrayR = guicreate("UNPlus 2.0", 570, 50, $pos[0]+5, $pos[1]+75, "" ,0x00000080 + 0x00000008) $button1 = GUICtrlCreateButton("Help",1, 1, 35, 27) GUISetState(@SW_SHOW) winActivate("Incident Detail - Unicenter ServicePlus Service Desk") while 1 select $msg = GUIGetMsg() case $msg = $button1 _F1A_Func() endselect wend Do _pos() Sleep(10) Until Not WinActive("Incident Detail - Unicenter ServicePlus Service Desk") guidelete($tooltrayR) _key_clean_1() EndFunc The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Bert Posted March 10, 2006 Author Share Posted March 10, 2006 I'm closer to what I want I want. I still need to have the toolbar move when the window it is tied to is moved. func _pos() $pos = WinGetPos ("Incident Detail - Unicenter ServicePlus Service Desk") endfunc Func _win2_func() $pos = WinGetPos ("Incident Detail - Unicenter ServicePlus Service Desk") HotKeySet("{F1}", "_F1B_Func");turns key on for help HotKeySet("{F5}", "_F5A_Func");turns key on for refresh ticket HotKeySet("{PRINTSCREEN}", "_key2_Func"); Print ticket $tooltrayR = guicreate("UNPlus 2.0", 570, 50, $pos[0]+5, $pos[1]+75, "" ,$WS_EX_TOPMOST) $button1 = GUICtrlCreateButton("Help",1, 1, 35, 27) GUISetState(@SW_SHOW) winActivate("Incident Detail - Unicenter ServicePlus Service Desk") Do select $msg = GUIGetMsg() case $msg = $button1 _F1A_Func() Case $msg = $GUI_EVENT_CLOSE guidelete($tooltrayR) Exit loop endselect _pos() Until Not WinActive("Incident Detail - Unicenter ServicePlus Service Desk") guidelete($tooltrayR) _key_clean_1() EndFunc thoughts? The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 10, 2006 Moderators Share Posted March 10, 2006 I'm closer to what I want I want. I still need to have the toolbar move when the window it is tied to is moved. func _pos() $pos = WinGetPos ("Incident Detail - Unicenter ServicePlus Service Desk") endfunc Func _win2_func() $pos = WinGetPos ("Incident Detail - Unicenter ServicePlus Service Desk") HotKeySet("{F1}", "_F1B_Func");turns key on for help HotKeySet("{F5}", "_F5A_Func");turns key on for refresh ticket HotKeySet("{PRINTSCREEN}", "_key2_Func"); Print ticket $tooltrayR = guicreate("UNPlus 2.0", 570, 50, $pos[0]+5, $pos[1]+75, "" ,$WS_EX_TOPMOST) $button1 = GUICtrlCreateButton("Help",1, 1, 35, 27) GUISetState(@SW_SHOW) winActivate("Incident Detail - Unicenter ServicePlus Service Desk") Do select $msg = GUIGetMsg() case $msg = $button1 _F1A_Func() Case $msg = $GUI_EVENT_CLOSE guidelete($tooltrayR) Exit loop endselect _pos() Until Not WinActive("Incident Detail - Unicenter ServicePlus Service Desk") guidelete($tooltrayR) _key_clean_1() EndFunc thoughts?You'll have to use WinGetPos() inside the loop, and if the x, y, width, and height changes, you'll have to adjust it from there. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Bert Posted March 11, 2006 Author Share Posted March 11, 2006 I thought I was doing that with the _pos() function. If I'm wrong, I do not understand what you mean then. Could you show me what you mean? The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Valuater Posted March 11, 2006 Share Posted March 11, 2006 i am not going to explain the whole function... but this is docking... maybe thats a direction for you Func _KeepWindowsDocked(ByRef $GUI1, ByRef $GUI2, ByRef $Dock, ByRef $x1, ByRef $x2, ByRef $y1, ByRef $y2) Local $p_win1 = WinGetPos($GUI1) Local $p_win2 = WinGetPos($GUI2) If (($p_win1[0] <> $x1 Or $p_win1[1] <> $y1) And BitAND(WinGetState($GUI1), 2) Or $Dock = 2) Then $x1 = $p_win1[0] $y1 = $p_win1[1] $x2 = $p_win1[2] + $x1 $y2 = $y1 WinMove($GUI2, "", $x2, $y2) $Dock = 1 ElseIf (($p_win2[0] <> $x2 Or $p_win2[1] <> $y2) And BitAND(WinGetState($GUI2), 2)) Then $x2 = $p_win2[0] $y2 = $p_win2[1] $x1 = $p_win2[0] - $p_win1[2] $y1 = $y2 WinMove($GUI1, "", $x1, $y1) ElseIf ($p_win1[0] <> $x1 Or $p_win1[1] <> $y1) And BitAND(WinGetState($GUI1), 16) Then WinSetState($GUI2, "", @SW_MINIMIZE) ElseIf ($p_win2[0] <> $x2 Or $p_win2[1] <> $y2) And BitAND(WinGetState($GUI2), 16) Then WinSetState($GUI1, "", @SW_MINIMIZE) ElseIf ($p_win1[0] <> $x1 Or $p_win1[1] <> $y1) And BitAND(WinGetState($GUI1), 2) Then WinSetState($GUI2, "", @SW_RESTORE) ElseIf ($p_win2[0] <> $x2 Or $p_win2[1] <> $y2) And BitAND(WinGetState($GUI2), 2) Then WinSetState($GUI1, "", @SW_RESTORE) EndIf EndFunc ;==>_KeepWindowsDocked from gafrost 8) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 11, 2006 Moderators Share Posted March 11, 2006 I thought I was doing that with the _pos() function. If I'm wrong, I do not understand what you mean then. Could you show me what you mean?$pos returns the Array of WinGetPos() ... Just calling it like _pos() doesn't without saving it to a variable doesn't look like you would get the desired affect your looking for. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Bert Posted March 11, 2006 Author Share Posted March 11, 2006 @val: I think this is exactly what I was looking for. I didn't know what to call it, but from the looks of the code, it should do just what I want to do. Thanks for the snippit. The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now