Jump to content
Sign in to follow this  
DeathRow

FOUND A BUG in Autoit command !!

Recommended Posts

DeathRow

Well ,sometimes if you try to pen firefox hidden or minimized,doesn't work ,and when it works,you can't show it again on the monitor ;)

ShellExecute( "C:\Program Files\Mozilla Firefox\firefox.exe","Google - Mozilla Firefox","","open",@SW_HIDE)
Sleep(2000)
WinSetState( "Google - Mozilla Firefox","",@SW_SHOW)
Edited by DeathRow

Share this post


Link to post
Share on other sites
notsure

Lets talk about the reason... why would you try to HIDE the window at first, and the next thing you want to do is to SHOW it... ?

beats me.

Share this post


Link to post
Share on other sites
DeathRow

Lets talk about the reason... why would you try to HIDE the window at first, and the next thing you want to do is to SHOW it... ?

beats me.

Whats your problem ? ? I don't understand why you deviate from the subject, its just an example to see that its a bug and doesn't work!

Next time don't put stupid comments

Edited by DeathRow

Share this post


Link to post
Share on other sites
Emiel Wieldraaijer

Please post complete example, and your AutoIt version


Best regards,Emiel Wieldraaijer

Share this post


Link to post
Share on other sites
DeathRow

This is on a Win7 x86 bit

Im going to try it on a x64 it ....

Share this post


Link to post
Share on other sites
Bert

I copied and pasted your code into my editor. You then edited your post to show it corrected. I then made my post with the code corrected. You just happen to correct it in your post the same way I did. You then try to say you didn't make an error. Nice try.

Share this post


Link to post
Share on other sites
water

When closing a subject please don't everwrite your original post and/or the original topic title.

All threads and posts serve as a reference for future users. If parts of the thread are missing it becomes useless.

If you want to close a thread prepend "[Closed]" to the topic title.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
DeathRow

I copied and pasted your code into my editor. You then edited your post to show it corrected. I then made my post with the code corrected. You just happen to correct it in your post the same way I did. You then try to say you didn't make an error. Nice try.

I saw my fault before you posted it and I quickly edit it and then I saw that you posted it too.

Ok so the code works well but not al all with firefox :

ShellExecute( "C:Program FilesMozilla Firefoxfirefox.exe","www.google.com","","open",@SW_HIDE)
Sleep(2000)
WinSetState( "Google - Mozilla Firefox","",@SW_SHOW)
Edited by DeathRow

Share this post


Link to post
Share on other sites
iamtheky

it works fine

opt("wintitlematchmode" , 2)

ShellExecute( "C:Program FilesMozilla Firefoxfirefox.exe","www.google.com","","open",@SW_HIDE)
Sleep(2000)
WinSetState( "Google - Mozilla Firefox","",@SW_SHOW)

edit: also works fine without the matchmode

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
jchd

DeathRow,

By using

WinSetState( "Google - Mozilla Firefox","",@SW_SHOW)

you assert that FireFox will have this content in the window title, which implies that Firefox will have accessed the Internet successfully and loaded the default page (which you also assume to be Google). One or more of these assertions can easily be proven wrong at times for some reason.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
DeathRow

Then ,open manually firefox and maximize it then close it and run this code:

ShellExecute( "C:Program FilesMozilla Firefoxfirefox.exe","www.google.com","","open",@SW_HIDE)

Then tell me if the window hided or not

Edited by DeathRow

Share this post


Link to post
Share on other sites
DeathRow

Did you ever consider getting the handle of the window first and referencing that instead of the window's title?

Does WinSetState command supports handles?

Share this post


Link to post
Share on other sites
BrewManNH

Does WinSetState command supports handles?

From the help file:

Window Handles / HWNDs

The variant datatype in AutoIt natively supports window handles (HWNDs). A window handle is a special value that windows assigns to a window each time it is created. When you have a handle you may use it in place of the title parameter in any of the function calls that use the title/text convention. The advantage of using window handles is that if you have multiple copies of an application open - which have the same title/text - you can uniquely identify them when using handles. When you use a window handle for the title parameter then the text parameter is completely ignored.

Various functions such as WinGetHandle, WinList and GUICreate return these handles. It is important to note that a window handle is not classed as a number or string - it is its own special type.

