![]() |
nonVCL Kontextsensitive Hilfe unter Vista
Mir wurde berichtet, dass meine kontextsensitive Hilfe in meinem Usermanager nicht funktioniert. da ich selber kein Vista habe hier mal der relevante Code, eventuell sieht da ja jemand den Fehler oder kann ihn zu mindest nachstellen:
Delphi-Quellcode:
WM_HELP:
begin ShowHelpHandle(PHelpInfo(lParam)^.hItemHandle, PHelpInfo(lParam)^.dwContextId); end; procedure ShowHelpHandle(ChildHandle: THandle; ContextId: Integer); const marginrect : TRect = (Left: - 1; Top: - 1; Right: - 1; Bottom: - 1); var Popup : THHPopup; URL : string; rect: TRect; pt: TPoint; begin URL := '::/popup.txt'; if (ContextId >= 0) then begin FillChar(Popup, SizeOf(Popup), 0); Popup.cbStruct := SizeOf(Popup); Popup.hinst := 0; Popup.idString := 0; Popup.pszText := PChar(ContextInfo[ContextId]); GetWindowRect(ChildHandle, rect); pt.X := rect.Left + 100; pt.Y := rect.Top + 25; Popup.pt := pt; Popup.clrForeGround := TColorRef(-1); Popup.clrBackground := TColorRef(-1); Popup.rcMargins := marginrect; Popup.pszFont := ''; HtmlHelp(0, @URL[1], HH_DISPLAY_TEXT_POPUP, dword(@Popup)); end; end; |
Re: nonVCL Kontextsensitive Hilfe unter Vista
:gruebel: Könntest du mir mal das Beispiel aus den Tutorials kompilieren und per Mail oder PN senden? Ich habe nämlich kein Delphi mehr, und ich würd's gern mal mit der Demo testen.
|
Re: nonVCL Kontextsensitive Hilfe unter Vista
Liste der Anhänge anzeigen (Anzahl: 1)
Here we go. Ich sehe gerade ich rufe nicht
Delphi-Quellcode:
auf. Daran könnte es eventuell liegen.
else Result := DefWindowProc(wnd,uMsg,wp,lp);
Exe im Anhang. PS: Installier dir gefälligst mal wieder Delphi. :? :mrgreen: |
Re: nonVCL Kontextsensitive Hilfe unter Vista
Zitat:
Mal als Reaktion auf diesen ![]()
Delphi-Quellcode:
Voilà.
function GetOCXPath(var Path: string): Boolean;
const HHPathRegKey = 'CLSID\{adb880a6-d8ff-11cf-9377-00aa003b7a11}\InprocServer32'; var rgHandle : HKEY; lpType, cbData : dword; pBuffer : array[0..MAX_PATH]of char; begin Result := false; lpType := REG_NONE; if(RegOpenKeyEx(HKEY_CLASSES_ROOT,HHPathRegKey,0,KEY_QUERY_VALUE, rgHandle) = ERROR_SUCCESS) then try lpType := REG_NONE; cbData := 0; if (RegQueryValueEx(rgHandle, nil, nil, @lpType, nil, @cbData) = ERROR_SUCCESS) and ((lpType = REG_SZ) or (lpType = REG_EXPAND_SZ)) and // <-- Typ (cbData > 1) then begin if RegQueryValueEx(rgHandle, nil, nil, @lpType, @pBuffer, @cbData) = ERROR_SUCCESS then begin Path := string(pBuffer); Path := ExpandEnvStr(Path); // <-- Umgebungsvariable // (Funktion in "MSysUtils.pas") Result := (Path <> '') and (fileexists(Path)); end; end; finally RegCloseKey(rgHandle); end; end; |
Re: nonVCL Kontextsensitive Hilfe unter Vista
Die Funktion ExpandEnvStr fehlt in meiner Version der MSysUtils.pas.
|
Re: nonVCL Kontextsensitive Hilfe unter Vista
Zitat:
|
Re: nonVCL Kontextsensitive Hilfe unter Vista
Ich habe das jetzt in den Usermanager eingebaut. Jetzt kann ich über eine Schaltfläche allerdings die Hilfe nicht mehr an einer bestimmten Stelle öffnen:
Delphi-Quellcode:
Die Hilfe besteht nur aus einer Seite mit Ankern innerhalb der Seite. Vor dem Fix wurde die Hilfe bei dem entsprechendem Anker geöffnet, jetzt öffnet sie sich ganz am Anfang.
ID_BTN_HELP:
begin HelpFilename := ExtractFilepath(ParamStr(0)) + HELPFILE; Url := string(HelpFilename + '::hilfe.html#3'); HtmlHelp(hDlg, PChar(Url), HH_DISPLAY_TOPIC, 0); end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:22 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz