----boundary-LibPST-iamunique-1335710175_-_-
Content-type: text/plain
On Sat, 17 Feb 2007 20:06:58 -0600, you wrote:
>I want to create a windows shortcut from within BlackBox.
>
>I have read the MSDN information on SHAddToRecentDocs, which is a
>WinAPI call to add a shortcut to the recent documents list. I cannot
>find any evidence of this in the (Win)API.odc file.
>
>I have also found a C++ entry for IShellLink::GetDescription that is a
>more general way to make windows shortcuts. There is a C++ utility
>using this described at
>http://www.flexhex.com/docs/articles/hard-links.phtml#softlinks and
>the source is available. I read C++ much more slowly than Oberon, and
>haven't digested this yet.
>
>I have also noticed that when I go to the Files menu and select open,
>then doubleclick on a file name to open it in blackbox, the recent
>files list is updated. I can't find anything in HostFiles that seems
>at all related to this, so I wonder if it is some side-effect buried
>deep in windows.
>
>I don't know how to access a C++ method in Blackbox, and I haven't dug
>through to find out how to modify WinAPI to have this call available.
>
>Has anyone else worked on this?
>
>
>--
>-- Aubrey McIntosh, Ph.D.
Hello,
I guess the Shell32 functions are not in Winapi.odc because this dll is distributed with Internet
Explorer. POW does not include them either.
For cases like this, I have a recent lcc distribution installed from
http://www.cs.virginia.edu/~lcc-win32/ . I look up the constants in it's header files, which are
always up to date.
Here is one way to do it:
MODULE PrivShell32 ["SHELL32.dll"];
IMPORT WinApi;
CONST
SHARD_PIDL = 1;
SHARD_PATHA = 2;
SHARD_PATHW = 3;
SHARD_PATH* = SHARD_PATHA;
PROCEDURE SHAddToRecentDocs* ( uFlags: INTEGER; pv: WinApi.PtrSTR );
END PrivShell32.
-----------------------------------------------------------------------
The uFlags parameter defines the type of the pv parameter; for best compatibility I chose a
non-unicode string; (pidl is more complicated but allows to specify folders like 'My Documents')
The function has to be called with path + filename of an existing file; on my system both the file
and the folder are added to my recent documents list.
-----------------------------------------------------------------------
MODULE PrivRecent;
IMPORT PrivShell32;
PROCEDURE Do*;
VAR name: ARRAY 256 OF SHORTCHAR;
BEGIN
name := "C:\Oberon\BlackBox 1.5\Xy\Rsrc\IFSPlugin.odc";
PrivShell32.SHAddToRecentDocs(PrivShell32.SHARD_PATH, name)
END Do;
END PrivRecent.Do
Brgds,
Koen.
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-1335710175_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIE9uIFNhdCwgMTcgRmViIDIwMDcgMjA6MDY6NTgg
LTA2MDAsIHlvdSB3cm90ZTpccGFyDQpccGFyDQo+SSB3YW50IHRvIGNyZWF0ZSBhIHdpbmRvd3Mg
c2hvcnRjdXQgZnJvbSB3aXRoaW4gQmxhY2tCb3guXHBhcg0KPlxwYXINCj5JIGhhdmUgcmVhZCB0
aGUgTVNETiBpbmZvcm1hdGlvbiBvbiBTSEFkZFRvUmVjZW50RG9jcywgd2hpY2ggaXMgYVxwYXIN
Cj5XaW5BUEkgY2FsbCB0byBhZGQgYSBzaG9ydGN1dCB0byB0aGUgcmVjZW50IGRvY3VtZW50cyBs
aXN0LiAgSSBjYW5ub3RccGFyDQo+ZmluZCBhbnkgZXZpZGVuY2Ugb2YgdGhpcyBpbiB0aGUgKFdp
bilBUEkub2RjIGZpbGUuXHBhcg0KPlxwYXINCj5JIGhhdmUgYWxzbyBmb3VuZCBhIEMrKyBlbnRy
eSBmb3IgSVNoZWxsTG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