Desktop Functions:

   Smart Device Functions:

Show Recent Changes
Subscribe (RSS)
Misc. Pages
Helpful Tools
Suggested Reading
Website TODO List
Download Visual Studio Add-In

BeginDeferWindowPos (user32)

C# Signature:

static extern IntPtr BeginDeferWindowPos(int nNumWindows);

VB.NET Signature

<DllImport("user32.dll", SetLastError:=True)> _
Public Shared Function BeginDeferWindowPos(nNumWindows As Integer) As IntPtr
End Function

VB Signature

Public Declare Function BeginDeferWindowPos Lib "user32" _
         (ByVal nNumWindows As Long) As Long

User-Defined Types:



The BeginDeferWindowPos function allocates memory for a multiple-window- position structure and returns the handle to the structure.

The multiple-window-position structure is an internal structure; an application cannot access it directly.

DeferWindowPos fills the multiple-window-position structure with information about the target position for one or more windows about to be moved. The EndDeferWindowPos function accepts the handle to this structure and repositions the windows by using the information stored in the structure.

If any of the windows in the multiple-window- position structure have the SWP_HIDEWINDOW or SWP_SHOWWINDOW flag set, none of the windows are repositioned.

If the system must increase the size of the multiple-window- position structure beyond the initial size specified by the nNumWindows parameter but cannot allocate enough memory to do so, the system fails the entire window positioning sequence (BeginDeferWindowPos

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

Do you know one? Please contribute it!


Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

Access directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version