Показать сообщение отдельно
Старый 20.06.2019, 13:40   #5  
Dron AKA andy is offline
Dron AKA andy
Moderator
 
944 / 253 (10) ++++++
Регистрация: 27.03.2002
Адрес: Москва
Мы на DAX2012 вот так сделали, для Win7 помогло:
Forms opening up with focus in background

X++:
//Add a new static, client-side method to Classes\Application, as below:
client static void disableWindowGhosting()
{
    DLL DLL;
    DLLFunction DLLFunction;
    container con = WinAPI::getVersion();
    ;
    if (conpeek(con, 1) == 6) //Vista and Win7/Win2008R2 only
    {
        //this will disable window ghosting for this process only, for its lifespan only
        DLL = new DLL('USER32');
        DLLFunction = new DLLFunction(DLL,'DisableProcessWindowsGhosting');
        DLLFunction.call();
    }
}
//Add a call to this from Application.startupPost(), like this:

if (hasGUI())
{
    Application::DisableWindowGhosting();
}
__________________
Андрей.
За это сообщение автора поблагодарили: Logger (3), Sergey Petrov (1).