Jump to content

LurchMan

Active Members
  • Posts

    426
  • Joined

  • Last visited

About LurchMan

  • Birthday 12/04/1987

Profile Information

  • Location
    The Milky Way

LurchMan's Achievements

Universalist

Universalist (7/7)

3

Reputation

  1. As usual Melba - Thank you for the spot on answer. This solves the problem.
  2. Hello Everyone - I'm trying to create a date control that is empty as the default value. I can't figure out how to accomplish this. I have tried setting the data to "" and I've tried using the $DTS_SHOWNONE and then setting the state to $GUI_UNCHECKED but to no avail. The end result I would like is to let the user select Date and time within the same control, however they could leave it blank. I'm building a searching application with multiple ways to search to items (date / time being one) but they do not have to use all search terms. Here's my sample script to show how I have it setup currently: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <DateTimeConstants.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Form1", 250, 200, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") $hDate = GUICtrlCreateDate ("", 10, 10, -1, -1, $DTS_SHOWNONE) GUICtrlSetData (-1, "") GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func Form1Close() Exit EndFunc Thank you in advance for any help.
  3. Melba23, once again you have made my GUI's much more functional! Thank you for the help!
  4. Hello Everyone - I have a small application that has a combo box that I would like to have it automatically update the list it contains each time the user clicks on the down arrow. The data comes from a SQLite database. I have attempted to use WM_NOTIFY with the below code: Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") If $iCode = $NM_CLICK Then Switch $hWndFrom Case GUICtrlGetHandle($inPrs_EmpName) ConsoleWrite("you click on Processing Stats Combo" & @CRLF) Case GUICtrlGetHandle($inPS_EmpName) ConsoleWrite("you click on Phone Stats Combo" & @CRLF) Case GUICtrlGetHandle($inPE_EmpName) ConsoleWrite("you click on Phone Eval Combo" & @CRLF) EndSwitch EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY I can't seem to get any response out of the combobox. Any Ideas? Thanks for the help in advance.
  5. Ok, that makes a little more sense. Thank you for your help!
  6. Hello all - I don't need any help with a script this time just help explaining a snippet: Local $Array[3] = [0, 1, ""] For $i = 0 To UBound ($Array) - 1 If $Array[$i] <> "" Then ConsoleWrite ('Value of array: ' & $Array[$i] & ' $Array[' & $i & '] is not ""' & @CRLF) Else ConsoleWrite ('Value of array: ' & $Array[$i] & ' $Array[' & $i & '] is ""' & @CRLF) EndIf Next Output: I understand why 0 gets translated as not <> "" as all three (0, "", False) would be translated as false. Now the question - Is there a more standardized way to deal with these situations? I have a section of a script that would fill in an array and do compares similar to the one above and it was checking to see if an element had data in it. Some of the data would be 0 and comparing it to "" would always return as True as seen above. I obviously got around this by comparing the element to -1 instead of "" as all the data in this case was numerical but is there a better way to achieve this? I apologize if this isn't well written, my thoughts are all over the place on this one. Thanks for any thoughts in advance.
  7. Hello All - I'm working on building an automated stress test for a new internal website for the company I work for. Currently I'm having issues with a form thats located on the internal website. The button I'm attempting to interact with is this: <input class="buttonOne submit" type="submit" value="Click Me" title="Click Me" /> I can get the form to fill in properly and every appears correct, however when I use: _IEFormSubmit ($oForm) The form resets and it doesn't submit. Does anyone have any ideas on this?
  8. I could have sworn I tried using GuiCtrlRead () but apparently not. Thanks for the help!
  9. Do the colors on the window change after it loads completely or do the buttons just appear?
  10. Hello Everyone - I'm working with radio buttons and I'm attempting to get the state of the button to see which one has been pressed. I have a small example script below. I cannot seem to get it to report anything different from any of the radio buttons. I have also tried using GuiCtrlRead () to no avail. Any help is appreciated! #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3>Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Form1", 498, 242, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") $Radio1 = GUICtrlCreateRadio("Radio1", 104, 48, 113, 17) $Radio2 = GUICtrlCreateRadio("Radio2", 104, 96, 113, 17) $Radio3 = GUICtrlCreateRadio("Radio3", 104, 152, 113, 17) GUICtrlCreateButton ("click me", 50, 10) GUICtrlSetOnEvent(-1, "ClickMe") GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func Form1Close() Exit EndFunc Func ClickMe () $State1 = GUICtrlGetState ($Radio1) $State2 = GUICtrlGetState ($Radio2) $State3 = GUICtrlGetState ($Radio3) ConsoleWrite($State1 & " " & $State2 & " " & $State3 & @LF) EndFunc
  11. No doubts here. I just want to learn what's actually happening with the solutions I've given on here.
  12. Absolutely perfect! Thank You! Could you explain that pattern to me please?
  13. Hello All - I'm using the following string and trying to get just the *.tif name inbetween the quotes: "901676","3rdparty","00019596.tif","THIRD PARTY REPORTS","Appraisal","Page", And I'm using the RegEx: $aResults = StringRegExp ($sStr, '\"(.*?)\.tif') This returns 901676","3rdparty","00019596 I am unsure of where my pattern is wrong, I'm horrible with RegEx! Any help is appreciate for where my pattern is wrong.
  14. You could use something like this: $rtn = _GetAdapterName () ConsoleWrite($rtn & @LF) Func _GetAdapterName () Local $sComputer = "." Local $sNetName = "" $objWMIService = ObjGet("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & $sComputer & "\root\cimv2") If IsObj ($objWMIService) Then $colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_NetworkAdapter Where MacAddress="' & _GetMACFromIP (@IPAddress1) & '"', "WQL", 0x10 + 0x20) If IsObj($colItems) Then For $objItem In $colItems $sNetName = $objitem.NetConnectionID Next EndIf EndIf If $sNetName <> "" Then Return $sNetName Else Return -1 EndIf EndFunc Func _GetMACFromIP ($sIP) Local $MAC,$MACSize Local $i,$s,$r,$iIP ;Create the struct ;{ ; char data[6]; ;}MAC $MAC = DllStructCreate("byte[6]") ;Create a pointer to an int ; int *MACSize; $MACSize = DllStructCreate("int") ;*MACSize = 6; DllStructSetData($MACSize,1,6) ;call inet_addr($sIP) $r = DllCall ("Ws2_32.dll", "int", "inet_addr", _ "str", $sIP) $iIP = $r[0] ;Make the DllCall $r = DllCall ("iphlpapi.dll", "int", "SendARP", _ "int", $iIP, _ "int", 0, _ "ptr", DllStructGetPtr($MAC), _ "ptr", DllStructGetPtr($MACSize)) ;Format the MAC address into user readble format: 00:00:00:00:00:00 $s = "" For $i = 0 To 5 If $i Then $s = $s & ":" $s = $s & Hex(DllStructGetData($MAC,1,$i+1),2) Next ;Return the user readble MAC address Return $s EndFunc Credit for the IP Address to MAC Address function goes to LazyCat
  15. Not a problem. Just want to make sure I wasn't going crazy
×
×
  • Create New...