Re: [BLACKBOX] Getting the User\Local Settings\Application Data\ path

From: [at]} <Marc>
Date: Thu, 24 Jan 2008 16:29:29 -0800

----boundary-LibPST-iamunique-477512807_-_-
Content-type: text/plain

> I'm interested in this. I spent a few minutes with it doing an end of
> day mindless copy, and I don't get a clean compile.
> Could you dress it up a little so it will write the string to the log?

Sorry about that... this should compile and run:

----
MODULE PrivApi ["SHELL32.dll"];
IMPORT WinApi;
CONST
  CSIDL_LOCAL_APPDATA* =           1CH; 
  CSIDL_FLAG_CREATE*   =         8000H; 
  SHGFP_TYPE_CURRENT*  =             0; 
  SHGFP_TYPE_DEFAULT*  =             1; 
 
PROCEDURE SHGetFolderPath* ["SHGetFolderPathW"]
( hwndOwner: WinApi.HWND;
  nFolder:   INTEGER;         
  hToken:    WinApi.HANDLE;   
  dwFlags:   INTEGER;         
  VAR [nil] pszPath: ARRAY [untagged] OF CHAR ):
  INTEGER;                    
END PrivApi.
----
MODULE  PrivTest;
IMPORT Log, WinApi, PrivApi, SYSTEM;
PROCEDURE Do*;
VAR
  result: INTEGER;
  str: ARRAY [untagged] WinApi.MAX_PATH OF CHAR;
BEGIN
  result := PrivApi.SHGetFolderPath
  ( WinApi.NULL, 
    PrivApi.CSIDL_LOCAL_APPDATA + PrivApi.CSIDL_FLAG_CREATE,  
    WinApi.NULL, 
    PrivApi.SHGFP_TYPE_CURRENT,
    str );
  Log.Char( '"' );
  Log.String( str );
  Log.Char( '"' );
  Log.Ln;
END Do;
BEGIN
END PrivTest.
----
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-477512807_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0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ccGFyDQpccGFyDQpccGFyDQotLS0tXHBhcg0KVG8gdW5zdWJzY3JpYmUsIHNlbmQgYSBt
ZXNzYWdlIHdpdGggYm9keSAiU0lHTk9GRiBCTEFDS0JPWCIgdG8gTElTVFNFUlZATElTVFMuT0JF
Uk9OLkNIXHBhcg0KfQ==
----boundary-LibPST-iamunique-477512807_-_---
Received on Fri Jan 25 2008 - 01:29:29 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:31:07 UTC