Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6096245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:54:16+00:00 2026-05-23T12:54:16+00:00

Well, I have the following problem: I’ve painted the tree cells in different colors

  • 0

Well, I have the following problem:

I’ve painted the tree cells in different colors depending on some boolean vars.
Example:

  • isProcessService,
  • isProcessInDebugger,
  • isProcessService,
  • isProcessElevated,
  • isProcessNet,
  • isProcessOwner,
  • isProcessinJob,
  • isProcessPacked,
  • isProcessMarkedForDeletion,
  • isProcessMarkedForCreation : Boolean;

So in BeforeCellPaint I’ll paint the cells background color based on those booleans like:

procedure TMainForm.ProcessVstBeforeCellPaint(Sender: TBaseVirtualTree;
  TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
  CellPaintMode: TVTCellPaintMode; CellRect: TRect; var ContentRect: TRect);
var
  NodeData: PProcessData;
begin
 if Node = nil then
    Exit;

  NodeData := Sender.GetNodeData(Node);

  if NodeData = nil then
    Exit;

  if (NodeData^.isProcessOwner) then
  begin
    TargetCanvas.Brush.Color := $00AAFFFF;
    TargetCanvas.FillRect(TargetCanvas.ClipRect);
  end;

  if (NodeData^.isProcessInDebugger) then
  begin
    TargetCanvas.Brush.Color := $00E5A5A5;
    TargetCanvas.FillRect(TargetCanvas.ClipRect);
  end;

    if (NodeData^.pProcessID = 0) or (NodeData^.pProcessID = 4) then
  begin
    TargetCanvas.Brush.Color := $00FFCCAA;
    TargetCanvas.FillRect(TargetCanvas.ClipRect);
  end;

  if (NodeData^.isProcessElevated) and not(NodeData^.isProcessInDebugger) then
  begin
    TargetCanvas.Brush.Color := $0000AAFF;
    TargetCanvas.FillRect(TargetCanvas.ClipRect);
  end;

  if (NodeData^isProcessService) and
    not (NodeData^.isProcessPacked) and
    not(NodeData^.isProcessNet) then
  begin
    TargetCanvas.Brush.Color := $00FFFFCC;
    TargetCanvas.FillRect(TargetCanvas.ClipRect);
  end;

  if (NodeData^.isProcessMarkedForDeletion) then
  begin
    TargetCanvas.Brush.Color := $005D5DFF;
    TargetCanvas.FillRect(TargetCanvas.ClipRect);
  end;

  if (NodeData^.isProcessMarkedForCreation) then
  begin
    TargetCanvas.Brush.Color := $0061E15E;
    TargetCanvas.FillRect(TargetCanvas.ClipRect);
  end;

  if (NodeData^.isProcessNet) then
  begin
    TargetCanvas.Brush.Color := $005CE0BF;
    TargetCanvas.FillRect(TargetCanvas.ClipRect);
  end;
end;

The question is:

How could I paint the cell green or red depending on a process is going to be created or deleted (let the color stay for at least one second and then switch back to its original value?)

I other words, a process is created paint the cell green wait a second and then switch back to the original color depending on: isProcessService, is ProcessOwner and so on…

The biggest Problem is I need this in a non blocking mode (I can not use sleep otherwise the tree will freeze too so the color change will not be noticed)

If you still can not follow me, I’m trying to mimic the same behavior Process Explorer or Process Hacker does when a process is created or deleted. Both applications paints the cell background for those processes red or green for a second then switching back to the original color the cell had.

Just for information, I’ll get notified of process creation or deletion via wmi.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:54:17+00:00Added an answer on May 23, 2026 at 12:54 pm

    Whenever a process is created, start a timer associated with that process with a timeout of 1s. The isProcessMarkedForCreation is set to true and so the row is painted green. When the timer fires the handler sets isProcessMarkedForCreation to false and forces a repaint of that row which removes the green highlight. Now that the timer has done its work it should be deleted. The exact same approach can be used for deletion.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem that the standard library doesn't solve well, and I'm
well i have the following problem. the html i have is malformed and i
I'm using Yii's zii.widgets.jui.CJuiDatePicker and have the following problem: It works well when inserting
Well, I have the following problem: I need to delete a row from a
I have the following problem to solve: Currently we have a metadata tree of
I have following problem: I have a TabActivity which works well. Inside, there is
I have the following problem (I think it's well known/standard) that I am thinking
Well i have the following code: <?php while(1==1){ echopiece<br>; flush(); }; ?> The problem
Well, I have researched and have not found a solution to the following problem
I have the following script that works well in Firefox and Chrome (not sure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.