-
Постов
10 -
Зарегистрирован
-
Посещение
-
Победитель дней
1
Сообщения, опубликованные Данил Абдрафиков
-
-
В Color Constants есть константа clActiveCaption, которая возвращает цвет активного окна, но в Windows 10 возвращается совсем не тот цвет, который на данный момент.
Пробовал так:
GetSysColor(COLOR_ACTIVECAPTION)
Или:
clActiveCaption
В общем-то есть предположение, что это давно уже не работает и несовместимо с Windows 8/10. Есть костыли по вытаскиванию цвета активного окна?
-
-
Аналогичная проблема со Splash
-
В общем-то, проблема общая, может быть исправят:
https://forums.embarcadero.com/message.jspa?messageID=883474
-
Я не использую GlowAnimations. Нашёл девайс, на котором возникает данная проблема. Кратко распишу код:
В b считывается длина строки, а далее в bb[0] считывается сама строка:
InStream := TResourceStream.Create(HInstance, 'Resource_' + IntToStr(x), RT_RCDATA); InStream.Seek(0, soFromBeginning); InStream.Seek(5, soFromCurrent); InStream.Read(b, 1); SetLength(bb, b); InStream.Read(bb[0], b);
Загрузка .PNG изображения из TMemoryStream в Timage:
mm := TMemoryStream.Create; mm.CopyFrom(InStream, InStream.Size - 6 - b); mm.Seek(0, soFromBeginning); img1.Bitmap.LoadFromStream(mm);
Ошибка возникает на строке:
img1.Bitmap.LoadFromStream(mm);
Ошибка, скорее всего, связана с TMemorySteam, и возникает она, только на определённых устройствах. Какие есть мысли по этому поводу?
-
В последнем обновлении RAD Studio 10.2 Tokyo, говорится следующее:
ЦитатаUnification of Delphi and Java threads on Android: CallInUIThread has been deprecated. All code is now running in the Java UI Thread, removing the need for thread synchronization.
The ProcessMessages method used to call the CheckSynchronize method, which called callbacks from the Java Native thread. There used to be two threads: the Delphi UI thread and the Java Native thread. After the refactoring work in 10.2, there is only one thread: the Java Native thread, which receives all notifications from Android and forwards them to the Delphi event handlers. While it is blocked via the while cycle, no event handler can be executed, preventing an exit from the cycle. Callbacks and events in general are called if there is no code holding the app main thread.
Собственно, после обновления на RAD Studio 10.2 Tokyo, на некоторых Android-устройствах возникает ошибка "Can not activate current context". У меня такой ошибки не возникает, а отловить вслепую очень сложно. Я думаю, ошибка напрямую связана с этим изменением. Как можно решить данную проблему, на какие операции в коде нужно обратить внимание?
Application crash with 'Can not activate current context' exception (посмотреть не могу):
https://quality.embarcadero.com/browse/RSP-17189
Утечка памяти в TNotificationCenter | TNotification
в TNotificationCenter
Опубликовано · Изменено пользователем Данил Абдрафиков
Версия: Delphi XE 10.2.3. Имеется метод:
procedure TNotificationStation.Notify(Caption: string; TextMsg: string); var NotificationCenter: TNotificationCenter; Notification: TNotification; begin // Win8 and newest if not TOSVersion.Check(6, 2) then MessageBox(0, PWideChar(TextMsg), PWideChar(Caption), MB_OK) else begin NotificationCenter := TNotificationCenter.Create(nil); try try Notification := NotificationCenter.CreateNotification; Notification.Name := 'TestPush'; Notification.Title := Caption; Notification.AlertBody := TextMsg; NotificationCenter.PresentNotification(Notification); finally FreeAndNil(Notification); end; finally FreeAndNil(NotificationCenter); end; end; end;
Чем больше пуш-сообщений вызывается, тем больше приложение начинает есть память. Один посланный пуш -> + ~100 кб. Проблема на Windows, платформы x64 и x86.
Совсем не ощущается, что память высвобождается после отправленного пуша. Собственно, куда уходит память?
В папке с Samples лежит проект: \Samples\CPP\VCL\Windows 10 Notifications
Если понажимать на кнопку Show, ситуация такая же.