Copy text to clipboard fails

Issue reported by  Eyas Kopty <e.kopty@yahoo.com>

from ldtp import *
print "Notepad Test Started"
launchapp(str("notepad"))
print waittillguiexist('*-Notepad')
print activatetext("*Notepad", "#15")
settextvalue("*Notepad","#15", "Set this text")
appendtext("*Notepad", "#15", "Sample Text")
copytext("*Notepad", "#15",1)

Traceback (most recent call last):
  File "untitled1.py", line 15, in <module>
    copytext("*Notepad", "#15",1)
  File "C:\Program Files (x86)\VMware\CobraWinLDTP\ldtp\__init__.py", line 403,
in copytext
    return _remote_copytext(window_name, object_name, start, end)
  File "C:\Program Files (x86)\VMware\CobraWinLDTP\ldtp\client.py", line 66, in
__call__
    return self.__send(self.__name, args)
  File "C:\Python27\lib\xmlrpclib.py", line 1570, in __request
    verbose=self.__verbose
  File "C:\Program Files (x86)\VMware\CobraWinLDTP\ldtp\client.py", line 187, in request
    raise e
xmlrpclib.Fault: <Fault 0: 'Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.'>

QA Notes:
Testing Done: With the above test script on Windows 7 SP1 64-bit
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto:
QT 5.0.2 specific changes

QT Combo box need special fixes, though their accessibility object population is poorly done based on QT Creator
Installed QT 5.0.2 64-bit on Windows 7 box from http://qt-project.org/downloads

QA Notes:
Testing Done: QT Creator
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto:
Check ToolBar type on click

Check ToolBar type on click

QA Notes:
Testing Done: Verified with click('pane0', 'tbarUserPromotedNotificationArea') on Windows 7 SP1
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto:
iImplemented MouseMove API

Implemented MouseMove API

QA Notes:
Testing Done: Verified with VMware Horizon Workspace
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto:
Check control type Table, DataItem

Check control type Table, DataItem
Include DataItem as table cell

QA Notes:
Testing Done: Windows 7 SP1 with HTML table rendering on IE - http://www.w3.org/Amaya/User/doc/Tables.html using getcellvalue('*InternetExplorer', 'tbl0', 0) API
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto:
Check errno attribute
Added new APIs setcellvalue, guitimeout

Added new APIs setcellvalue, guitimeout
Support Custom control type under Table (WinForms DataGridView)

setcellvalue('Form1', 'tblDataGridView', 2, 2, '');wait(2);settextvalue('Form1', 'txtEditingControl', 'abc')
Maybe we should implement grabcellvalue ?
getcellvalue('Form1', 'tblDataGridView', 2, 2);wait(2);gettextvalue('Form1', 'txtEditingControl')
Python 3.x support

QA Notes:
Testing Done: Test program provided by Andy Chen <liuqing.chen@oracle.com>
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto:
Handle valuepattern in click API

Handle valuepattern in click API

>>> click('dlgWindows Security', 'lstUseanotheraccount')

Traceback (most recent call last):
  File "<pyshell#10>", line 1, in <module>
    click('dlgWindows Security', 'lstUseanotheraccount')
  File "C:\Program Files (x86)\VMware\CobraWinLDTP\ldtp\client.py", line 66, in __call__
    return self.__send(self.__name, args)
  File "C:\Python25\lib\xmlrpclib.py", line 1437, in __request
    verbose=self.__verbose
  File "C:\Program Files (x86)\VMware\CobraWinLDTP\ldtp\client.py", line 185, in request
    raise LdtpExecutionError(e.faultString.encode('utf-8'))
LdtpExecutionError: Unable to perform action

>>> click('dlgWindows Security', 'lstUseanotheraccount')
1

QA Notes:
Testing Done: Windows 7 SP1 "Windows Security" dialog
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto:
Fix bugs in APIs enterstring() and generatekeyevent()
Fix two bugs in Keyboard implementation
Write to log file if environment variable is set

