\Classes\Info\onEventGoingIdle
X++:
//Event fired by kernel when the client goes idle.
//It is not fired during CTRL-Break dialog.
void onEventGoingIdle()
{
this.operationProgressClear();
this.endLengthyOperation(true);
///
if(strLwr(curUserID())!='admin')
TitleChanger::changeTitle();
}
X++:
static void changeTitle()
{
#define.WM_SETTEXT(0x000C)
str caption;
str prefix=new Session().AOSName()+": ";
int defWindowProc(
int _handle,
int _msg,
int _wParam,
str _lParam )
{
int ret;
DLL _DLL = new DLL('USER32');
DLLFunction _defwproc = new DLLFunction(_DLL, 'DefWindowProcA');
;
_defwproc.returns(ExtTypes:: DWord); // LRESULT
_defwproc.arg(ExtTypes:: DWord); // handle window
_defwproc.arg(ExtTypes:: DWord); // message
_defwproc.arg(ExtTypes:: DWord); // wparm
_defwproc.arg(ExtTypes::String); // lparm
return _defwproc.call(_handle, _msg, _wParam, _lParam);
}
;
caption = winapi::getWindowText(infolog.hWnd());
if(!StrUtils::startsWith(caption, prefix))
defWindowProc(infolog.hWnd(), #WM_SETTEXT, 0, prefix + caption);
}
X++:
// строка _s начинается на _suffix
static boolean startsWith(str _s, str _prefix)
{
return
strLen(_s)>=strLen(_prefix)
&&
subStr(_s, 1, strLen(_prefix))==_prefix;
}