On Win32 systems, shell/[1,2]
executes the command using the CreateProcess() API and waits for the
command to terminate. If the command ends with a &
sign, the command is handed to the WinExec() API, which does not wait
for the new task to terminate. See also win_exec/2
and win_shell/2.
Please note that the CreateProcess() API does not imply the
Windows command interpreter (command.exe on Windows 95/98 and cmd.exe
on Windows-NT) and therefore commands built-in to the
command-interpreter can only be activated using the command interpreter.
For example:
'command.exe /C copy file1.txt file2.txt'
shell(Command, 0)
'.
/bin/sh
, the
environment variable SHELL
overrides this default. Not
available for Win32 platforms.
SW_*
constants written in lowercase without the SW_*
:
hide
maximize
minimize
restore
show
showdefault
showmaximized
showminimized
showminnoactive
showna
shownoactive
shownormal
. In addition, iconic
is a synonym
for minimize
and
normal
for shownormal
open
,
print
or explore
or another operation
registered with the shell for the given document-type. On modern systems
it is also possible to pass a URL as File,
opening the URL in Windows default browser. This call interfaces to the
Win32 API ShellExecute(). The Show argument determines the
initial state of the opened window (if any). See win_exec/2
for defined values.
win_shell(Operation, File, normal)
DWORD
, the value is returned as an integer. If the value is
a string it is returned as a Prolog atom. Other types are currently not
supported. The default `root' is HKEY_CURRENT_USER
. Other
roots can be specified explicitly as HKEY_CLASSES_ROOT
,
HKEY_CURRENT_USER
, HKEY_LOCAL_MACHINE
or
HKEY_USERS
. The example below fetches the extension to use
for Prolog files (see README.TXT
on the Windows version):
?- win_registry_get_value('HKEY_LOCAL_MACHINE/Software/SWI/Prolog', fileExtension, Ext). Ext = pl |
all
, collate
, ctype
, messages
,
monetary
, numeric
or time
. For
details, please consult the C-library locale documentation. See also section
2.17.1. Please note that the locale is shared between all threads
and thread-safe usage of setlocale/3
is in general not possible. Do locale operations before starting threads
or thoroughly study threading aspects of locale support in your
environment before use in multi-threaded environments.
~
. For compatibility only.
--
. Integer
arguments are passed as Prolog integers, float arguments and Prolog
floating point numbers and all other arguments as Prolog atoms. New
applications should use the prolog-flag argv
. See also
prolog prolog-flag
argv
.
A stand-alone program could use the following skeleton to handle command-line arguments. See also section 2.10.2.4.
main :- current_prolog_flag(argv, Argv), append(_PrologArgs, [--|AppArgs], Argv), !, main(AppArgs). |
There is no standard for time-representation in the Prolog community. SWI-Prolog represents it as a floating-point number using the same basic representation as the POSIX standard, seconds elapsed since the January 1970, 0 hours. This format is also used for predicates accessing time-information from files (see time_file/2).
The Windows executable PLWIN.EXE console has a number of predicates to control the appearance of the console. Being totally non-portable, we do not advice using it for your own application, but use XPCE or another portable GUI platform instead. We give the predicates for reference here.
bottom
, top
, topmost
and notopmost
.
Topmost windows are displayed above all other windows.
true
, show the window, if false
hide the
window.
&
is
underlined and defines the associated accelerator key. Before
is the label before which this one must be inserted. Using -
adds the new entry at the end (right). For example, the call below adds
a Application entry just before the Help menu.
win_insert_menu('&Application', '&Help') |
-
inserts a separator. Goal
is called if the user selects the item.