C language function:GetModuleFileName sample codes

Search sample code in the internet.It is the result.


TITLE : AutoCAD DevBlog: RealDWG
if (GetModuleFileName(NULL, buf, MAX_PATH) != 0).......
http://adndevblog.typepad.com/autocad/realdwg/page/2/


TITLE : LoadDLLViaAppInit | Didier Stevens
I realize this approach allows a lot of flexibility, but you could also just change the code for your injected DLL: in DllMain(), check if the fdwReason parameter is DLL_PROCESS_ATTACH, and then check the process name via GetModuleFileName(NULL, szProcess, sizeof(szProcess)). Then decide to load or not. If not, return FALSE from DllMain()........
http://blog.didierstevens.com/2009/12/23/loaddllviaappinit/
search Google

https://www.google.com/#q=GetModuleFileName