Jump to content

Cupidkidd

Members
  • Posts

    4
  • Joined

  • Last visited

Cupidkidd's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. You're right. I forgot the authority of administrator. So I added #requireadmin as you suggested. Now, the first problem is solved naturally. I didn't do anything, just re-compile it and test. It worked normally. Thank you, Melba23. And I'll continue to focus on the second problem.
  2. Thank Melba23 to reminder me. Here is the code for the first question. There are Chinese words in the code, I doubt whether friends could understand me... It's a simple application. I mean to get text from some textboxes in a window automaticlly. Then write the data into a text file, and an opening notepad as well. When I run it in the SCiTE(ACN) 2.29, it goes well. After compiling to exe, it runs with no effection... WinWait("通用测量","开始测量") Local $var_file = "C:\record.txt" Local $file_id = FileOpen ($var_file,1) If $file_id=-1 Then MsgBox (0, "", "文件有错误,必须退出脚本!") Exit EndIf Run("notepad.exe") WinWaitActive("无标题 - 记事本") ;"untitled - notepad" ControlSend("无标题 - 记事本", "", "Edit1", "年-月-日 时:分:秒" & @TAB & "CO" & @TAB & "CO2" & @TAB & "HC" & @TAB & "NO" & @TAB & "O2" _ & @TAB & "λ" & @TAB & "油温" & @TAB & "转速{ENTER}") FileWriteLine($file_id, "年-月-日 时:分:秒" & @TAB & "CO" & @TAB & "CO2" & @TAB & "HC" & @TAB & "NO" _ & @TAB & "O2" & @TAB & "λ" & @TAB & "油温" & @TAB & "转速") ;code up write the data title like date, oxygen, etc. Local $var_time = "" Local $var_data = "" While WinExists("通用测量", "开始测量") $var_time = @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC $var_data = ControlGetText("通用测量", "开始测量", "Edit2") & @TAB & ControlGetText("通用测量", "开始测量", "Edit3") _ & @TAB & ControlGetText("通用测量", "开始测量", "Edit4") & @TAB & ControlGetText("通用测量", "开始测量", "Edit5") _ & @TAB & ControlGetText("通用测量", "开始测量", "Edit6") & @TAB & ControlGetText("通用测量", "开始测量", "Edit7") _ & @TAB & ControlGetText("通用测量", "开始测量", "Edit8") & @TAB & ControlGetText("通用测量", "开始测量", "Edit9") ControlSend("无标题 - 记事本", "", "Edit1", $var_time & @TAB & $var_data & "{ENTER}") FileWriteLine($file_id, $var_time & @TAB & $var_data) Sleep(560) WEnd FileClose($file_id) MsgBox(0, "", "五气上位机测量窗体已经关闭,退出脚本!")
  3. Firstly, every time I open my Qt application, the control has a different handle. Secondly, I put the caption/text into the parameter but no action... Do you know why?
  4. Now two problem worry me a lot. Hope the professionals give me a hand. No1. when in the status of script, it runs normal. after compiling, it can be executed, but no any action. No2. how to deal with the control of QWidge. the function 'ControlClick' etc. don't have effection.... expect your help...
×
×
  • Create New...