首页
社区
课程
招聘
[求助]SetWindowLong为什么能隐藏窗口?
发表于: 2011-12-10 10:04 6601

[求助]SetWindowLong为什么能隐藏窗口?

2011-12-10 10:04
6601
invoke SetWindowLong,hWnd,-8,1028 
在窗口程序中加入这句话以后 在任务管理器的应用程序列表就看不到了 这是为什么呢?
我去windows.h查找了-8的定义是 GWL_HWNDPARENT 关于GWL_HWNDPARENT的解释百度没找到
SetWindowLong函数本身的解释是改变指定窗口的属性.函数也将指定的一个32位值设置在窗口的额外存储空间的指定偏移位置。
这句话能在应用程序列表中隐藏 是不是应用了 “函数也将指定的一个32位值设置在窗口的额外存储空间的指定偏移位置” 请大家帮忙解答下 谢谢

[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

收藏
免费 0
支持
分享
最新回复 (5)
雪    币: 175
活跃值: (40)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
2
线索:用Spy++查看调用这个函数后的窗体的属性,发现Owner Window变了
2011-12-14 10:56
0
雪    币: 113
活跃值: (100)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
3
baidu没找到。

大部分MSDN上都有答案,http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).aspx

在win95的时代,GWL_HWNDPARENT这个参数是用来修改父窗口的。现在不用了,

MSDN: You must not call SetWindowLong with the GWL_HWNDPARENT index to change the parent of a child window. Instead, use the SetParent function.

你的代码就是将父窗口修改成了1028这个窗口句柄。

至于你说的额外存储空间,
MSDN: The function also sets the 32-bit (long) value at the specified offset into the extra window memory.

nIndex [in]
Type: int


The zero-based offset to the value to be set. Valid values are in the range zero through the number of bytes of extra window memory, minus the size of an integer. To set any other value, specify one of the following values.

因此,你的代码用的是other value,和额外储存空间没有关系。实际上,额外存储空间需要你自己注册窗口类。

Reserve extra window memory by specifying a nonzero value in the cbWndExtra member of the WNDCLASSEX structure used with the RegisterClassEx function.
2011-12-14 11:11
0
雪    币: 278
活跃值: (709)
能力值: ( LV15,RANK:520 )
在线值:
发帖
回帖
粉丝
4
过来学习
2011-12-14 11:15
0
雪    币: 1283
活跃值: (46)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
5
这个看MSDN,里面有对应的参数的详细说明!
2011-12-16 09:11
0
雪    币: 544
活跃值: (264)
能力值: ( LV12,RANK:210 )
在线值:
发帖
回帖
粉丝
6
看了下win32k.sys,LZ你这invoke SetWindowLong,hWnd,-8,1028发错了吧。

一般情况下我虚拟机里面窗口、钩子什么的句柄数目加起来不超过1024个,父窗口句柄不会是1028。
只有创建了很多窗口下才可能到1028个,句柄才有可能是1028
2011-12-16 13:31
0
游客
登录 | 注册 方可回帖
返回
//