The purpose of this plugin is to give developers a common "platform/interface" to show PopUps. It is born from the source code of NewStatusNotify, another plugin I've made.
Remember that users *must* have this plugin enabled, or they won't get any popup. Write this in the requirements, do whatever you wish ;-)... but tell them!
wParam = lParam = 0. Process this message if you have allocated your own memory. (i.e.: POPUPDATA.PluginData != NULL)
*)
UM_FREEPLUGINDATA = ((*WM_USER*)$400 + $200);
(*
UM_DESTROYPOPUP
wParam = lParam = 0. Send this message when you want to destroy the popup, or use the function below.
*)
UM_DESTROYPOPUP = ((*WM_USER*)$400 + $201);
(*
UM_INITPOPUP
wParam = (WPARAM)(HWND)hPopUpWindow (but this is useless, since I'll directly send it to your hPopUpWindow
lParam = 0.
This message is sent to the PopUp when its creation has been finished, so POPUPDATA (and thus your PluginData) is reachable.
Catch it if you needed to catch WM_CREATE or WM_INITDIALOG, which you'll never ever get in your entire popup-life.
Return value: if you process this message, return 0. If you don't process it, return 0. Do whatever you like ;-)
*)
UM_INITPOPUP = ($400(*WM_USER*) + $202);
(*
wParam = hPopUpWindow
lParam = lpzNewText
returns: > 0 for success, -1 for failure, 0 if the failure is due to second line not being shown. (but you could call PUIsSecondLineShown() before changing the text...)
Changes the text displayed in the second line of the popup.
*)
MS_POPUP_CHANGETEXT = 'PopUp/Changetext';
(*
This is mainly for developers.
Shows a warning message in a PopUp. It's useful if you need a "MessageBox" like function, but you don't want a modal window (which will interfere with a DialogProcedure. MessageBox steals focus and control, this one not.
wParam = lpzMessage
lParam = 0; Returns: 0 if the popup was shown, -1 in case of failure.
*)
MS_POPUP_SHOWMESSAGE = 'PopUp/ShowMessage';
(* helper functions, will be inlined on FPC if you have the swithces enabled *)
function PUAddPopup(ppdp: PPOPUPDATA): int;
{$ifdef FPC}
inline;
{$endif}
begin
Result := CallService(MS_POPUP_ADDPOPUP, WPARAM(ppdp), 0);
end;
function PUGetContact(hPopUpWindow: THandle): THandle;
{$ifdef FPC}
inline;
{$endif}
begin
Result := CallService(MS_POPUP_GETCONTACT, WPARAM(hPopUpWindow), 0);
end;
function PUGetPluginData(hPopUpWindow: THandle): Pointer;