Jump to content

ElwoodB

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by ElwoodB

  1. Better late than never 😉
  2. it is a bad habit to use values instead of "understandable" names, here "2" instead of $INET_DOWNLOADCOMPLETE. Unless you want to lose time by reading your code again. Back to topic: The code you propose here doesn't work for me. I find two issues: 1) I can see 2 connections to my FTP server, one done by InetGet and one done by InetGetSize. This is strange (I would expect the 2 to use the same connection) but as InetGetSize does not use a connection handle I guess it's by design. Then, I see the 2 connections staying idle for 2 minutes and then they disconnect from the server with error: 425 Error while transfering data: ECONNABORTED - Connection aborted 2) If I use first InetGetSize and then InetGet, I have only one connection, instead of two. It makes me think there is some tricky stuff here. If I use Example 1 from the help page of _FTP_ProgressDownload, it works perfectly, even the progress bar. So this is the way to go, IMO.
  3. Thanks for pointing that out. By reading Jon answer from 10 years ago, came to my mind the same questions of the two comments below Jon's. When I read this Jon's comment, I'm sure a small explanation have to go to the Run() help file. I propose :
  4. Hi Jos, Here are two scripts. Runme-first.au3 #NoTrayIcon #include <MsgBoxConstants.au3> Opt('MustDeclareVars', 1) Local $pid If FileExists(@ScriptDir & "\runas-admin.exe") Then $pid = Run(@ScriptDir & "\runas-admin.exe") If $pid = 0 Then MsgBox($MB_OK,"Cannot Run() runas-admin.exe",@error) EndIf $pid = ShellExecute(@ScriptDir & "\runas-admin.exe") If $pid = 0 Then MsgBox($MB_OK,"Cannot ShellExecute() runas-admin.exe",@error) EndIf EndIf Exit 0 Runas-admin.exe : #NoTrayIcon #RequireAdmin #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Opt("GUICoordMode", 1) ;1=absolute, 0=relative, 2=cell MsgBox($MB_OK,"username is",@UserName) Exit 0 About the environnment : I am on a Windows Server 2022 which is connected to an Active directory. I am logged as a user with admin rights (so I can right click a binary and select "Run as administrator". I have this UAC warning and when I click Yes, the program is executed. Test : I run "runme-first" by double-clicking the .exe. It cannot Run(runas-admin.exe) and it displays @error = 1 And then it can ShellExecute() the same binary and displays the current username.
  5. Hi, I know Run and ShellExecute are not the same but I really wonder if the following is a bug or not. I have an AutoIT exe that I run by double-clicking the file in Windows (it runs in the current user profile) . It then runs another AutoIT exe which has the #RequireAdmin option. When I use Run() it doesn't run, PID is 0 and @error flag is 1. If I use ShellExecute() it runs fine. Should I create a bug report?
  6. TommyDDR on the French forum gave me the answer (link). The good line is, ie. using the global $tagNMHDR variable: Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
  7. I didn't understand what you mean. I probably can't help but you need to give more details if you want people to help. How exactly do you use Autoit? As the published application? As a way to generate the RDP icon? Not related to AutoIt but I've seen several programs to not work when moved on a monitor which is not the main one.
  8. Ah yes, I used AutoIt Full Installation installer but then I probably selected the ZIP download because it says "(includes x86 and x64 components" so I thought it was better than the installer one 😞. BTW, when running the editor (from Full Installation) for the first time, it says msvcp140.dll is missing. I suggest that installer would check if the MSVC runtimes are installed. It could then warn the user.
  9. @Jos I didn't want to be harsh but yes, it was badly worded, sorry 😞 Then why syntax highliting is not integrated by default? I have the impression that it's always better to make things easier for everyone, especially for newcomers. So I am surprised it's not integrated 16 years later.
  10. Hi, With the same code, if I compile for x86, my double-click works. If I compile in x64, it does nothing. I use GUIRegisterMsg($WM_NOTIFY, "MyFunction") What can cause this? I just found this bug report: https://www.autoitscript.com/trac/autoit/ticket/1432 I don't see how it can apply to my code. Still trying...
  11. Wow, we are 16 years later, and the new version still doesn't highlight au3 files. When I install AutoIt (last version), it comes with SciTE 4.4.6 and au3 syntax highlighting works. If I change the content of C:\Program Files (x86)\AutoIt3\SciTE by the latest version, 5.2.3, highlighting doesn't work. It should not be related to admin rights as both old and new versions are stored in the same location, with the same rights. In the new version, when I click on the Language menu, the displayed menu items does not show "au3" in the menu. Also if I run SciTE.exe from anywhere else with full user rights (like on "Desktop"), same behavior. With Process monitor, I see that the au3.properties file is opened. So what can explain that highlighting doesn't work?
  12. Thanks for your time, Jos. I was Run-ing "mstsc.exe" and I found out that it spawns a new process immediately so the new process had a new PID and ProcessExists() could not find it obviously. So I had to rely on WinWait() to catch the window opened by Mstsc. So in the end I was fooled by MS, again 😛
  13. Arghh, I read that many times. Sorry 😞 As I have a problem in my code (which seems related to passing arguments to a Func), I thought the manual could be wrong. I need to sleep. 🙂 Thanks for highlithing the "or".
  14. 1) because it's still wrong from my point of view. 2) Source : https://www.autoitscript.com/autoit3/docs/functions/ProcessExists.htm 3) It's nowhere mentioned that using the PID as as argument works. 4) in my very small test, it doesn't work 4 good reasons to update this thread, IMO.
  15. Hum, according to the documentation, ProcessExists($pid) should not work as this function expects a process name and not a PID. Or is the documentation wrong?
×
×
  • Create New...