I want to do some automation with SQL Server management studio and need to track what Windows messages were sent to it when I click the "Execute" button. Basically what I want to do is:
- When the user press the "Execute" button or press F5, intercept it.
- Check the text in the editor, it the first line is
--sqlcmd
, then change the query mode to "SQLCMD mode". Otherwise ensure the query mode is not "SQLCMD mode". - Execute as normal.
I want to use AutoHotKey
's PostMessage
function to do it. However I don't know how to track what messages to post. Anyone can give some suggestions?