In the program below, whare are WinTypes
, WinProcs
and what is the purpose of SW_NORMAL
?
program ex;
uses Wincrt,WinTypes, WinProcs;
var
ch:string;
procedure exe (che:string);
begin
writeln('ecrire ch');
readln(che);
if ch ='oui' then
begin
WinExec('cmd /k "C:\TPW\exercice\project\site.html"', SW_NORMAL);
end;
end;
begin
exe(ch);
end.
The code is in Turbo Pascal 1.5.
Wintypes and winprocs are translated Windows 3.x headers that come with windows versions of Turbo Pascal and Delphi 1. In later Delphi versions these are aliased to the more "modern" (as in after 1995) win32 Windows unit.
SW_NORMAL is a parameter to winexec that has info about the window of the generate program.
You can look up Windows functions (even ancient ones like this) in MSDN, and this will give you a link for WinExec which links through to Showwindow for the various windows options and their explanation.
Your program is weird in the sense that it uses win 3.x apis to call a Windows NT+ "cmd.exe".
来源:https://stackoverflow.com/questions/41642281/what-are-wintypes-winprocs-and-sw-normal