Note: Window handles will work no matter what WinTitleMatchMode is currently in use.

  • Like 1

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
Valik

Stop being an argumentative bitch and work with the people trying to help you or I will remove your ability to receive support on this forum. Your attitude and behavior are not acceptable for somebody requesting help from volunteers.

  • Like 2

Share this post


Link to post
Share on other sites
DeathRow

Stop being an argumentative bitch and work with the people trying to help you or I will remove your ability to receive support on this forum. Your attitude and behavior are not acceptable for somebody requesting help from volunteers.

Wow, you are really coureageous o.o ...because you are the admin and you can ban, and all the skids are licking you in the ass, no ? But what was if you wasn't ?? Let me tell you: you are my personal bitch ! Best escort ever!! Hmm... and I really love how you fools are asking "why are you doing this,why you want to do that..."( because you are afraid of...I know it...) and then I lie your asses up with all the bullshits and you trust them ...hahahaha

"...the people trying to help you..." well..you are very helpful too, my lovely escort, and all your script skids :]] Don't know shit about C++ ....

And my last wish : click on this little doggy and press Ctrl + A ;)

....................../´¯/)

....................,/¯../

.................../..../

............./´¯/'...'/´¯¯`·¸

........../'/.../..../......./¨¯

........('(...´...´.... ¯~/'...')

..........................'...../

..........''............. _.·´

..........................(

..............................

Edited by DeathRow
  • Like 1

Share this post


Link to post
Share on other sites
Valik

Why do people still think they can win? Do they not pay attention to the threads where I state we block tens of thousands of addresses? Do they not notice how hollow all the threats we receive end up ringing? Oh well.

  • Like 4

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Similar Content

    • bbProg
      By bbProg
      Hi,
       
      how can I wait activate for windows with information as in the photos attached?
      Class is not being recognized by the script.
       
      thanks in advanced.



    • Fortitude
      By Fortitude
      Hello!
      I have made a program, that opens a folder, and then store the path ("C:\programFiles\etc") in a variable.
      Then i need to open the command panel as administrator, and write  in the stored path, and some other text.

      Can i somehow instantly copypaste the text i needed, instead of writing in the command panel with the Send commands?
       
      #RequireAdmin #include <MsgBoxConstants.au3> Global Const $sMessage = "Select a folder" ; Display an open dialog to select a file. Global $sFileSelectFolder = FileSelectFolder($sMessage, "") If @error Then MsgBox($MB_SYSTEMMODAL, "", "Nem választottál ki mappát!") Exit EndIf Global $Tiff_path = $sFileSelectFolder & "\TiffChecker_2_32" FileCopy( "C:\TiffChecker_2_32.exe" , $sFileSelectFolder) $CMD = $Tiff_path & " " & $sFileSelectFolder & " /s/d" Run("C:\WINDOWS\system32\cmd.exe") WinWaitActive("C:\WINDOWS\system32\cmd.exe") Send($CMD) Sleep(1000) Send("{ENTER}") sleep(1000) MsgBox(0,"Press OK", "Press OK to continue") FileCopy("C:\Tiffchecker.txt", $sFileSelectFolder) Also, how do i close the command panel, when the program is finished? (usually its under 1 second, so after the send i just put a Sleep function there)
    • rcmaehl
      By rcmaehl
      A UDF with Extended Functions for Window Management
       
      Notes:
      Fixes WinGetClassList's barbaric returning of a @LF separated string instead of an array.
       
      Potential Uses:
      Automating applications that change their controls' handles/classes on each launch (e.g. half of Cisco's programs)
       
      Functions:
      _WinGetClassList
      _WinGetClassNNList
      _WindowGetHandleList
      _WindowGetHandleListFromPos
       
      Download: 
      WindowEx.zip  (v0.4)
       
      Changelog:
      10/04/2016 (v0.4): _WinGetClassNNList Fixed : Not Returning an Index when using $2D_ARRAY _WinGetClassNNList Fixed : Not Properly returning $aArray[x][1] on Classes with instances > 9 when using $2D_ARRAY 10/03/2016 (v0.3): _WinGetClassList Added : Exactly the same as WinGetClassList but returns a more civilized Array _WinGetClassNNList Added : Returns Classes and their instances in either a 1D or 2D array depending on Flags _WindowGetHandleList Renamed: _WinGetHandleList SCRIPT BREAKING! _WindowGetHandleListFromPos Renamed: _WinGetHandleListFromPos SCRIPT BREAKING! 10/01/2016 (v0.2): WindowsExConstants.au3 Added : Flags in _WindowGetHandleListFromPos _WindowGetHandleListFromPos Removed: ConsoleWrite left in during debug _WindowGetHandleListFromPos Added : Flag for if part of a Control is at $X, $Y return it as well. 10/01/2016 (v0.1): _WindowGetHandleList Added : Retrieves the handles of classes from a window. _WindowGetHandleListFromPos Added : Retrieves the handles of classes at a specific position from a window. Known and Reported Bugs:
      None reported To Do:
      To Be Decided. Opinions welcome! Upcoming Changes:
      To Be Decided.
    • rudi
      By rudi
      Hello,
      for a script to display PDF files I'd like to simply use the default program for PDF files, so I used "ShellExecute(<pdf-file-full-path>)" to open these files.
       
      The result for *SOME* of the workstations is, that the Adobe Reader starts up with asking for its language. (English/German). When starting AcroRd32.exe through "ShellExecute()", this "choose your language" dialog is showing up *ALWAYS*.
       
      Just to have mentioned it: Process Explorer is presenting this command line, it looks the same for both, PCs with and without that question "Choose Language? [English|German]"
      "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" --channel=4680.0.860715181 --type=renderer "\\pc0009\Y_DRV_H\Daten\TIF\08\32\G000110832_Freigegeben.idw.pdf"  
      The next approach I thought of was to use Foxit Portable (instead of Acrord32.exe), started from a Network Drive, but it's starting up ugly slowly...
      So I tried to "Run()" instead to "ShellExecute()" the Adobe Reader. Now the result looks more stange, the "select your language" dialog shows up every now and then, but not always for the Win7 installations affected.
       
      If I place a "msgbox()" just in front of the "run()" command, it seems never to show this "select your language" dialog.
      If I take out this MsgBox() the "select your language" dialog shows up sometimes.
      When I "ClipPut()" the run command prior the "Run()" and paste that one to a CMD box, then it seems to *NEVER* happen, that this "select your language" dialog shows up.
       
      "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" "\\pc0009\Y_DRV_H\Daten\TIF\08\32\G000110832_Freigegeben.idw.pdf" $AcroRead='"C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"' $PDF='"Y:\Temp\DRV_H\Daten\TIF\33\85\153385_Freigegeben.dwg.pdf"' MsgBox(0,"Values",$AcroRead & @CRLF & $PDF,1) $MyCommand=$AcroRead & " " & $PDF ClipPut($MyCommand) Run($MyCommand)  
      It looks like, that this "--channel=... --type=renderer" parameters are always fact for the AcroRd32.exe instance, that is opening the PDF to be displayed. The Instance opening the "PDF Display GUI" seems to always be a child process of another AcroRd32.exe process.
       
      Any clue, what's going on "backstage" here? How to avoid this "Choose your language" dialog? Or maybe someone can mention a different "portable" PDF viewer, I could use for this purpose?  
      Any suggestions appreciated, regards, Rudi.
    • FrancescoDiMuro
      By FrancescoDiMuro
      Good morning everyone

      I was playing a little bit with "Screen Capture" UDF, and I was trying to make a "Window" capture, but, since I made a GUI which through I fire the event "Capture", my GUI is captured as well, and I don't want to
      This is the line of code that makes the capture:
       
      _ScreenCapture_CaptureWnd($strScreenCaptureFileName, $objActiveWindow, 0, 0, -1, -1, False) And these are the lines of code which select the "active" window:
       
      Local $objCurrentWindow = 9999 If _IsPressed("01") Then $objCurrentWindow = WinGetHandle("[ACTIVE]") If $objCurrentWindow <> $objMyGUI Then $objActiveWindow = $objCurrentWindow EndIf EndIf Sorry If I made stupid mistakes
      Thanks in advance.

      Francesco
×