
nmontec
Active Members-
Posts
25 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by nmontec
-
Dear All, I am having some trouble in automating a window. Everything is fine is I may use the couple WinActivate/WinWaitActive but it is not working if the window is minimized. I need to click a button and I tried the following: I declared in an object a reference like this: self.autoit=win32com.client.Dispatch('AutoItX3.Control') self.autoit.AutoItSetOption('WinTitleMatchMode',2) self.autoit.AutoItSetOption("WinDetectHiddenText", 1) And a t a certain point I press the Exit button self.autoit.ControlClick('Dome','','[CLASSNN:WindowsForms10.BUTTON.app.0.378734a15]') self.autoit.ControlClick('Dome','','[NAME:ButtonExit]') self.autoit.ControlClick('Dome','','[CLASS:WindowsForms10.BUTTON.app.0.378734a; INSTANCE:15]') Now, If the window is active and screen is not locked all is ok.But if window is minimized and/or screen is locked the command does not have any effect on the window. As far as I know controlclick should work also on these situations. Am I wrong? Thanks a lot for your help Nicola
-
Dear All, I have a UI where a users has got two buttons. one "Play" and one "Pause". When I hit "Play" the program runs Func A, but then if I hit "Pause" the function associated to"Pause" is not run until the Func "Play" is not completed and this is exactly what I don't want as I want to stop the flow and being able to keep it going again if I press "Play" again. Do you have any idea on how to do that? At the moment (not working) I have something like this: $start=GUICtrlCreateButton ( "Play", 20, 250, 70, 25) GUICtrlSetOnEvent($start, "StartButton") $stop=GUICtrlCreateButton ( "Pause", 100, -1, 70, 25) GUICtrlSetOnEvent($stop, "StopButton") Func StartButton() for $i=1 to 10 ; do something sleep (1000) next EndFunc Func StopButton() ; Pause the script EndFunc Thanks a lot for your help Nicola
-
You're right, I didn't post any code.. The array is declared Global $Sequence[5][5] Checkboxes are created with something like this for $i=0 to 4 step 1 $FilterLabel="Filter #" & $i GUICtrlCreateLabel($FilterLabel,5,$i*30+63) $Sequence[$i][0]=GUICtrlCreateCheckbox("",50,$i*30+60,20,20) Next This is the function where I get the error Func ReadExposureMatrix () for $FilterNo=0 to 4 Step 1 if (GUICtrlRead($Sequence[$FilterNo][0])==$GUI_CHECKED) Then $ExposureMatrix[$FilterNo][0]=1 Else $ExposureMatrix[$FilterNo][0]=0 EndIf $ExposureMatrix[$FilterNo][1]=GUICtrlRead ( $Sequence[$FilterNo][1] )*1000 $ExposureMatrix[$FilterNo][2]=GUICtrlRead ( $Sequence[$FilterNo][2] ) $ExposureMatrix[$FilterNo][3]=GUICtrlRead ( $Sequence[$FilterNo][3] ) $ExposureMatrix[$FilterNo][4]=GUICtrlRead ( $Sequence[$FilterNo][4] ) Next EndFunc In particular the error is pointing at this line if (GUICtrlRead($Sequence[$FilterNo][0])==$GUI_CHECKED) Then Thanks once again
-
Hello Everyone, I've got a GUI with some checkboxes and a button that executes a procedure when it's pressed. When the procedure is completed, if i hit again the button the GUI crashes saying that an array is not initialized. The array is global and it was filled with the values I got from the GUI on the first run, and because I don't clear it I would expect to have the same content on the second one, so I'm puzzled. Do you have any idea on why this happens? How do work this around? Thanks a lot! Nicola
-
Dear All, to get the handle of the Canon EOS Utility (software to remotely control a Canon EOS DSLR camera via USB cable) I use this command: $EOS_Handle = WinGetHandle("[CLASS:WindowsForms10.window.8.app.0.3553390]", "") Well, this works on my PC, but not on others. Can anyone tell me how to address correctly this window? I can't use its title as the title changes depending on the camera, so I need something general. Otherwise, Is there a general method I can use to retrieve the correct handle whatever Canon EOS Utility I have installed? thanks a lot Nicola
-
Sometimes my script hangs on a loop
nmontec replied to nmontec's topic in AutoIt General Help and Support
Hi, just to let you know that I browsed the forum a little bit digging for info and I tried also this: Func Esposizione ($qsi,$tempo,$filtro,$nomefile) Dim $Pronto $qsi.Expose ($tempo,1,$filtro) $Pronto=False Do $Pronto=$qsi.ImageReady if @error Then ConsoleWrite ( "Bad Luck!" & chr(13)) Exit EndIf Until $Pronto $qsi.SaveImage ("c:\\tmp\\" & $nomefile) ConsoleWrite ( "Fine cattura frame" & chr(13)) EndFunc Despite the @error the $Pronto=$qsi.ImageReady always hangs the program and the consolewrite inside the "@error if statement" is never reached. -
Sometimes my script hangs on a loop
nmontec replied to nmontec's topic in AutoIt General Help and Support
Thank you for your reply. I did try the timer code as you wrote and I got the same error The requested action with this object has failed at the line If $qsi.ImageReady Then What is a COM error handler? May you point me out to the related documentation? Thank you very much! Nicola -
Sometimes my script hangs on a loop
nmontec replied to nmontec's topic in AutoIt General Help and Support
I get the following error: C:\Users\betelgeuse\Documents\QSIDitheringConPHD.au3 (38) : ==> The requested action with this object has failed.: WEnd WEnd^ ERROR Line 38 is "WEnd" -
Dear All, I have written this function: Func Esposizione ($qsi,$tempo,$filtro,$nomefile) If ($qsi.Expose ($tempo,1,$filtro)) Then ConsoleWrite ( "Inizio cattura frame" & chr(13)) while (Not $qsi.ImageReady) WEnd $qsi.SaveImage ("c:\\tmp\\" & $nomefile) ConsoleWrite ( "Fine cattura frame" & chr(13)) EndIf EndFunc The script, sometimes, hangs with the error at the "Wend" statement. Unfortunately is "sometimes" and not "always" and that makes me difficult to debug this. I tried to put a sleep() inside the while loop, with different timings, but it didn't help. $qsi.ImageReady is a call to a boolean COM property. Thanks to everyone who can help me in sort this out Best regards, Nicola
-
Yes, it does work and it works with my window! Now, this is nice, but I don't understand how you reached this, I never use the WinAPI so I don't know how to use it. Can you point me out to some documentation regarding this API? I'm also relatively new to Windows...
-
yes it does work, but what's the difference between my application "PHD" and your window "PHD"? I don't understand... PS: I tried also with other windows like firefox, same thing, I don't get the event.
-
Yes, this is the intended purpose of this piece of code. It does not work anywhere within the PHD window or outside of it. Edit: I just tried to print out the GUIGetMsg() and it always returns 0. I guess this means that it never gets for any reason any event...this is weird. It's my first time to get events, but the code to me seems treally simple that I don't know where I could have mistaken. Func StoreCoordinate() WinActivate("PHD") WinWaitActive("PHD") While 1 $msg=GUIGetMsg() ConsoleWrite($msg & @CRLF) If $msg = $GUI_EVENT_PRIMARYDOWN Then $Stella = MouseGetPos() ConsoleWrite($Stella[0] & " " & $Stella[1] & @CRLF) Return $Stella EndIf WEnd EndFunc
-
No it does not work also in the way you rewrote it. This is the full code I tried: #include <GUIConstantsEx.au3> Func StoreCoordinate() WinActivate("PHD") WinWaitActive("PHD") While 1 If GUIGetMsg() = $GUI_EVENT_PRIMARYDOWN Then $Stella = MouseGetPos() ConsoleWrite($Stella[0] & " " & $Stella[1] & @CRLF) Return $Stella EndIf WEnd EndFunc AutoItSetOption("WinTitleMatchMode",2) AutoItSetOption ( "MouseCoordMode" , 0) $Stella=StoreCoordinate()
-
Hello All, I've got the following function: Func StoreCoordinate() WinActivate("PPP") WinWaitActive("PPP") while 1 $msg=GUIGetMsg () if $msg<>0 Then if $msg==$GUI_EVENT_PRIMARYDOWN Then $Stella=MouseGetPos() ConsoleWrite($Stella[0]& " " & $Stella[1] & chr(13)) ExitLoop EndIf EndIf WEnd Return $Stella EndFunc This function never ends despite I clicked with the mouse many times. Do you know why the loop never ends? Thanks for the help Nicola
-
Dear All, I'd like to get the frames from a video application to do some processing on them, is it possible? How? thanks a lot for your help Nicola
-
Dear All, just wanted to let you know that I found the solution for this issue. I'd like to share it with you just in case in future someone comes into the same question. Basically the EXE file that I own with ActiveX controls needs to be run as it act like a server. Once the executable is run, the object will become available as a COM object so it will be available the same way as any COM object. Best regards Nicola
-
Hello All, I would like to use an EXE file which contain an ActiveX object with its related properties/methods. I know how to use DLL and COM with AutoIT, but this seems to be somewhat (AFAIK) different because: - with DLL, for instance , you can specify the path to the filename, and then use the functions inside, but can not instantiate objects - with COM you can instantiate object using properties/methods, but the COM object is registered at installation time into windows and you can not specify a path to an exe file where the COM object is. So, what can I do? Thanks in advance for your help! Best regards Nicola
-
Dear All, I have source code to fill up a listview upon reading a file. If the User opens another file, the system has to erase the previous listview and generate a new one. How can I do that? Thank you and best regards Nicola
-
Do you mean there is no rule of thumb on which one to use, without actually trying them out?
-
It works! Thanks a lot! By the way, reading the documentation it says: "By default, AutoIt uses the 'stdcall' calling method. To use the 'cdecl' method place ':cdecl' after the return type." What does cdecl mean? Which is the difference between the two calling methods and why a C compiled function needs to use cdecl? Thanks again! Nicola
-
Juvigy: getting rid of the double slashes does not solve the issue trancexx: the asterisk is needed AFAIK because you need to specify that is a pointer to a string, I used this as reference: http://www.autoitscript.com/autoit3/docs/functions/DllCall.htm However, I tried without the asterisk and it's not working either.
-
Dear All, I wrote a C function in a DLL: int GetElbrusStatus(char *statuspath) I already tested the code within C and it's working. Then I created a small script to test it with AutoIT: $libreria="C:\\tmp\\libAstroDirector.dll" if FileExists($libreria) Then MsgBox(0,"Risultato","DLL found") $dll = DllOpen($libreria) if $dll<>-1 Then MsgBox(0,"Risultato","DLL Opened") $result = DllCall($dll, "int", "GetElbrusStatus", "str*","D:\\Elbrus\\Images\\elbrus.sta") MsgBox(0,"Risultato",@error) DllClose($dll) Else MsgBox(0,"Risultato","Unable to open DLL") EndIf Else MsgBox(0,"Risultato","DLL NOT found") EndIf Exit The pop up messages "DLL found" and "DLL Opened" do pop up, but after that nothing happens, I can't even get the message with the @error variable printed. What's the problem in your opinion? How can I solve this? Thanks very much for your help Best regards Nicola
-
Managing Windows with changing title
nmontec replied to nmontec's topic in AutoIt GUI Help and Support
Thanks for replying, I found the chapter you refer to, I went through FAQ and Tutorials, but I had overlooked this. -
Dear All, I need to open a window and act on its controls. Everything is working as long as I hard code the window title. The problem is that this window opens with a different title depending on the device is connected to, so I can not hard code its title. Is there a way I can still use this AutoIT so that I can access the controls independently from the title? Thanks a lot Best regards, Nicola
-
Dear All, is it possible to work with keyboard and mouse while an autoit script is running? thanks Nicola