无句柄模式是怎么一回事(有分没人抢,无奈,另外请刘麻子和江南草大虾接分) ( 积分: 300 )

  • 主题发起人 chenybin
  • 开始时间
那焦点的效果勒
 
资源文件(QQRes.dll)中根本就是有登录对话框的所有按钮、编辑框等控件的,记得上次在一个贴子里我还贴给你看过,所有控件也都是有句柄的。<br>拿VC来看资源?你当VC是万能钥匙吗?eXeScope、FreeRes、ResHacker、....,查看资源的工具多了
 
richedit的windowless模式,实际上是通过com进行的,你的程序得实现ITextHost接口,让richedit附着在某一个实体窗口上,这个实体(host)再提供itextservice接口,实现你自己的程序和richedit之间诸如message/notification的沟通。<br><br>实际上,ie等浏览器上实现的网页,也有text/button等元素,它们也是通过com来操作,也是没有hwnd的。
 
to lichengbin: 上次没说是QQRes.dll,知道就可以打开了,后面那几个工具都不会用<br><br>to 江南草:能说说怎么实现吗?怎么模拟也行
 
来自:zjan521, 时间:2005-9-15 23:22:49, ID:3207128 | 编辑<br>[ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/richedit/richeditcontrols/richeditcontrolreference/richeditinterfaces/iricheditole.asp ]<br>无句柄RichEdit &nbsp;<br><br>MSDN中有相关内容撒.
 
谢谢zjan521,这个我已经看过了,无奈水平有限,实在不知道怎么结合起来写个小程序,特别是怎么让<br>[blue]让richedit附着在某一个实体窗口上,这个实体(host)再提供itextservice接口[/blue]<br><br>这个没有理解,另外我记得大虾在一个帖子里面说过JAVA里面怎么画的,如果要画Edit怎么做呢,而且有焦点的效果,用tab可以转移焦点,光标也画出来吗?
 
只有顶的份,学习
 
不懂,不过帮顶
 
大侠论剑,看下热闹
 
chenybin 少不了问你问题,帮你顶。呵呵
 
关注中!!!关注中!!!关注中!!!关注中!!!
 
顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶
 
不懂,不过帮顶
 
顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶
 
不懂,也要顶[8D]
 
顶,学习 !!!!!!
 
Edit也可以画出来,就是稍微麻烦一点,给大家贴一段试试看:<br>//Form中添加一个Edit和一个Timer,把Timer的Interval设置为500,事件设置为Timer1Timer即可<br>unit Unit1;<br><br>interface<br><br>uses<br> &nbsp;Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> &nbsp;Dialogs, StdCtrls, Spin, ExtCtrls;<br><br>type<br> &nbsp;TForm1 = class(TForm)<br> &nbsp; &nbsp;Edit1: TEdit;<br> &nbsp; &nbsp;Timer1: TTimer;<br> &nbsp; &nbsp;procedure Timer1Timer(Sender: TObject);<br> &nbsp; &nbsp;procedure FormCreate(Sender: TObject);<br> &nbsp;private<br> &nbsp; &nbsp;{ Private declarations }<br> &nbsp; &nbsp;procedure DrawMyEdit;<br> &nbsp;public<br> &nbsp; &nbsp;{ Public declarations }<br> &nbsp;end;<br><br>var<br> &nbsp;Form1: TForm1;<br> &nbsp;SelIndex: Integer=1;<br> &nbsp;ShowFocus:Boolean=True;<br> &nbsp;ShowText: String='Edit1';<br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm1.DrawMyEdit;<br>var<br> &nbsp;d: HDC;<br> &nbsp;r: TRect;<br> &nbsp;b, bb: HBRUSH;<br> &nbsp;s: String;<br>begin<br> &nbsp;d:=GetDC(Handle);<br> &nbsp;r:=Rect(0, 0, 100, 22);<br> &nbsp;b:=CreateSolidBrush(clWhite);<br> &nbsp;bb:=SelectObject(d, b);<br> &nbsp;FillRect(d, r, b);<br> &nbsp;SelectObject(d, bb);<br> &nbsp;DrawEdge(d, r, 10, BF_RECT);<br><br> &nbsp;InflateRect(r, -3, -3);<br><br> &nbsp;DrawText(d, PChar(ShowText), Length(ShowText), r, DT_EDITCONTROL);<br><br> &nbsp;if ShowFocus then<br> &nbsp;begin<br> &nbsp; &nbsp;s:=Copy(ShowText, 1, SelIndex);<br> &nbsp; &nbsp;if s&lt;&gt;'' then<br> &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp;DrawText(d, PChar(s), Length(s), r, DT_EDITCONTROL or DT_CALCRECT);<br> &nbsp; &nbsp; &nbsp;InflateRect(r, 0, -1);<br> &nbsp; &nbsp; &nbsp;MoveToEx(d, r.Right, r.Top, nil);<br> &nbsp; &nbsp; &nbsp;LineTo(d, r.Right, r.Bottom);<br> &nbsp; &nbsp;end;<br> &nbsp;end;<br> &nbsp;<br> &nbsp;ReleaseDC(Handle, d);<br>end;<br><br>procedure TForm1.Timer1Timer(Sender: TObject);<br>begin<br> &nbsp;ShowFocus:=not ShowFocus;<br> &nbsp;DrawMyEdit;<br>end;<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> &nbsp;Timer1.Interval:=500;<br>end;<br><br>end.
 
诚挚邀请你加入我的qq群,不知你可否同意,如果同意请给我发电字邮件:zycai25@hotmail.com 或加上我的qq号:232277276 谢谢!
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
919
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
顶部