Jump to content

levanduyet

Active Members
  • Posts

    22
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

levanduyet's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Dear All, I have write the installer program, I need to install the ActiveX. I want to check the version of ActiveX before overiting it. How can I check this ActiveX exist and the version of this ActiveX? FileInstall("C:\WINDOWS\System32\COMDLG32.OCX",@TempDir & "\COMDLG32.OCX",1) Tks, LVD
  2. Hi, Here are two windows that I have mention above: LVD
  3. Dear All, I have written the code for using SAP. But I have the problem as following: When I login to SAP, there are two case: _ If nobody use my ID to login, I will see normal window when I login. _ If some one use my ID, and login first, I will see other window when I login. So, how can I write code to work with the above case? Tks, LVD
  4. Hi Mat,Tks, but it look so complicated for me. LVD
  5. Hi,I know this: FileSelectFolder("Xin chọn thư mục để cài đặt","::{20D04FE0-3AEA-1069-A2D8-08002B30309D}") But I want to use the function of Yashied. LVD
  6. Hi Yashied, How can I start with the folder: "My Computer"? Tks, LVD
  7. Dear All, In my script that I use: $FolderPath = FileSelectFolder("Please chose the folder","") If I want the initial folder is "My computer" what code should I use? Tks, LVD
  8. Hi Happy in Moscow, How about changing the caption of button "OK" or "Cancel"? Tks, LVD
  9. Dear All, When I use the following code: $FolderPath = FileSelectFolder("Chose folder","") How can I change the caption of SelectFolder window and button. Tks, LVD
  10. Hi All, I am making the installation file. I want to check the "Administrator" before let the script do something. If I use the following code: If @UserName <> "Administrator" Then EndIf in some case, it's not correct because the user may change the name but they are still "Administrator group". So, How can I check the user in "Administrator" group or not? Tks, LVD
  11. Dear All, I have found out func _SAPObjSelect($object_id) Local $SubString $sap_object_id = $object_id Select ; GuiButtons Case StringInStr($object_id, "/btn") > 0 $sap_session.findById("wnd[" & $sap_window_num & "]/" & $object_id).press ; GuiRadioButton Case StringInStr($object_id, "/rad") > 0 $sap_session.findById("wnd[" & $sap_window_num & "]/" & $object_id).select ; GuiCheckBox Case StringInStr($object_id, "/rad") > 0 Or _ StringInStr($object_id, "/chk") > 0 $sap_session.findById("wnd[" & $sap_window_num & "]/" & $object_id).selected = True ; GuiMenubar Case StringInStr($object_id, "mbar/") > 0 $sap_session.findById("wnd[" & $sap_window_num & "]/" & $object_id).select ; GuiToolbarContextButton, Duyet add more date: 14.06.2010 ; So the user must call _SAPObjSelect("/usr/cntlCONTAINER/shellcont/shell,&MB_EXPORT,1 ~~> pressToolbarContextButton ; So the user must call _SAPObjSelect("/usr/cntlCONTAINER/shellcont/shell,&MB_EXPORT,2 ~~> pressContextMenuItem Case StringInStr($object_id, "shellcont/shell") >0 $SubString=StringSplit($object_id,",",1) ;If it's ToolbarContextButton If $SubString[0]=3 and $SubString[3]=1 Then ;session.findById("wnd[0]/usr/cntlCONTAINER/shellcont/shell").pressToolbarContextButton "&MB_EXPORT" $sap_session.findById("wnd[" & $sap_window_num & "]/" & $SubString[1] ).pressToolbarContextButton($SubString[2]) ElseIf $SubString[0]=3 and $SubString[3]=2 Then ;session.findById("wnd[0]/usr/cntlCONTAINER/shellcont/shell").selectContextMenuItem "&PC" $sap_session.findById("wnd[" & $sap_window_num & "]/" & $SubString[1] ).selectContextMenuItem($SubString[2]) EndIf ; GuiLabel Case StringInStr($object_id, "/lbl") > 0 ; If the GuiLabel is not an expanded twistie, then select it (for a GuiLabel twistie, this will expand it) if StringCompare($sap_session.findById("wnd[" & $sap_window_num & "]/" & $object_id).text, "5") <> 0 Then $sap_session.findById("wnd[" & $sap_window_num & "]/" & $object_id).setFocus $sap_session.findById("wnd[" & $sap_window_num & "]/" & $object_id).caretPosition = 1 _SAPVKeysSend("F2") EndIf EndSelect Return 1 EndFunc But the red one shown error: D:\Study_All\Learning_AutoIt\SAP.au3 (392) : ==> The requested action with this object has failed.: $sap_session.findById("wnd[" & $sap_window_num & "]/" & $SubString[1] ).selectContextMenuItem($SubString[2]) $sap_session.findById("wnd[" & $sap_window_num & "]/" & $SubString[1] )^ ERROR Anyone know. Tks, Le Van Duyet
  12. Dear All, I have record and find out that, these thing does not content in SAP.au3 at func _SAPObjSelect($object_id) session.findById("wnd[0]/usr/cntlCONTAINER/shellcont/shell").pressToolbarContextButton "&MB_EXPORT" session.findById("wnd[0]/usr/cntlCONTAINER/shellcont/shell").selectContextMenuItem "&PC" So, how I can adjust the SAP.au3 and use it. Tks, Le Van Duyet
  13. Thank you. Solved. Anyway, what's wrong with my UDF above. LVD
  14. I am new in AutoIt. Anyone help me to understand that How can I write the UDF to return an array. Something like following: Func _ChoseDate() Local $n1,$n2, $msg, $button_1 Local $arrTest[2] GUICreate("Get the movements", 140, 140, 800, 200) $n1 = GUICtrlCreateDate("", 20, 20, 100, 20, $DTS_SHORTDATEFORMAT) $n2=GUICtrlCreateDate("",20,60,100,20,$DTS_SHORTDATEFORMAT) ; to select a specific default format ;$DTM_SETFORMAT_ = 0x1032 ; $DTM_SETFORMATW ;$style = "yyyy/MM/dd HH:mm:ss" ;GUICtrlSendMsg($n1, $DTM_SETFORMAT_, 0, $style) ;GUICtrlSendMsg($n2, $DTM_SETFORMAT_, 0, $style) ; Create the controls $button_1 = GUICtrlCreateButton("&OK", 20, 100, 100, 30) GUISetState() ; In this message loop we use variables to keep track of changes to the radios, another ; way would be to use GUICtrlRead() at the end to read in the state of each control While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ;This function will return 0 if the user does not want to run this Return 0 GUIDelete() Exit Case $msg = $button_1 ;Return the chosen date $DTM_SETFORMAT_ = 0x1032 ; $DTM_SETFORMATW $style = "yyyy/MM/dd HH:mm:ss" GUICtrlSendMsg($n1, $DTM_SETFORMAT_, 0, $style) GUICtrlSendMsg($n2, $DTM_SETFORMAT_, 0, $style) $iDateCalc = _DateDiff( 'D',GUICtrlRead($n1),GUICtrlRead($n2)) if $iDateCalc<0 Then return 0 GUIDelete() Exit Else $arrTest[0]=GUICtrlRead($n1) $arrTest[1]=GUICtrlRead($n2) Return $arrTest GUIDelete() Exit EndIf EndSelect WEnd EndFunc Tks, LVD
×
×
  • Create New...