So, endlich den Fehler gefunden der bei deinem MpuAboutWnd den Rangecheck Error verursacht:
Code:
function LinkStcWndProc(hLinkStc, uMsg, wParam, lParam: [color=#ff0000]DWORD[/color]): [color=#ff0000]DWORD[/color]; stdcall;
So sollte es sein damit auch die LinkStcWndProc mit der CallWindowProc übereinstimmt:
function LinkStcWndProc(hLinkStc, uMsg: DWORD; wParam, lParam: integer): LRESULT; stdcall;
und dann noch:
Code:
WM_CTLCOLORSTATIC:
begin
// set textcolor of "Link" tatic
if lParam = Integer(GetDlgItem(hWnd, ID_STC_WEB)) then
begin
[color=#ff0000]SetTextColor(wParam,
RGB(0, 0, 255));
SetBkColor(wParam, GetSysColor(COLOR_BTNFACE));[/color]
Brush := GetSysColorBrush(COLOR_BTNFACE);
// save brush as a window property
SetProp(hWnd, PROP_BRUSH, Brush);
// return brush
Result := Brush;
end //...
Integer ist kein Word.
Sollte so aussehen:
Delphi-Quellcode:
WM_CTLCOLORSTATIC:
begin
// set textcolor of "Link" tatic
if lParam = Integer(GetDlgItem(hWnd, ID_STC_WEB))
then
begin
SetTextColor(DWORD(wParam),
RGB(0, 0, 255));
SetBkColor(DWORD(wParam), GetSysColor(COLOR_BTNFACE));
Brush := GetSysColorBrush(COLOR_BTNFACE);
// save brush as a window property
SetProp(hWnd, PROP_BRUSH, Brush);
// return brush
Result := Brush;
end //...
Dazu habe ich dann für den Link noch ein passenden Cursor eingebaut ohne viel Tamtam im Quelltext.
Delphi-Quellcode:
// "Link" static
hstcWeb := CreateWindowEx(0, '
STATIC', PCHar(
URL), WS_CHILD
or WS_VISIBLE
or SS_NOTIFY
or SS_CENTER, 5, 97, WINDOWWIDTH -
15, 18, hWnd, ID_STC_WEB, HInstance,
nil);
SetClassLong(hstcWeb, GCL_HCURSOR, LoadCursor(0, IDC_HAND));
Dann habe ich mir erlaubt das Iconarray zu entfernen im es durch ein Res.-Icon zu ersetzen.
Ein Aufruf sieht dann zB. so aus.:
Delphi-Quellcode:
procedure IrgendWieIrgendWoIrgendWann;
begin
MpuAboutWnd.URL := 'http://www.michael-puff.de';
MpuAboutWnd.ICON_ID := 1;
TAboutWnd.ShowAboutWnd(hDlg);
end;
Überlauf und Bereichsprüfung sind bei meinem Delphi immer an!
Done.