Jump to content

SupaNewb

Active Members
  • Posts

    32
  • Joined

  • Last visited

Profile Information

  • Location
    Jax, Fl
  • Interests
    Autoit, ASP.NET, C#, C++, CSS

SupaNewb's Achievements

Seeker

Seeker (1/7)

4

Reputation

  1. This post might help you:
  2. I still have that reg value (C:\MyAutoit\MyIncludes;C:\MyAutoit\Others_UDF) It doesn't appear to have any effect. However, I was able to add only one additional UDF/Includes directory to SciTEUser.properties ( openpath.$(au3)=$(SciteDefaultHome)\..\include;C:\MyAutoit\MyIncludes) I would also like to know if this is wrong or improper usage? If so, Is there a correct way to add 2 more directories without adding the full path to the UDF/include(#include "C:\MyAutoit\MyUDFs\MyFF.au3") ?
  3. #include <GuiListBox.au3> __GetAllListBoxText() Func __GetAllListBoxText() Local $hListBox, $iItemCount, $sText $hListBox = ControlGetHandle("Flow Monitor", "", "[CLASS:ListBox; INSTANCE:1]") $iItemCount = _GUICtrlListBox_GetCount($hListBox) For $i = 0 To $iItemCount - 1 $sText = _GUICtrlListBox_GetText($hListBox,$i) ConsoleWrite("Index: " & $i & @TAB & "Text String: " & $sText & @CRLF) Next EndFunc ;==>__GetAllListBoxText
  4. ;taking a wild guess here lol. ControlFocus("CAESAR II 2014 - InstallShield Wizard", "&Serial Number:","[CLASS:Edit; INSTANCE:1]") Sleep(100) ControlSend("CAESAR II 2014 - InstallShield Wizard", "&Serial Number:","[CLASS:Edit; INSTANCE:1]", "123456789") ;OR ControlFocus("CAESAR II 2014 - InstallShield Wizard", "&Serial Number:","[CLASS:Edit; INSTANCE:1]") Sleep(100) Send("{NUMPAD1}{NUMPAD2}{NUMPAD3}{NUMPAD4}{NUMPAD5}{NUMPAD6}{NUMPAD7}{NUMPAD8}{NUMPAD9}{ENTER}")
  5. No result? What does it return in the console(the lower pane in Scite) when you run your code? If ControlGetText fails, it sets the @error flag to 1. That is why I included @error in the ConsoleWrite. When my code doesn't work or return as expected, I start console writing the output of each command until the problem is isolated. There is actually a nifty tool in Scite(Debug To Console) that speeds up this process. That combined with the help file is usually all that is needed.
  6. Try this Local $sText = ControlGetText("Flow Monitor", "", "[CLASS:ListBox; INSTANCE:1]")If no good, try this to see what is returning in the console #include <MsgBoxConstants.au3> Local $hWnd = WinGetHandle("[CLASS:IDM_FrameWindow; INSTANCE:1]") ConsoleWrite("Handle: " & $hWnd & @TAB & "Error Code: " & @error & @CRLF) Local $sText = ControlGetText("Flow Monitor", "", "[CLASS:ListBox; INSTANCE:1]") ConsoleWrite("Text: " & $sText & @TAB & "Error Code: " & @error & @CRLF) MsgBox($MB_SYSTEMMODAL, "", "The text is: " & $sText)
  7. ControlSetText("CAESAR II 2014 - InstallShield Wizard", "&Serial Number:","[CLASS:Edit; INSTANCE:1]", "123456789")
  8. [CLASS:ListBox; INSTANCE:1] if the Windows ListBox is the first instance. There is a GuiListBox UDF. You will need to know the ListBox control ID or it's handle.
  9. #include <GUIConstantsEx.au3> #include <GuiEdit.au3> $Form1 = GUICreate("Username", 170, 235, 190, 200) $usernamefield = GUICtrlCreateInput("", 21, 120, 130, 20) $passwordfield = GUICtrlCreateInput("Password", 21, 145, 130, 20, 0x0020) _GUICtrlEdit_SetCueBanner(GUICtrlGetHandle($usernamefield), "User Name") GUISetState() While True $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit ;~ if ControlGetFocus($usernamefield) = True and GUICtrlRead($usernamefield) = "Username" Then ;~ GUICtrlSetData($usernamefield, "") ;~ ElseIf ControlGetFocus($usernamefield) = True Then ;~ GUICtrlSetData($username, "Username") ;~ EndIf EndSwitch WEnd
  10. Here is just one of many ways to accomplish your goal. #Include <StructureConstants.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> Global $fPCEDblClck = False;a global flag to trigger internal message handler Global $hMainGui = GUICreate("SomeTitle",240,200) Global $idListView1 = GUICtrlCreateListView("Column A|Column B",-1,-1,120,200) Global $idListView2 = GUICtrlCreateListView("Column A|Column B",120,-1,120,200) Global $dLVhWnd,$dLVIndex,$dLVSubItem GUISetState() GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") __LoadListViews() While 1 $Msg = GUIGetMsg(1) Switch $Msg[1] Case $hMainGui Switch $Msg[0] Case $GUI_EVENT_CLOSE GUIDelete($hMainGui) Exit EndSwitch EndSwitch If $fPCEDblClck Then __SomeFunction(); if the flag = True Then call your function/s WEnd Func __SomeFunction() $fPCEDblClck = False;reset flag first ConsoleWrite("ListView Handle: " & $dLVhWnd & @CRLF) ConsoleWrite("ListView Index: " & $dLVIndex & @CRLF) ConsoleWrite("SubItem: " & $dLVSubItem & @CRLF) EndFunc Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $hWndFrom, $iCode, $tNMHDR $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $iCode Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) $dLVhWnd = $hWndFrom $dLVIndex = DllStructGetData($tInfo, "Index") $dLVSubItem = DllStructGetData($tInfo, "SubItem") $fPCEDblClck = True EndSwitch Return $GUI_RUNDEFMSG;return back to Autoit message handler EndFunc ;==>WM_NOTIFY Func __LoadListViews() For $i = 0 To 9 GUICtrlCreateListViewItem($i,$idListView1) GUICtrlCreateListViewItem($i,$idListView2) Next EndFunc
  11. From the help file: ControlGetText Example() Func Example() ; Run Notepad Run("notepad.exe") ; Wait 10 seconds for the Notepad window to appear. Local $hWnd = WinWait("[CLASS:Notepad]", "", 10);this is one way to obtain the Notepad Window/GUI handle ; Set the edit control in Notepad with some text. The handle returned by WinWait is used for the "title" parameter of ControlSetText. ControlSetText($hWnd, "", "Edit1", "This is some text") ; Retrieve the text of the edit control in Notepad. The handle returned by WinWait is used for the "title" parameter of ControlGetText. Local $sText = ControlGetText($hWnd, "", "Edit1") ; Display the text of the edit control. MsgBox($MB_SYSTEMMODAL, "", "The text in Edit1 is: " & $sText) ; Close the Notepad window using the handle returned by WinWait. WinClose($hWnd) EndFunc ;==>Example You will get more help here by posting the actual code that you have tried. Once you obtain the GUI/Window handle that contains the control/s you want to interact with, the problem is half solved. Are you able to retrieve/obtain the GUI handle?
  12. #Include <GUIConstantsEx.au3> $Form1 = GUICreate("FruitMachine", 170, 235, 190, 200) local $fruit[5] $addfruit = GUICtrlCreateButton("Add", 21, 170, 130, 30) $fruitinput = GUICtrlCreateInput("Fruit", 21, 145, 130, 20) $selectfruit = GUICtrlCreateCombo($fruit, 21, 95, 130, 20) GUISetState() While True $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $addfruit __UpdateCombo() ;~ _ArrayInsert($fruit, UBound(($usernames)),GUICtrlRead($fruitinput)) endswitch ;~ for $i = 0 to $i-1 step 1 ;~ GUICtrlSetData($selectfruit, $fruit[$i]) #supposed to update combo box ;~ Next WEnd Func __UpdateCombo() Local $sFruit = GUICtrlRead($fruitinput) If Not $sFruit = "" Then GUICtrlSetData($selectfruit,$sFruit) EndFuncA little tip.....One post is all that is required.
  13. Issue: If either date picker controls receive focus, then use arrow keys to change date in edit portion, flags do not set to True until mouse move or mouse click. I have used this exact method in the past & it works perfectly. I just can't figure out what I am doing wrong here. The only thing different I can think of is I just updated my Autoit version to ;Autoit v3.3.14.0 & if it matters system I am using is running Win7 Pro x86. #include <WindowsConstants.au3> #include <GuiRichEdit.au3> #include <Date.au3> #include <DateTimeConstants.au3> #include <GUIConstantsEx.au3> ;If either date picker controls recieve focus, then use arrow keys to change date ; in edit portion, flags do not set to True until mouse move or mouse click. ;Flags set fine when drop down is closed Global $fdpLogChange = False, $fdpMainChange = False Global $hDailyLogGUI, $g_id_dpDailyLog Global $hMainGui = GUICreate("GardenBuddy", @DesktopWidth / 1.5, @DesktopHeight / 1.4, -1, -1) Global $g_id_dpMain = GUICtrlCreateDate(_NowDate(), 8, 20, 181, 25) Global $mView = GUICtrlCreateMenu("&View") Global $mPlantChart = GUICtrlCreateMenuItem("Plant Chart", $mView, 0) GUICtrlCreateMenuItem("", $mView, 1) Global $mDailyLog = GUICtrlCreateMenuItem("Daily Log", $mView, 2) GUISetState() GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") While 1 $Msg = GUIGetMsg(1) Switch $Msg[1] Case $hMainGui Switch $Msg[0] Case $GUI_EVENT_CLOSE GUIDelete($hMainGui) Exit Case $mDailyLog __CreateDailyLog() Case Else If $fdpMainChange = True Then __DateChangeMain() EndSwitch Case $hDailyLogGUI Switch $Msg[0] Case $GUI_EVENT_CLOSE GUIDelete($hDailyLogGUI) Case Else If $fdpLogChange = True Then __DateChangeDL() EndSwitch EndSwitch WEnd Func __CreateDailyLog() Local $iW = @DesktopWidth / 2, $iH = @DesktopHeight / 2 $hDailyLogGUI = GUICreate("Daily Log", $iW, $iH, -1, -1, $WS_OVERLAPPEDWINDOW) $g_reDailyLog = _GUICtrlRichEdit_Create($hDailyLogGUI, "", 0, 60, $iW, $iH - 110, _ BitOR($WS_VSCROLL, $ES_WANTRETURN, $ES_AUTOVSCROLL, $ES_MULTILINE)) _GUICtrlRichEdit_SetFont($g_reDailyLog, 12) $g_id_dpDailyLog = GUICtrlCreateDate(_NowDate(), 8, 20, 181, 25) GUISetState() EndFunc ;==>__CreateDailyLog Func __DateChangeDL();Would like to be instantly notified if user changes the date through any means. $fdpLogChange = False ConsoleWrite("Log Changed" & @CRLF) EndFunc ;==>__DateChangeDL Func __DateChangeMain() $fdpMainChange = False ConsoleWrite("Main Changed" & @CRLF) EndFunc ;==>__DateChangeMain Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $tInfo, $hWndDateDailyLog, $hWndDateMain $hWndDateDailyLog = GUICtrlGetHandle($g_id_dpDailyLog) $hWndDateMain = GUICtrlGetHandle($g_id_dpMain) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndDateDailyLog, $hWndDateMain Switch $iCode Case $DTN_DATETIMECHANGE If $iIDFrom = $g_id_dpDailyLog Then $fdpLogChange = True If $iIDFrom = $g_id_dpMain Then $fdpMainChange = True Return 0 Case $DTN_CLOSEUP ;no return value Case $DTN_USERSTRING Return 0 Case $DTN_WMKEYDOWN Return 0 EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY
  14. I am running Firefox v30., Win7 32bit(x86). Since version 29 if my browser window was not Maximized, the window controls(maximize,minimize,restore etc.) would disappear however, if you hover your cursor in the taskbar (over the firefox icon) a control will appear. Right click on the window instance then left click on maximize. That black spot should be gone and your window controls should come back. I don't know why Mozilla did this. Maybe someone else will chime in and tell us there's a setting in 'about:config' that can change/disable this behavior.
×
×
  • Create New...