• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 8075
  • Last Modified:

SW_SHOWNORMAL - undeclared identifier?

ShellExecute(nil, "open", "blah.txt", nil, nil, SW_SHOWNORMAL)

i seem to have a problem issuing this command with the constant SW_SHOWNORMAL. i have had to replace sw_shownormal with 0 or some number otherwise i get compilation error "undeclared identifier".  i am using ShellAPI.

Do you reckon my Delphi6 installation is corrupted?
0
eriklee
Asked:
eriklee
  • 2
1 Solution
 
Russell LibbySoftware Engineer, Advisory Commented:

Have you included "Windows" (.pas) unit in the uses clause of your source? This is where the declarations are exposed from;

 { ShowWindow() Commands }
  {$EXTERNALSYM SW_HIDE}
  SW_HIDE = 0;
  {$EXTERNALSYM SW_SHOWNORMAL}
  SW_SHOWNORMAL = 1;
  {$EXTERNALSYM SW_NORMAL}
  SW_NORMAL = 1;
  {$EXTERNALSYM SW_SHOWMINIMIZED}
  SW_SHOWMINIMIZED = 2;
  {$EXTERNALSYM SW_SHOWMAXIMIZED}
  SW_SHOWMAXIMIZED = 3;
  {$EXTERNALSYM SW_MAXIMIZE}
  SW_MAXIMIZE = 3;
  {$EXTERNALSYM SW_SHOWNOACTIVATE}
  SW_SHOWNOACTIVATE = 4;
  {$EXTERNALSYM SW_SHOW}
  SW_SHOW = 5;
  {$EXTERNALSYM SW_MINIMIZE}
  SW_MINIMIZE = 6;
  {$EXTERNALSYM SW_SHOWMINNOACTIVE}
  SW_SHOWMINNOACTIVE = 7;
  {$EXTERNALSYM SW_SHOWNA}
  SW_SHOWNA = 8;
  {$EXTERNALSYM SW_RESTORE}
  SW_RESTORE = 9;
  {$EXTERNALSYM SW_SHOWDEFAULT}
  SW_SHOWDEFAULT = 10;
  {$EXTERNALSYM SW_MAX}
  SW_MAX = 10;

Regards,
Russell
0
 
erikleeAuthor Commented:
thanks champion.

p/s why do some people write 'nil' whilst other write 'NULL'?
0
 
Russell LibbySoftware Engineer, Advisory Commented:

NULL is commonly used by those familiar with C/C++ programming, while nil is used by those familiar with the pascal language. Same thing, different name... ;-)

Regards,
Russell
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now