CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    ListView Mouse Disable

    I am trying to figure out how do I disable mouse input in a ListView(SysListView32) control using Win32API not MFC.

    One way around is to Disable the window by EnableWindow(FALSE) but this approach sets the color of it gray and I need to set the background color to White.

    How can I achieve this. Any ideas ?
    ◄◄ hypheni ►►

  2. #2
    Join Date
    Aug 2009
    Posts
    219

    Re: ListView Mouse Disable

    Euhm,

    I'm not sure but why not handle all clicks on the HWND yourself? If not all are sended, you could try to send the SetCapture() API.

    Hope it helps.

  3. #3
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: ListView Mouse Disable

    Actually Im implementing the thing in NSIS installer where I cant handle this Callbacks.
    Im posting here just for API method so that I can implement that in NSIS way.

    My simple question is How do I disable mouse click to any window ?.
    ◄◄ hypheni ►►

  4. #4
    Join Date
    Jun 2006
    Location
    Chile
    Posts
    13

    Re: ListView Mouse Disable

    Quote Originally Posted by hypheni View Post
    Actually Im implementing the thing in NSIS installer where I cant handle this Callbacks.
    Im posting here just for API method so that I can implement that in NSIS way.

    My simple question is How do I disable mouse click to any window ?.
    The gray color is set by default. you can set its style as owner-draw to change its color.
    For your simple question, that needs you to handle mouse clicks on "any windows" you want to control.

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: ListView Mouse Disable

    Quote Originally Posted by hypheni View Post
    My simple question is How do I disable mouse click to any window ?.
    As mentioned, just handle all the mouse messages and do nothing with them.

  6. #6
    Join Date
    Jun 2006
    Location
    Chile
    Posts
    13

    Re: ListView Mouse Disable

    Quote Originally Posted by Arjay View Post
    As mentioned, just handle all the mouse messages and do nothing with them.
    What do you mean by "do nothing with them" ?

  7. #7
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: ListView Mouse Disable

    Quote Originally Posted by PumpoBee View Post
    What do you mean by "do nothing with them" ?
    Don't call the base class message handler for messages you want to discard.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured