Jump to content

Athos

Active Members
  • Posts

    50
  • Joined

  • Last visited

Athos's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. Thanks John, that works very well
  2. Hi guys I'm currently using: Local $sHTML = _IEDocReadHTML($oIE) to get the html source code from a page. Thing is, I want to be able to view the entire source code preferably in a text document like notepad. I tried using MsgBox, but it wont let me scroll down. My current code to get this is as follows: Run("notepad.exe") Sleep(1000) WinWait("[CLASS:Notepad]") ControlSend("Untitled - Notepad","","", $sHTML) Problem with this is that it takes a lot of time, and I want to be able to get the source code instantly.
  3. ame1011, I am waiting for the objects to laod/exist. These objects do load with the page, my problem is waiting until they are in fact loaded.
  4. Also I can see the source of the given object, it's just I don't think there are any attributes to manipulate.
  5. I don't get what it means when _IEPropertyGet($agreeB, "isdisabled)=0. It fails, so does that mean its enabled? If so then, why can't I click it right away??
  6. Are we supposed to do this all with IEPropertyGet?
  7. Hi guys. I'm having difficulty trying to detect if an object is loaded. So basically, I want to imitated the _IELoadWait() Method, but instead, I want to wait until a particular object appears on the screen. In the past I was able to do this by looking for a particular link, but with this current webpage, all I have access to are 2 objects. <INPUT TYPE="button" NAME="a_button" VALUE="I accept"> <INPUT TYPE="button" NAME="b_button" VALUE="I don't accept"> So I need to wait until either of these buttons is clickable, but I'm really not sure how. There doesn't appear to be a collection for objects. There is a form element one, but these objects don't have a form that I can reference.
  8. The database runs the background operations of the program I'm automating (think version control but for autocad). I don't think I have any access to this database, so I feel like I have to do it the way I wrote in the OP.
  9. It's a database error that I have no control over. Basically It occurs because I'm trying to do something, and the database hasn't finished processing enough stuff for me to do it. The way I got around this problem before was to simply wait an arbitrary amount of time (like 1 minute) so that the db has enough time to recover. The problem with this, is that the amount of time the database needs to finish processing can vary (sometimes more than a minute). So instead of just waiting an arbitrary amount of time, I want to able to constantly close these messages until the database has finished it's background processes and I can proceed with the script. I don't think there is another way to know if the database has finished all its operations otherwise.
  10. Hi Guys, I have a question on how to deal with an error box that I keep getting. So while my script normally works great, occassionaly, I get an error box (which is tied to a database error). Keep in mind this is an application error control box and not an Autoit error. The way a human would deal with this problem would be to click ok at any point that this popup appears. You just keep closing them until you can continue on with the test. Is there a way to get my script to constantly look for this popup and, if it appears to just click it? (I guess like exception handling)
  11. Hi guys, I have a qustion involving sliding guis. I wanted my gui to be able to slide out (so I can have more hidden options and the like). So I followed the guide in this excellent link: Sure enough it worked and I have a sliding GUI now..... But there is just one problem (one that poster Rishav had but the question was never answered). The width of the child GUI that slides out is always the same as the parent button. This is annoying, because I want a button with dimensions (30,50) to slide out a child Gui that has dimensions almost the size of the parent gui (lets just say 500,300). So can anybody tell me how I can fix this? I tried manually changing the child gui's height but to no avail. As a code reference I'll post sandin's original example: (if that can be modified so that hte child gui is longer than I can surely fix my own). #include #include #Include ;Global Const $WM_ENTERSIZEMOVE = 0x0231 ;Global Const $WM_EXITSIZEMOVE = 0x0232 $main_height = 300 ;height of the pop-up window $slide_speed = 500 ;window pop-up/down speed, bigger number = slower, smaller number = faster $Gui = GUICreate("Test", 370, 200) ;main GUI $checkbox = GUICtrlCreateCheckbox("Disable main window when child is open", 5, 5, 250) GUICtrlSetState(-1, $GUI_CHECKED) $button1 = GUICtrlCreateButton("Child_1", 5, 160, 100, 30) $button2 = GUICtrlCreateButton("Child_2", 110, 30, 250, 20) $bb = GUICtrlCreateTab(130, 80, 200, 100) $lol = GUICtrlCreateTabItem("Random control") WinSetTrans($Gui, "", 255) ;if it's not set to 255, then sliding out has visual bugs GUISetState(@SW_SHOW, $Gui) $ParentPosArr = WinGetPos($Gui) $ChildGui = GuiCreate("Child test", 100, $main_height, $ParentPosArr[0]+$ParentPosArr[2], $ParentPosArr[1]+5,$WS_POPUP, $WS_EX_MDICHILD, $Gui) $childpos = WinGetPos($ChildGui) $label1 = GUICtrlCreateButton("Test button 1", $childpos[2]/2-45, 5, 90) GUICtrlSetResizing (-1, $GUI_DOCKWIDTH+$GUI_DOCKHCENTER) ;button will be in center, and will not change width in case of window increasement (like when u press button2) $label2 = GUICtrlCreateButton("Close", $childpos[2]/2-45, 270, 90) GUICtrlSetResizing (-1, $GUI_DOCKWIDTH+$GUI_DOCKHCENTER) $label3 = GUICtrlCreateInput("Test", $childpos[2]/2-45, 80, 90) GUICtrlCreateGraphic(0, 0, $childpos[2], $childpos[3], 0x07) ;gray line on the edge of the pop up window GUISetState(@SW_HIDE, $ChildGui) $child2 = GuiCreate("Child test", 100, $main_height, $ParentPosArr[0]+$ParentPosArr[2], $ParentPosArr[1]+5,$WS_POPUP, $WS_EX_MDICHILD, $Gui) ;transparent window to lock main window when child is opened GUISetBkColor(0, $child2) WinSetTrans($child2, "", 100) GUISetState(@SW_HIDE, $child2) GUIRegisterMsg(0x0231,"WM_ENTERSIZEMOVE") GUIRegisterMsg(0x0232, "WM_EXITSIZEMOVE") Func WM_ENTERSIZEMOVE($hWndGUI, $MsgID, $WParam, $LParam) WinSetTrans($ChildGui,"",254) EndFunc Func WM_EXITSIZEMOVE($hWndGUI, $MsgID, $WParam, $LParam) WinSetTrans($ChildGui,"",255) EndFunc While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $button1 _show_child_window($button1, $slide_speed) ;slide in pop-up window ($button1 = button's handle) Case $button2 _show_child_window($button2, $slide_speed) case $label2 _slide_out($ChildGui, $slide_speed) EndSwitch WEnd Func _show_child_window($button_handle, $Speed) if WinExists($ChildGui) then _slide_out($ChildGui, $Speed/2) ;2x faster if switching between button pop-ups endif _slide_in($ChildGui, $Speed, $button_handle) EndFunc func _slide_in($hwGui, $Speed, $hwCtrl) Local $position = ControlGetPos($Gui, "", $hwCtrl) Local $position2 = WinGetPos($Gui) Local $position2b = WinGetClientSize($Gui) Local $position3 = WinGetPos($hwGui) Local $light_border = ($position2[2]-$position2b[0])/2 Local $thick_border = ($position2[3]-$position2b[1])-$light_border WinMove($hwGui, "", $position2[0]+$position[0]+$light_border, $position2[1]+$position[1]+$position[3]+$thick_border, $position[2]);set the window exacly below button DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwGui, "int", $Speed, "long", 0x00040004) _WinAPI_RedrawWindow($hwGui) GUISetState(@SW_SHOW, $hwGui) if GUICtrlRead($checkbox) = $GUI_CHECKED Then WinMove($child2, "", $position2[0]+$light_border, $position2[1]+$thick_border, $position2b[0], $position2b[1]) WinSetTrans($child2, "", 0) GUISetState(@SW_DISABLE, $child2) GUISetState(@SW_SHOWNOACTIVATE, $child2) for $i = 1 to 100 Step 10 ;showing "lock window" in smooth transparency WinSetTrans($child2, "", $i) Sleep(1) Next EndIf EndFunc func _slide_out($hwGui, $Speed) if WinExists($child2) Then for $i = 100 to 1 Step -10 WinSetTrans($child2, "", $i) Sleep(1) Next GUISetState(@SW_HIDE, $child2) EndIf DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwGui, "int", $Speed, "long", 0x00050008) GUISetState(@SW_HIDE, $hwGui) EndFunc
  12. Nope I just tried that and it didn't get the text. Even if this is impossible though, it's not a huge deal for me, as I was able to get the information I wanted by saving the config file and I'm able to track the information I wanted that way. I was just hoping I could get it directly from this screen.
  13. Hi Guys. I have a problem when I'm trying to get text from a control window, but there is no specific text there. The control id is: >>>> Window <<<< Title: Options Class: Dialog Position: 296, 107 Size: 688, 769 Style: 0x96CC0000 ExStyle: 0x00000100 Handle: 0x0000000000020F30 >>>> Control <<<< Class: TextArea Instance: 3 ClassnameNN: TextArea3 Name: Advanced (Class): [CLASS:TextArea; INSTANCE:3] ID: Text: Position: 8, 616 Size: 272, 23 ControlClick Coords: 147, 13 Style: 0x56000000 ExStyle: 0x00000000 Handle: 0x0000000000020F38 I've tried $sText = ControlGetText(WinGetTitle("[CLASS:TextArea]"), "", "[CLASS:TextArea; INSTANCE:3]") And I've had no luck. However, the text is cleary visible on the page and can be highlighted by double clicking. My question is do I have to resort to copying it into a new notepad, reading it there and then putting that data back into my script, or is there an easier way. Also, thanks for all your help so far. Best, Athos
  14. BrewMan: While I was indeed able to increase the size of the column, making both the time and date visible, copying them to the aggregated excel sheet still formated the time and date as decimals I think it's worth noting that I'm getting my data to the array using _ExcelReadSheetToArray().
×
×
  • Create New...