How to center a common dialog

By | 2017-06-09

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
    • WM_INITDIALOG
Centrdlg Sample

Attachments

FileUploadedSize
899-20170609-062808-CENTRDLG.ZIP6/9/2017 6:28:08 AM3467

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.