Monday, 5 January 2009

Show current configuration in title bar of windows

This code snippet shows the current configuration of the AX client you have opened. Really helpful if you have several different AX clients opened at the same time.

void workspaceWindowCreated(int _hWnd)
{
SqlSystem sqlSystem = new SqlSystem();
LoginProperty loginProperty = sqlSystem.createLoginProperty();
;

// Put workspace window specific initialization here.

// Show application details in title bar
if (loginProperty)
{
WinAPI::setWindowText(_hWnd, strFmt("%1 - %2@%3 (%4)", WinAPI::getWindowText(_hWnd), loginProperty.getDatabase(), loginProperty.getServer(), this.currentAOLayer()));
}
}

No comments: