Sign in to follow this  
Followers 0
DLB

Monitor buttons

4 posts in this topic

Thanks in advance for any help or suggestions.

History: My company is using an application now with Win7 that works perfectly with XP. The application uses external modules that do not function in Win7 and will not be updated. So, I need to write a script that will monitor the window (See Attached Image) and then let me know when either of the two (2) buttons are clicked. Since the support module is not installed the buttons will not do anything. My script will take over when the buttons are clicked.

Detecting when the window is open and active is easy and works. However, I have not been able to detect when the "Eject" or "Format" buttons are clicked.

Again, thanks for any help that you may give.

David

post-46146-0-06338100-1312309095_thumb.j

Format DVD Script.au3

Share this post


Link to post
Share on other sites



Sorry if you have already explored this idea, but why not just skip their window all together? You seem to already know the command line you want to use:

RunWait( @ComSpec & " /C Format Z:/FS:FAT32 /Q /Y","",@SW_SHOW )

and you know the Window title

"Select Action for Deck A"

So why not just do something like:

Do
    If WinExists("Select Action for Deck A", "Cannot read deck. It could be unformatted") Then
        WinClose("Select Action for Deck A", "Cannot read deck. It could be unformatted")
        RunWait(@ComSpec & " /C Format Z:/FS:FAT32 /Q /Y", "", @SW_SHOW)
    EndIf
Until 1 = 2

At least this way, any time the window in question is found it will be closed and the format will begin. If the successful operation of your program requires that the format be complete before the copy operation begins then you could replace "Until 1=2" with something like Until WinExists("Next Step", "new window text")

Hope that helps!

Ian


My projects:

  • IP Scanner - Multi-threaded ping tool to scan your available networks for used and available IP addresses, shows ping times, resolves IPs in to host names, and allows individual IPs to be pinged.
  • INFSniff - Great technicians tool - a tool which scans DriverPacks archives for INF files and parses out the HWIDs to a database file, and rapidly scans the local machine's HWIDs, searches the database for matches, and installs them.
  • PPK3 (Persistent Process Killer V3) - Another for the techs - suppress running processes that you need to keep away, helpful when fighting spyware/viruses.
  • Sync Tool - Folder sync tool with lots of real time information and several checking methods.
  • USMT Front End - Front End for Microsoft's User State Migration Tool, including all files needed for USMT 3.01 and 4.01, 32 bit and 64 bit versions.
  • Audit Tool - Computer audit tool to gather vital hardware, Windows, and Office information for IT managers and field techs. Capabilities include creating a customized site agent.
  • CSV Viewer - Displays CSV files with automatic column sizing and font selection. Lines can also be copied to the clipboard for data extraction.
  • MyDirStat - Lists number and size of files on a drive or specified path, allows for deletion within the app.
  • 2048 Game - My version of 2048, fun tile game.
  • Juice Lab - Ecigarette liquid making calculator.
  • Data Protector - Secure notes to save sensitive information.
  • VHD Footer - Add a footer to a forensic hard drive image to allow it to be mounted or used as a virtual machine hard drive.
  • Find in File - Searches files containing a specified phrase.

Share this post


Link to post
Share on other sites

Sorry if you have already explored this idea, but why not just skip their window all together? You seem to already know the command line you want to use:

RunWait( @ComSpec & " /C Format Z:/FS:FAT32 /Q /Y","",@SW_SHOW )

and you know the Window title

"Select Action for Deck A"

So why not just do something like:

Do
    If WinExists("Select Action for Deck A", "Cannot read deck. It could be unformatted") Then
        WinClose("Select Action for Deck A", "Cannot read deck. It could be unformatted")
        RunWait(@ComSpec & " /C Format Z:/FS:FAT32 /Q /Y", "", @SW_SHOW)
    EndIf
Until 1 = 2

At least this way, any time the window in question is found it will be closed and the format will begin. If the successful operation of your program requires that the format be complete before the copy operation begins then you could replace "Until 1=2" with something like Until WinExists("Next Step", "new window text")

Hope that helps!

Ian

I had thought about closing the window, but as you might expect I still need to be able to allow the disk to be ejected. I will see if the window can be force closed. If so, I will do that and try to build a new window that looks very close to the same and provide the "Format" and "Eject" buttons in the new window.

Thanks for your input

David

Share this post


Link to post
Share on other sites

I have seen your post yesterday and I thought that somebody replying will tell you that you posted a support request in the wrong forum.

That didn't happen so I will do it: please pay attention to forum sections and try to post in the relevant place.

Reported the post to moderators to move it to the correct section.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0