WindowHandleToPlatform

WindowHandleToPlatform

本文介绍了embarcadero WindowHandleToPlatform c ++的示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个用于c ++ builder的WindowHandleToPlatform示例
我想使用句柄来做bitblt和其他函数到
我可以使用VCL和工作伟大的。
Think WindowHandleToPlatform是firemonkey的解决方案,但文档非常差。

I need an example of WindowHandleToPlatform for c++ builderI want to use the handle to do bitblt and other functions to a formI can do this using VCL and works great.Think WindowHandleToPlatform is the solution for firemonkey, but documentation is very poor

感谢

推荐答案

尝试:

#include <FMX.Platform.Win.hpp>

void __fastcall TMyForm::DoSomething()
{
    TWinWindowHandle *ThisHandle = WindowHandleToPlatform(this->Handle);
    if (ThisHandle != NULL)
    {
        HWND hWnd = ThisHandle->Wnd;
        if (ThisWnd != NULL)
        {
            // use ThisWnd as needed...
        }
    }
}

或使用 FormToHWND() > WindowHandleToPlatform()内部):

Or use FormToHWND() instead (which uses WindowHandleToPlatform() internally):

#include <FMX.Platform.Win.hpp>

void __fastcall TMyForm::DoSomething()
{
    HWND ThisWnd = FormToHWND(this);
    if (ThisWnd != NULL)
    {
        // use ThisWnd as needed...
    }
}

无论哪种方式,请记住这些功能是特定的Windows。如果你想要跨平台的东西,你必须找到另一个解决方案。

Either way, keep in mind that these functions are specific Windows. If you want something that is cross-platform, you will have to find another solution.

这篇关于embarcadero WindowHandleToPlatform c ++的示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 17:15