Taskbar jump list App current folder!

Windows specific forum
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Taskbar jump list App current folder!

Post by ChrisR »

When my application is (re)launched from the taskbar jump list (the context menu with Close, Pin, App)
It crashes, it does not find some required linked files, which are in the current folder next to the exe
It seems that the current folder is not the one of the exe but C:\Windows\System32
No worries if I pin the app and start it from the jump list.

Do you have any idea how to solve this problem?
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Taskbar jump list App current folder!

Post by mk-soft »

Code: Select all

Procedure.s GetProgramPath()
  Protected r1.s
  r1 = GetPathPart(ProgramFilename())
  ProcedureReturn r1
EndProcedure

Debug GetProgramPath()
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Taskbar jump list App current folder!

Post by ChrisR »

Thanks mk-soft :)
My problem is solved now with:
SetCurrentDirectory(GetPathPart(ProgramFilename()))

However, it is not so good when debugging:
GetPathPart(ProgramFilename()) = C:\Users\ChrisR\AppData\Local\Temp\
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Taskbar jump list App current folder!

Post by mk-soft »

Set compiler option to create temporäre executable into the quell code folder
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Taskbar jump list App current folder!

Post by ChrisR »

:)
I was mainly interested for the executable
But good to have in debug, if needed.
Thanks
Post Reply