📄 444.htm
字号:
<B>Base Class</B>; then press Finish button.
<LI>Open <CODE>CHtmlView</CODE> derived class; in my project
"<CODE>CShowcaseView</CODE>".
<LI>In <CODE>OnInitialUpdate()</CODE> member function, instead of
default parameter of <CODE>Navigate2</CODE> type give: <PRE text>res:<SPAN class=code-comment>//</SPAN><SPAN class=code-comment> [Resource-Only Dll Name] // [Html file name]</SPAN></PRE>
<P>e.g. : <I>res://ResOnly.dll//Skin.htm</I></P>
<P>What is <CODE>OnInitialUpdate()</CODE>?</P>
<P>This member function is called by the framework after the view is
first attached to the document, but before the view is initially
displayed. Here you call <CODE>Navigate2</CODE> function and force view
for representing <I><B>Skin.htm</B></I> file. By "res:", you can refer
to an HTML page embedded in the resources of a dynamic-link library
(<I>.dll</I>) file. It is a protocol like "<B>http:</B>".</P>
<LI>In ClassView panel, right-click on the C...View (e.g.
<CODE>CShowcaseView</CODE>) and select <B>Add Virtual Function...</B>
command.
<LI>In related dialogbox choose <B>OnBeforeNavigate2</B> and press
<B>Add and Edit</B> button. <CODE>OnBeforeNavigate2</CODE> member
function is called by the framework to cause an event to fire before a
navigation occurs in the web browser. By this function, we can lead web
browser to the URL we want.
<P><CODE>OnBeforeNavigate2</CODE> have some parameters. First of all is
target URL to navigate to, and end of all is a pointer to a cancel flag;
an application can set this parameter to nonzero to cancel the
navigation operation.</P>
<LI>Type the below code snippet after TODO comment: <PRE>CString url=lpszURL;
<SPAN class=code-keyword>if</SPAN> (url.Right(<SPAN class=code-digit>4</SPAN>) == _T(<SPAN class=code-string>"</SPAN><SPAN class=code-string>exit"</SPAN>))
{
*pbCancel = TRUE;
keybd_event( VK_MENU, <SPAN class=code-digit>0</SPAN>, <SPAN class=code-digit>0</SPAN>, <SPAN class=code-digit>0</SPAN> );
keybd_event( VK_F4, <SPAN class=code-digit>0</SPAN>, <SPAN class=code-digit>0</SPAN>, <SPAN class=code-digit>0</SPAN> );
keybd_event( VK_F4, <SPAN class=code-digit>0</SPAN>, KEYEVENTF_KEYUP, <SPAN class=code-digit>0</SPAN> );
keybd_event( VK_MENU, <SPAN class=code-digit>0</SPAN>, KEYEVENTF_KEYUP, <SPAN class=code-digit>0</SPAN> );
}
<SPAN class=code-keyword>else</SPAN> <SPAN class=code-keyword>if</SPAN>(url.Right(<SPAN class=code-digit>7</SPAN>) == _T(<SPAN class=code-string>"</SPAN><SPAN class=code-string>execute"</SPAN>))
{
*pbCancel = TRUE;
MessageBox(<SPAN class=code-string>"</SPAN><SPAN class=code-string>This button could execute some commands."</SPAN>);
}</PRE></LI></OL>
<P>It is clear, it tests URL. If the last segment was "exit", it would
have terminated program; but it was "execute"; it does something that you
want.</P>
<P>Now it is ready. If you act correctly, that must be like my demo exe
file.
<P>Thankfully greet guru Paul DiLascia.</P>
<P>Don't remember to visit my website <A
href="http://www.codeproject.com/KB/DLL/www.pishro-narmafzar.com">http://www.codeproject.com/KB/DLL/www.pishro-narmafzar.com</A></P><!-- Article Ends --><!-- Main Page Contents End --></DIV></SPAN>
<FORM id=aspnetForm
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"
name=aspnetForm action=ResourceOnlyDLL.aspx method=post>
<DIV><INPUT id=__VIEWSTATE type=hidden
value=/wEPDwULLTEwMDUyNjYzMjhkZIaHpfmmY3nwB220ssiAYUyFh652
name=__VIEWSTATE> </DIV>
<H2>License</H2>
<DIV id=ctl00_LicenseTerms>
<P>This article has no explicit license attached to it but may contain
usage terms in the article text or the download files themselves. If in
doubt please contact the author via the discussion board below.</P>
<P>A list of licenses authors might use can be found <A
href="http://www.codeproject.com/info/Licenses.aspx">here</A></P></DIV>
<H2>About the Author</H2>
<TABLE cellSpacing=5 cellPadding=0 width="100%" border=0>
<TBODY>
<TR vAlign=top>
<TD id=ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberPhotoTable
style="WIDTH: 155px" vAlign=top><B><A
id=ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberProfileLink
href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=240004">Mahmood
Komeily</A></B><BR><BR>
<CENTER><IMG id=ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberPhoto
style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px"
src="444.files/{9F07937E-88F5-431D-AFDF-D8D522F09919}.gif"></CENTER><BR><SPAN
class=SmallText
id=ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberType></SPAN></TD>
<TD>I born in tehran at 1975<BR>and began programming with commodore
64<BR>I established "Pishro Narmafzar Iran" Corporation in
2001.<BR>i'm expert in VC++, VC#, MS SQL Server, ASP .NET & have
developed :<BR>1-Persian Photoshop (fully localized)<BR>2-Persian
Freehand (fully localized)<BR>3-Pardis (persian/arabic typing in
graphical and video editing programs include : Ulead video
studio,Ulead media studio,Pinnacle studio, Premiere, Flash,
Freehand, 3D Max, Auto CAD, Photoshop, CorelDraw, Ulead Cool
3D,...)<BR>Pardis is only persian/arabic typing tool for Ulead Video
Studio in world.<BR>Mahmoud komeily, mahmood komeili, محمود
کمیلی<BR>
<TABLE>
<TBODY>
<TR id=ctl00_AboutAuthorRptr_ctl00_AboutAuthor_jobTitleRow>
<TD class=SmallText noWrap>Occupation: </TD>
<TD width="100%"><SPAN class=SmallText
id=ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberJobTitle>Web
Developer</SPAN></TD></TR>
<TR id=ctl00_AboutAuthorRptr_ctl00_AboutAuthor_locationRow>
<TD class=SmallText>Location: </TD>
<TD width="100%"><SPAN class=SmallText
id=ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberLocation><IMG
height=11 alt="Iran, Islamic Republic Of"
src="444.files/IR.gif" width=16> Iran, Islamic Republic
Of</SPAN></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR>
<TABLE id=ctl00_PopularArticlesRow cellSpacing=0 cellPadding=0
width="100%" border=0>
<TBODY>
<TR vAlign=top>
<TD style="WIDTH: 100%">
<H2>Other popular DLLs & Assemblies articles:</H2>
<UL>
<LI><A
href="http://www.codeproject.com/KB/DLL/pwdspy.aspx">PasswordSpy -
Retrieving lost passwords using Windows hooks</A>
<DIV class=SmallText>A practical application of setting Windows
hooks</DIV>
<LI><A href="http://www.codeproject.com/KB/DLL/XDllPt1.aspx">Step
by Step: Calling C++ DLLs from VC++ and VB - Part 1</A>
<DIV class=SmallText>This series of articles is a step-by-step
guide to constructing C++ DLLs that include C++ functions and C++
classes, and then calling the DLL functions and classes from VC++
and VB programs.</DIV>
<LI><A href="http://www.codeproject.com/KB/DLL/hooks.aspx">Hooks
and DLLs</A>
<DIV class=SmallText>There is a lot of confusion about how to set
up and use global hook functions. This essay attempts to clear up
some of these issues.</DIV>
<LI><A
href="http://www.codeproject.com/KB/DLL/SimpleDll2.aspx">DLLs are
simple: Part 2</A>
<DIV class=SmallText>This article describes how to export classes
from a DLL.</DIV>
<LI><A
href="http://www.codeproject.com/KB/DLL/SimpleDllP3.aspx">DLLs are
Simple! Part 3</A>
<DIV class=SmallText>This article describes how to create a DLL
with a DEF file and use it.</DIV></LI></UL>
<H2></H2></TD>
<TD>
<SCRIPT type=text/javascript>document.write(unescape("%3ca%20href%3d%22http%3a%2f%2fwww.codeproject.com%2fRedir.aspx%3fadid%3d6679%26way%3dban%22%20target%3d%22_blank%22%20rel%3d%22nofollow%22%3e%3cimg%20src%3d%22http%3a%2f%2fwww.codeproject.com%2fscript%2fAdm%2fServeImg.aspx%3fFile%3d%252fscript%252fadmentor%252fimages%252finnovaysys_docX_320x250.gif%26C%3dFalse%26adid%3d6679%22%20alt%3d%22%22%20border%3d%220%22%20width%3d%22300%22%20height%3d%22250%22%3e%3c%2fa%3e"));</SCRIPT>
</TD></TR></TBODY></TABLE>
<DIV id=ctl00_AddTo_AddTo style="MARGIN: 10px">
<SCRIPT language=JavaScript type=text/javascript>
var socialLinks = new social();
socialLinks.addtoMethod=1;
socialLinks.DrawLinks("socialLinks", document.location.href, escape(document.title), 100, 0, "SmallText Bold", "AddTo");
</SCRIPT>
</DIV>
<TABLE class=RatingBar id=ctl00_RateArticleRow cellSpacing=0 cellPadding=0
width="100%" border=0>
<TBODY>
<TR>
<TD><A
href="http://www.codeproject.com/KB/DLL/ResourceOnlyDLL.aspx#_top">Article
Top</A></TD>
<TD align=right>
<TABLE cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD id=ctl00_RateArticle_VoteResultDiv noWrap align=right
width="100%"><SPAN id=voteRes></SPAN><IMG id=loaderImg
style="DISPLAY: none" height=16 alt=loading...
src="444.files/ajax-loader.gif" width=16> </TD>
<TD class=SmallText id=voteTbl style="WHITE-SPACE: nowrap"
align=right>
<TABLE>
<TBODY>
<TR>
<TD id=ctl00_RateArticle_RateText
style="PADDING-RIGHT: 5px; WHITE-SPACE: nowrap"><I><B>Rate
this Article for us!</B></I></TD>
<TD id=ctl00_RateArticle_StartForm
align=right><I> Poor</I></TD>
<TD id=ctl00_RateArticle_VoteFormDiv
style="WHITE-SPACE: nowrap" align=left>
<TABLE id=ctl00_RateArticle_VoteRBL border=0>
<TBODY>
<TR>
<TD><INPUT id=ctl00_RateArticle_VoteRBL_0
type=radio value=1
name=ctl00$RateArticle$VoteRBL></TD>
<TD><INPUT id=ctl00_RateArticle_VoteRBL_1
type=radio value=2
name=ctl00$RateArticle$VoteRBL></TD>
<TD><INPUT id=ctl00_RateArticle_VoteRBL_2
type=radio value=3
name=ctl00$RateArticle$VoteRBL></TD>
<TD><INPUT id=ctl00_RateArticle_VoteRBL_3
type=radio value=4
name=ctl00$RateArticle$VoteRBL></TD>
<TD><INPUT id=ctl00_RateArticle_VoteRBL_4
type=radio value=5
name=ctl00$RateArticle$VoteRBL></TD></TR></TBODY></TABLE></TD>
<TD id=ctl00_RateArticle_EndForm noWrap
align=left><I>Excellent</I> <INPUT class=FormButton id=ctl00_RateArticle_SubmitRateBtn onclick="return rateItem(9875,2);" type=submit value=Vote name=ctl00$RateArticle$SubmitRateBtn>
</TD>
<TD><SPAN
id=ctl00_RateArticle_ErrorMessage></SPAN></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<DIV><INPUT id=__EVENTVALIDATION type=hidden
value=/wEWCALq3b79CALAlMXDBwLBlMXDBwLClMXDBwLDlMXDBwLElMXDBwLP+++tCwK5upDkC5+mZPFc6drCGf9p1l/m44DVo6i9
name=__EVENTVALIDATION> </DIV></FORM>
<DIV
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; OVERFLOW: hidden; PADDING-TOP: 10px; WHITE-SPACE: nowrap; TEXT-ALIGN: center"><IFRAME
src="F:\books\plug-in and dll资料\DLL are simple\444.files\ServeHTML(1).htm"
frameBorder=0 width=468 scrolling=no height=60></IFRAME><IFRAME
src="444.files/ServeLinks.htm" frameBorder=0 width=300 scrolling=no
height=60></IFRAME></DIV><A name=_comments></A><!-- Forum Start -->
<DIV id=_MessageBoard onclick="return SwitchMessage(event, null)">
<TABLE class=Frm_MainTable id=ForumTable cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD>
<FORM
style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"
action=/script/Forums/SetOptions.aspx?floc=%2fKB%2fDLL%2fResourceOnlyDLL.aspx&fid=163508
method=get><INPUT type=hidden value=163508 name=fid><INPUT
type=hidden
value=?floc=%2fKB%2fDLL%2fResourceOnlyDLL.aspx&fid=163508
name=currentQS><INPUT type=hidden value=/KB/DLL/ResourceOnlyDLL.aspx
name=floc>
<TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
<TBODY>
<TR class=Frm_HeaderRow1>
<TD style="WHITE-SPACE: nowrap"><IMG hei
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -