您的位置:首页 > 家居用品 > 卫浴洁具 > EXEAPI

EXEAPI

luyued 发布于 2011-04-30 16:44   浏览 N 次  

#include
#include typedef DWORD (WINAPI *fn)();
typedef DWORD (WINAPI *fn1)(void* p1);
typedef DWORD (WINAPI *fn2)(void* p1, void* p2);int _tmain(int argc, _TCHAR* argv[])
{
HMODULE h = LoadLibrary(_T("Kernel32.dll"));
if(!h)return 0; fn2 f2 = (fn2)GetProcAddress(h, "GetProcAddress");
if(!f2)return 0; DWORD tick(0);
fn f = (fn)f2(h, "GetTickCount");
if(f)
{
tick = f();
} DWORD attributes(0);
fn1 f1 = (fn1)f2(h, "GetFileAttributesW");
if(f1)
{
attributes = f1(L"c:\\windows\\notepad.exe");
} FreeLibrary(h);
return 0;
}
目的:执行 WindowsAPI 的程序
图文资讯
广告赞助商