We help IT Professionals succeed at work.

Delphi

59K

Solutions

17K

Contributors

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.

Is it possible to monitor if an application is operating a keyboard hook?  Can I write a program to tell when an application has tapped into and is capturing keyboard input?
0
Hi,

I'm trying to extract some info from a html code and i need to extract the url (link) from a structure block in html source.

Example, i have this html structure:

<div class="browse-info">
<span class="info">
<span class="browseTitleLink"><a href="http://xxx.com/movie/xxx">xxx</a></span><br />
<span class="browseInfoList" ><b>Size:</b> 1.85 GB</span><br />
<span class="browseInfoList" ><b>Quality:</b> 1080p</span><br />
<span class="browseInfoList" ><b>Genre:</b> Crime | Drama</span><br />
<span class="browseInfoList" ><b>IMDB Rating:</b> 6.0/10</span><br />
<span class="browseSeeds">
<span class="peers"><b>Peers:</b> 1454</span>
<span class="seeds"><b>Seeds:</b> 3412</span>
</span>
</span>
<span class="links">
<a href="http://xxx" class="std-btn-small mright">View Info<span></span></a>
<a href="http://xxx" class="std-btn-small mleft downloadDwl" data-movieID="4502" data-downloadID="4694">Download<span></span></a>
</span>
</div>
</div>
<div class="divider"></div>
</div>

Open in new window


I'm using this code to get some info:

procedure TForm1.Button3Click(Sender: TObject);
Var
  Documento : OleVariant;
  Elementos : OleVariant;
  I         : Integer;
  Item : TListItem;
  Source : TMemoryStream;
  Memo : Tmemo;
  IdHttp : TidHttp;
  Qualidade : String;
begin
Listview1.Clear;
idHttp := TIdHttp.Create(Self);
idHttp.AllowCookies := True;
idHttp.HandleRedirects := True;
memo := Tmemo.Create(Self);
Memo.Visible := False;
memo.Parent := Form1;
Source := 

Open in new window

0
Hi,

I have  DBTreeView.
1. How can I select exact node by AbsoluteiIndex (it is absolute when it is all exapnded), I know absolute Idnex when it is expanded.
Only level 0 is visible and node which i want to select is on level 5


Thx, Hrvica
0
Thanks
Alex
0
Hi,

I want to have a selected value that is different than the displayed value?

It is possible to do this in HTML and in .net.

Is it possible to do this in Delphi/FireMonkey Mobile?

When I go into the ComboBox Items Designer it only shows a place to enter the display text.

Likewise in the Object Inspector, the Combo Box items look more like ListView items with text only, no values.

My desire is to have unique values for the displayed items that can be stored in a DB table and used against a lookup table.

I would also like to have the combo items populated form that same lookup table, but I don't see any way to do that with Live Bindings.

Gary
0
Hi Experts, I have a 3-button MessageDlg like this:


MsgVar := MessageDlg('Problem found!'+#13#10+#13#10+
                        'Click YES to proceed and display each occurence of this.'+#13#10+
                        'Click IGNORE to proceed without showing any more occurrences.'+#13#10+
                        'Click ABORT to abort this process altogether.', mtWarning, [mbYes,mbIgnore,mbAbort], 0);

if MsgVar = mrYes then FoundDiscrepancy[i] := FALSE
else if MsgVar = mrIgnore then FoundDiscrepancy[i] := TRUE
else EXIT;

Open in new window



When it displays, it shows the 3 buttons in the wrong order. It shows them as
YES   ABORT   IGNORE

when it should be:

YES   IGNORE  ABORT

However, when I do click a button, it does seem to perform the appropriate action - it's just the order that's wrong. Any idea what would be going on?

Thanks!
    Shawn
0
Hi,

I have TDBTreeView connected on my TAdoDataSet

How can I Drag and drop without from node to node

for example
Id 15  
under id 23

When I have to update my dataset before?
And ofcourse in some folder i can't move it

15 can only go to operators.

Thx, Hrvica
sort.xls
0
Hi,

i have table with same id like absoluteindex in DBtreeview

how to locate row with right click on the mouse before popping up menu, because pop up menu depends on which absoluteindex is clicked

