一般地,獲取當前模塊路徑都是通過調用 GetModuleFileName 來獲取的。 參數 hModule A handle to the loaded module whose path is being requested. If this parameter is NULL, GetModuleFileName retrieves the path of the executable fi ...
2016-11-08 17:44 0 5279 推薦指數:
最近整理了一些獲取當前模塊路徑的代碼,都是通過調用 GetModuleFileName() 來獲取 [cpp] view plain copy DWORD WINAPI GetModuleFileName ...
這個方法可以獲取到 當前程序的運行的路徑,通過while循環,將程序所在的文件夾路徑提取出來,通過sprintf_s進行,你所需要的文件路徑的拼接 ...
HMODULE getCurrModuleHandle(){ MEMORY_BASIC_INFORMATION info; ::VirtualQuery((LPCVOID)(&getCurrM ...
POINT point; GetCursorPos(&point); header: Declared in Winuser.h, include Windows.h ...
前7種獲取的都是exe所在目錄,后兩種獲取的是dll所在目錄 ...
VC上或取當前路徑有多種方法,最常用的是使用 GetCurrentDirectory和GetModuleFileName函數,個中都有諸多注意事項,特別總結一下 一、獲取當前運行目錄的絕對路徑 1、使用GetCurrentDirectory函數假設程序路徑為D:\Test\tst.exe,執行 ...
...