我怎样才能在Win 64 32位和64位应用程序之间共享HWND? [英] How can I share HWND between 32 and 64 bit applications in Win x64?

查看:740
本文介绍了我怎样才能在Win 64 32位和64位应用程序之间共享HWND?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MSDN告诉我,要处理窗口(HWND)可以32位和64位应用程序之间共享,在的进程间通信(MSDN)。然而,在Win32中一个HWND为32位,而在64位的Windows是64位。那么,怎样才能手柄可以共享?

MSDN tells me that handles to windows (HWND) can be shared between 32- and 64-bit applications, in Interprocess Communication (MSDN). However, in Win32 a HWND is 32 bits, whereas in 64 bit Windows it is 64 bits. So how can the handles be shared?

我想同样的问题适用于句柄命名的对象,如互斥,信号和文件句柄。

I guess the same question applies to handles to named objects such as mutexes, semaphores and file handles.

推荐答案

不,他们可以共享的事实意味着,只有低32位在Win64的过程中使用? Windows处理的指标不是指针,至少就我所知道的,所以除非MS希望允许超过2 ^ 32窗口/文件/互斥/等。处理没有理由在Win64中使用无效*的高32位。

Doesn't the fact that they can be shared imply that only the lower 32 bits are used in Win64 processes? Windows handles are indexes not pointers, at least as far as I can tell, so unless MS wanted to allow more than 2^32 window/file/mutex/etc. handles there's no reason to use the high 32 bits of a void* on Win64.

这篇关于我怎样才能在Win 64 32位和64位应用程序之间共享HWND?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