Changeset 1488 for trunk/dll/systemf.c


Ignore:
Timestamp:
Dec 22, 2009, 12:42:55 AM (16 years ago)
Author:
Gregg Young
Message:

Fixed commands so reordering them in commands.dat no longer changes their ID or hot key assignment; added 20 new hot keys; the environment information is now used when executing a command; some code clean up in command.c; added CheckExecutibleFlags to systemf.c the eliminate repetative code in assoc.c, command.c & cmdline.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/systemf.c

    r1480 r1488  
    2727                Dos/Win programs from being inserted into the execute dialog with message why.
    2828  12 Jul 09 GKY Allow FM/2 to load in high memory
     29  21 Dec 09 GKY Added CheckExecutibleFlags to streamline code in command.c assoc.c & cmdline.c
    2930
    3031***********************************************************************/
     
    6465static PSZ pszSrcFile = __FILE__;
    6566
     67     
    6668//static HAPP Exec(HWND hwndNotify, BOOL child, char *startdir, char *env,
    6769//          PROGTYPE * progt, ULONG fl, char *formatstring, ...);
     70
     71/**
     72 * CheckExecutibleFlags checks the dialog controls and returns the appropriate
     73 * flags to be passed the runemf
     74 */
     75
     76ULONG CheckExecutibleFlags(HWND hwnd, INT caller)
     77{
     78  /**
     79   * caller indicates the dialog calling the function:
     80   * 1 = Associations (ASS_)
     81   * 2 = CmdLine      (EXEC_)
     82   * 3 = Commands     (CMD_)
     83   **/
     84
     85  ULONG flags = 0;
     86
     87  if (caller != 2 &&
     88      WinQueryButtonCheckstate(hwnd, caller == 3 ? CMD_DEFAULT : ASS_DEFAULT))
     89    flags = 0;
     90  else if (WinQueryButtonCheckstate(hwnd, caller == 3 ? CMD_FULLSCREEN :
     91                                    caller == 1 ? ASS_FULLSCREEN : EXEC_FULLSCREEN))
     92    flags = FULLSCREEN;
     93  else if (WinQueryButtonCheckstate(hwnd, caller == 3 ? CMD_MINIMIZED :
     94                                    caller == 1 ? ASS_MINIMIZED : EXEC_MINIMIZED))
     95    flags = MINIMIZED;
     96  else if (WinQueryButtonCheckstate(hwnd, caller == 3 ? CMD_MAXIMIZED :
     97                                    caller == 1 ? ASS_MAXIMIZED : EXEC_MAXIMIZED))
     98    flags = MAXIMIZED;
     99  else if (WinQueryButtonCheckstate(hwnd, caller == 3 ? CMD_INVISIBLE :
     100                                    caller == 1 ? ASS_INVISIBLE : EXEC_INVISIBLE))
     101    flags = INVISIBLE;
     102  if (WinQueryButtonCheckstate(hwnd, caller == 3 ? CMD_KEEP : caller == 1 ? ASS_KEEP :
     103                               EXEC_KEEP))
     104    flags |= caller == 2 ? SEPARATEKEEP : KEEP;
     105  else if (caller == 2)
     106    flags |= SEPARATE;
     107  if (caller !=2 && WinQueryButtonCheckstate(hwnd, caller == 3 ? CMD_PROMPT : ASS_PROMPT))
     108    flags |= PROMPT;
     109  if (caller == 3 && WinQueryButtonCheckstate(hwnd, CMD_ONCE))
     110    flags |= ONCE;
     111  if (caller == 1 && WinQueryButtonCheckstate(hwnd, ASS_DIEAFTER))
     112    flags |= DIEAFTER;
     113  return flags;
     114}
    68115
    69116/**
Note: See TracChangeset for help on using the changeset viewer.