Jump to content

Search the Community

Showing results for tags 'winclose'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 4 results

  1. OK, after days looking at my code, the help file and forums I come (again) for help on message windows. I'm having trouble trying to close window messages that appear. This is the code I'm using #include <MsgBoxConstants.au3> Local $obs_handler = 0 Opt("WinTitleMatchMode",2) While 1 $obs_handler = WinWait("C:\Users\", "", 1) If IsHWnd($obs_handler) then MsgBox($MB_OK, "Message", "handler: "&$obs_handler, 1) ;Sleep(100) $obs_handler = HWND($obs_handler) WinKill($obs_handler, "") ;<<<<< PROBLEM!!!!! Else MsgBox($MB_OK, "Message", "No handler", 1) EndIf Send("{ESC}") Sleep(2000) $obs_handler = 0 WEnd The problem is on the Winkill command, it won't just close the window! Winwait is capturing the handler, it checks as handler. Ii'm using the HWND() command just to be sure it is the correct variable type. I've also checked the message box info with the autoit window info tool and the handle value matches the one captured by the code. I've tried winkill, winclose, using wingethandle, moving the winkill command to Before the message box so it is not converted to a string, and now using the hwnd function to force the variable type of the handler. The use of the sleep command does not make any diference. As a side quest, I'd like to use classes to capture the windows instead of titles, just to keep things cleaner, but using the [CLASS:...] value for winwait is not working. I have the class name and number, am I missing something? Thanks!
  2. I have a small exe I created in AutoIt that seems to be causing some problems in OutLook when people go to save a PDF or Reply to emails. Here is my code. TraySetState(2) WinWait("[CLASS:#32770]", "Make sure that your sign-in address, user name, and password are correct and try again.", 0) WinClose( "Lync") So this works just fine, it closes these message prompts we are trying to suppress. But if the autoit executable is running when someone is using Outlook and they go to Save as PDF. When they click "Save As" and go to type in the name of the file to save, they can't type in the box. So if they close the autoit executable that's running only the code above, then they can use type in the name of the file. So we know the EXE is preventing users from saving documents. Now, I'm sure it could be the way I've written this code, but I'm new to AutoIt and I'm not sure what could be causing this. This little script seems like it' targeting the correct CLASS # and Window TItle and exact message. So I don't understand why it's interfering with other applications. Any ideas?
  3. I have spent the past couple of days searching for the answer to this question, and I have not found one that really works. What I am trying to do, is have the following code always run and when ever notepad is open and idle for more then 2 seconds close it. It works but only when their is one instance of Notepad, if there are more then one it does not close all of them at the same time. Can someone help me, using this code, to have all windows with the title Notepad close? #include <Timers.au3> ;Declare the Timer: ; Global $TIMER = TimerInit() Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) HotKeySet("#{F4}", "_exit") ; Ctrl-Shift-Alt-X to exit While 1 ;If this application is active then reset the timer: If WinExists("Notepad") And _Timer_GetIdleTime() >= 2 * 1000 Then MsgBox (0, "Time reached", "You have been idle for more than 2 seconds.") WinClose("Notepad") EndIf ;Sleep for 1 seconds before looping again: ; Sleep(1000) WEnd Func _exit() Exit EndFunc Thanks Grimm
  4. I am having some issues with what should be the simplest of scripts. I have a program that records internet tv. If the network drops for some reason, an error window pops up and it will not record anything that is scheduled from that point on until the error is closed. So if this occurs at night when I am sleeping, I could miss recording several tv shows. So here is what I have done. The error windows do not have a title so I am using the window text and WinGetHandle to close. Like this... while 1 sleep(100) if WinExists("","ネットワークに接続できません。") then $handle = WinGetHandle("","ネットワークに接続できません。") WinClose($handle) ;MsgBox(0, "WinGetHandle Result",$handle) EndIf Wend I have tested this out by manually creating the error window using this and the above script will close the window fine. MsgBox(0, "","ネットワークに接続できません。") When I force the program to throw the error by disconnecting my network cable, the error window comes up but never closes. I added the WinGetHandle Result msgbox to see if it was even detecting the window. It does display the proper handle, I confirmed it by using the AutoIt Window Info tool. I even tried this but it doesn't work either..... while 1 sleep(100) if WinExists("","ネットワークに接続できません。") then $handle = WinGetHandle("","ネットワークに接続できません。") WinActivate($handle) Send("{ESC}") ;MsgBox(0, "WinGetHandle Result",$handle) EndIf Wend Any suggestions?
×
×
  • Create New...