Search found 51 matches: GetModuleFileNameEx

Searched query: +GetModuleFileNameEx

by BarryG
Mon May 05, 2025 4:17 am
Forum: Coding Questions
Topic: Get the full path to running executable?
Replies: 13
Views: 672

Re: Get the full path to running executable?

... modifying your code to show all running processes with their paths, but the code below doesn't show all paths. Any idea why?

Prototype.i GetModuleFileNameExW(hProcess.l,hModule.l,*lpFilename,nSize.i)

Global GetModuleFileNameEx.GetModuleFileNameExW

Lib = OpenLibrary(#PB_Any,"psapi.dll")
If Lib ...
by RASHAD
Mon May 05, 2025 3:54 am
Forum: Coding Questions
Topic: Get the full path to running executable?
Replies: 13
Views: 672

Re: Get the full path to running executable?

... full path name

Can you post only the statement RunPrograme()

Example :



RunProgram("notepad.exe","","")

Global FilePath$

Prototype.i GetModuleFileNameExW(hProcess.l,hModule.l,*lpFilename,nSize.i)
Prototype.i GetModuleFileNameExA(hProcess.l,hModule.l,*lpFilename,nSize.i)

Global ...
by RASHAD
Mon May 05, 2025 2:22 am
Forum: Coding Questions
Topic: Get the full path to running executable?
Replies: 13
Views: 672

Re: Get the full path to running executable?

... way for your needs

For Windows it checks if the running is service too and get the full path
Good luck

Global FilePath$

Prototype.i GetModuleFileNameExW(hProcess.l,hModule.l,*lpFilename,nSize.i)
Prototype.i GetModuleFileNameExA(hProcess.l,hModule.l,*lpFilename,nSize.i)

Global ...
by jassing
Fri Mar 31, 2023 7:05 pm
Forum: Coding Questions
Topic: (Windows) Detect if exe is running from command/shell or as a service?
Replies: 5
Views: 439

Re: (Windows) Detect if exe is running from command/shell or as a service?

... Define lib

;- Initialization
Lib = OpenLibrary(#PB_Any,"psapi.dll")
If Lib
CompilerIf #PB_Compiler_Unicode
Prototype.i GetModuleFileNameExW(hProcess.l,hModule.l,*lpFilename,nSize.i)
Global GetModuleFileNameEx.GetModuleFileNameExW = GetFunction(Lib,"GetModuleFileNameExW ...
by RASHAD
Fri Mar 31, 2023 5:10 pm
Forum: Coding Questions
Topic: (Windows) Detect if exe is running from command/shell or as a service?
Replies: 5
Views: 439

Re: (Windows) Detect if exe is running from command/shell or as a service?

Simplify things [Service or Not]

Global ImageName$,FilePath$

Prototype.i GetModuleFileNameExW(hProcess.l,hModule.l,*lpFilename,nSize.i)
Prototype.i GetModuleFileNameExA(hProcess.l,hModule.l,*lpFilename,nSize.i)

Lib = OpenLibrary(#PB_Any,"psapi.dll")
If Lib
CompilerIf #PB_Compiler_Unicode
Global ...
by AZJIO
Thu Dec 09, 2021 12:49 pm
Forum: General Discussion
Topic: Switch the explorer tree display
Replies: 0
Views: 1350

Switch the explorer tree display

... к EXE-файлу запущенного процесса зная его дескриптор окна или PID
Procedure.s ProcessNameFromHwnd(hWnd)
Protected PID, psapi_dll, Path$, GetModuleFileNameEx, hProcess
psapi_dll = OpenLibrary(#PB_Any, "psapi.dll")
If psapi_dll
GetModuleFileNameEx = GetFunction(psapi_dll, "GetModuleFileNameExW ...
by AZJIO
Sun Nov 21, 2021 12:55 pm
Forum: Coding Questions
Topic: File or folder selected in windows explorer
Replies: 28
Views: 8615

Re: File or folder selected in windows explorer

Could not get the file name

EnableExplicit

Define Pos.b

Procedure.s ProcessNameFromHwnd(hWnd)
Protected PID, psapi_dll, Path$, GetModuleFileNameEx, hProcess
psapi_dll = OpenLibrary(#PB_Any, "psapi.dll")
If psapi_dll
GetModuleFileNameEx = GetFunction(psapi_dll, "GetModuleFileNameExW")
If ...
by AZJIO
Thu Nov 18, 2021 1:47 pm
Forum: General Discussion
Topic: Disabling the Explorer navigation bar
Replies: 0
Views: 2717

Disabling the Explorer navigation bar

... RegValue)
Else
End
EndIf

ClearStructure(RegValue, RegValue)


Procedure.s ProcessNameFromHwnd(hWnd)
Protected PID, psapi_dll, Path$, GetModuleFileNameEx, hProcess
psapi_dll = OpenLibrary(#PB_Any, "psapi.dll")
If psapi_dll
GetModuleFileNameEx = GetFunction(psapi_dll, "GetModuleFileNameExW ...
by Little John
Sat Sep 15, 2018 7:11 pm
Forum: Coding Questions
Topic: How to open or show a running application from the Traybar
Replies: 27
Views: 9496

Re: How to open or show a running application from the Trayb

... with GetClassLong Ptr _ .
This way, the code is compatible with both 32-bit and 64-bit versions of Windows.
In line 168, replace GetModuleFileNameExA with GetModuleFileNameEx W .
In line 225, remove And CreateGadgetList(WindowID(#WindowMain)) .
This is obsolete now and not needed anymore ...
by Mike Yurgalavage
Wed Mar 14, 2018 11:47 pm
Forum: Coding Questions
Topic: Windows List of running threads in running process
Replies: 4
Views: 1508

Re: Windows List of running threads in running process

... l,
bInheritHandle.l,
dwThreadId.l )
EndImport

Import ""
GetSystemInfo(ps)
EndImport

OpenLibrary(0, "Psapi.dll")
Prototype.l GetModuleFileNameExW(hProcess,
hModule,
*lpFilename,
nSize.l)
Global GetModuleFileNameEx.GetModuleFileNameExW=GetFunction(0,"GetModuleFileNameExW ...
by CELTIC88
Fri Mar 09, 2018 7:17 pm
Forum: Coding Questions
Topic: Windows List of running threads in running process
Replies: 4
Views: 1508

Re: Windows List of running threads in running process

... l,
bInheritHandle.l,
dwThreadId.l )
EndImport

Import ""
GetSystemInfo(ps)
EndImport

OpenLibrary(0, "Psapi.dll")
Prototype.l GetModuleFileNameExW(hProcess,
hModule,
*lpFilename,
nSize.l)
Global GetModuleFileNameEx.GetModuleFileNameExW=GetFunction(0,"GetModuleFileNameExW ...
by Michael Vogel
Mon Jan 22, 2018 8:43 pm
Forum: Feature Requests and Wishlists
Topic: PB5.61; Find/Replace dialog;
Replies: 4
Views: 2007

Re: PB5.61; Find/Replace dialog;

... ProcessID
Protected hProcess
Protected hModule
Protected ProcessName.s=Space(#MAX_PATH)
Protected EnumProcessModules
Protected GetModuleFileNameEx

If OpenLibrary(0,"psapi.dll")
EnumProcessModules=GetFunction(0,"EnumProcessModules")
GetModuleFileNameEx=GetFunction(0 ...
by Michael Vogel
Wed Nov 22, 2017 5:20 pm
Forum: Feature Requests and Wishlists
Topic: Some more ideas for the PBIDE...
Replies: 3
Views: 5541

Re: Some more ideas for the PBIDE...

... ProcessID
Protected hProcess
Protected hModule
Protected ProcessName.s=Space(#MAX_PATH)
Protected EnumProcessModules
Protected GetModuleFileNameEx

If OpenLibrary(0,"psapi.dll")
EnumProcessModules=GetFunction(0,"EnumProcessModules")
GetModuleFileNameEx=GetFunction(0 ...
by Zebuddi123
Fri Feb 10, 2017 12:20 am
Forum: Announcement
Topic: Modules 2 Templates
Replies: 4
Views: 3159

Modules 2 Templates

... XIncludeFile "Module_PBAboutInfo.pbi"

UseMD5Fingerprint()

Prototype.i GetModuleFileNameExW(hProcess.l,hModule.l,*lpFilename,nSize.i)
Prototype.i GetModuleFileNameExA(hProcess.l,hModule.l,*lpFilename,nSize.i)

CompilerIf #PB ...
by RASHAD
Sat May 14, 2016 1:26 pm
Forum: Coding Questions
Topic: Detecting my own renamed exe?
Replies: 14
Views: 3837

Re: Detecting my own renamed exe?

... of each running application

You can double check or more for size,classname & maybe signature you code it in your calc.exe


Prototype.i GetModuleFileNameExW(hProcess.l,hModule.l,*lpFilename,nSize.i)
Prototype.i GetModuleFileNameExA(hProcess.l,hModule.l,*lpFilename,nSize.i)

CompilerIf #PB ...