How to center a common dialog
Responds to the WM_INITDIALOG message to center the Common Dialog Control on a form.
This sample uses a derivative of the technique created for the Windows Styles article
in Visual Basic Programmer's Journal.
Uses the following API functions:
- CallNextHookEx
- CallWindowProc
- CopyMemory (RtlMoveMemory)
- GetWindowRect
- SetWindowsHookEx
- SetWindowLong
- SetWindowPos
- UnHookWindowsHookEx
Back to Code Samples
Copyright © 2000 by Matt E. Hart, All Rights Reserved Worldwide.
Nothing on this web site may be reproduced, in any form, without express written consent.