473,394 Members | 1,567 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,394 software developers and data experts.

C# equivalent to Win32 API 'LockWindowUpdate'?

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 painting of the window including children
controls until unlocked. The only thing that I can find that even seems
close in .NET is SuspendLayout and ResumeLayout, but these don't really
effect painting - just sizing, moving, docking, and anchoring. Painting
elements such as text and color still can be seen. I even went so far as to
create a DLLImport within my .NET form for the 'LockWindowUpdate' API, but
when I used it, it had very adverse effects - painting got all messed up.
It seems like such a simple concept: I don't want my form to paint anything
until I tell it to - specifically only after all initialization has been
complete. What am I missing? Any and all information about this topic
would be most appreciated.

Thank you,
Dan
Nov 15 '05 #1
1 12852
I have used the LockWindowUpdate API call without problems. Call with
Handle, release by calling again with 0.

[DllImport("user32.dll", EntryPoint="LockWindowUpdate", SetLastError=true,
ExactSpelling=true, CharSet=CharSet.Auto,
CallingConvention=CallingConvention.StdCall)]

private static extern long LockWindow(long Handle);
Perhaps try a Form.Invalidate afterward?

--
Regards,
Matt
ma*********@iinet.net.au
"Dan H." <Da**@projectavatar.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
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 painting of the window including children
controls until unlocked. The only thing that I can find that even seems
close in .NET is SuspendLayout and ResumeLayout, but these don't really
effect painting - just sizing, moving, docking, and anchoring. Painting
elements such as text and color still can be seen. I even went so far as to create a DLLImport within my .NET form for the 'LockWindowUpdate' API, but
when I used it, it had very adverse effects - painting got all messed up.
It seems like such a simple concept: I don't want my form to paint anything until I tell it to - specifically only after all initialization has been
complete. What am I missing? Any and all information about this topic
would be most appreciated.

Thank you,
Dan

Nov 15 '05 #2

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

Similar topics

7
by: Kenjis Kaan | last post by:
I would like to use the crypt function in a Win32 (ie. C program using Visual C++ 6.0 compiler). I wrote a little program to see if it will link but it didn't. So I guess maybe the function isn't...
4
by: groleo | last post by:
Hi. I'm trying to port a piece of code, written for win32, that uses the finddata_t structure. Is there an equivalent , or a work-around, that implement finddata_t on *nix platforms?
9
by: Nadav | last post by:
Hi, I am tring to pass messages between threads, using the good old C++ I would call the GetMessage/PostThreadMessage APIs, Now, I am using C# and i can't find any equivalenty for these calls, any...
6
by: | last post by:
Please, help. Is there a PostThreadMessage equiavalent functionality in .NET framework? I have messages coming from a COM server and they are being delivered in different threads. I would like...
2
by: Nadav | last post by:
What is the C# equivalent of the Win32 AdjustTokenPrivileges API Is there any at all? -- Nadav http://www.ddevel.com
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...
3
by: Paul Remblance | last post by:
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...
10
by: Bishoy | last post by:
Hi, In VB.NET there is a keyword called "My" which has a lot of properties collected at it. Is there any equivalent to this "My" in C#? Thank you.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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.