Код (Text): #include "stdafx.h" int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // TODO: Place code here. MessageBox(NULL, lpCmdLine ,"Caption",MB_OK); return 0; } lpCmdLine = http://www.ollydbg.de/odbg110.zip
_splitpath, _wsplitpath Break a path name into components. h**p://msdn.microsoft.com/en-us/library/e737s6tf%28VS.80%29.aspx
Код (Text): #include <windows.h> #pragma comment(linker, "/ENTRY:start") #pragma comment(linker, "/opt:nowin98") #pragma comment(lib, "kernel32.lib") #pragma comment(lib, "user32.lib") void start(void) { DWORD len; char buf[512]; if ( 0 == (len = GetModuleFileName(NULL, buf, sizeof(buf))) ) ExitProcess(0); while ( buf[len - 1] != '\\' ) { if ( ! --len ) ExitProcess(0); } MessageBox(NULL, &buf[len], "FileName is", MB_OK | MB_ICONINFORMATION); ExitProcess(0); }