firemonkey

Detect screen lock - FMX in Win32

只愿长相守 提交于 2019-12-01 14:07:57
I want my application to run some code when the screen gets locked (Win 7 and 10). My application may be in the background too when user locks screen. Anyone point me in right direction? Thank you, relayman Use WTSRegisterSessionNotification() to register an HWND to receive WTS_SESSION_(UN)LOCK notifications via the WM_WTSSESSION_CHANGE window message. You can use FMX's FormToHWND() function to obtain your Form's HWND . However, FireMonkey controls, including Forms, do not have an overridable WndProc() method to process window messages, like VCL does, so you will have to use the Win32 API's

How to programmatically alter Font properties in Firemonkey controls

社会主义新天地 提交于 2019-12-01 13:12:32
I have some code that paints a set of controls laid on top of a TImage. I then grab the TImage's MakeScreenshot to save out the file. This now works perfectly. What I am now struggling with is changing the font properties of one or more labels / text style controls. No matter what I try, the label does not change. Below is my sample code :- procedure TfrmSnapshot.Process; var LRect1, LRect2, LRect3, LRect4: TRectF; X, Y, W, H: Integer; begin // X := Round(Label1.Position.X); Y := Round(Label1.Position.Y); W := Round(X + Label1.Width); H := Round(Y + Label1.Height); LRect1.Create(X, Y, W, H); X

Why am I getting “Connection reset by peer” with Indy only on a HTTPS (SSL) site?

杀马特。学长 韩版系。学妹 提交于 2019-12-01 13:03:48
I am trying to use Indy HTTP (Delphi Seattle) to get the contents of a https webpage and I always seem to get Error 10054 - Connection reset by peer. Other sites seem to work just fine. The website in cause is https://www.adultwork.com . I have added the SSL, Cookie and Compressor components, but maybe I'm missing something, some settings, IDK... If anybody could help, it would be greatly appreciated. I was able to reproduce the issue, and it is due to Indy's TIdIOHandlerSocketOpenSSL component only enabling TLS v1.0 by default . Like many other sites nowadays, AdultWorks does not accept TLS 1

Detect screen lock - FMX in Win32

我与影子孤独终老i 提交于 2019-12-01 12:58:28
问题 I want my application to run some code when the screen gets locked (Win 7 and 10). My application may be in the background too when user locks screen. Anyone point me in right direction? Thank you, relayman 回答1: Use WTSRegisterSessionNotification() to register an HWND to receive WTS_SESSION_(UN)LOCK notifications via the WM_WTSSESSION_CHANGE window message. You can use FMX's FormToHWND() function to obtain your Form's HWND . However, FireMonkey controls, including Forms, do not have an

ListBox items change after doing scroll in Firemonkey

*爱你&永不变心* 提交于 2019-12-01 12:54:14
I am developing a Multi-Device Application in Firemonkey where Main class has a ListBox component with some items. Each of these items has the same custom style. My problem is when I have so many items in the ListBox and I have to do scroll vertical to see the rest of items. In this case, the ListBox has a strange behaviour and when I do scroll up after doing scroll down the item's components (a button for example) have changed his background colour and the items have changed his order inside ListBox. For example, if I had: Item 1 Item 2 Item 3 after I do scroll I have: Item 2 Item 3 Item 1

Delphi FireMonkey TListBox AddObject exception on Android

こ雲淡風輕ζ 提交于 2019-12-01 12:52:29
I'm having a problem adding a TObject value to a FireMonkey TListBox in Delphi 10.0 Seattle. An exeception is raised when casting an Integer variable to a TObject pointer. I tried the cast to TFmxObject with no success. On Windows, the cast works like a charm, but on Android it raises the exception. Here is my code: var jValue:TJSONValue; i,total,id: integer; date: string; begin while (i < total) do begin date := converteDate(jValue.GetValue('date' + IntToStr(i), '')); id := StrToInt(jValue.GetValue('id' + IntToStr(i), '')); ListBox1.Items.AddObject(date, TObject(id)); i := i + 1; end; end;

C++ Builder bccarm error when calling std::vector::push_back with TObject descendant

强颜欢笑 提交于 2019-12-01 12:24:34
I have some simple C++ code which won't be compiled by the Clang based C++11 compiler bccaarm of C++ Builder 10.1 Berlin. This is the code: TComponent* Comp = new TComponent(this); std::vector<TComponent*> Comps; Comps.push_back(Comp); And this is the error: [bccaarm error] stl_iterator.h(963): rvalue reference to type 'value_type' (aka 'System: classes::TComponent * __strong') can not be bound to lvalue of type '__borland_class * isTObj __strong' (aka 'System::Classes::TComponent * __strong') The compiler stops at line 963 in the file stl_iterator.h: The other C++ compilers bcc32 and bcc32c

Missing .bpl files

谁说胖子不能爱 提交于 2019-12-01 11:21:54
After compiling a FireMonkey project and executing the app on another PC I've encountered an error - "rtl190.bpl is missing". So I searched google and I found the "solution" which didn't work for me. It said that I should uncheck "Link with Dynamic RTL" and "Link with Delphi runtime...". Indeed after compiling, the executable is bigger, but still I'm encountering the exact same error. I must copy "rtl190.bpl" and "fmx190.bpl" manually to exe's directory in order to make it work. How can I fix this problem? You should also uncheck Build with runtime packages under: Project-> Options-> Packages-

Create run time TTabItem , firemonkey

六月ゝ 毕业季﹏ 提交于 2019-12-01 10:43:36
Seems like i need some help with a project. I have a routine , that constructs run time multiple TabItems on to a page control in firemonkey, and i want to have a close button on the tab. The new tab has a checkbox for the close button loading from the styler of the tabitems. The page has a default tab, and within some button, i am adding run time the new tab items. I have managed to apply the event for closing the default tab page, but doesn't work within the run time created tab pages. Any help would be appreciated. This is the piece of code for the runtime tabitems procedure TForm1

ListBox items change after doing scroll in Firemonkey

对着背影说爱祢 提交于 2019-12-01 10:39:15
问题 I am developing a Multi-Device Application in Firemonkey where Main class has a ListBox component with some items. Each of these items has the same custom style. My problem is when I have so many items in the ListBox and I have to do scroll vertical to see the rest of items. In this case, the ListBox has a strange behaviour and when I do scroll up after doing scroll down the item's components (a button for example) have changed his background colour and the items have changed his order inside