Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

can i prevent windows alert or warning messages?


  • Please log in to reply
3 replies to this topic
kumar
  • Members
  • 21 posts
  • Last active: Dec 10 2008 01:45 PM
  • Joined: 08 Sep 2008
i want to prevent windows messages like "the disk isn't ready, please insert the disk into the drive"
can we stop like this type of messages with reg edit through ahk ?
Thank u

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004
I don't know if you can stop them from showing but you can use a timer to check for them and send keys accordingly. Here is an example:

#SingleInstance Force
#Persistent
SetKeyDelay, -1 ; send keys instantly
SetTimer, Check, 200
Return

Check:
If WinActive("Confirm File Delete") || WinActive("Confirm Multiple File Delete") 
|| WinActive("Unsafe Removal of Device") || WinActive("Confirm Folder Delete")
|| WinActive("WARNING","Are you sure you want to delete the selected Cookie(s) ?")
	Send, {Enter}
Return

"Anything worth doing is worth doing slowly." - Mae West
Posted Image

Mustang
  • Members
  • 421 posts
  • Last active: Dec 26 2010 10:08 PM
  • Joined: 17 May 2007
Maybe this can help also: <!-- m -->http://www.autohotke... ... 323#123323<!-- m -->

Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004
From my testing these message boxes don't send HSHELL_WINDOWACTIVATED or HSHELL_WINDOWCREATED on creation, but if you change the focus to another window and back to the message box it will then send HSHELL_WINDOWACTIVATED.

It is possible to catch them on creation using SetWinEventHook. Not all message boxes send EVENT_SYSTEM_ALERT but we can use EVENT_SYSTEM_FOREGROUND instead.

Edited to add: This may be of interest.
"Anything worth doing is worth doing slowly." - Mae West
Posted Image