Welcome to PhoneASK, where you can ask questions and receive answers from other members of the community.

Multiple selection in tree control using Win32

asked 9 days ago by Kinlan
Hello,

Did anybody did the multiple selection in the tree control
using win32..

i stucked here for multiple selection

i have only winProc of tree control so how to handle
in it

Please reply its very urgent basis

Smile | :)

Many thanks
.

Your answer

2 Answers

answered 9 days ago by shigeta
For Win32 API
ctrlTree.Create(WS_CHILD|TVS_HASBUTTONS|TVS_CHECKBOX|, ctrlRect, this, IDC_TREECTRL);
Then check notification of NM_CLICK event
case NM_CLICK:
{
    POINT cursorPos; GetCursorPos(&cursorPos);
    ScreenToClient(hwndTree, &cursorPos);
    TVHITTESTINFO thinf;
    thinf.pt = cursorPos;
    TreeView_HitTest(hwndTree, &thinf);
    if (thinf.flags == TVHT_ONITEMSTATEICON)
    {
        //state changed: check the state of the item under the cursor
        BOOL isChecked = TreeView_GetCheckState(hwndTree, thinf.hItem);
        if (isChecked)
        // do something
        else
        // do nothing?
    }
}
break;


For MFC
At form designer selectenable the "Check boxes" style on your control.
Then use the following code:

DWORD dwLong = m_tree.GetWindowLong(GWL_EXSTYLE);
dwLong |= TVS_CHECKBOXES;
m_tree.SetWindowLong(GWL_EXSTYLE, dwLong);
answered 8 days ago by Joel
If you can use WTL CTreeViewCtrl.
for more details-
TreeCtrl - A WTL tree control with Windows Vista style item selection[ ^]

thanks.

Related Questions

