确定当前的 HINSTANCE? [英] Determine the current HINSTANCE?

查看:43
本文介绍了确定当前的 HINSTANCE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

win32 应用程序的 HINSTANCE 被传递给 WinMain,但是有没有其他方法可以确定当前的 HINSTANCE(如果你不知道,我对 win32 编程非常陌生!)?我需要在库内创建一个窗口(因为库是跨平台的),我不想将其传入.

The HINSTANCE of a win32 application is passed to WinMain, but is there any other way of determining the current HINSTANCE (in case you couldn't tell, I'm very new to win32 programming!)? I need to create a window inside of a library and (since the library is cross platform), id prefer not to have to pass it in.

推荐答案

如果没记错,GetModuleHandle(NULL); 返回实例句柄.

If memory serves, GetModuleHandle(NULL); returns the instance handle.

这篇关于确定当前的 HINSTANCE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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