473,395 Members | 1,720 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,395 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 9774
"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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.