Jump to content

Merckie

Members
  • Posts

    3
  • Joined

  • Last visited

Merckie's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. The file looks like XML so you may be able to use _XMLDOMWrapper to extract the date/time string. #Include <Date.au3> Local $DatePart, $TimePart $text = 39876.7707 $Date = _DateAdd("D",Floor($text),"1900/01/01 00:00:00") $Date = _DateAdd("n",Round(($text-Floor($text))*24*60),$Date) _DateTimeSplit($Date, $DatePart, $TimePart) $Date = $DatePart[2] & "/" & $DatePart[3] & "/" & $DatePart[1] & " " & $TimePart[1] & ":" & $TimePart[2] MsgBox(0,"",$Date)
  2. I think it's the number of days since 1/1/1900. The fractional number will be the time, the whole number the date. You can probably use the _DateAdd function.
  3. I'm a newb to AutoIt and coding in general. I have been working with AutoIt for a few months now and have already had lots of success, but I've hit a wall. A few years ago we contracted out to a group to automate a Windows app for us using QTP (Quick Test Professional)...the code sucks and I'm constantly having to restart the automation scripts. I've been re-coding the QTP automation into AutoIt and am stuck when it comes to controlling a scroll bar. I can get the scroll bar to move but the actual window doesn't refresh. I have tried many different methods of moving the scroll bar (except for actually moving it with the mouse), but none refresh the window. I have also tried sending keyboard commands, Arrow-down, Page-down, etc., and refresh commands (_WinAPI) but those don't work either. In QTP, the scroll bar and window act normally with the command: "WinObject("AfxWnd42").VScroll micPageNext, 2", but I can't seem to find anything in AutoIt that acts similarily. Thanks for any help! (I apologize for the sloppyness of my code, but it's a result of trying lots of variations) #include-once #include <GuiTab.au3> #Include <GuiListView.au3> #include <GUIConstantsEx.au3> #include <TreeviewConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <GUIListBox.au3> #include <_XMLDomWrapper.au3> #Include <GuiComboBoxEx.au3> #Include <GuiScrollBars.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StructureConstants.au3> #include <ScrollBarConstants.au3> #include <GuiEdit.au3> #include <GuiStatusBar.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <ScrollBarConstants.au3> #Include <GuiScroll.au3> #Include <WinAPI.au3> AutoItSetOption("MustDeclareVars", 0) Local $Max, $yPos, $Page, $Pos WinActivate("Somnologica - [","") Sleep(2000) Local $hWnd = ControlGetHandle("Somnologica - [","","[CLASS:AfxWnd42; INSTANCE:8]") Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT) $Max = DllStructGetData($tSCROLLINFO, "nMax") $Page = DllStructGetData($tSCROLLINFO, "nPage") $Pos = DllStructGetData($tSCROLLINFO, "nPos") DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page) DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS) _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO, True) ;_GUIScrollBars_ScrollWindow($hWnd, 0, $Pos + $Page) ;Scrollbar_Scroll($hWnd, $SB_VERT, $Max) ;WM_VSCROLL($hWnd, $SB_PAGEDOWN) Sleep(2000) ;Local $hWnd2 = ControlGetHandle("Somnologica - [","","[CLASS:Afx:400000:0]") Local $hWnd2 = WinGetHandle ("Somnologica - [","") ConsoleWrite("hWnd2: " & $hWnd2 & @CRLF) ;Local $return = _WinAPI_UpdateWindow($hWnd2) Local $return = _WinAPI_RedrawWindow($hWnd2,0,0,$RDW_ERASE) ConsoleWrite("Update: " & $return & @CRLF) Sleep(2000) MouseMove ((0.5*@DesktopWidth), (0.75*@DesktopHeight)) ConsoleWrite((0.5*@DesktopWidth) & " " & (0.75*@DesktopHeight) & @CRLF) MouseClick("right",MouseGetPos(0),MouseGetPos(1),1,10) ConsoleWrite("Completed")
×
×
  • Create New...