procedure TDomainObjectsOperatorLocations.JvDBTreeView1MouseDown(
  Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  var
Item: TTreeNode;
begin
  inherited;
Item := JvDBTreeView1.GetNodeAt(X, Y);
if Assigned(Item) then
   begin
     Item.Selected := True;
     qTable.Locate('Id', item.absoluteindex,[]);
   end;

Open in new window

end;

Thank you, H
0
Hi,

how to add image on DBtreeview


Thx, hrvica
0
Hi Experts... I have a popupmenu with several items dynamically populated in my app. I would like to have it so that when a user clicks on any of these items in the popupmenu, another very small popupmenu will appear showing always the same two entries (For example: Numeric, and Text). SO in other words, the user click an item from the first popup, then he needs to specify whether the item he clicked is a Numeric or Text value, so he does another selection accordingly from the 2nd popup that immediately appears. How to do this?

Thanks!
    Shawn
0
How to select node by absoluteindex?


like this

TreeView1.Items.AddChild(AbsoluteIndex,'Child')

Thx, Hrvica
0
I have table (attach) like this i should sorted in treeview

how should I put it in attach

if ParentID is null that row is firstnode in treeview
if row has ParentId then it is under same id

Thx, Hrvica
sort.xls
0
Hi

I have a ScrollBox and I populate it with lot's of TLables and TVirtualStringTrees... I create  a long report with heading (TLabel) and data grid (TVirtualStringTree)  and it works fine. By default I have 10+ reports and show the ones that have any data. So, sometimes I show all of them, sometimes just 1 or 2 (each has label/name of report and virtual tree for data).
So, they are all already in the scroll box, I just hide/show the ones I need.

The problem is that in very rare cases the first few reports have a couple of thousand lines/nodes, so the scroll box can quickly get to 50.000 in height. The problem is, that virtual trees don't go after 32767 point! Meaning all treeviews that should be located on positions 32767+ get stuck on that position, but all the labels get positioned to a proper pos in scroll box, 50.000, 100.000+.

I searched around and found that TScrollBox used to have a problem with not extending beyond 32767, due to some Windows limitation. Either this was true in earlier Delphi version, I use D2006, because TLabel has no problem being position beyond 32767 position mark.

So, is it a limitation of ScrollBox that affects TVirtualStringTree or is it TVirtualStringTree limitation? Any suggestions how to overcome it?

You can test with simple, TScrollBox and put TLabel and TVirtualStringTree inside. Then set:
Label1.Top := 35.000;
VirtualStringTree1 .Top := 35.020;

Open in new window

and it won't work, tree view will be shown higher than label.
0
Hi,

if I have  treview like this

Root1
    Ch1
       ChCh1
           ChChCh1

If I click ChChCh1

how do I get text like this
ChChCh1, ChCh1, Ch1, Root1

if I click on ChCH1
how do I get text like this
    ChCh1, Ch1, Root1

and so on....

Thx, Hrvica
0
Hi i have one function for finding root and formshow procedure
i need much simpler Syntax

Dat.q(q)(q) is TadoDataset

function FindRootNode(ACaption: String; ATreeView: TTreeView): TTreeNode;
var LCount: Integer;
begin
  result := nil;
  LCount := 0;
  while (LCount < ATreeView.Items.Count) and (result = nil) do
  begin                                              // and (ATreeView.Items.Item[LCount].Parent = nil)
    if (ATreeView.Items.Item[LCount].Text = ACaption) then
      begin
         result := ATreeView.Items.Item[LCount];
      end;
    inc(LCount);
  end;
end;

procedure TDomainObjectsOperatorLocations.FormShow(Sender: TObject);
var i,j:Integer;
    LDestNode, ObjectNode, OperatorNode, LocationNode, DeviceNode: TTreeNode;
begin
  inherited;
  Dat.q.Close;
  Dat.q.CommandText:= ' Select * from domains';
  Dat.q.Open;
  TreeView1.Items.Clear;
  Dat.q.First;
  i:=0;
  while not Dat.q.Eof do
    begin                                                      // +' '+Dat.q.FieldByName('NAME').AsString
      TreeView1.Items.Add(nil,Dat.q.FieldByName('CODE').AsString); // +' '+Dat.q.FieldByName('NAME').AsString
      LDestNode:= FindRootNode(Dat.q.FieldByName('CODE').AsString, TreeView1);
      Dat.qq.Close;
      Dat.qq.CommandText:= 'Select objects.code, objects.name, objects.domaincode, domains.name as domainname';
      Dat.qq.CommandText:= Dat.qq.CommandText + ' from objects left join domains on objects.domaincode=domains.code';
    …
0
Hi,

In my treeView I have 3 level 0 nodes
RootNode1
RootNode2
RootNode3

on each rootnode i want to add 2 child node
ObjectNode
OperatorNode

And after i Select need to add on RootNode1.ObjectNode Object1 and Object5
                                                     RootNode1.OperatorNode Operator1 and Operator2  

                                                     RootNode2.ObjectNode Object3 and Object4
                                                     RootNode2.OperatorNode Operator3 and Operator4  

                                                     RootNode3.ObjectNode Object5 and Object6
                                                     RootNode3.OperatorNode Operator7 and Operator8  

RootNode1
    ObjectNode
          Object1
          Object2
    OperatorNode
          Operator1
          Operator2
RootNode2
    ObjectNode
          Object3
          Object4
    OperatorNode
          Operator3
          Operator4
RootNode3
    ObjectNode
          Object5
          Object6
    OperatorNode
          Operator5
          Operator6

And after if i select RootNode3.ObjectNode  how should i show text
ShowMesssage(TRootNode3.ObjectNode);


Thx Hrvica
0
I have a datetime field in a clientdataset which I have added an index to but when I attempt to apply cliendataset.setrange([mystartdate],[myenddate]) it results in no records.

What am I doing wrong?

Thanks for your help

Daniel
0
For over 10 years I have been using the ExecuteFile function from the fmxUtils unit.  Upon switching to Delphi XE2, I no longer seem to have that available to me.   WinExec does not work.  CreateProcess gives access violation.  What do I have to do to execute a program? This was something that was always simple to do. Now suddenly it seems rather tricky.  Perhaps it's something in the ASCII to Unicode conversion as all winapi calls seem to be PWideChar instead of PChar.
0
Hi experts.

I'm trying to get the atrribute "lastLogonTimestamp" and it is a date from activedirectory by using SQL syntax. The date is a largeinteger datatype.

I do not know how to get the data from AD into something useful.

I have tried to do this:

var
bigint : int64

begin
  try
    ADOQuery4.SQL.Clear;
    ADOQuery4.SQL.Text := 'SELECT operatingSystem, lastLogonTimestamp FROM '+ Quotedstr('LDAP://OU=COMPUTERS,OU='+copy(ComputerNavn,3,2)+',OU='+copy(ComputerNavn,1,2)+',OU=FIRM,DC=AD,DC=FIRM,DC=ORG') + ' WHERE cn = '+ QuotedStr(ComputerNavn);
    ADOQuery4.Open;
    bigint := ADOQuery4.FieldByName('lastLogonTimestamp').AsLargeInt;
  finally
    ADOQuery4.Close;
  end;
end;

Open in new window


but I get this error:


'Could not convert variant of type (Dispatch) into type (Boolean)'
0
I have three worksheets in a workbook.  The second and third sheet each have a chart.  I am trying to access one of these charts to change the title and data range.  

I have defined

XLApp: TExcelApplication;
ExcelWS: ExcelWorksheet;
Chart: ExcelChart;

I can access a worksheet with

  ExcelWS := XLApp.WorkSheets.Get_Item(2) as ExcelWorkSheet;

However I am unable to access the Chart.

  Chart := XLApp.Charts[1] as ExcelChart;

  Chart := XLApp.Charts.Get_Item(1) as ExcelChart;

both give me an Invalid index error

Does any one have any idea of the correct syntax to achieve this.

Delphi v6 with Excel2000.pas
Excel 2010
Windows 7 Professional

Many thanks
0
Hi,
I`ve got a group of data like in attached file. I need to find values which are almost the same or very similar (the difference between values should be less than 100, i`ve also marked the values by -------------* string which shows where are the similar values.
In the attached example I should be able to receive 4 results:
1. 8160 - 8200
2. 24940 - 24920
3. 32920 - 33060
4. 41680 - 41760
values.txt
0
Hello, we have a Delphi Program (running under windows) that only runs correctly when the OS is set to english number format, i.e. the dot .  as decimal separator. As we are in Germany this means changing the number format every time.

I spent some time trying to convince delphi to use the dot regardless what locale is set but I could not get this working. Then I thought it might be possible to set environment variables before executing the program; I set LANG to "en" but this does not seem to influence the decimal separator. Is there another environment variable for this or another way to run a program with specific language/number settings?

Thank you for a hint,
jc
0
I am developing an app that requires parallel payment through credit cards with any payment gateway like paypal, stripe, braitree. For example an user, paid $10 to the app, then the app send some amount like $5 to driver account and rest amount to app admin. Please let me know if you have any answer. thanks
0
I know the name of another computer on the LAN. In Delphi (XE4), how can I obtain its MAC address?
0
Hi can any one help I need to solve this

Query object inherited from TQuery which will only post a
record if it is currently in dsInsert or dsEdit state by overriding the
protected DoBeforePost procedure.

any ideas?
0

Delphi

59K

Solutions

17K

Contributors

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.