delphi shelltreeview checkbox

drop a shelltreeview on a form (from samples components) and add:

procedure TForm1.FormCreate(Sender: TObject);
var
  dwStyle : DWord;
begin
  dwStyle := GetWindowLong(ShellTreeView1.Handle,GWL_STYLE);
  dwStyle := dwStyle or OBM_CHECKBOXES;
  SetWindowLong(ShellTreeView1.Handle,GWL_STYLE,dwStyle);  
end;

It displays Checkboxes and NOW...
how to get the CHECKED folders ?

Thanks
yarekAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mahdiparakCommented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
adm_adamleeCommented:
I recommend Virtual shell tool
http://www.mustangpeak.net/
it is powerful, with checkbox, easy to get checked folders.
TNameCommented:
Or try this:
(TForm1.FormCreate as you already have it)


procedure TForm1.Button1Click(Sender: TObject);
var
i:Integer;
aNode: TTreeNode;
begin
 for i:=0 to  ShellTreeView1.Items.Count-1 do
   if IsNodeChecked(ShellTreeView1.Items[i]) then
     ShowMessage(ShellTreeView1.Items[i].Text);

end;

function TForm1.IsNodeChecked(aNode :TTreeNode) :Boolean;
var
  aTVItem :TTVItem;
begin
  with aTVItem do begin
    Mask  := TVIF_STATE;
    hItem := aNode.ItemId;
  end;
  TreeView_GetItem(aNode.TreeView.Handle, aTVItem);
  result := (aTVItem.State and $2000) = $2000;
end;
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

TNameCommented:
If you think you've googled enough, google some more ;)
TNameCommented:
Oh, and you'll need CommCtrl in the uses clause.
ziolkoCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup Zone:
split between TName {http:#17495453} and mahdiparak {http:#17467478}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

ziolko
Experts Exchange Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.