Ayd192
asked on
HTML Dialogs?
Hi,
Can anybody give me some information or links about using HTML dialogs in delphi?
My main question is how I can access data in a HTML dialog ( for example edis boxes ) ?
Can anybody give me some information or links about using HTML dialogs in delphi?
My main question is how I can access data in a HTML dialog ( for example edis boxes ) ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Slick812,
Sorry for my late reply.
Thank you for your answers, they helped a lot ( Actually they answered almost all of my questions).
I should confess I didn't understand the part you use resources to pass images to dialog and your code dind't work right on this, but rest of the code was great.
thanx
Sorry for my late reply.
Thank you for your answers, they helped a lot ( Actually they answered almost all of my questions).
I should confess I didn't understand the part you use resources to pass images to dialog and your code dind't work right on this, but rest of the code was great.
thanx
Yea, I did this in win XP with IE ver 6, I'm not sure if the images from resources is suppose to work in all versions of IE (four and above) or not, but it works for me in IE 6. I fould the code to get the images from resources, but it did not say anything about the version of IE that it did or did not work in. This was a tough one to figure out the code for, since the only sample code I could find was in C++
do you need somethig else?
Ayd192
Is this question still active?
Do you need more help with this?
Is this question still active?
Do you need more help with this?
ASKER
Thank you Slick812,
as I've told you, your answers helped a lot.
I've forget to Accept your answer, but I'll do it now.
Excuse me for being late.
as I've told you, your answers helped a lot.
I've forget to Accept your answer, but I'll do it now.
Excuse me for being late.
FIRST, the HTML code for the for the Dialog.htm
<html>
<!--TOOLBAR_START--><!--TO
<HTML id=Dialog1 STYLE="height: 17em; width: 15em">
<head><title>HTML Dialog</title>
<SCRIPT language="JScript">
<!--
window.returnValue = 0;
--->
</SCRIPT>
</head>
<BODY BGCOLOR="#DEE2C0" TEXT="#000000" LINK="#0000CC" VLINK="#990099" ALINK="#CC0000">
<center><font size="+2" face="Comic Sans MS, Arial" color = "Red"><b>HTML Dialog</b><br></font><br><
This is the HTML Dialog page, So What<br><br>
<HR width="70%">
<FONT SIZE="+1" face="Arial">Click a Button to close this HTML Dialog Box</FONT>
<P><INPUT type=BUTTON value="OK" id="okButton" onClick="window.returnValu
<INPUT type=BUTTON value="Cancel" id="cancelButton" class=button onClick="window.returnValu
</body></html>
==========================
NEXT, the Delphi code for your button press -
uses
UrlMon, ActiveX, ComObj;
procedure TForm1.but_HtmlDialogClick
type
TShowHTMLDialog = function(hwndParent: Cardinal;
IMnk: IMoniker; varArgIn: OleVariant;
PWCHOptions: PWCHAR; varArgOut: OleVariant): HRESULT; stdcall;
var
hLib2: Integer;
ShowHTMLDialog: TShowHTMLDialog;
pURLMoniker: IMoniker;
VarArgs, VarReturn: OLEVariant;
HR1: HRESULT;
Str1: String;
begin
hLib2 := LoadLibrary('MSHTML.DLL');
if hLib2 <> 0 then
try
ShowHTMLDialog := GetProcAddress(hLib2, 'ShowHTMLDialog');
if @ShowHTMLDialog <> nil then
begin
VarReturn := 1;
OLECheck(CreateURLMoniker(
HR1 := ShowHTMLDialog(Handle, pURLMoniker, VarArgs, nil, VarReturn);
if HR1 = S_OK then
begin
if VarIsEmpty(VarReturn) then
ShowMessage('varOleStr');
str1 := VarReturn;
ShowMessage('VarReturn is '+str1);
end else
ShowMessage('The ShowHTMLDialog FAILED');;
end;
finally
FreeLibrary(hLib2);
end;
end;
==========================
I could not find any webpages for info about Delphi using ShowHTMLDialog( ), I did find some for C++,, but they did not provide much more info than the MSDN example web page .. . .
I could not get the VarArgs to be accepted with information in it, only if it was empty