|
[求助]RET指令的一点疑惑
对于汇编指令: ret 就是把EAX寄存器中的值返回 XOR EAX,EAX 就是对EAX寄存器清零 所以接下来的RET 就把零返回去了 调用DefWindowProc,hWnd,uMsg,wParam,lParam后, 在EAX中就是一个LRESULT型数据(整型数据) 接下来,就把它返回了。 消息队列中有许多消息 有些消息,就像前面的if ,else ... 只是我们重载,也就是修改Windows系统默认的处理方式 其它消息不可能不处理吧 于是调用默认的Windows消息处理函数DefWindowProc进行处理。 所有的默认消息,你都给它返回个0,操作系统怎么知道你要处理什么东东呢? 要求显示窗口的消息就丢掉了,系统没有处理,当然不能显示窗口了!!! 说得我自已都糊涂了。 |
|
[通告]看雪论坛成立核心管理团队
恭喜 恭喜 恭喜 恭喜 |
|
[求助]麻烦问个小区别问题
推荐文章 <<Microsoft Windows 3 Developer's Workshop>>(Microsoft Press,by Richard Wilton) 在Windows环境中,句柄是用来标识项目的,这些项目包括:模块(module)、任务(task)、实例 (instance)、文件(file)、内存块(block of memory)、菜单(menu)、控制(control)、字体(font)、资源(resource),包括图标(icon),光标 (cursor),字符串(string)等、GDI对象(GDI object),包括位图(bitmap),画刷(brush),元文件(metafile),调色板(palette),画笔(pen),区域 (region),以及设备描述表(device context)。 <<WINDOWS编程短平快>>(南京大学出版社): 句柄是WONDOWS用来标识被应用程序所建立或使用的对象的唯一整数,WINDOWS使用各种各样的句柄标识诸如应用程序实例,窗口,控制,位图,GDI对象等等。WINDOWS句柄有点象C语言中的文件句柄。 二、MS源代码: #ifdef STRICT typedef void *HANDLE; #define DECLARE_HANDLE(name) struct name##__ { int unused; }; typedef struct name##__ *name #else typedef PVOID HANDLE; #define DECLARE_HANDLE(name) typedef HANDLE name #endif DECLARE_HANDLE(HMODULE); DECLARE_HANDLE(HINSTANCE); DECLARE_HANDLE(HLOCAL); DECLARE_HANDLE(HGLOBAL); DECLARE_HANDLE(HDC); DECLARE_HANDLE(HRGN); DECLARE_HANDLE(HWND); DECLARE_HANDLE(HMENU); DECLARE_HANDLE(HACCEL); DECLARE_HANDLE(HTASK); 三、理解: HANDLE就是PVOID,也就是无类型指针, 上面这些资源的句柄Handles都不过是指向struct的指针,至于这个struct的用处,连M$都说unused了,现在解释下M$这么做的意义,这就是所谓数据封装,你可以在你的程序中把M$的内部结构指针传来传去,可是你却不知道它到底指向的内容是什么。 句柄与指针确实是完全不同的两个概念。句柄仅仅是一个32位整数,WIN32中用于标记某个系统或进程的对象,可以理解为对象索引(由于M$未完全公开相关技术,在一定程度上只能如此理解),这个索引更像是一种映射关系(从句柄到对象指针的映射),而不是纯粹意义上的“数组下标”。 句柄可以理解为用于指向或标识内存的一块“资源”,这些资源如:文件(file)、内存块(block of memory)、菜单(menu)等等。操作系统通过句柄来定位核心对象和系统资源。 指针即为指向内存的“数据或指令”某一单元。 说的确切一点,句柄实际上是一种指向某种资源的指针,但与指针又有所不同:指针对应着一个数据在内存中的地址,得到了指针就可以自由地修改该数据。Windows并不希望一般程序修改其内部数据结构,因为这样太不安全。所以Windows给每个使用GlobalAlloc等函数声明的内存区域指定一个句柄(本质上仍是一个指针,但不要直接操作它),平时你只是在调用API函数时利用这个句柄来说明要操作哪段内存。 句柄是Windows编程的一个关键性的概念,编写Windows应用程序总是要和各种句柄打交道。所谓句柄,就是一个唯一的数,用以标识许多不同的对象类型,如窗口、菜单、内存、画笔、画刷等。在Win32里,句柄是指向一个“无类型对象”(void*)的指针,也就是一个4字节长的数据。无论它的本质是什么,句柄并不是一个真正意义上的指针。从构造上看,句柄是一个指针,尽管它没有指向用于存储某个对象的内存位置。事实上,句柄指向一个包含了对该对象进行的引用的位置。句柄的声明是这样的: typedef void *HANDLE 由于Windows是一个多任务操作系统,它可以同时运行多个程序或一个程序的多个副本。这些运行的程序称为一个实例。为了对同一程序的多个副本进行管理,Windows引入了实例句柄。Windows为每个应用程序建立一张表,实例句柄就好象是这张表的一个索引。 Windows不仅使用句柄来管理实例,也用它来管理窗口、位图、字体、元文件、图标等系统资源。 四、引喻: 牧童遥指杏花村 牧童的手为指针,杏花村的牌子为句柄,杏花村酒店为对象的实例. 附注:获得窗口句柄三种方法 1.HWND FindWindow(LPCTSTR lpClassName, LPCTSTR lpWindowName) HWND FindWindowEx(HWND hwndParent, HWND hwndChildAfter,LPCTSTR lpClassName, LPCTSTR lpWindowName) 2.HWND WindowFromPoint(POINT& Point)//获得当前鼠标光标位置的窗口HWND 3.BOOL CALLBACK EnumChildProc(HWND hwnd,LPARAM lParam) BOOL CALLBACK EnumChildWindows(HWND hWndParent, WNDENUMPROC lpEnumFunc,LPARAM lParam) BOOL CALLBACK EnumWindows(WNDENUMPROC lpEnumFunc, LPARAM lParam) BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam) |
|
|
|
[求助]Windows环境下32位汇编语言程序设计(第2版)》
怎到会过时呢。编程的书很难过时的。 |
|
[求助]麻烦问个小区别问题
看起来楼主还在门外。 的确只是字母不同。 不过这些在源码中经常看到,只是作者随便起的名字而已。没有约定但是俗成: hInstance 实例句柄 hMenu 菜单句柄 hWinMain 函数句柄 h 是HANDLE(中文的意思就是句柄) 的头一个字母。 所谓句柄,其实只是个32位的数据。 给它们起不同的名字,只是为了源码更容易看懂。 句柄是要定义的。 一般是这样的: HINSTANCE hInstance; //定义一个实例句柄 你也完全可以这样: HINSTANCE wofan ; //定义一个实例句柄,不过时间一长,你就不明白wofan是什么了,呵呵 |
|
[原创]献给初学C++者-----完美C++疑难解答
学习,Download看下 |
|
[求助]借个地方说句话
不是一般的强烈支持楼主!!!! |
|
[求助][求助]winlicense的这个WinLicense.chs汉化文件怎么用谁能帮帮我?
晕,进错了门,漂到了水之王国…… |
|
|
|
|
|
[求助]language2000 谁有啊?
有些工具在当年很出名,所以早年的书会有介绍。因为作者没有升级,它们也就慢慢从电脑中消失了。可以明确的说,这个软件已经没有什么用了,用来分析它的原理还是可以的。 |
|
[求助]请高手看看这些是不是算法所在
晕,下断,跟进Call里去 |
|
[求助]谁会破解QQ游戏四国军旗刷分器
跪求好没志气哟 |
|
[分享]DataRescue.IDA.Pro.Advanced.v5.1.0.899 破解补丁
没有下载,想它应该是从这里流出去的吧?现在是回娘家? |
|
[分享]诛仙飞天外挂。。源码公布 VB
同感!就这样,如果不亲自玩一下这个Game,就无法编译这个程序了。看这份源码,可以了解一下外挂的写法。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值