【不解】微软搞的什么鬼?

ypyRock 2002-11-10 10:39:56
今天用 WindowFromPoint 函数,MSDN上说可以找回指定坐标下的窗口句柄,但磁盘共享属性页里的“共享名”等static、edit的句柄却找不到,为什么???
用SPY++来找有时可以,有时也找不到,好奇怪!!!
...全文
31 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
ypyRock 2002-11-15
  • 打赏
  • 举报
回复
:)
ypyRock 2002-11-12
  • 打赏
  • 举报
回复
:(
dd
Againstwind 2002-11-11
  • 打赏
  • 举报
回复
关注!
ypyRock 2002-11-11
  • 打赏
  • 举报
回复
没人理解吗?还是我的问题太高深了???
mo01 2002-11-10
  • 打赏
  • 举报
回复
gz
ypyRock 2002-11-10
  • 打赏
  • 举报
回复
可否有详尽一点的解释??
nevergrief 2002-11-10
  • 打赏
  • 举报
回复
可能是因为这个原因:

Remarks
The WindowFromPoint function does not retrieve a handle to a hidden or disabled window, even if the point is within the window. An application should use the ChildWindowFromPoint function for a nonrestrictive search.

我是2001 July的msdn。
上面有个例子,好好看看:
Interface from Running Object Table
A running object table (ROT) tells what object instances are active. By querying this table, you can accelerate the process of connecting a client to an object when the object is already running. Before programs can access TOM interfaces through the running object table, a TOM instance with a window needs to register in the ROT using a moniker. You construct the moniker from a string containing the hexadecimal value of its HWND. The following code sample shows how to do this.

// This TOM implementation code is executed when a new windowed
// instance starts up.
// Variables with leading underscores are members of this class.

OLECHAR szBuf[10]; // Place to put moniker
MONIKER *pmk;
wsprintf(szBuf, "%x", _hwnd);
CreateFileMoniker(szBuf, &pmk);
OleStdRegisterAsRunning(this, pmk, &_dwROTcookie);
....................

// Accessibility Client:
// Find hwnd for window pointed to by mouse cursor.

GetCursorPos(&pt);
hwnd = WindowFromPoint(pt);

// Look in ROT (running object table) for an object attached to hwnd

wsprintf(szBuf, "%x", hwnd);
CreateFileMoniker(szBuf, &pmk);
CreateBindContext(0, &pbc);
pmk->BindToObject(pbc, NULL, IID_ITextDocument, &pDoc);
pbc->Release();

if( pDoc )
{
pDoc->RangeFromPoint(pt.x, pt.y, &pRange);
// ...now do whatever with the range pRange


哈哈,我是DFW上的wukw

2,640

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