CreateProcess时可传入。
另:VC编程中给人的感觉WinMain是应用程序的入口点,但从汇编编程角度来说,WinMain是在执行一些初始化步骤后才调用的一个子过程,传入的参数是在初始化是获取的,同时 "WinMain "也可改成任意的名称。不知你是否指的是这种情况。
.code
start:
invoke GetModuleHandle, NULL
mov g_hInst, eax
invoke GetCommandLine, NULL
mov g_CmdLine, eax
...
invoke WinMain, g_hInst, NULL, g_CmdLine, SW_SHOWDEFAULT
invoke ExitProcess, eax
WinMain proc hInstance:DWORD, hInstPrev:DWORD, lpCmdLine:DWORD, nCmdShow:DWORD
...
xor eax, eax
ret
WinMain endp
end start
另:VC编程中给人的感觉WinMain是应用程序的入口点,但从汇编编程角度来说,WinMain是在执行一些初始化步骤后才调用的一个子过程,传入的参数是在初始化是获取的,同时 "WinMain "也可改成任意的名称。不知你是否指的是这种情况。
.code
start:
invoke GetModuleHandle, NULL
mov g_hInst, eax
invoke GetCommandLine, NULL
mov g_CmdLine, eax
...
invoke WinMain, g_hInst, NULL, g_CmdLine, SW_SHOWDEFAULT
invoke ExitProcess, eax
WinMain proc hInstance:DWORD, hInstPrev:DWORD, lpCmdLine:DWORD, nCmdShow:DWORD
...
xor eax, eax
ret
WinMain endp
end start
本文解析了Windows程序入口点WinMain函数的作用及其实现细节。通过示例代码展示了如何使用WinMain函数,并解释了其参数来源及其如何被调用。
993

被折叠的 条评论
为什么被折叠?



