Results 1 to 13 of 13

Thread: Listview not locking

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Location
    Canada
    Posts
    202

    Listview not locking

    Hi... I am using the LockWindowUpdate API to lock a listview... however it does not seem to be working. I am locking a Treeview at the same time and it works but not the listview. When I try to lock the listview the LockWindowUpdate function returns 0... Any ideas??? Here's my code minus the API Declaration:

    VB Code:
    1. Private Sub Listview_DblClick()
    2.     Dim retval as Long
    3.  
    4.     retval = LockWindowUpdate(TreeView1.Hwnd) 'returns 1
    5.     retval = LockWindowUpdate(ListView1.Hwnd) ' returns 0
    6. End Sub

    Thanks....

    BestCoder

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    I did some searching and couldn't find anything specific to a ListView control. Could simple perform a LockWindowUpdate on the entire form? Allegedly, this locks all controls on the form.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Location
    Canada
    Posts
    202
    Yes you are right... I could do that, at least for a test... I do need to access some of the controls on this form while the Treeview and Listview are locked. I'll let you know the results of the test.

    Thanks....

    BestCoder

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Location
    Canada
    Posts
    202
    Ok... not sure why this is but it seems that the one that is locked first is the only one that will work. If I lock the treeview first it locks fine and the listview doesn't, but if I lock the Listview first it locks fine and thre treeview doesn't. Know anything about this??

    Thanks a mil.

    BestCoder

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    No idea...how about locking one and disabling the other?

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Location
    Canada
    Posts
    202
    yeah that's what I'm doing... strange though.

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    I know that even in their current iterations these controls have some, how shall I say, "issues", but this is a strange one. I'm going to have a look at MSDN and see what I can see. If I find anything worthy I'll post it.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Location
    Canada
    Posts
    202
    yeah... I looked in the Platform SDK Documentation but couldn't find anything that gave any reasons for that behavior.

  9. #9
    Fanatic Member
    Join Date
    Jun 1999
    Location
    California, USA
    Posts
    662
    Only one window can be "locked" at a time. Try locking the form. Or put both the controls in a frame and lock the frame.

    You can even lock the desktop (use GetDesktopWindow())

    just make sure to call LockWindowUpdate(0) to "unlock" whatever is locked.

  10. #10
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Actually, I like that Frame idea that agent has. Have you tried that?

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Location
    Canada
    Posts
    202
    Yes that is a good idea. I hadn't thought of that. Thanks for replies agent and hack...

    BestCoder

  12. #12
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Help R Us...

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Location
    Canada
    Posts
    202

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