
dannydy
Active Members-
Posts
37 -
Joined
-
Last visited
Everything posted by dannydy
-
Many Thanks. This is really help me a lot
-
This is really useful, But how do i get the Default Gateway. And how do i get the value from col 2. (I just want the ip adress, Default Gateway and MAC) i amend it with trial and error, but no luck i couldnt get what i want. #include <array.au3> $aTest = GetNics() _ArrayDisplay($aTest) Func GetNics() Local $NETWORK_REG_KEY = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\" Local $tagIP_ADDRESS_STRING = "char IPAddress[16];" Local $tagIP_MASK_STRING = "char IPMask[16];" Local $tagIP_ADDR_STRING = "ptr Next;" & $tagIP_ADDRESS_STRING & $tagIP_MASK_STRING & "DWORD Context;" Local $tagIP_ADAPTER_INFO = "ptr Next; DWORD ComboIndex; char AdapterName[260];char Description[132]; UINT AddressLength; BYTE Address[8]; dword Index; UINT Type;" & _ " UINT DhcpEnabled; ptr CurrentIpAddress; ptr IpAddressListNext; char IpAddressListADDRESS[16]; char IpAddressListMASK[16]; DWORD IpAddressListContext; " & _ "ptr GatewayListNext; char GatewayListADDRESS[16]; char GatewayListMASK[16]; DWORD GatewayListContext; " & _ "ptr DhcpServerNext; char DhcpServerADDRESS[16]; char DhcpServerMASK[16]; DWORD DhcpServerContext; " & _ "int HaveWins; " & _ "ptr PrimaryWinsServerNext; char PrimaryWinsServerADDRESS[16]; char PrimaryWinsServerMASK[16]; DWORD PrimaryWinsServerContext; " & _ "ptr SecondaryWinsServerNext; char SecondaryWinsServerADDRESS[16]; char SecondaryWinsServerMASK[16]; DWORD SecondaryWinsServerContext; " & _ "DWORD LeaseObtained; DWORD LeaseExpires;" Local $dll = DllOpen("Iphlpapi.dll") Local $ret = DllCall($dll, "dword", "GetAdaptersInfo", "ptr", 0, "dword*", 0) Local $adapterBuffer = DllStructCreate("byte[" & $ret[2] & "]") Local $adapterBuffer_pointer = DllStructGetPtr($adapterBuffer) Local $return = DllCall($dll, "dword", "GetAdaptersInfo", "ptr", $adapterBuffer_pointer, "dword*", $ret[2]) Local $adapter = DllStructCreate($tagIP_ADAPTER_INFO, $adapterBuffer_pointer) If Not @error Then Dim $aAdapters[100][4] $i = 0 Do $aAdapters[$i][0] = DllStructGetData($adapter, "Description") $aAdapters[$i][1] = RegRead($NETWORK_REG_KEY & DllStructGetData($adapter, "AdapterName") & "\Connection", "Name") $aAdapters[$i][2] = DllStructGetData(DllStructCreate($tagIP_ADDR_STRING, DllStructGetPtr($adapter, "IpAddressListNext")), "IPAddress") $aAdapters[$i][3] = DllStructGetData(DllStructCreate($tagIP_ADDR_STRING, DllStructGetPtr($adapter, "IpAddressListNext")), "IPMask") $i += 1 $ptr = DllStructGetData($adapter, "Next") $adapter = DllStructCreate($tagIP_ADAPTER_INFO, $ptr) Until @error ReDim $aAdapters[$i][4] EndIf Return $aAdapters EndFunc ;==>GetNics
-
Hmmm.....still unable to get the IP address on WIFI
-
#include <Array.au3> #include <Constants.au3> Local $aArray = _IPDetails() If @error = 0 Then Local $sData = 'Your IP Address: ' & $aArray[1] & @CRLF & _ 'Your Gateway Address: ' & $aArray[3] & @CRLF & _ 'You DNS Servers: ' & $aArray[4] MsgBox($MB_SYSTEMMODAL, '', $sData) EndIf _ArrayDisplay($aArray) Func _IPDetails() Local $oWMIService = ObjGet('winmgmts:{impersonationLevel = impersonate}!\\' & '.' & '\root\cimv2') Local $oColItems = $oWMIService.ExecQuery('Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True', 'WQL', 0x30), $aReturn[5] = [0] If IsObj($oColItems) Then For $oObjectItem In $oColItems If $oObjectItem.IPAddress(0) == @IPAddress1 Then $aReturn[0] = 4 $aReturn[1] = $oObjectItem.IPAddress(0) $aReturn[2] = $oObjectItem.MACAddress $aReturn[3] = $oObjectItem.DefaultIPGateway(0) $aReturn[4] = _WMIArrayToString($oObjectItem.DNSServerSearchOrder(), ', ') ; You could use _ArrayToString() but I like creating my own Functions especially when I don't need alot of error checking. EndIf Next EndIf Return SetError($aReturn[0] = 0, 0, $aReturn) EndFunc ;==>_IPDetails Func _WMIArrayToString($aArray, $sDelimeter = '|') Local $sString = 'Not Available' If UBound($aArray) Then For $i = 0 To UBound($aArray) - 1 $sString &= $aArray[$i] & $sDelimeter Next $sString = StringTrimRight($sString, StringLen($sDelimeter)) EndIf Return $sString EndFunc ;==>_WMIArrayToString This is the code I found on AutoIT Forum, its worked on Wired but not wireless. Could anyone help me on this, please?
-
Read value from ListView on mouse click
dannydy replied to dannydy's topic in AutoIt General Help and Support
Many Thanks, this is really helpful...i've been headache for this:) -
#include <GuiConstantsEx.au3> #include <File.au3> #include <Array.au3> #include <ListviewConstants.au3> #include <GuiListView.au3> GUICreate("Automation", 300, 500) $mylist = GUICtrlCreateList("", 10, 60, 280, 100) $add = GUICtrlCreateButton("Add", 10, 35, 75, 20) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Switch $msg Case $add Local $FileList _FileReadToArray("C:\Users\Danny Tan\Desktop\test.txt", $FileList) For $i = 1 To $FileList[0] GUICtrlSetData($mylist, $FileList[$i]) Next Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Need some helps here, How do i trying to read the data when i select it from the listview. i couldn't get it worked.
-
#include <Constants.au3> HotKeySet("{ESC}", "_Exit") Global $up= Ping("www.bing.com") Do $date = @MDAY & "" & @MON & "" & @YEAR $time = @HOUR & "" & @MIN & "" & @SEC Run(@ComSpec & ' /c ping -t -s 1 myservername >> %userprofile%\desktop\' & $date & $time & '.txt', @SystemDir, @SW_show) ConsoleWrite($up & @LF) sleep(5000) Send("^+c") _ProcessCloseEx("cmd.exe") ;Send("!+{F4}") until $up=0 Func _Exit() Exit EndFunc ;==>_Exit Func _ProcessCloseEx($sPID) ;ConsoleWrite($sPID & @LF) local $killLync = $sPID ;ConsoleWrite($killLync & @LF) If IsString($sPID) Then $sPID = ProcessExists($sPID) ;ConsoleWrite($sPID & @LF) If Not $sPID Then Return msgbox(64,"Lync Status","Lync is not Running");SetError(1, 0, 0) Return Run(@ComSpec & " /c taskkill /F /PID " & $sPID & " /T", @SystemDir, @SW_HIDE) & TrayTip($killLync,"Killed", 5, 1) EndFunc Hi Guys, need some helps here This is my pinging code. I was trying to ping continuously to my office server. now the issue I hit was I couldn't get the cmd windows close once its running. It opens a new one after the and old one stayed after the looping. I tried to search around, but no luck I couldn't find the solution. The workaround for me right now is kill the process by PID. Really appreciate someone can take a look into it.
-
abundant thanks to all of you for the sharing and valuables input, i managed to get it worked perfectly based on the example at above article(OnEvent mode). but the messageloop mode is abit complicated for me, couldnt understand how's work at all.
-
Actually i had tried to put the $msg = GUIGetMsg inside the loop, but still unable to exit.
-
Hello guys, need some simple help here. Global $site = "http://www.bing.com" Global $up= Ping("www.bing.com") HotKeySet("{ESC}", "_Exit") if $up = 0 Then $msg = GUIGetMsg() do $up= Ping("www.bing.com") sleep(2000) Until $up <> 0 or $msg = $GUI_EVENT_CLOSE Or $msg = $Cancel Func _Exit() Exit EndFunc ;==>_Exit This is my coding, when the interface started and when there's no network connection, it will keep looping until there's network connection. While in the looping, when click on the GUI cancel button or window close event, the script will stop running and exit. My problem here's i couldnt click the cancel button nor the window close event to exit. I only managed to press the "{ESC}" to terminate the script. Appreciate someone can help me. i tried many times but i failed and gave up.
-
Xandy, with luck i managed to do it. Here's the code stringregexp($aEmail[$1],'^[\_|[color=#ff0000][b]\-[/b][/color]]*([a-z0-9]+(\.|\_|[color=#ff0000][b]\-[/b][/color]*)?)+@([a-z][a-z0-9\-]+(\.|\-*\.))+[a-z]{2,6}$',0) Basically i added - in the statement(Highlighted in red). Many Thanks for taken a loop into it.
-
i found the issue, my company address has this hyphen "-". So if i enter any email address with hypen(i.e danny-dy@hotmail.com), it will throw me an error. How to i modify the coding to handle hyphen. i did several trial and error, but i couldn't get it right. This is the expression for handling underscore stringregexp($aEmail[$1],'^[\_]*([a-z0-9]+(\.|\_*)?)+@([a-z][a-z0-9\-]+(\.|\-*\.))+[a-z]{2,6}$',0) This is the expression for handling hyphen stringregexp($aEmail[$1],'^[\-]*([a-z0-9]+(\.|\-*)?)+@([a-z][a-z0-9\-]+(\.|\-*\.))+[a-z]{2,6}$',0) How do i make them into one statement, please?
-
Many Thanks both of you(kylomas and Xandy). Its working fine, however if i entered one email address, the program threw me an error on that. its only worked on multiple email addresses. i'm working on it right now, make some modification will handle it. Really appreciate that save me a lot of time:)
-
Hi, i've created a simple program, asking user to enter his/her email address, e.g dannyd_y@hotmail.com Or user can enter multiple email addresses, dannyd_y@hotmail.com;dannyd_yq@yahoo.com. Func mainlobby() Global $msg, $receiver local $sendemilbutton,$recipientsread,$recipientsenter GUICreate($toolname,$width, $height, 500, 250, -1, $WS_EX_ACCEPTFILES) ; will create a dialog box that when displayed is centered GUISetBkColor(0x6666FF) $recipientsenter = GUICtrlCreateInput("", 10, 5, 250, 20) $sendemilbutton = GUICtrlCreateButton("Send Email", 230, 128, 70, 25,-1,0x00000001) GUISetState(@SW_SHOW) do $msg = GUIGetMsg() Select Case $msg = $sendemilbutton if GUICtrlRead($recipientsenter) ="" Then msgbox(16,"Email Not Input","Cannot Find Any Email") Else msgbox(0,"Email Input",GUICtrlRead($recipientsenter)) $receiver = GUICtrlRead($recipientsenter) CreateMailItem() EndIf EndSelect Until $msg = $GUI_EVENT_CLOSE GUIDelete() _Exit() EndFunc How do i validate if user is entering the right format. i've made some studies on this it seems like the right way of coding is using StringRegExp, but i coudlnt understand the regular expression pattern at all. Appreciate someone can help me. Many Thanks.
-
Need some helps here, does anyone know the scripts for show/hide the file name extension in Windows? i tried to find google this but i couldnt find any related infor. Appreciate if someone can help me. Thanks
-
How to Get file "date last saved"
dannydy replied to dannydy's topic in AutoIt General Help and Support
This is how i do, but it doesnt make any differences.... average it takes 8secs for returning the result. #include <File.au3> ; only used for the example script, not needed for the UDF #include <Array.au3> ; only used for the example script, not needed for the UDF $sFolder="sharepoinMyexcel.xlsx" ConsoleWrite("File size of = " & _FileGetProperty($sFolder, "size") & @CRLF) ; displays in the console the Size of the file ConsoleWrite("Modified Date = " & _FileGetProperty($sFolder, "Date last saved") & @CRLF) Func _FileGetProperty(Const $S_PATH, Const $S_PROPERTY = "") Local Const $objShell = ObjCreate("Shell.Application") If @error Then Return SetError(3, 0, 0) Local $iPropertyCount = 300 ; arbitrary number used, Windows 7 only returns 289 properties, Windows XP only returns 38 (future proofing) If StringLeft($S_PATH, 1) = '"' Then StringTrimLeft($S_PATH, 1) ; deletes any quotes around the pathfilename, otherwise will cause errors If StringRight($S_PATH, 1) = '"' Then StringTrimRight($S_PATH, 1) ; deletes any quotes around the pathfilename, otherwise will cause errors If Not FileExists($S_PATH) Then Return SetError(1, 0, 0) Local Const $S_FILE = StringTrimLeft($S_PATH, StringInStr($S_PATH, "", 0, -1)) Local Const $S_DIR = StringTrimRight($S_PATH, StringLen($S_FILE) + 1) Local Const $objFolder = $objShell.NameSpace($S_DIR) Local Const $objFolderItem = $objFolder.Parsename($S_FILE) If $S_PROPERTY Then For $I = 0 To $iPropertyCount If $objFolder.GetDetailsOf($objFolder.Items, $I) = $S_PROPERTY Then Return $objFolder.GetDetailsOf($objFolderItem, $I) Next Return SetError(2, 0, 0) EndIf ;Local $av_ret[300][2] = [[1]] ; For $I = 1 To $iPropertyCount + 1 ; If $objFolder.GetDetailsOf($objFolder.Items, $I) Then ;$av_ret[$I][0] = $objFolder.GetDetailsOf($objFolder.Items, $I - 1) ; $av_ret[$I][1] = $objFolder.GetDetailsOf($objFolderItem, $I - 1) ; $av_ret[0][0] += 1 ;EndIf ; Next ; ReDim $av_ret[$av_ret[0][0] + 1][2] ;If Not $av_ret[1][0] Then Return SetError(2, 0, 0) ;Return $av_ret EndFunc ;==>_FileGetProperty -
How to Get file "date last saved"
dannydy replied to dannydy's topic in AutoIt General Help and Support
Thanks a lot water, this UPF was very useful. But it takes sometimes to return the file properties. -
Hi, i need some help here. basically i was trying to get the file date of modified. But i found that the date modified was different with Date last saved. Thus i need to get this date last save from excel file instead of date modified. This is my code, the return date was modified date. My file date of modified was 22/5/2012, date of last saved was 28/5/2012 which is today. Note the file was saved in the sharepoint server. Global Const $ocsfilepath = "My sharePoint pathMy excel file" Local $ocs = FileGetTime($ocsfilepath,0,0) ConsoleWrite(_filetimeconverttest($ocs[2],$ocs[1],$ocs[0],$ocs[3],$ocs[4]) & @LF) Func _filetimeconverttest($gday,$gdate,$gyear, $grab, $fmin) If $grab > 12 Then $grab = $grab -12 $x = "PM" elseif $grab = 12 Then $x = "PM" Elseif $grab = 0 Then $grab =12 $x = "AM" Else $x = "AM" EndIf $filetimeto = $gday & "/" & $gdate & "/" &$gyear & " " & $grab & ":" & $fmin & $x Return ($filetimeto) EndFunc
-
Hi Ai, Thank you so much for you quick response. You have helped me out alot.
-
hmmmm....still unsuccessful While ProcessExists('Excel.EXE') $msg = GUIGetMsg() MsgBox(16,'Excel Status','Close And Save any Excel file') GUICtrlSetState ($button,$GUI_DISABLE) if ProcessWaitClose('Excel.EXE')Then GUICtrlSetState ($button,$GUI_ENABLE) ExitLoop elseif $msg = $GUI_EVENT_CLOSE Or $msg = $Cancel Then _exit() EndIf WEnd
-
Hi guys, need some helps here. i was trying to check if there's any excel file opened, then disable the ok button. Enable it Until the excel file is closed. I managed to do that, but the thing is when there's excel file open and i click on cancel or $GUI_EVENT_CLOSE button, it didnt work. It will work after i closed my excel file. #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <Timers.au3> #include <GuiStatusBar.au3> #include <ProgressConstants.au3> #include <GuiListView.au3> #include <Date.au3> Global $hStatusBar, $LWSelectedICurrent = -1,$Sec, $Min, $Hour, $Time Local $StartTicks = _TimeToTicks(@HOUR, @MIN, @SEC) ;MsgBox(0,"",$StartTicks) ; calculate 1 minutes later Local $EndTicks = ($StartTicks + 1 * 60 * 1000) ;MsgBox(0,"",$EndTicks) _TicksToTime($EndTicks, $Hour, $Min, $Sec) ;MsgBox(262144, '', 'If No selection has been made,the Program Will terminate at :' & $Hour & ":" & $Min & ":" & $Sec) Local $hGUI, $iTimerProgress Local $aParts[3] = [100,250,-1] dim $Selection Example() Func Example() Local $listview, $button,$Cancel, $item1, $item2, $item3,$item4, $msg $hGUI = GUICreate("Test Summary Generation", 300, 250, 600, 500, -1, $WS_EX_ACCEPTFILES) ;ToolTip("If No selection has been made,the Program Will terminate at : " & StringFormat("%02d:%02d:%02d", $Hour, $Min, $Sec), 600, 720) ToolTip("If No selection has been made,the Program Will terminate at : " & $Hour & ":" & $Min & ":" & $Sec, 600, 720) GUISetBkColor(0x00E0FFFF) ; will change background color $listview = GUICtrlCreateListView("Test Summary Update ", 50,10, 200, 150);,$LVS_SORTDESCENDING) $button = GUICtrlCreateButton("OK", 75, 170, 70, 20) $Cancel = GUICtrlCreateButton("Cancel", 150, 170, 70, 20) $item1 = GUICtrlCreateListViewItem("item1", $listview) $item2 = GUICtrlCreateListViewItem("item2", $listview) $hStatusBar = _GUICtrlStatusBar_Create($hGUI, $aParts) _GUICtrlStatusBar_SetText($hStatusBar,"Current Date : " & StringFormat("%02d-%02d-%02d", @MDAY, @MON, @YEAR), 1) _GUICtrlStatusBar_SetText($hStatusBar,@TAB & @TAB & StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC), 2) _GUICtrlStatusBar_SetText($hStatusBar,"No Selection") _Timer_SetTimer($hGUI, 1000, "_UpdateStatusBarClock") GUICtrlSetData($item1, "Exchange Online") GUICtrlSetData($item2, "OCS Wave 14") GUISetState() [b]While ProcessExists('Excel.EXE'); Checks if process is running maybe? MsgBox(16,'Excel Status','Close And Save any Excel file') GUICtrlSetState ($button,$GUI_DISABLE) if ProcessWaitClose('Excel.EXE')Then GUICtrlSetState ($button,$GUI_ENABLE)[/b] [b]EndIf WEnd[/b] Do $LWSelectedI = _GUICtrlListView_GetSelectedIndices($listview, true) If $LWSelectedI[0] <> 0 Then If $LWSelectedI[1] <> $LWSelectedICurrent Then _GUICtrlStatusBar_SetText($hStatusBar,_GUICtrlListView_GetItemTextString($listview ,$LWSelectedI[1])) $LWSelectedICurrent = $LWSelectedI[1] EndIf EndIf $msg = GUIGetMsg() Select Case $msg = $button ;MsgBox(0, "Selection Made", GUICtrlRead(GUICtrlRead($listview))) $Selection= guictrlread($listview) if $selection = 6 or $selection=7 Then local $answer=MsgBox(1, "Selection Made", _GUICtrlListView_GetItemTextString($listview ,$LWSelectedICurrent) & @LF & "Note* You can Press {ECS} key to terminate program when generating the summary*") if $answer = 1 Then ExitLoop EndIf if $answer = 2 Then $rreturn = 00123 endif EndIf if $selection = 0 Then msgbox (16,"Please Select","No Selection") Elseif $rreturn = 00123 then else ExitLoop endif Case $msg = $listview MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2) Case $msg = $GUI_EVENT_CLOSE Or $msg = $Cancel ;ExitLoop _Exit() EndSelect Until $msg = $GUI_EVENT_CLOSE EndFunc ;==>Example Func _UpdateStatusBarClock($hWnd, $Msg, $iIDTimer, $dwTime) #forceref $hWnd, $Msg, $iIDTimer, $dwTime _GUICtrlStatusBar_SetText($hStatusBar, @TAB & @TAB & StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC), 2) $livetime = _TimeToTicks(@HOUR, @MIN, @SEC) ;$EndTicks = $Hour & ":" & $Min & ":" & $Sec ;MsgBox(0,"",$livetime) ;MsgBox(0,"",$EndTicks) if $livetime = $EndTicks Then MsgBox(0,"Program Self-Termination","No Selection has been Made",10) _Exit() EndIf EndFunc ;==>_UpdateStatusBarClock Func _Exit() Exit EndFunc ;==>_Exit exit
-
Yeah, StringFormat is the workaround...but earlier i converted the $EndTicks to HH:MM:SS, and then compare with the $livetimer( converted to HH:MM:SS as well). If current mins/secs starts from 00 to 08, then the condition will fail. Because $EndTicks is display as HH:M:S.
-
Hi guys, This is kind of strange, When i convert $EndTicks to _TicksToTime($EndTicks, $Hour, $Min, $Sec), then any mins/secs from 00 to 08 after added up with 1mins be truncated to 1number(e.g 1mins after 20:00:00 is 20:1:0), i have no idea????? Please see the attachment for screen capture #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <Timers.au3> #include <GuiStatusBar.au3> #include <ProgressConstants.au3> #include <GuiListView.au3> #include <Date.au3> Global $hStatusBar, $LWSelectedICurrent = -1,$Sec, $Min, $Hour, $Time Local $StartTicks = _TimeToTicks(@HOUR, @MIN, @SEC) ;MsgBox(0,"",$StartTicks) ; calculate 1 minutes later Local $EndTicks = ($StartTicks + 1 * 60 * 1000) ;MsgBox(0,"",$EndTicks) _TicksToTime($EndTicks, $Hour, $Min, $Sec) ;MsgBox(262144, '', 'If No selection has been made,the Program Will terminate at :' & $Hour & ":" & $Min & ":" & $Sec) Local $hGUI, $iTimerProgress Local $aParts[3] = [100,250,-1] dim $Selection,$statuselect Example() Func Example() Local $listview, $button,$Cancel, $item1, $item2, $item3,$item4, $msg $hGUI = GUICreate("Test Summary Generation", 300, 250, 600, 500, -1, $WS_EX_ACCEPTFILES) ;ToolTip("If No selection has been made,the Program Will terminate at : " & StringFormat("%02d:%02d:%02d", $Hour, $Min, $Sec), 600, 720) ToolTip("If No selection has been made,the Program Will terminate at : " & $Hour & ":" & $Min & ":" & $Sec, 600, 720) GUISetBkColor(0x00E0FFFF) ; will change background color $listview = GUICtrlCreateListView("Test Summary Update ", 50,10, 200, 150);,$LVS_SORTDESCENDING) $button = GUICtrlCreateButton("OK", 75, 170, 70, 20) $Cancel = GUICtrlCreateButton("Cancel", 150, 170, 70, 20) $item1 = GUICtrlCreateListViewItem("item1", $listview) $item2 = GUICtrlCreateListViewItem("item2", $listview) $hStatusBar = _GUICtrlStatusBar_Create($hGUI, $aParts) _GUICtrlStatusBar_SetText($hStatusBar,"Current Date : " & StringFormat("%02d-%02d-%02d", @MDAY, @MON, @YEAR), 1) _GUICtrlStatusBar_SetText($hStatusBar,@TAB & @TAB & StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC), 2) _GUICtrlStatusBar_SetText($hStatusBar,"No Selection") _Timer_SetTimer($hGUI, 1000, "_UpdateStatusBarClock") GUICtrlSetData($item1, "Exchange Online") GUICtrlSetData($item2, "OCS Wave 14") GUISetState() Do $LWSelectedI = _GUICtrlListView_GetSelectedIndices($listview, true) If $LWSelectedI[0] <> 0 Then If $LWSelectedI[1] <> $LWSelectedICurrent Then _GUICtrlStatusBar_SetText($hStatusBar,_GUICtrlListView_GetItemTextString($listview ,$LWSelectedI[1])) $LWSelectedICurrent = $LWSelectedI[1] EndIf EndIf $msg = GUIGetMsg() Select Case $msg = $button ;MsgBox(0, "Selection Made", GUICtrlRead(GUICtrlRead($listview))) $Selection= guictrlread($listview) if $selection = 6 or $selection=7 Then local $answer=MsgBox(1, "Selection Made", _GUICtrlListView_GetItemTextString($listview ,$LWSelectedICurrent) & @LF & "Note* You can Press {ECS} key to terminate program when generating the summary*") if $answer = 1 Then ExitLoop EndIf if $answer = 2 Then $rreturn = 00123 endif EndIf if $selection = 0 Then msgbox (16,"Please Select","No Selection") Elseif $rreturn = 00123 then else ExitLoop endif Case $msg = $listview MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2) Case $msg = $GUI_EVENT_CLOSE Or $msg = $Cancel ;ExitLoop _Exit() EndSelect Until $msg = $GUI_EVENT_CLOSE EndFunc ;==>Example Func _UpdateStatusBarClock($hWnd, $Msg, $iIDTimer, $dwTime) #forceref $hWnd, $Msg, $iIDTimer, $dwTime _GUICtrlStatusBar_SetText($hStatusBar, @TAB & @TAB & StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC), 2) $livetime = _TimeToTicks(@HOUR, @MIN, @SEC) ;$EndTicks = $Hour & ":" & $Min & ":" & $Sec ;MsgBox(0,"",$livetime) ;MsgBox(0,"",$EndTicks) if $livetime = $EndTicks Then MsgBox(0,"Program Self-Termination","No Selection has been Made",10) _Exit() EndIf EndFunc ;==>_UpdateStatusBarClock Func _Exit() Exit EndFunc ;==>_Exit exit
-
Many Thanks for taking the time to answer me. Your input means a lot. At least i dont need to get headache on this