Change the bolded part to "BtnCancel"
code:
<Control xsi:type="ButtonControl" Id="BtnClose">
<Position Left="112" Top="25" Width="50"/>
<Caption>Close</Caption>
BtnCancel is built into Messenger Plus! Live Scripting that when clicked it will close the window.
Or with your code
code:
function OnWndTestEvent_CtrlClicked(Wnd, ControlId) {
Debug.Trace("Hello World!");
if(ControlId == "BtnClose"){
Debug.Trace("woot");
Wnd.Close(0);
}
}
Or with the Windows API
code:
var WM_CLOSE = 0x10;
function OnWndTestEvent_CtrlClicked(Wnd, ControlId) {
Debug.Trace("Hello World!");
if(ControlId == "BtnClose"){
Debug.Trace("woot");
Interop.Call('user32', 'SendMessageW', Wnd.Handle, WM_CLOSE, 0, 0);
}
}