473,396 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

LockWindowUpdate VB 2005

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

Friend Declare Function LockWindowUpdate Lib "user32.dll" (ByVal
hWndLock As Long) As Boolean
LockWindowUpdate(Me.Handle.ToInt32)
LockWindowUpdate(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.
May 26 '06 #1
3 9775
"Paul Remblance" <pa**@remblance.co.uk> schrieb:
I have just converted a project from VB 2003 to VB 2005 and the
LockWindowUpdate no longer works!

Friend Declare Function LockWindowUpdate Lib "user32.dll" (ByVal
hWndLock As Long) As Boolean
LockWindowUpdate(Me.Handle.ToInt32)
LockWindowUpdate(0)

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


\\\
Private Declare Function LockWindowUpdate Lib "user32.dll" ( _
ByVal hWndLock As IntPtr _
) As Boolean
....
LockWindowUpdate(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/>

May 26 '06 #2

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ON**************@TK2MSFTNGP05.phx.gbl...
"Paul Remblance" <pa**@remblance.co.uk> schrieb:
I have just converted a project from VB 2003 to VB 2005 and the
LockWindowUpdate no longer works!

Friend Declare Function LockWindowUpdate Lib "user32.dll" (ByVal
hWndLock As Long) As Boolean
LockWindowUpdate(Me.Handle.ToInt32)
LockWindowUpdate(0)

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


\\\
Private Declare Function LockWindowUpdate Lib "user32.dll" ( _
ByVal hWndLock As IntPtr _
) As Boolean
...
LockWindowUpdate(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/>


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

Friend Declare Function LockWindowUpdate Lib "user32.dll" (ByVal
Friend Declare Function LockWindowUpdate Lib "user32.dll" (ByVal
hWndLock As IntPtr) As Boolean
LockWindowUpdate(Me.Handle.ToInt64)
LockWindowUpdate(0)

hWndLock As Long to hWndLock As IntPtr
Me.Handle.ToInt32 to Me.Handle.ToInt64

Also tried your LockWindowUpdate(Me.Handle) which also worked.
May 26 '06 #3
"Paul Remblance" <pa**@remblance.co.uk> schrieb:
Many thanks, reached the same conclusion (but a bit slower!)

Friend Declare Function LockWindowUpdate Lib "user32.dll" (ByVal
Friend Declare Function LockWindowUpdate Lib "user32.dll" (ByVal
hWndLock As IntPtr) As Boolean
LockWindowUpdate(Me.Handle.ToInt64)
LockWindowUpdate(0)

hWndLock As Long to hWndLock As IntPtr
Me.Handle.ToInt32 to Me.Handle.ToInt64


You do not need 'Me.Handle.ToInt62'. 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/>

May 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dan H. | last post by:
Hello, I've been having a pickle of time trying to find any information about the following. The Win32 API has a function called 'LockWindowUpdate' which, if I'm not mistaken, prohibits all...
2
by: Richard Thornley | last post by:
Hello, I have used the API Function "LockWindowUpdate" in my VB 6 applications and was curious if this API function still exists in VB.Net. I have spent 4 hours surfing the 'net for an example...
2
by: Gene Vital | last post by:
I am using the LockWindowUpdate API to lock my form while updating and then Unlock when I am done. It was pretty simple to make the call to lock the form with the form handle but how do I Unlock...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.