查找窗口在位置使用碳和碳的问题在64位应用程序 [英] Find Window At Location Using Carbon And Carbon Problems In 64-Bit Applications

查看:267
本文介绍了查找窗口在位置使用碳和碳的问题在64位应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如我在一些问题今天I'm寻找办法让窗口或windowPart引用在某个位置说。虽然我知道我可以使用可可用于此目的(我不知道怎么做,但)我preFER(可能需要)来做到这一点使用碳,因为需要这个功能是用C ++编写整个应用程序,但从来就发现了许多问题,努力吧。

As I said in some questions today I´m looking for the way to get window or windowPart references at a certain location. Although I know I could use Cocoa for this purpose (I don´t know how to do it yet) I prefer (and probably need) to do this using Carbon because the entire application that needs this functionality is written in C++ but I´ve found many problems trying it.

有谁得到了有效的windowPtr或windowRef使用下列功能之一? FindWindow函数,MacFindWindow,HIWindowFindAtLocation或FindWindowOfClass

Does anyone get a valid windowPtr or windowRef using one of the following functions? FindWindow, MacFindWindow, HIWindowFindAtLocation or FindWindowOfClass

我总是得到0作为windowRef或windowPtr的I'm寻找。什么I'm做错了什么?任何想法?

I always get 0 as the windowRef or windowPtr that I´m looking for. What I´m doing wrong? Any ideas?

It's不错,现在如果你想创建一个64位应用程序的Mac OS X,你需要使用可可来实现其用户界面,因为一些API常用的Carbon应用程序在64位应用程序无法使用?

It´s true that now if you want to create a 64-bit application for Mac OS X, you need to use Cocoa to implement its user interface because some APIs commonly used by Carbon applications are not available in 64-bit applications?

感谢你。

JxXx

推荐答案

根据<一href="http://stackoverflow.com/questions/1372011/which-api-can-be-used-to-capture-the-mouse-when-moving-os-x-carbon-windows/2628750#2628750">your针对这一问题,看来,你正在试图获得WindowRef到另一个应用程序的窗口。

Based on your response to this question it appears that you are trying to get a WindowRef to another application's window.

由于此张贴到碳-dev邮件列表说:

您不能访问存储在其他程序中。一个WindowRef从另一个程序   就毫无意义在你的程序的内存空间。

You can't access memory in other programs. A WindowRef from another program would be meaningless in your program's memory space.

和64位碳的一句话是这样的:

And the word on 64-bit carbon is this:

如果你想创建一个64位   应用程序的Mac OS X,你需要   用可可来实现其用户   接口。

If you want to create a 64-bit application for Mac OS X, you need to use Cocoa to implement its user interface.

编辑 -

您可以用鼠标位置 [NSEvent mouseLocation] (可可)或者 GetMouse()(碳) 。如果你想与属于另一个应用程序窗口进行交互,则需要使用类似<一个href="http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Accessibility/cocoaAXIntro/cocoaAXintro.html"相对=nofollow>辅助功能API (可可),或在低层次的<一个href="http://developer.apple.com/Mac/library/documentation/Carbon/Reference/CGWindow_Reference/Reference/Functions.html"相对=nofollow>石英窗口列表功能的。石英函数返回所有窗口(属于所有的应用程序)的每个列表和有限的信息(边界,拥有PID等。)

You can get the mouse location with [NSEvent mouseLocation] (Cocoa) or GetMouse() (Carbon). If you want to interact with windows belonging to another application, you'll need to use something like the Accessibility API (Cocoa), or the low-level Quartz Window list functions. The Quartz function returns a list of all windows (belonging to all applications) and limited information about each (bounds, owning PID, etc.)

这篇关于查找窗口在位置使用碳和碳的问题在64位应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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