Can someone confirm this please:
<font color=blue>On Application Close
%hWnd% = Window.Find "Untitled - Notepad"
Result = Dialog.MessageBox "%hWnd%"
%PreventApplicationClose% = TRUE</font color=blue>
Test this without Notepad open and get Result = %hWnd%
Open notepad and Result = 6422722 etc.
Close notepad and Result still = 6422722
For your convenience:<font color=green>
<IR_ACTIONS_LIST>
<Action name="Find">
<Type>127</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>0</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<FindText>Untitled - Notepad</FindText>
<Variable>%hWnd%</Variable>
</Action>
<Action name="Message Box">
<Type>5</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<DialogTitle>Title</DialogTitle>
<DialogMessage>%hWnd%</DialogMessage>
<Icon>3</Icon>
<Variable>%Result%</Variable>
<DialogType>0</DialogType>
<DefaultButton>0</DefaultButton>
</Action>
<Action name="Set Value">
<Type>6</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%PreventApplicationClose%</Variable>
<Value>TRUE</Value>
<Evaluate>0</Evaluate>
</Action>
</IR_ACTIONS_LIST></font color=green>
<font color=blue>On Application Close
%hWnd% = Window.Find "Untitled - Notepad"
Result = Dialog.MessageBox "%hWnd%"
%PreventApplicationClose% = TRUE</font color=blue>
Test this without Notepad open and get Result = %hWnd%
Open notepad and Result = 6422722 etc.
Close notepad and Result still = 6422722
For your convenience:<font color=green>
<IR_ACTIONS_LIST>
<Action name="Find">
<Type>127</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>0</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<FindText>Untitled - Notepad</FindText>
<Variable>%hWnd%</Variable>
</Action>
<Action name="Message Box">
<Type>5</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<DialogTitle>Title</DialogTitle>
<DialogMessage>%hWnd%</DialogMessage>
<Icon>3</Icon>
<Variable>%Result%</Variable>
<DialogType>0</DialogType>
<DefaultButton>0</DefaultButton>
</Action>
<Action name="Set Value">
<Type>6</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%PreventApplicationClose%</Variable>
<Value>TRUE</Value>
<Evaluate>0</Evaluate>
</Action>
</IR_ACTIONS_LIST></font color=green>
Comment