- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
摘自/delphibbs/dispq.asp?lid=2135796?一直有人问如何在DirectX全屏游戏中弹出窗口就象金山游侠一样.我答应过要给出原码,只是一直没有时间整理,不过现在总算是弄玩了.代码不长,大致作了些注释,但愿你能看懂:)按照我的说明一步步作应该就能成功,但有时可能不行,为什么?我也不知道,或许是你哪一步做错了,或者是Delphi的问题?天知道,但大多数时候按照我给出的步骤,这些代码应该能实现我们的目标.下面的代码经过了一定的测试,但并没有刻意设计保证程序兼容性和稳定性的代码,所以不能保证在所有的机器上正常运行.如果死机或者花屏了,那么很不幸它不适合你,在找些别人写的类似的代码吧(不过以前有人公开过类似的代码吗?如果有请mail给我:)试一试吧,希望我们能把它完善起来.{***************HOOK.DLL************FileName:Hook.dpr(The KEY unit to pop up a window in DX apps)Author: tTui or tt.t (As u like ;)Feature:This unit contain the Demo codes for pop up an MODAL window in Apps which use exclusive directX fullscreen mode.Description: 1.Uses KeyBoard hook to hook the hotkey.? ? ? ? ? ? ?2.Uses s0me tricks to get the *real* IDirectDraw pointer.? ? ? ? ? ? ?3.Call the *IDirectDraw.FilptoGDISurface* to make sure the poped up window could be seen.(See MSDN for the reason)? ? ? ? ? ? ?4.Uses GetMessage hook to hook the WM_TIMER,WM_SETFOCUS... messages.(Why?I dont want to tell u :) Find the reason by urself)? ? ? ? ? ? ?5.The HotKey is Left WIN + NumPad *? ? ? ? ? ? ?6.Mute codes needed, but havnt wrote yet.? ? ? ? ? ? ?7.Complied with Delphi 6. Tested under Win98SE, Win ME, Win 2K,Win XP and Win 2003.NET with DirectX 89.Known Bugs: ?1.Cannot repaint the background when the poped up window moved.? ? ? ? ? ? ?2.May crash when try to pop up from some games and apps.? ? ? ? ? ? ?3.Cannot show the cursor in some games.? ? ? ? ? ? ?4.May minimize the main App, when try to pop up the window.? ? ? ? ? ? ?5.Many more...but unknown yet...MY MAIL: ttui@163.comBTW, if u want to pop up an MODALLESS window, u should write the codes all by urself.*DO NOT* ask me for that.***********************************}library Hook;uses? SysUtils,? Classes,? Windows,? Messages,? Dialogs,? DirectDraw, ?//*Modified* Jedis DirectX header file for Delphi.? FormUnit in FormUnit.pas {Form1}; ?//The unit contains the popup window.{$R *.res}type? PHookRec = ^THookRec;? THookRec = record?
文档评论(0)