Delphi

How to force load a page in Twebbrowser control when this is not visible

放肆的年华 提交于 2021-02-18 11:31:10
问题 i need to execute some javascript functions from delphi code, but this functions fails if the page is not loaded in the Twebbrowser control. so the problem is if page is located in a tabshet wich is not active the page is not loaded until the tabsheet is become active. the question is How to force load a page in a Twebbrowser control when this is not visible. to test this behaviour just put a pagecontrol, with 2 tabsheets , and a twebbrowser in the second tabsheet, now in the oncreate event

How to make a form always stay on top

走远了吗. 提交于 2021-02-18 11:19:30
问题 I have an application which consists of a form with FormStyle declared as "fsStayOnTop", so that it always is shown on top of all other windows. Now I would like to temporarily show another form where the user can set some settings. That form should also be shown on top, so I change the FormStyle property of the main form to "fsNormal" and the FormStyle of the form I want to show to "fsStayOnTop". When the temporary form closes the main form gets "fsStayOnTop" again. Now the settings form

Display simple markup in a Label in Delphi

感情迁移 提交于 2021-02-18 05:12:42
问题 I am currently displaying some text in a TLabel. I would now like to emphasise certain words within the text by displaying them in bold or perhaps italic . What is the recommended way to do this in Delphi? Is there a TLabel-like component that can display simple HTML or markup? I am imagining some code like this: label.text:='This information is <b>important</b>'; I am using Delphi 2010 回答1: JvHTLabel in the JVCL will do the trick very nicely. Download the whole library from http://jvcl

Display simple markup in a Label in Delphi

北城余情 提交于 2021-02-18 05:12:03
问题 I am currently displaying some text in a TLabel. I would now like to emphasise certain words within the text by displaying them in bold or perhaps italic . What is the recommended way to do this in Delphi? Is there a TLabel-like component that can display simple HTML or markup? I am imagining some code like this: label.text:='This information is <b>important</b>'; I am using Delphi 2010 回答1: JvHTLabel in the JVCL will do the trick very nicely. Download the whole library from http://jvcl

Get user picture

一笑奈何 提交于 2021-02-17 20:51:51
问题 OS: Win7x64 (2008,2008r2). Lang: Delphi Xe2. How to receive a full path (and file name) to the image "user account picture"? How to set new picture? Example on delphi plz. Need: ...function GetCurrentUserPicture:string; ...function GetUserPicture(UserName:String):string; ...function SetUserNewPicture(UserName, ImageFileName:String):bool; 回答1: There is an undocumented function in shell32.dll. On Windows XP its ordinal is 233, on Windows Vista and 7 its ordinal is 261. Its function prototype

How to sent text string to service?

帅比萌擦擦* 提交于 2021-02-17 06:41:33
问题 I have a desktop application and a service. How can i send string from desktop application into my service and handle it in a service? I don't want use sockets because it may be blocked by Windows Firewall. 回答1: If you don't want to use network transport then probably the simplest way to do cross-session IPC is to use a named pipe. The main thing to take care over is that you will need to supply security attributes when creating the named pipe. Without doing so you won't succeed in cross

Delphi Firedac not recognizing new ALTER feature in sqlite3

风流意气都作罢 提交于 2021-02-17 06:25:09
问题 SQLite3 release 3.25 and higher allows me to "ALTER TABLE myTable RENAME COLUMN oldColName TO newColName" . But I get an error "near RENAME" when I execute this in my Delphi code, but it works running the new sqlite3.dll from the command line or with another utility. This works: HerdConnection.ExecSQL('ALTER TABLE myTable RENAME TO NewNameTable'); This fails: HerdConnection.ExecSQL('ALTER TABLE myTable RENAME COLUMN oldcolName TO NewColName'); Since i installed the new sqlite3.dll driver, the

How to count all the words in a textfile with multiple space characters

无人久伴 提交于 2021-02-17 04:40:48
问题 I am trying to write a procedure that counts all the words in a text file in Pascal. I want it to handle multiple space characters, but I have no idea how to do it. I tried adding a boolean function Space to determine whether a character is a space and then do while not eof(file) do begin read(file,char); words:=words+1; if Space(char) then while Space(char) do words:=words; but that doesnt work, and basically just sums up my(probably bad) idea about how the procedure should look like. Any

How to count all the words in a textfile with multiple space characters

青春壹個敷衍的年華 提交于 2021-02-17 04:40:36
问题 I am trying to write a procedure that counts all the words in a text file in Pascal. I want it to handle multiple space characters, but I have no idea how to do it. I tried adding a boolean function Space to determine whether a character is a space and then do while not eof(file) do begin read(file,char); words:=words+1; if Space(char) then while Space(char) do words:=words; but that doesnt work, and basically just sums up my(probably bad) idea about how the procedure should look like. Any