CFree 5.0 漢化版;建立一個簡單視窗程式;
此工具帶有Win32 api的智能提示;
Win32 API的LoadLibrary函數,功能是載入子產品;下面示例載入icmp.dll;此dll位于system32目錄;然後顯示載入子產品以後的句柄;如果載入失敗,則子產品句柄為0;
代碼和工程如上;運作結果如下;
#include <windows.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
/* TODO: Place code here.*/
char szBuffer[100];
HMODULE hmod1=LoadLibrary("icmp.dll");
wsprintf(szBuffer, "%x",hmod1);
MessageBox(NULL,szBuffer,TEXT("icmp子產品句柄"),0);
return 0;
}
wsprintf,"%x",格式化為十六進制;