WM_INITDIALOG:
begin
// Load settings
LoadRegistrySettings(hwnd);
SendDlgItemMessage(hwnd, IDC_RICHEDIT_AGREEMENT, EM_SETBKGNDCOLOR, 0,
RGB($DD, $DD, $DD));
SetWindowLong(GetDlgItem(hwnd, IDC_RICHEDIT_AGREEMENT),
GWL_USERDATA,
SetWindowLong(GetDlgItem(hwnd, IDC_RICHEDIT_AGREEMENT), GWL_WNDPROC, Integer(@RichEditSubclassWndProc)));
CoInitialize(
nil);
lib := LoadLibrary('
MSHTML.DLL');
if lib <> 0
then
begin
@CreateHTMLPropertyPage := GetProcAddress(lib, '
CreateHTMLPropertyPage');
if CreateURLMoniker(
nil, '
http://www.erm.tu-cottbus.de/rules/crrules.shtml', pUrlMoniker) = S_OK
then
if CreateHTMLPropertyPage(pUrlMoniker, ppPropertyPage) = S_OK
then
begin
pUrlMoniker._Release;
GetWindowRect(GetDlgItem(hwnd, IDC_RICHEDIT_AGREEMENT), rect);
ScreenToClient(hwnd, rect.TopLeft);
ScreenToClient(hwnd, rect.BottomRight);
DestroyWindow(GetDlgItem(hwnd, IDC_RICHEDIT_AGREEMENT));
ppPropertyPage.Activate(hwnd, rect, True);
end;
end;
end;
WM_CLOSE:
begin
// Close the dialog and end the message loop
ppPropertyPage.Deactivate;
ppPropertyPage._Release;
FreeLibrary(lib);
CoUninitialize;
EndDialog(hwnd, wParam);
end;