Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CListCtrl and Selection...

CListCtrl and Selection...

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bernhard
    wrote on last edited by
    #1

    In my program i use a CListCtrl.. Selecting multiple Items.. everything is ok.. but after processing the selection i would like to destroy the selection the user made.. visually it is simple, using SetSelectionMark(-1)... but msdn says: "This macro does not affect the selection state of the item" and this is the problem.. the user clicks "process" once again.. and the same selection gets processed... but i want to delete the section.. the only solution i found would be setting the "ItemState" to NonSelected.. but i had to do this for the whole selection.. is there any other / easier way?? thanks in advance bernhard stolen sig#19: "Just looking for loopholes." W. C. Fields [American actor, 1880-1946, explaining why he was reading the Bible on his deathbed.]

    B M 2 Replies Last reply
    0
    • B Bernhard

      In my program i use a CListCtrl.. Selecting multiple Items.. everything is ok.. but after processing the selection i would like to destroy the selection the user made.. visually it is simple, using SetSelectionMark(-1)... but msdn says: "This macro does not affect the selection state of the item" and this is the problem.. the user clicks "process" once again.. and the same selection gets processed... but i want to delete the section.. the only solution i found would be setting the "ItemState" to NonSelected.. but i had to do this for the whole selection.. is there any other / easier way?? thanks in advance bernhard stolen sig#19: "Just looking for loopholes." W. C. Fields [American actor, 1880-1946, explaining why he was reading the Bible on his deathbed.]

      B Offline
      B Offline
      Bret Faller
      wrote on last edited by
      #2

      Well if you are doing the processing in a loop then you could just set the ItemState to Nonselected as soon as you are done processing that item and then when all processing is done set the selection mark to -1. Bret Faller Odyssey Computing, Inc.

      1 Reply Last reply
      0
      • B Bernhard

        In my program i use a CListCtrl.. Selecting multiple Items.. everything is ok.. but after processing the selection i would like to destroy the selection the user made.. visually it is simple, using SetSelectionMark(-1)... but msdn says: "This macro does not affect the selection state of the item" and this is the problem.. the user clicks "process" once again.. and the same selection gets processed... but i want to delete the section.. the only solution i found would be setting the "ItemState" to NonSelected.. but i had to do this for the whole selection.. is there any other / easier way?? thanks in advance bernhard stolen sig#19: "Just looking for loopholes." W. C. Fields [American actor, 1880-1946, explaining why he was reading the Bible on his deathbed.]

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        ListView_SetItemState ( hwndYourList, -1, LVIS_SELECTED, 0 ); turns off the selected state for all items in the list. --Mike-- http://home.inreach.com/mdunn/ "Listen you footwarriors, can you hold down a bit with the firing? I've just got three impromptu weddings breaking out behind me!" -- Arthur Dent :love: your :bob: with :vegemite: and :beer:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups