- Protect Private Files
- ShellCrypt: Download It Here
ShellCrypt also features resizable dialogs, based partly on a technique described in the SclblDlg.exe example in MSDN (article Q112639). During the WM_INITDIALOG message, ShellCrypt's resizable dialogs call the CResize::Init function to enumerate all child windows belonging to the dialog, and the dialogs save their original positions and dimensions into a CArray member. Resizing attributes are then applied to individual controls. These specify whether the control should be scaled or moved when the dialog is resized. Whenever the OnSize function is called in the main dialog, the CResize::OnSize member function is invoked to calculate the new locations for all controls in the dialog. This function compares the original position and size of the control with the new dimensions of the dialog and repositions the control according to the control's sizing attribute.
To convey to the user that a window is resizable, it's helpful to display a size gripthe diagonal lines located in the bottom-right corner of the window. One way to display this indicator is to use the DrawFrameControl() function with DFCS_SCROLLSIZEGRIP as a parameter. The DrawFrameControl() function doesn't support transparency, though, and thus can't be used with ShellCrypt's bitmapped backgrounds. To draw the size grip, ShellCrypt creates a CBitmap object using the function LoadOEMBitmap(OBM_SIZE). The program then renders the image as a transparent bitmap in the corner of the dialog.