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. Uniquely select and double click an item in the List View

Uniquely select and double click an item in the List View

Scheduled Pinned Locked Moved C / C++ / MFC
helpdatabaseperformancetutorialquestion
8 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.
  • S Offline
    S Offline
    scody
    wrote on last edited by
    #1

    Hi, I am new to Windows programming. I am trying to uniquely select and double click an item in the list view (SysListView32) in third party software. This task is somewhat similar to MyProgram trying to double click an item in a ControlPanel-like list view. To accomplish this I am sending a LVM_FINDITEM message to get the item index of the item to be double clicked. LVFINDINFO lvfi; ZeroMemory(&lvfi, sizeof(LVFINDINFO)); lvfi.flags = LVFI_STRING; lvfi.psz = (LPCTSTR)"Item Name"; int itemIndex = ::SendMessage( aControlHWnd, LVM_FINDITEM, (WPARAM)(int)(iStart), (LPARAM)(const LVFINDINFO *)(&lvfi)); This send message is causing a runtime error. After going through some forums and message boards I found that this is due to one of the message parameter which is a pointer to a structure, as you cannot pass a pointer-to-memory to another process. :sigh: Now I would like to know how to custom marshal this message to the other process? :confused: OR Any alternative solution to uniquely select and double click an item in the list view. Any idea or solution to this problem is greatly appreciated. Thanks in advance.

    L 1 Reply Last reply
    0
    • S scody

      Hi, I am new to Windows programming. I am trying to uniquely select and double click an item in the list view (SysListView32) in third party software. This task is somewhat similar to MyProgram trying to double click an item in a ControlPanel-like list view. To accomplish this I am sending a LVM_FINDITEM message to get the item index of the item to be double clicked. LVFINDINFO lvfi; ZeroMemory(&lvfi, sizeof(LVFINDINFO)); lvfi.flags = LVFI_STRING; lvfi.psz = (LPCTSTR)"Item Name"; int itemIndex = ::SendMessage( aControlHWnd, LVM_FINDITEM, (WPARAM)(int)(iStart), (LPARAM)(const LVFINDINFO *)(&lvfi)); This send message is causing a runtime error. After going through some forums and message boards I found that this is due to one of the message parameter which is a pointer to a structure, as you cannot pass a pointer-to-memory to another process. :sigh: Now I would like to know how to custom marshal this message to the other process? :confused: OR Any alternative solution to uniquely select and double click an item in the list view. Any idea or solution to this problem is greatly appreciated. Thanks in advance.

      L Offline
      L Offline
      Llasus
      wrote on last edited by
      #2

      scody wrote:

      uniquely select and double click an item in the list view.

      So you need to get the list view item when the user double clicks, right?

      S 1 Reply Last reply
      0
      • L Llasus

        scody wrote:

        uniquely select and double click an item in the list view.

        So you need to get the list view item when the user double clicks, right?

        S Offline
        S Offline
        scody
        wrote on last edited by
        #3

        No, I need to double click a list view item. Sorry, if it is confusing.. For example, if I want to double click an item named "Item Name", I should be able to click it irrespective of wherever it is positioned in the list, so I called it uniquely(that’s an exaggeration!) select.

        L 1 Reply Last reply
        0
        • S scody

          No, I need to double click a list view item. Sorry, if it is confusing.. For example, if I want to double click an item named "Item Name", I should be able to click it irrespective of wherever it is positioned in the list, so I called it uniquely(that’s an exaggeration!) select.

          L Offline
          L Offline
          Llasus
          wrote on last edited by
          #4

          scody wrote:

          I need to double click a list view item.

          Have you added the double clicked event on the listview? After a list view item being double clicked, what will the program do next?

          S 1 Reply Last reply
          0
          • L Llasus

            scody wrote:

            I need to double click a list view item.

            Have you added the double clicked event on the listview? After a list view item being double clicked, what will the program do next?

            S Offline
            S Offline
            scody
            wrote on last edited by
            #5

            I dont have access to the code of the third party software where I am double clicking the item. I just want to invoke the item to perform some task, as if some user is double clicking the item. To cut short I am trying to test the GUI of the third party software.

            L 2 Replies Last reply
            0
            • S scody

              I dont have access to the code of the third party software where I am double clicking the item. I just want to invoke the item to perform some task, as if some user is double clicking the item. To cut short I am trying to test the GUI of the third party software.

              L Offline
              L Offline
              Llasus
              wrote on last edited by
              #6

              I think one possible reason that this doesn't work is that your LVFINDINFO is declared within your application's memory, so other applications won't see this.

              1 Reply Last reply
              0
              • S scody

                I dont have access to the code of the third party software where I am double clicking the item. I just want to invoke the item to perform some task, as if some user is double clicking the item. To cut short I am trying to test the GUI of the third party software.

                L Offline
                L Offline
                Llasus
                wrote on last edited by
                #7

                See this link[^].

                J 1 Reply Last reply
                0
                • L Llasus

                  See this link[^].

                  J Offline
                  J Offline
                  jhwurmbach
                  wrote on last edited by
                  #8

                  And this is possible without any elevated user rights? :wtf::omg: Sorry I must leave, the "Security Breach"-Alarm jut got off.


                  Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all.
                  Douglas Adams, "Dirk Gently's Holistic Detective Agency"

                  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