LockWindowUpdate VB 2005

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Remblance

    #1

    LockWindowUpdate VB 2005

    I have just converted a project from VB 2003 to VB 2005 and the
    LockWindowUpdat e no longer works!

    Friend Declare Function LockWindowUpdat e Lib "user32.dll " (ByVal
    hWndLock As Long) As Boolean
    LockWindowUpdat e(Me.Handle.ToI nt32)
    LockWindowUpdat e(0)

    Any other ideas how to lock the window in VB 2005?

    I have a tab control where I need to 'flick' between tabs in the background.
    Seeing each page flash as it goes through is annoying.
    Tried: SuspendLayout() with the form and tab control which didn't work.


  • Herfried K. Wagner [MVP]

    #2
    Re: LockWindowUpdat e VB 2005

    "Paul Remblance" <paul@remblance .co.uk> schrieb:[color=blue]
    >I have just converted a project from VB 2003 to VB 2005 and the
    >LockWindowUpda te no longer works!
    >
    > Friend Declare Function LockWindowUpdat e Lib "user32.dll " (ByVal
    > hWndLock As Long) As Boolean
    > LockWindowUpdat e(Me.Handle.ToI nt32)
    > LockWindowUpdat e(0)
    >
    > Any other ideas how to lock the window in VB 2005?[/color]

    \\\
    Private Declare Function LockWindowUpdat e Lib "user32.dll " ( _
    ByVal hWndLock As IntPtr _
    ) As Boolean
    ....
    LockWindowUpdat e(Me.Handle)
    ///

    Note that 'Long' is a 64-bit type in VB.NET opposed to VB6 where it was a
    32-bit type.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • Paul Remblance

      #3
      Re: LockWindowUpdat e VB 2005


      "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
      news:ONvz3CMgGH A.4304@TK2MSFTN GP05.phx.gbl...[color=blue]
      > "Paul Remblance" <paul@remblance .co.uk> schrieb:[color=green]
      >>I have just converted a project from VB 2003 to VB 2005 and the
      >>LockWindowUpd ate no longer works!
      >>
      >> Friend Declare Function LockWindowUpdat e Lib "user32.dll " (ByVal
      >> hWndLock As Long) As Boolean
      >> LockWindowUpdat e(Me.Handle.ToI nt32)
      >> LockWindowUpdat e(0)
      >>
      >> Any other ideas how to lock the window in VB 2005?[/color]
      >
      > \\\
      > Private Declare Function LockWindowUpdat e Lib "user32.dll " ( _
      > ByVal hWndLock As IntPtr _
      > ) As Boolean
      > ...
      > LockWindowUpdat e(Me.Handle)
      > ///
      >
      > Note that 'Long' is a 64-bit type in VB.NET opposed to VB6 where it was a
      > 32-bit type.
      >
      > --
      > M S Herfried K. Wagner
      > M V P <URL:http://dotnet.mvps.org/>
      > V B <URL:http://classicvb.org/petition/>[/color]

      Many thanks, reached the same conclusion (but a bit slower!)

      Friend Declare Function LockWindowUpdat e Lib "user32.dll " (ByVal
      Friend Declare Function LockWindowUpdat e Lib "user32.dll " (ByVal
      hWndLock As IntPtr) As Boolean
      LockWindowUpdat e(Me.Handle.ToI nt64)
      LockWindowUpdat e(0)

      hWndLock As Long to hWndLock As IntPtr
      Me.Handle.ToInt 32 to Me.Handle.ToInt 64

      Also tried your LockWindowUpdat e(Me.Handle) which also worked.


      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: LockWindowUpdat e VB 2005

        "Paul Remblance" <paul@remblance .co.uk> schrieb:[color=blue]
        > Many thanks, reached the same conclusion (but a bit slower!)
        >
        > Friend Declare Function LockWindowUpdat e Lib "user32.dll " (ByVal
        > Friend Declare Function LockWindowUpdat e Lib "user32.dll " (ByVal
        > hWndLock As IntPtr) As Boolean
        > LockWindowUpdat e(Me.Handle.ToI nt64)
        > LockWindowUpdat e(0)
        >
        > hWndLock As Long to hWndLock As IntPtr
        > Me.Handle.ToInt 32 to Me.Handle.ToInt 64[/color]

        You do not need 'Me.Handle.ToIn t62'. Handles are 32-bit on 32-bit systems
        and 64-bit on 64-bit systems, which is what 'IntPtr' is designed for. So I
        strongly recommend to use the solution I posted!

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://classicvb.org/petition/>

        Comment

        Working...