I have a simple Win32 GUI app which has an edit control in the main window. If I write: printf(Hello world!\n); I would like the text to appear in that control instead of the console. How to? Updat
Is the documentation for Rich Edit Controls really as bad (wrong?) as it seems to be? Right now I'm manually calling LoadLibrary(riched20.dll) in order to get a Rich Edit Control to show up. The doc
I have a running code with 9 threads to operate on a 3*3 matrix .. I want to make the number of threads an input from the user .but I can't divide the matrix on for example 4 threads only. Any help wo
I am trying to improve my coding skills by making my code more structured and readable. I code the GUI (thanks edit). I have been reading through Firefox's open source code to improve but it uses GTK+
Version 6.0 of the common controls (comctl32.dll) implements a new approach for subclassing controls that is not available on older versions of Windows. What is the best way to implement subclassing s
I'm trying to find a way to replace all instances of a string token in a file with another string. How can I do this in C++ with the win32 API? In other languages this is an easy thing to do, but in
For example, my docx file contains the following sentences: This is a Perl example This is a Python example This is another Perl example I want to apply bold style to all the occurrences of the word
Having looked around for the best way to perform the (supposedly) simple task of clearing a cmd.exe console window and finding out that simply using system('cls'); is wrong (in the line of For every
I am fairly new to Perl and am having a hard time grasping the behavior of the following password input code snippet: use Win32::Console; my $StdIn = new Win32::Console(STD_INPUT_HANDLE); my $Password
I have a C++ project in the MS Visual Studio 2008 IDE (note, NO MFC, NO .NET, just native Win32 APIs!) and I was wondering if it is possible to add to it a child window that can parse and render HTML/
My app. will be running on the system try monitoring for a hotkey; when the user selects some text in any window and presses a hotkey, how do I obtain the selected text, when I get the WM_HOTKEY messa
let's say I have the following elements: Actions table id type date ----------- ---------- ---------- 1 start 2012-01-01 10:00:00 2 suspend 2012-01-01 11:00:00 3 resume 2012-01-01 12:00:00 4 suspend 2
I have a set of checkboxes that I want to turn into a multiple selection input: <div id=taxons_offered> <h3>Taxonomies Offered In</h3> <% for store in Store.all %> <% if s
How can I add a UITableView into my View-Based Application where the user will tap on more than one cell, and it will become selected, exactly like the Clock app's New Alarm setting named Repeat (
I'm using jQuery 1.3.2: <script src=../../Scripts/jquery-1.3.2.js type=text/javascript></script> I've got the following html: <div id=container-div> <div id=package_1>
Demo <table id=tableStudent border=1> <thead> <tr><th>ID</th><th>Name</th> <th>Class</th></tr> </thead> <tbody> <tr>&l
If I can hook into a Win32 process, will I be able to do: Read variables from inside a Class inside the process? I have a full source code for the Win32 app above, can I use that as reference for thi
is there any good book/video/web tutorials for multithreading in win32? I only found Addison-Wesley - Multithreading Applications in Win32 (1996) book and might going to order it soon.
I am trying to create a helloworld program using only masm and not masm32 libs. Here is the code snippet: .386 .model flat, stdcall option casemap :none extrn MessageBox : PROC extrn ExitProcess : PRO
Recently our application encountered a strange problem. The application has a win32 window in the WPF window, when resize the WPF window, the problem occurred. StackTrace: Exception object: 0000000002
I am fairly new to python, and have no experience with writing services for windows. I have tried to hack together a windows service based on afew tutorials i have found out there. I need this service
I have the following code <div id=gridRow></div> <div class=gridC-R45><div><span>COLA</span></div></div> <div class=gridC-R45><div><
I'm working on an experimental TreeView where each TreeViewItem can either represent a condition, or a branch with an operator. This is to be parsed into SQL. For example, the tree could have a branch
I need to install OpenCV on Win32. I do not have it installed currently. I downloaded OpenCV-2.0.0a-win32.exe and ran it. What the heck do I do now? There are no .lib's and whatnot. I found some instr
Can you dock a child window control in C++ win32 API (like are there WS_* styles or something), or do you always have to listen for the WM_SIZE message on the parent window and manually re-layout/fill
I want to host Win32 window in WPF window to avoid flickering of DirectX content during window resizing. Could someone say what is correct way to do this? And need I worry about DPI and something else
hi is there a proper Java win32 library, for example, displaying current processes, finding out port numbers a process has taken etc etc. ? (or something like a WMI library ?) thanks
How do I get HANDLE to last run process by user? My Application will be running, has started one process using CreateProcess() or ShellExecute() , and then user comes and executes another, independent
I have some problems with the handling of CTRL+C events, in a Win32 C++ console program. Basically my program looks like this: (based on this other question: Windows Ctrl-C - Cleaning up local stack o
Is .NET better than Win32 or the othe way around? Which would be the pros \ cons of both, in what situations one would be better than the other. Has Microsoft released .Net as a replacement for Win32?
I have been a .NET developer since I started coding. I would like to learn Win32 programming. Need advice on where to start. What are the best resources /books for learining Win32 programming. I know
I've been able to set local hotkeys like this RegisterHotKey(hwndDlg, 100, MOD_ALT | MOD_CONTROL, 'S'); how can I set the hotkey to be global?( I want it to be there even when my window is hidden)
I'm running mysqldump.exe with needed parameters from cmd and this all works fine. Then, all of the sudden, it started to give me a popup Not a valid win32 application and in the console it's saying
How could I create similar structure to handle Win32 Messages like it is in MFC? In MFC; BEGIN_MESSAGE_MAP(CSkinCtrlTestDlg, CDialog) //{{AFX_MSG_MAP(CSkinCtrlTestDlg) ON_BN_CLICKED(IDC_BROWSE, OnBrow
I have a tree that appears as follows. A1 B1 B2 A2 A3 B3 A4 A5 C1 C2 C3 A6 I want to filter this to return A1 A2 A3 A4 A5 A6 The basic idea is to only return A nodes. The struggle that I am havin
How to get the OS version for all windows, at least the name for win95,98,me,xp,vista,7? Im using visual c++ 2010 and I want to include this feature in a pure win32 app.
In general, what needs to be done to convert a 16 bit Windows program to Win32? I'm sure I'm not the only person to inherit a codebase and be stunned to find 16-bit code lurking in the corners. The co
The below code works to load xml files of a tree view in the user-control. Somehow i feel the code for expand/close is not well coded. Is there any other way of coding this in a more clean form? try{
I'm receiving a very standard Viewstate error in a very specific scenario in one of current projects. Sys.WebForms.PageRequestManagerServerErrorException: Failed to load viewstate. The control tree i
I need to select multiple row in tableview for iphone 4.3.should change background color of cell if selected with out accessory type.after navigating to multiple view,if I get back to table view need
I have two dropdown in html page.1st dropdown Contain Class-1, class-2,class3.. and 2nd dropdown contain StudentNameID for selected Classes. I wanted to multiple selection for classes in first dropdow
Lets say that I have selected the word 'test' three times using ctr + d. Is there a way to tab through the selections. So for example if I wanted to go to the second word and only change that one. I
I have a table that goes something like this: IDs Timestamp Values 124 300.6 1.23 124 350.1 -2.4 309 300.6 10.3 12 123.4 9.00 18 350.1 2.11 309 350.1 8.3 ... and I'd like to select all the rows that
i want to create listview like below. check box | Textview | Textview | Textview | Textview | Textview | Textview | all data come from database and set in textview. i tried but i got some problem wh
I'm trying to find a way to create a binary tree where 3 doubles are stored in each node and another tree where 6 doubles are stored in each node. The problem I'm having is figuring out a way to imple
I have a regions table of which I want a tree view (table simple ordered as tree) is it possible using sql queries help is appreciated, I tried to do it using self joins but i did not get the desired
Consider the following array, which is claimed to have represented a binary tree: [1, 2, 5, 6, -1, 8, 11] Given that the index with value -1 indicates the root element, I've below questions: a) How is
Suppose I have a weighted non-directed graph G = (V,E). Each vertex has a list of elements. We start in a vertex root and start looking for all occurances of elements with a value x. We wish to travel
After running some hours my application fails in creating a new font object: CreateFontIndirect() returns NULL. I know how to find memory leaks (i.e. using parallel inspector or another profiler - mos
I need to get a list of all processes on a windows system including names and PID. EnumProcess can obtain a list of pids, but how do I get the process name from the pid? I don't want to call OpenProce
...