kman
Active Members-
Posts
30 -
Joined
-
Last visited
About kman
- Birthday 07/04/1968
Profile Information
-
Location
Prescott, AZ
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
kman's Achievements
Seeker (1/7)
0
Reputation
-
Any thoughts or ideas on this? Thank you.
-
Thank you for this. I also want to thank Hatcheda and Generator for their help as well with this little project Im trying to do. Let me explain what I am trying to accomplish. We have a program that switches between two locations. I am trying to create an image that will show on the header bar what location is active and nothing if the window is minimized or another application window is active. With help I have been able to use splashimageon to do this but get a flicker of the image based on the sleep time because it is recreating the image. I thought maybe I would try using a gui image as there might be more ways to control the flicker and less overhead of having to install the images on the computers using it. This is my first work with GUI and I am stuck, but whats new? Any help with either would be greatly appreciated! Here is the image code that works well but gets the "flicker": Opt("WinTitleMatchMode", 2) $westdest ="C:\Meds\campus\west.gif" $eastdest ="C:\Meds\campus\east.gif" Global $Width = 500 Global $Height = 20 Run("\\hmmrpt\Meds\MED-Update.exe","\\hmmrpt\Meds") ProcessWait("hmm.exe") While 1 If WinActive("WEST **MMLIVE**") Then $size=WinGetPos("Horizon Meds Manager:") Global $X = ((($size[2]/2)-($Width/2))+$size[0]) Global $Y = (($Height/15)+$size[1]) SplashImageOn("", $westdest, $Width, $Height, $X, $Y, 17) Else If WinActive("EAST **MMLIVE**") Then $size=WinGetPos("Horizon Meds Manager:") Global $X = ((($size[2]/2)-($Width/2))+$size[0]) Global $Y = (($Height/15)+$size[1]) SplashImageOn("", $eastdest, $WIDTH, $HEIGHT, $X, $Y, 17) Else SplashOff() EndIf EndIf If Not ProcessExists("HMM.exe") Then Exit EndIf Sleep(1000) WEndoÝ÷ Øw«z+-á!Êx¯(§»ÌÊg¬±çn¥«¢+Ù=ÁÐ ÅÕ½Ðí]¥¹Q¥Ñ±5Ñ¡5½ÅÕ½Ðì°È¤)=ÁÐ ÅÕ½ÐíQÉå%½¹ÕÅÕ½Ðì°Ä¤((¥¹±Õ±ÐíÕ¥ ½¹ÍѹÑ̹ÔÌÐì()±½°ÀÌØí]¥Ñ ôÔÀÀ)±½°ÀÌØí!¥¡ÐôÈÀ()]¡¥±Ä)%]¥¹Ñ¥Ù ÅÕ½Ðí]MPÅÕ½Ðì¤Q¡¸($ÀÌØíÍ¥éõ]¥¹ÑA½Ì ÅÕ½Ðí!½É¥é½¸5Ì5¹ÈèÅÕ½Ðì¤(%±½°ÀÌØí`ô ÀÌØíÍ¥élÉt¼È¤´ ÀÌØí]¥Ñ ¼È¤¤¬ÀÌØíÍ¥élÁt¤(%±½°ÀÌØídô ÀÌØí!¥¡Ð¼ÄÔ¤¬ÀÌØíÍ¥élÅt¤(%Õ¥ ÉÑ ÅÕ½ÐìÅÕ½Ðì°ÀÌØí]¥Ñ °ÀÌØí!¥¡Ð°ÀÌØí`°ÀÌØíd°ÀÌØí]M}A=AU@°ÀÌØí]M}a}Q=A5=MP¬ÀÌØí]M}a}Q==1]%9=¤(%U%MÑ ½±½È Áá ÀÀÌ̤(%U%Mѽ¹Ð ÄаÔÔÀ¤(%U% Ñɱ ÉÑ1° ÅÕ½Ðí]MP 5AULÅÕ½Ðì°ÄäÀ°´Ä¤(%Õ¥MÑMÑÑ¡M]}M!=¤($)±Í(%]¥¹Ñ¥Ù ÅÕ½ÐíMPÅÕ½Ðì¤Q¡¸($$ÀÌØíÍ¥éõ]¥¹ÑA½Ì ÅÕ½Ðí!½É¥é½¸5Ì5¹ÈèÅÕ½Ðì¤($%±½°ÀÌØí`ô ÀÌØíÍ¥élÉt¼È¤´ ÀÌØí]¥Ñ ¼È¤¤¬ÀÌØíÍ¥élÁt¤($%±½°ÀÌØídô ÀÌØí!¥¡Ð¼ÄÔ¤¬ÀÌØíÍ¥élÅt¤($$ÀÌØí½ÍÐõÕ¥ ÉÑ ÅÕ½ÐìÅÕ½Ðì°ÀÌØí]¥Ñ °ÀÌØí!¥¡Ð°ÀÌØí`°ÀÌØíd°ÀÌØí]M}A=AU@°ÀÌØí]M}a}Q=A5=MP¬ÀÌØí]M}a}Q==1]%9=¤($%U%MÑ ½±½È ÁàÌÍ Ì̤($%U%Mѽ¹Ð ÄаÔÔÀ¤($%U% Ñɱ ÉÑ1° ÅÕ½ÐíMP 5AULÅÕ½Ðì°ÄäÀ°´Ä¤($%U%MÑMÑÑ¡M]}M!=¤)±Í(%Õ¥MÑMÑÑ¡M]}!%¤(%¹%)¹%)M±À ÄÀÀÀ¤)]¹
-
Hello everyone. How do I get the following so it only appears on the screen and there is no sign of it in the taskbar? Thank you for your help. #include <GUIConstants.au3> GUICreate("My GUI") GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend
-
Dude! That worked perfect!! That formula for $X was the kicker and I used your previous formula for $Y, as I had that set to my needs already. Your time and effort is very much appreciated as I have been working on and off of this thing for the last week or two. Thank You!!
-
Sorry for the delay, been catching up from the long weekend and trying this in between. Thank you very much, this has helped me out quite a bit! I do have to hard code the height and width to match the image size I have. I think because of this it throws off your formula for centering the Y position or $Left variable. I know that the default position for center of X and Y is -1. I cant figure out how to incorporate that to get the left positioning base on wingetpos. Please let me know if anymore information is needed.
-
The active window could always be different sizes, full screen, half screen depending on the user. After getting the xy coordinates of the active window by using wingetpos how can you get the spalshimage to always be at x=-1 y=-1 (centered).
-
Thank you both for your help!! I have it close to doing what Im looking for but it is putting the image at the default posistion (the top left corner of the window). How do I get the image to be placed in the center of the active window? Im stuck there. Const $WIDTH = 500 Const $HEIGHT = 25 Dim $MousePos[2] $westdest ="C:\Meds\campus\west.gif" $eastdest ="C:\Meds\campus\east.gif" ProcessWait("hmm.exe") While 1 $wsize=WinGetPos("WEST **MMLIVE**") If WinActive("WEST **MMLIVE**") Then SplashImageOn("", $westdest, $WIDTH, $HEIGHT, $wsize[0], $wsize[1], 17) Else SplashOff() EndIf If Not ProcessExists("HMM.exe") Then Exit EndIf Sleep(2500) WEnd
-
I am running this script to display an image depending on the active window. We run dual monitors and I would like this image to display on which ever monitor the active window is on. Is this possible? Thank you! Const $WIDTH = 500 Const $HEIGHT = 25 $westdest ="C:\Meds\campus\west.gif" $eastdest ="C:\Meds\campus\east.gif" $XPOS = -1 $YPOS = 0 Run("\\hmmrpt\Meds\MED-Update.exe","\\hmmrpt\Meds") ProcessWait("hmm.exe") While 1 If WinActive("WEST **MMLIVE**") Then SplashImageOn("", $westdest, $WIDTH, $HEIGHT, $XPOS, $YPOS, 17) Else If WinActive("EAST **MMLIVE**") Then SplashImageOn("", $eastdest, $WIDTH, $HEIGHT, $XPOS, $YPOS, 17) Else SplashOff() EndIf EndIf If Not ProcessExists("HMM.exe") Then Exit EndIf Sleep(2500) WEnd
-
Thank you, that is close to what I am looking for. I had to make a small change to get it to display. I will list that below. It only seems to switch once, it will display "west" then when I change the window to east it will display "east" but will then stay there if I switch back to west. Also how can you get the display to always display on top and when neither east or west window is active display nothing, but once one of them becomes active again show the appropriate display. When these display it also shows a box in the task bar so you can manually switch these. Is there a way to get these out of the taskbar? I also made images and used splashimageon but those blink according to the sleep time this way seems easier to do but the blink can be annoying to the user, can that be "smoothed" out? Opt("WinTitleMatchMode", 2) Opt("TrayIconDebug", 1) #include <GuiConstants.au3> $oWest=GuiCreate("",500,25,-1,0,$WS_POPUP) GUISetBkColor (0xCC0033) GUISetFont (14,500) GUICtrlCreateLabel ("West Campus",190,2) GuiSetState(@SW_HIDE) $oEast=GuiCreate("",500,25,-1,0,$WS_POPUP) GUISetBkColor (0x33CC33) GUISetFont (14,500) GUICtrlCreateLabel ("East Campus",190,2) GuiSetState(@SW_HIDE) While 1 If WinActive("WEST") Then GUISetState(@SW_SHOW,$oWest) Else If WinActive("EAST") Then GUISetState(@SW_SHOW,$oEast) EndIf EndIf Sleep(1000) WEnd
-
Thanks, I have tried something like that but they both show up at the same time. Im sure its because the command after the "then". Also, how do you get it so its always on top? CODE#include <GuiConstants.au3> GuiCreate("",500,25,-1,0,$WS_POPUP) GUISetBkColor (0xCC0033) GUISetFont (14,500) GUICtrlCreateLabel ("West Campus",190,2) GuiSetState() GuiCreate("",500,25,-1,0,$WS_POPUP) GUISetBkColor (0x33CC33) GUISetFont (14,500) GUICtrlCreateLabel ("East Campus",190,2) GuiSetState() While 1 If WinActive("WEST") Then $msg = GUIGetMsg (0) Else If WinActive("EAST") Then $msg = GUIGetMsg (1) Else ; I want nothing to be displayed if the windows I want are not active EndIf EndIf Sleep(1000) WEnd
-
Hello Everyone, Here is what I am trying to do. When a particular window is open I get a box with a particular text. When another window is open the box will change color and text. Im basically trying to give the user a better visual cue of what is on the screen. I can get what Im looking for by using SplashTextOn but I am limited of course with no color. So I am trying to us the GUI function to do the same thing. But I am stuck on how to get the GUI to display. The code using Splash is below along with the GUI code I have so far. Any help would be appreciated. Thank You! CODEOpt("WinTitleMatchMode", 2) Opt("TrayIconDebug", 1) Const $WIDTH = 500 Const $HEIGHT = 20 Dim $MousePos[2] $XPOS = -1 $YPOS = 0 While 1 If WinActive("WEST") Then SplashTextOn("west", "West Campus", $WIDTH, $HEIGHT, $XPOS, $YPOS, 17, "", 12, 800) Else If WinActive("EAST") Then SplashTextOn("east", "East Campus", $WIDTH, $HEIGHT, $XPOS, $YPOS, 17, "", 12, 800) Else SplashOff() EndIf EndIf Sleep(1000) WEnd GUI code: CODE$west = GuiCreate("",500,25,-1,0,$WS_POPUP) GUISetBkColor (0xCC0033) GUISetFont (14,500) GUICtrlCreateLabel ("West Campus",190,2) GuiSetState() $east = GuiCreate("",500,25,-1,0,$WS_POPUP) GUISetBkColor (0x33CC33) GUISetFont (14,500) GUICtrlCreateLabel ("East Campus",190,2) GuiSetState()
-
I think I get that. How do I include the host file? Can I do that with #include? Sorry for the newb questions!
-
Thank you November! I have been slowly heading that way. Here is what I have currently, but right now the screen flickers or keeps loading the host file. I will keep working on this but would appreciate any help. Thank you! CODE#cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.2.0 Author: November Date: 2007, March 02 Script Function: Script ping loop with dynamic hosts #ce ---------------------------------------------------------------------------- ; Start Script ;Includes #include <GuiListView.au3> #include <GUIConstants.au3> #include <GuiList.au3> #include <GuiTreeView.au3> #include <file.au3> #include <array.au3> ;Options ;Opt ("GUICloseOnESC", 1) Opt ("TCPTimeout", 10) Opt("TrayIconHide", 1) Opt("TrayAutoPause", 0) Opt("GUIResizeMode", 1) Opt("GUIOnEventMode", 0) ;Hotkeys HotKeySet("{ESC}", "exity") ;Declaration Dim $listview, $totalservers, $ping, $msg, $aRecords, $x, $exitB, $index, $item, $round, $Progress, $value, $FileHost, $host, $totalservers, $repeat, $stop, $gui, $errorhost, $HelpB, $teste, $nametoip, $location, $name, $tempfile, $exitHB, $decision ;inicial declarations $host = 0;Grants no hostfile in the beginning $scan = 0; Grants no Scna was made for correct file export ;GUI creation $osversion = @OSVersion;Organizes the images for the buttons for w2k and winxp select case $OSVersion = "WIN_2000" $iconexit = "105" $iconscan = "55" $iconhelp = "23" $iconfile = "70" $iconexport = "6" case $OSVersion = "WIN_XP" $iconexit = "27" $iconscan = "22" $iconhelp = "23" $iconfile = "70" $iconexport = "6" EndSelect $gui = GUICreate("Visual Ping - Version 1.7", 450, 375, @DesktopHeight/2-120, @DesktopWidth/2-380, $WS_VISIBLE + $WS_CLIPSIBLINGS + $LVS_EX_GRIDLINES) ;, $LVS_EX_GRIDLINES and $LVS_EX_GRIDLINES $progress = GUICtrlCreateProgress (20, 250, 150, 15); $PBS_SMOOTH $listview = GUICtrlCreateListView(" Server Name | Server Status | IP Address ", 15, 20, 415, 210, $LVS_EX_HEADERDRAGDROP) ;$FileHost = GUICtrlCreateButton("Host File", 245, 263, 45, 45, $BS_ICON,$BS_DEFPUSHBUTTON) $repeat = GUICtrlCreateButton("Scan Hosts", 290, 263, 45, 45, $BS_ICON,$BS_DEFPUSHBUTTON) $exitB = GUICtrlCreateButton("Exit Program", 335, 263, 45, 45, $BS_ICON,$BS_DEFPUSHBUTTON) $HelpB = GUICtrlCreateButton("Help", 380, 263, 45, 45, $BS_ICON,$BS_DEFPUSHBUTTON) ;GUICtrlCreateLabel( "HOSTS", 250, 310, 50, 15) GUICtrlCreateLabel( "SCAN", 290, 310, 50, 15) GUICtrlCreateLabel( "EXIT", 345, 310, 50, 15) GUICtrlCreateLabel( "HELP", 385, 310, 50, 15) ;GUI Style GUICtrlSetImage ($repeat, "shell32.dll",$iconscan) ;GUICtrlSetImage ($FileHost, "shell32.dll",$iconfile) GUICtrlSetImage ($exitB, "shell32.dll",$iconexit) GUICtrlSetImage ($HelpB, "shell32.dll",$iconhelp) GUICtrlCreateLabel( "OVERALL : ", 20, 270, 65, 15, $SS_SUNKEN, $SS_WHITERECT) GUICtrlCreateLabel( "", 85, 270, 50, 15, $SS_SUNKEN ) GUICtrlCreateLabel( "TOTAL HOSTS: ", 20, 290, 115, 15, $SS_SUNKEN ) GUISetFont(9, 400, 2, "Monotype Corsiva") GUISetFont(9, 400, "", "") ;Read GUI GUISetState() ;Selection Loop While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE exity() Case $msg = $exitB exity() Case $msg = $repeat prerepeat() Case $msg = $FileHost file() Case $msg = $helpb help() EndSelect Wend ;funcs func prerepeat();Checks if host file is loaded if not $host = 0 Then repeat() ;Return Else $errorhost = GUICtrlCreateLabel( "ERROR : HOST FILE NOT LOADED", 45, 325, 350, 15, $SS_SUNKEN) GUICtrlSetColor($errorhost, 0xff0000) return EndIf EndFunc Func repeat();Ping the Host File $name = "EXPORTDAY" & @YEAR & @WDAY & @HOUR & @MIN & @SEC & ".TXT" $tempfile = _FileCreate(@TempDir & "\" & $name) FileWriteLine(@TempDir & "\" & $name, "SERVER,STATUS,IP" & @CRLF) TCPStartup() _GUICtrlListViewDeleteAllItems ( $listview ) $teste = UBound ( $aRecords )-1 for $x = 1 to $teste $errorhost = GUICtrlCreateLabel( "Scanning : " & $aRecords[$x], 45, 325, 350, 15, $SS_SUNKEN) $ping = ping($aRecords[$x], 2) $nametoip = TCPNameToIP($aRecords[$x]) if $nametoip = "" Then $nametoip = "NO IP AVAILABLE" EndIf if $ping Then $ping = "ONLINE" $item = GUICtrlCreateListViewItem($aRecords[$x] & "|" & $ping & "|" & $nametoip, $listview) GUICtrlSetColor($item, 0x3cb371) Else $ping = "OFFLINE" $item = GUICtrlCreateListViewItem($aRecords[$x] & "|" & $ping & "|" & $nametoip, $listview) GUICtrlSetColor($item, 0xff0000) EndIf FileWriteLine(@TempDir & "\" & $name, $aRecords[$x] & "," & $ping & "," & $nametoip & @CRLF) $value = Number($x*100/$totalservers) $round = round($value) GUICtrlCreateLabel( "OVERALL : ", 20, 270, 65, 15, $SS_SUNKEN ) GUICtrlCreateLabel( " " & $round & " %", 85, 270, 50, 15, $SS_SUNKEN ) GUICtrlCreateLabel( "TOTAL HOSTS: " & $totalservers, 20, 290, 115, 15, $SS_SUNKEN ) GUICtrlSetData($progress, $round) Next $errorhost = GUICtrlCreateLabel( "SCAN COMPLETED", 45, 325, 350, 15, $SS_SUNKEN) GUICtrlSetColor($errorhost, 0x3cb371) TCPShutdown() $scan = 1 EndFunc Func file();Opens Host File and removes empty lines $host = _FileReadToArray("C:\Documents and Settings\User\Desktop\ping.txt",$aRecords) if @error = 1 Then $host = 0 Return EndIf while 0 $newvar = _ArraySearch($aRecords, "", 0, 0, 0, false) if @error = 6 Then ExitLoop Else _ArrayDelete($aRecords, $newvar) EndIf wend $totalservers = UBound ( $aRecords )-1 $errorhost = GUICtrlCreateLabel( "HOST FILE LOADED", 45, 325, 350, 15, $SS_SUNKEN) GUICtrlCreateLabel( "TOTAL HOSTS: " & $totalservers, 20, 290, 115, 15, $SS_SUNKEN ) GUICtrlSetColor($errorhost, 0x3cb371) Return EndFunc Func help();Brings the Help Box $helpgui = GUICreate("Visual Ping - HELP", 220, 175, @DesktopHeight/2, @DesktopWidth/2-250, $WS_CAPTION + $WS_SYSMENU) $help = GUICtrlCreateLabel("Visual Ping - Version 1.7" & @LF & @LF & "Simple program to ping hosts" & @LF & "Text file export" & @LF & "" & @LF & "November 2007" & @LF & "Designed for Free Use", 20, 10) $exitHB = GUICtrlCreateButton("Exit Program", 85, 120, 45, 45, $BS_ICON,$BS_DEFPUSHBUTTON) GUICtrlSetImage ($exitHB, "shell32.dll",$iconexit, 0) GUISetState() while 1 $decision = GUIGetMsg() Select Case $decision = $GUI_EVENT_CLOSE GUIDelete($helpgui) Return Case $decision = $exitHB GUIDelete($helpgui) Return EndSelect wend EndFunc Func exity();Exit Program FileDelete(@TempDir & "\" & $name) exit EndFunc ;Fim de script
-
Thanks for the constructive help aces. Its too bad we are all not as skilled as you to leave worthless comments. Im just looking for a little help to point me in the right direction.
-
November, this is a very nice program and something I would like to use but wondering if you or someone could help me modify it for what Im looking for. Is there a way to have the host file preloaded or included in the script? Im looking to make it as simple for a user as possible and have them just be able to scan what is already set for them without giving them the option of importing and exporting? Thanks for any help!!