dcsimg
Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: PowerBuilder
Expertise: Beginner
Jun 26, 1998

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Application Start Directory

Question:
My application is started by clicking an icon with a TARGET of "\\itgcssd1\sgrs\v3.01\32\sgrs.exe" and a START IN directory of "c:\winnt". Is there any way to determine the TARGET location in PowerScript?

Answer:
The target directory is set by Windows when the application is started. Therefore you can check the current directory to get the taget directory.

To do this, you will need an API call:
Function ulong GetCurrentDirectoryA (ulong textlen, ref string dirtext)
library "KERNEL32.DLL"

Then in a function use the API call as follows:

Ulong		lul_size = 260 	// MAX_PATH
Ulong		lul_Rc
String	ls_CurrentDir

ls_CurrentDir = Space (lul_size)

lul_rc = GetCurrentDirectoryA(lul_size, ls_CurrentDir)

if lul_rc > 0 THEN
	return ls_CurrentDir
else
	return ""
end if
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date