Write to log file if environment variable LDTP_LOG_FILE is set
NOTE: File content will be overwritten

Example:
set LDTP_LOG_FILE=c:\ldtp.log

QA Notes:
Testing Done: Windows 7 SP1
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto:
Added scrollbar as supported type

Added scrollbar as supported type

QA Notes:
Testing Done: With Notepad horizontal and vertical scrollbar
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto:
Write to log file if environment variable is set

Write to log file if environment variable LDTP_LOG_FILE is set
NOTE: File content will be overwritten

Example:
set LDTP_LOG_FILE=c:\ldtp.log

QA Notes:
Testing Done: Windows 7 SP1
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto:
Added Scrollbar related APIs

New Scrollbar APIs added
onedown('*Notepad', 'Vertical', 10)
oneup('*Notepad', 'Vertical', 10)
oneright('*Notepad', 'Horizontal', 10)
oneleft('*Notepad', 'Horizontal', 10)
scrolldown('*Notepad', 'Vertical')
scrollup('*Notepad', 'Vertical')
scrollright('*Notepad', 'Horizontal)
scrollleft('*Notepad', 'Horizontal')

QA Notes:
Testing Done:
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto:
Updated ooldtp compatible with other supported languages
Fix to support InvokePattern on Open button

getAllItem( ) didnt go in the switch case in InternalComboHandler() Combobox.cs as our ComboBox doesn't support ExpandCollapsePattern and InvokePattern, but it's 'Open' object supports InvokePattern
Patch by: Helen Wu <liyuan.wu@oracle.com>

QA Notes:
Testing Done: By Helen on their test environment
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto:
Fix to support taskbar with consistent index

Fix to support taskbar with consistent index
With this fix, all the window without title will have index increased
Anything with window title, will not be incremented, noticed that taskbar have issues due to com exception thrown at random interval
and the window handle is removed from List (WindowList), due to this paneProgramManager is available before pane0 (taskbar), so the taskbar become pane1
Tests break just due to this reason

QA Notes:
Testing Done: VMware Horizon Files test
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto:
Free memory at end

Free memory at end

QA Notes:
Testing Done:
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto:
Added new keyboard controls

Added new keyboard controls (right, left, up, down arrow keys)
with the name:
right, arroawr, arrowright
left, arrowl, arrowleft
up, arrowu, arrowup
down, arrowd, arrowdown

QA Notes:
Testing Done: VMware Horizon Files system tray icon
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto:
Don't grab focus if type is tab item

Exception being thrown on verifying with Remote Desktop Connection->Show Options->Selecting a tab

selecttabindex('dlgRe*','ptlSettings',5)

System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at UIAutomationClient.IUIAutomationElement.GetCurrentPropertyValueEx(Int32 propertyId, Int32 ignoreDefaultValue)
   at System.Windows.Automation.AutomationElement.GetCurrentPropertyValue(AutomationProperty property, Boolean
ignoreDefaultValue)
   at System.Windows.Automation.AutomationElement.GetCurrentPropertyValue(AutomationProperty property)
   at System.Windows.Automation.AutomationElement.GetPropertyValue(AutomationProperty property, Boolean cached)
   at System.Windows.Automation.AutomationElement.AutomationElementInformation.get_BoundingRectangle()
   at Ldtpd.Utils.InternalClick(AutomationElement element) in C:\Program Files (x86)\Perforce\depot\tools\WinLdtpdService\Ldtpd\Utils.cs:line 1154
   at Ldtpd.Tab.SelectTabIndex(String windowName, String objName, Int32 index) in C:\Program Files (x86)\Perforce\depot\tools\WinLdtpdService\Ldtpd\Tab.cs:line 195

QA Notes:
Testing Done: Remote Desktop options on Windows 7
Documentation Notes:
Bug Number:
Reviewed by:
Approved by:
Mailto: