473,851 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# equivalent to Win32 API 'LockWindowUpda te'?

Hello,

I've been having a pickle of time trying to find any information about the
following. The Win32 API has a function called 'LockWindowUpda te' 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 'LockWindowUpda te' 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 12890
I have used the LockWindowUpdat e API call without problems. Call with
Handle, release by calling again with 0.

[DllImport("user 32.dll", EntryPoint="Loc kWindowUpdate", SetLastError=tr ue,
ExactSpelling=t rue, CharSet=CharSet .Auto,
CallingConventi on=CallingConve ntion.StdCall)]

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

--
Regards,
Matt
ma*********@iin et.net.au
"Dan H." <Da**@projectav atar.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.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 'LockWindowUpda te' 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 'LockWindowUpda te' 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
5023
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 implement or implemented in a different naming convention. Could someone please help me or show me another method of doing encryption under Win32? TIA
4
2234
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
13467
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 Idea how to communicate between threads and access the threads message queue will be appriciated... -- Nadav http://www.ddevel.com
6
9011
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 to receive these messages in one thread, thus synchronize them. I don't want to use form's Invoke method, but something similar, thread-related. Thanks for any suggestions.
2
4935
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
6945
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 but found nothing that seems to work. If "LockWindowUpdate" is still valid in VB.Net could some provide a sample where a form is locked? Cheers, Richard
2
3025
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 it? I can't seem to get it. Thanks.
3
9805
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 LockWindowUpdate(Me.Handle.ToInt32) LockWindowUpdate(0) Any other ideas how to lock the window in VB 2005?
10
6138
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
9895
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9744
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10670
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7900
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7072
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5735
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5931
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4142
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.