Changeset 1488
- Timestamp:
- Dec 22, 2009, 12:42:55 AM (16 years ago)
- Location:
- trunk/dll
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/assoc.c
r1479 r1488 21 21 24 Aug 08 GKY Warn full drive on save of .DAT file; prevent loss of existing file 22 22 15 Nov 09 GKY Add check for attempt to open zero byte file (avoids MMPM trying to play them) 23 21 Dec 09 GKY Added CheckExecutibleFlags to streamline code in command.c assoc.c & cmdline.c 23 24 24 25 **************************************************************************************/ … … 755 756 } 756 757 bstrip(temp.mask); 757 bstrip(temp.pszCmdLine); 758 if (WinQueryButtonCheckstate(hwnd, ASS_DEFAULT)) 758 bstrip(temp.pszCmdLine); 759 temp.flags = CheckExecutibleFlags(hwnd, 1); 760 /*if (WinQueryButtonCheckstate(hwnd, ASS_DEFAULT)) 759 761 temp.flags = 0; 760 762 else if (WinQueryButtonCheckstate(hwnd, ASS_FULLSCREEN)) … … 771 773 temp.flags |= DIEAFTER; 772 774 if (WinQueryButtonCheckstate(hwnd, ASS_PROMPT)) 773 temp.flags |= PROMPT; 775 temp.flags |= PROMPT;*/ 774 776 if (fCancelAction){ 775 777 fCancelAction = FALSE; … … 830 832 } 831 833 bstrip(temp.mask); 832 bstrip(temp.pszCmdLine); 833 if (WinQueryButtonCheckstate(hwnd, ASS_DEFAULT)) 834 bstrip(temp.pszCmdLine); 835 temp.flags = CheckExecutibleFlags(hwnd, 1); 836 /*if (WinQueryButtonCheckstate(hwnd, ASS_DEFAULT)) 834 837 temp.flags = 0; 835 838 else if (WinQueryButtonCheckstate(hwnd, ASS_FULLSCREEN)) … … 846 849 temp.flags |= DIEAFTER; 847 850 if (WinQueryButtonCheckstate(hwnd, ASS_PROMPT)) 848 temp.flags |= PROMPT; 851 temp.flags |= PROMPT;*/ 849 852 if (fCancelAction){ 850 853 fCancelAction = FALSE; … … 934 937 } 935 938 bstrip(temp.mask); 936 bstrip(temp.pszCmdLine); 937 if (WinQueryButtonCheckstate(hwnd, ASS_DEFAULT)) 939 bstrip(temp.pszCmdLine); 940 temp.flags = CheckExecutibleFlags(hwnd, 1); 941 /*if (WinQueryButtonCheckstate(hwnd, ASS_DEFAULT)) 938 942 temp.flags = 0; 939 943 else if (WinQueryButtonCheckstate(hwnd, ASS_FULLSCREEN)) … … 950 954 temp.flags |= DIEAFTER; 951 955 if (WinQueryButtonCheckstate(hwnd, ASS_PROMPT)) 952 temp.flags |= PROMPT; 956 temp.flags |= PROMPT;*/ 953 957 if (fCancelAction){ 954 958 fCancelAction = FALSE; -
trunk/dll/cmdline.c
r1482 r1488 26 26 aren't user settable; realappname should be used for setting applicable to 27 27 one or more miniapp but not to FM/2 28 21 Dec 09 GKY Added CheckExecutibleFlags to streamline code in command.c assoc.c & cmdline.c 28 29 29 30 ***********************************************************************/ … … 718 719 ex = INSTDATA(hwnd); 719 720 WinQueryDlgItemText(hwnd, EXEC_CL, 1000, ex->commandline); 720 ex->flags = 0; 721 ex->flags = CheckExecutibleFlags(hwnd, 2); 722 /*ex->flags = 0; 721 723 if (WinQueryButtonCheckstate(hwnd, EXEC_MINIMIZED)) 722 724 ex->flags |= MINIMIZED; … … 732 734 ex->flags |= SEPARATEKEEP; 733 735 else 734 ex->flags |= SEPARATE; 736 ex->flags |= SEPARATE;*/ 735 737 strset(ex->environment, 0); 736 738 WinQueryDlgItemText(hwnd, EXEC_ENVIRON, 1000, ex->environment); -
trunk/dll/command.c
r1487 r1488 28 28 24 Aug 08 GKY Warn full drive on save of .DAT file; prevent loss of existing file 29 29 15 Oct 08 GKY Prevent asking to add %a on NormalizeCmdLine abort 30 21 Dec 09 GKY Fix the environment so it can be saved, deleted and used consistently. 31 21 Dec 09 GKY Allow command menu reorder without changing the "ID" or hot key for a command. 32 Added load_inicommand to load the IDs from the ini file. 33 21 Dec 09 GKY Added 20 new hot keys for commands. 34 21 Dec 09 GKY Added CheckExecutibleFlags to streamline code in command.c assoc.c & cmdline.c 30 35 31 36 ***********************************************************************/ … … 62 67 #include "fortify.h" 63 68 69 VOID load_inicommands(VOID); 70 64 71 typedef struct 65 72 { 66 73 PSZ pszCmdLine; 67 74 CHAR title[100]; 75 CHAR env[1002]; 68 76 ULONG flags; 69 77 ULONG ID; … … 77 85 static PSZ pszSrcFile = __FILE__; 78 86 static LINKCMDS *cmdtail; 79 static INT CommandDatVersion = 0; 87 static BOOL UsedCommandIDs[300]; 88 static BOOL UsedHotKeyIDs[40]; 80 89 81 90 #pragma data_seg(GLOBAL2) 82 91 LINKCMDS *cmdhead; 83 92 BOOL cmdloaded; 84 BOOL UsedCommandIDs[300];85 BOOL UsedHotKeyIDs[20];86 93 87 94 MRESULT EXPENTRY CommandTextProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) … … 338 345 xfree(info->title, pszSrcFile, __LINE__); 339 346 xfree(info->pszCmdLine, pszSrcFile, __LINE__); 347 xfree(info->env, pszSrcFile, __LINE__); 340 348 free(info); 341 349 info = next; … … 349 357 LINKCMDS *info; 350 358 PSZ pszCmdLine; 351 CHAR *p;352 359 CHAR title[100]; 353 360 CHAR flags[34]; 354 CHAR ID[34]; 355 CHAR HotKeyID[34]; 361 ULONG size; 356 362 357 363 if (cmdhead) 358 364 free_commands(); 365 PrfQueryProfileData(fmprof, FM3Str, "UsedCommandIDs", &UsedCommandIDs, 366 &size); 367 PrfQueryProfileData(fmprof, FM3Str, "UsedHotKeyIDs", &UsedHotKeyIDs, 368 &size); 359 369 cmdloaded = TRUE; 360 370 pszCmdLine = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__); … … 363 373 fp = _fsopen(pszCmdLine, "r", SH_DENYWR); 364 374 if (fp) { 365 xfgets(title, sizeof(title), fp, pszSrcFile, __LINE__);366 lstrip(title);367 if (!strnicmp(title, "Version", 7) && !CommandDatVersion) {368 p = title + 7;369 while (*p == ' ')370 p++;371 bstripcr(p);372 CommandDatVersion = atol(p);373 }374 375 while (!feof(fp)) { 375 376 if (!xfgets_bstripcr(title, sizeof(title), fp, pszSrcFile, __LINE__)) 376 377 break; 377 title[strlen(title)] = 0; // Match size to entry file max378 //title[strlen(title)] = 0; // Match size to entry file max? Not needed as bstripcr does this? GKY 21 Dec 09 378 379 if (!*title || *title == ';') 379 380 continue; … … 381 382 break; /* error! */ 382 383 if (!xfgets_bstripcr(flags, sizeof(flags), fp, pszSrcFile, __LINE__)) 383 break; /* error! */ 384 if (CommandDatVersion) { 385 if (!xfgets_bstripcr(ID, sizeof(ID), fp, pszSrcFile, __LINE__)) 386 break; /* error! */ 387 ID[34] = 0; 388 if (!xfgets_bstripcr(HotKeyID, sizeof(HotKeyID), fp, pszSrcFile, __LINE__)) 389 break; /* error! */ 390 ID[34] = 0; 391 } 392 pszCmdLine[strlen(pszCmdLine)] = 0; // fixme to know why chopped this way? 393 //bstripcr(pszCmdLine); 384 break; 385 //pszCmdLine[strlen(pszCmdLine)] = 0; // fixme to know why chopped this way? Not needed as bstripcr does this? GKY 21 Dec 09 394 386 flags[34] = 0; 395 //bstripcr(flags);396 387 if (!pszCmdLine) 397 388 continue; … … 405 396 info->title = xstrdup(title, pszSrcFile, __LINE__); 406 397 info->flags = atol(flags); 407 if (CommandDatVersion) {408 info->ID = atol(ID);409 info->HotKeyID = atol(HotKeyID);410 }411 398 if (!info->pszCmdLine || !info->title) { 412 399 xfree(info->pszCmdLine, pszSrcFile, __LINE__); … … 432 419 free(pszCmdLine); 433 420 fclose(fp); 434 } 421 load_inicommands(); 422 } 423 } 424 } 425 426 /** 427 * load_inicommand loads the data from the ini file into an info struct 428 * after COMMANDS.DAT has been loaded; It generates new IDs where necessary 429 * it saves the environment from the old ini key and deletes it as needed 430 **/ 431 432 VOID load_inicommands(VOID) 433 { 434 LINKCMDS *info;; 435 INT x = 0; 436 INT y = 0; 437 ULONG ID = 0; 438 ULONG HotKeyID = 0; 439 CHAR env[1002]; 440 CHAR keyID[120]; 441 CHAR keyHotKeyID[120]; 442 CHAR keyenv[120]; 443 ULONG size; 444 445 if (!cmdloaded || !cmdhead) 446 return; 447 info = cmdhead; 448 while (info) { 449 bstripcr(info->title); 450 sprintf(keyID, "COMMAND.%sID", info->title); 451 sprintf(keyHotKeyID, "COMMAND.%sHotKeyID", info->title); 452 sprintf(keyenv, "COMMAND.%senv", info->title); 453 size = sizeof(ULONG); 454 PrfQueryProfileData(fmprof, FM3Str, keyID, &ID, &size); 455 size = sizeof(ULONG); 456 PrfQueryProfileData(fmprof, FM3Str, keyHotKeyID, &HotKeyID, &size); 457 PrfQueryProfileString(fmprof, FM3Str, keyenv, NullStr, env, sizeof(env)); 458 if (ID) { 459 if (env != NullStr) 460 info->env = xstrdup(env, pszSrcFile, __LINE__); 461 info->ID = ID; 462 info->HotKeyID = HotKeyID; 463 } 464 //This updates the old commands.dat file to the new format 465 //assigning the IDs based on file order or on next available ID if 466 //COMMAND.DAT is hand edited. 467 else { 468 for (x = 0; x < 300; x++) { 469 if (!UsedCommandIDs[x]) { 470 ID = info->ID = IDM_COMMANDSTART + x; 471 UsedCommandIDs[x] = TRUE; 472 for (y = 0; y < 40; y++) { 473 if (!UsedHotKeyIDs[y]) { 474 HotKeyID = info->HotKeyID = IDM_COMMANDNUM0 + y; 475 UsedHotKeyIDs[y] = TRUE; 476 break; 477 } 478 } 479 break; 480 } 481 if (x == 299) 482 saymsg(MB_OK | MB_ICONEXCLAMATION , HWND_DESKTOP, 483 GetPString(IDS_COMMANDSLIMITTITLETEXT), 484 GetPString(IDS_COMMANDSLIMITREACHEDTEXT )); 485 } 486 PrfQueryProfileString(fmprof, FM3Str, info->pszCmdLine, NullStr, env, sizeof(env)); 487 info->env = env; 488 if (env != NullStr) 489 PrfWriteProfileString(fmprof, FM3Str, info->pszCmdLine, NULL); 490 if (info->env) 491 strcpy(env, info->env); 492 ID = info->ID; 493 HotKeyID = info->HotKeyID; 494 PrfWriteProfileData(fmprof, FM3Str, keyID, &ID, sizeof(INT)); 495 PrfWriteProfileData(fmprof, FM3Str, keyHotKeyID, &HotKeyID, sizeof(INT)); 496 if (env != NullStr) 497 PrfWriteProfileString(fmprof, FM3Str, keyenv, env); 498 PrfWriteProfileData(fmprof, FM3Str, "UsedCommandIDs", &UsedCommandIDs, 499 sizeof(BOOL) * 300); 500 PrfWriteProfileData(fmprof, FM3Str, "UsedHotKeyIDs", &UsedHotKeyIDs, 501 sizeof(BOOL) * 40); 502 } 503 ID = 0; 504 HotKeyID = 0; 505 info = info->next; 435 506 } 436 507 } … … 442 513 CHAR s[CCHMAXPATH + 14]; 443 514 INT x = 0; 515 INT ID = 0; 516 INT HotKeyID = 0; 517 CHAR env[1002]; 518 CHAR keyID[120]; 519 CHAR keyHotKeyID[120]; 520 CHAR keyenv[120]; 444 521 445 522 if (!cmdloaded || !cmdhead) … … 451 528 fp = xfopen(s, "w", pszSrcFile, __LINE__); 452 529 if (fp) { 453 //Adds line for version tracking454 fprintf(fp,"Version 2\n");455 fputs(GetPString(IDS_COMMANDFILETEXT), fp);456 info = cmdhead;457 530 while (info) { 458 //This updates the old commands.dat file to the new format 459 //assigning the IDs based on file order 460 if (!info->ID) { 461 info->ID = IDM_COMMANDSTART + x; 462 UsedCommandIDs[x] = TRUE; 463 if (x < 20) { 464 info->HotKeyID = IDM_COMMANDNUM0 + x; 465 UsedHotKeyIDs[x] = TRUE; 466 } 467 } 468 fprintf(fp, ";\n%0.99s\n%0.*s\n%lu\n%lu\n%lu\n", 469 info->title, MaxComLineStrg, info->pszCmdLine, 470 info->flags, info->ID, info->HotKeyID); 471 //else 472 // fprintf(fp, 473 // ";\n%0.99s\n%0.*s\n%lu\n", 474 // info->title, MaxComLineStrg, info->pszCmdLine, info->flags); 531 fprintf(fp, ";\n%0.99s\n%0.*s\n%lu\n", 532 info->title, MaxComLineStrg, info->pszCmdLine, info->flags); 533 534 if (info->env) 535 strcpy(env, info->env); 536 ID = info->ID; 537 HotKeyID = info->HotKeyID; 538 bstripcr(info->title); 539 sprintf(keyID, "COMMAND.%sID", info->title); 540 sprintf(keyHotKeyID, "COMMAND.%sHotKeyID", info->title); 541 sprintf(keyenv, "COMMAND.%senv", info->title); 542 PrfWriteProfileData(fmprof, FM3Str, keyID, &ID, sizeof(INT)); 543 PrfWriteProfileData(fmprof, FM3Str, keyHotKeyID, &HotKeyID, sizeof(INT)); 544 if (env != NullStr) 545 PrfWriteProfileString(fmprof, FM3Str, keyenv, env); 475 546 x++; 476 547 info = info->next; 477 } // while 548 } // while info 478 549 PrfWriteProfileData(fmprof, FM3Str, "UsedCommandIDs", &UsedCommandIDs, 479 550 sizeof(BOOL) * 300); 480 551 PrfWriteProfileData(fmprof, FM3Str, "UsedHotKeyIDs", &UsedHotKeyIDs, 481 sizeof(BOOL) * 20);552 sizeof(BOOL) * 40); 482 553 fclose(fp); 483 554 } // if (fp) … … 489 560 { 490 561 LINKCMDS *info; 491 ULONG size;492 562 INT x; 563 INT y; 493 564 494 565 if (!addme || !*addme->pszCmdLine || !*addme->title) … … 498 569 if (!stricmp(info->title, addme->title)) 499 570 return NULL; // Got a dup 571 if (addme->HotKeyID && info->HotKeyID && info->HotKeyID == addme->HotKeyID) 572 info->HotKeyID = 0; //avoid assigning hot key to multiple commands 500 573 info = info->next; 501 574 } … … 506 579 info->title = xstrdup(addme->title, pszSrcFile, __LINE__); 507 580 info->HotKeyID = addme->HotKeyID; 581 if (info->HotKeyID >= IDM_COMMANDNUM0 && info->HotKeyID <= IDM_COMMANDNUM19) 582 UsedHotKeyIDs[info->HotKeyID - IDM_COMMANDNUM0] = TRUE; 583 else 584 info->HotKeyID = 0; 508 585 if (!info->ID) { 509 PrfQueryProfileData(fmprof, FM3Str, "UsedCommandIDs", &UsedCommandIDs, 510 &size); //profile updated by save_commands 586 //profile updated by save_commands 511 587 for (x = 0; x < 300; x++) { 512 588 if (!UsedCommandIDs[x]) { 513 589 info->ID = IDM_COMMANDSTART + x; 514 590 UsedCommandIDs[x] = TRUE; 591 for (y = 0; y < 40; y++) { 592 if (!UsedHotKeyIDs[y]) { 593 info->HotKeyID = IDM_COMMANDNUM0 + y; 594 UsedHotKeyIDs[y] = TRUE; 595 break; 596 } 597 } 515 598 break; 516 599 } 600 if (x == 299) 601 saymsg(MB_OK | MB_ICONEXCLAMATION , HWND_DESKTOP, 602 GetPString(IDS_COMMANDSLIMITTITLETEXT), 603 GetPString(IDS_COMMANDSLIMITREACHEDTEXT )); 517 604 } 518 605 } 519 606 if (addme->flags) 520 607 info->flags = addme->flags; 608 if (addme->env) 609 info->env = xstrdup(addme->env, pszSrcFile, __LINE__); 521 610 if (!info->pszCmdLine || !info->title || !info->ID) { 522 611 xfree(info->pszCmdLine, pszSrcFile, __LINE__); 612 xfree(info->title, pszSrcFile, __LINE__); 523 613 xfree(info->title, pszSrcFile, __LINE__); 524 614 free(info); … … 561 651 } 562 652 xfree(info->pszCmdLine, pszSrcFile, __LINE__); 563 xfree(info->title, pszSrcFile, __LINE__); 653 xfree(info->title, pszSrcFile, __LINE__); 654 xfree(info->env, pszSrcFile, __LINE__); 564 655 free(info); 565 656 return TRUE; … … 642 733 WinCheckButton(hwnd, CMD_KEEP, ((info->flags & KEEP) != 0)); 643 734 WinCheckButton(hwnd, CMD_ONCE, ((info->flags & ONCE) != 0)); 644 WinSetDlgItemText(hwnd, CMD_TITLE, info->title); 645 { 646 CHAR env[1002]; 647 ULONG size; 648 649 *env = 0; 650 size = sizeof(env) - 1; 651 if (PrfQueryProfileData(fmprof, FM3Str, info->pszCmdLine, env, &size) && 652 *env) 653 WinSetDlgItemText(hwnd, CMD_ENVIRON, env); 654 else 655 WinSetDlgItemText(hwnd, CMD_ENVIRON, NullStr); 656 } 735 WinSetDlgItemText(hwnd, CMD_TITLE, info->title); 736 if (info->env) 737 WinSetDlgItemText(hwnd, CMD_ENVIRON, info->env); 738 else 739 WinSetDlgItemText(hwnd, CMD_ENVIRON, NullStr); 657 740 } 658 741 break; … … 724 807 PSZ pszWorkBuf; 725 808 APIRET ret; 809 CHAR env[1002]; 726 810 727 811 memset(&temp, 0, sizeof(COMMAND)); … … 746 830 strcat(temp.pszCmdLine, " %a"); 747 831 } 748 WinQueryDlgItemText(hwnd, CMD_TITLE, sizeof(temp.title), temp.title); 749 if (WinQueryButtonCheckstate(hwnd, CMD_DEFAULT)) 832 WinQueryDlgItemText(hwnd, CMD_TITLE, sizeof(temp.title), temp.title); 833 bstripcr(temp.title); 834 temp.flags = CheckExecutibleFlags(hwnd, 3); 835 /*if (WinQueryButtonCheckstate(hwnd, CMD_DEFAULT)) 750 836 temp.flags = 0; 751 837 else if (WinQueryButtonCheckstate(hwnd, CMD_FULLSCREEN)) … … 762 848 temp.flags |= PROMPT; 763 849 if (WinQueryButtonCheckstate(hwnd, CMD_ONCE)) 764 temp.flags |= ONCE; 850 temp.flags |= ONCE;*/ 851 *env = 0; 852 WinQueryDlgItemText(hwnd, CMD_ENVIRON, 1000, env); 853 bstripcr(env); 854 if (*env) { 855 strcpy(temp.env, env); 856 } 765 857 if (fCancelAction){ 766 858 fCancelAction = FALSE; … … 771 863 info = add_command(&temp); 772 864 if (!info) 773 { 774 WinDismissDlg(hwnd, 0); 775 /*saymsg(MB_ENTER, hwnd, 776 GetPString(IDS_ERRORTEXT), 777 GetPString(IDS_CANTADDCOMMANDTEXT), 778 temp.title);*/ 779 } 865 WinDismissDlg(hwnd, 0); 866 else { 867 x = (SHORT) WinSendDlgItemMsg(hwnd, 868 CMD_LISTBOX, 869 LM_INSERTITEM, 870 MPFROM2SHORT(LIT_END, 0), 871 MPFROMP(temp.title)); 872 if (x >= 0) { 873 WinSendDlgItemMsg(hwnd, 874 CMD_LISTBOX, 875 LM_SETITEMHANDLE, 876 MPFROMSHORT(x), MPFROMP(info)); 877 WinSendDlgItemMsg(hwnd, 878 CMD_LISTBOX, 879 LM_SELECTITEM, 880 MPFROMSHORT(x), MPFROMSHORT(TRUE)); 881 } 882 } 883 save_commands(); 884 load_commands(); 885 free(temp.pszCmdLine); 886 } 887 x = (SHORT) WinSendDlgItemMsg(hwnd, 888 CMD_LISTBOX, 889 LM_QUERYSELECTION, 890 MPFROMSHORT(LIT_FIRST), MPVOID); 891 save_commands(); 892 WinDismissDlg(hwnd, 0); 893 break; 894 895 case DID_CANCEL: 896 WinDismissDlg(hwnd, 0); 897 break; 898 899 case IDM_HELP: 900 if (hwndHelp) 901 WinSendMsg(hwndHelp, 902 HM_DISPLAY_HELP, 903 MPFROM2SHORT(HELP_COMMAND, 0), MPFROMSHORT(HM_RESOURCEID)); 904 break; 905 906 case CMD_ADD: 907 { 908 COMMAND temp; 909 PSZ pszWorkBuf; 910 APIRET ret; 911 CHAR env[1002]; 912 913 memset(&temp, 0, sizeof(COMMAND)); 914 temp.pszCmdLine = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__); 915 if (!temp.pszCmdLine) 916 break; //already complained 917 pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__); 918 if (!pszWorkBuf) { 919 free(temp.pszCmdLine); 920 break; //already complained 921 } 922 WinQueryDlgItemText(hwnd, CMD_CL, MaxComLineStrg, temp.pszCmdLine); 923 NormalizeCmdLine(pszWorkBuf, temp.pszCmdLine); 924 memcpy(temp.pszCmdLine, pszWorkBuf, strlen(pszWorkBuf) + 1); 925 free(pszWorkBuf); 926 if (!strchr(temp.pszCmdLine, '%') && !fCancelAction){ 927 ret = saymsg(MB_YESNO, 928 HWND_DESKTOP, 929 NullStr, 930 GetPString(IDS_TOACTONSELECTEDTEXT)); 931 if (ret == MBID_YES) 932 strcat(temp.pszCmdLine, " %a"); 933 } 934 WinQueryDlgItemText(hwnd, CMD_TITLE, sizeof(temp.title), temp.title); 935 bstripcr(temp.title); 936 temp.flags = CheckExecutibleFlags(hwnd, 3); 937 /*if (WinQueryButtonCheckstate(hwnd, CMD_DEFAULT)) 938 temp.flags = 0; 939 else if (WinQueryButtonCheckstate(hwnd, CMD_FULLSCREEN)) 940 temp.flags = FULLSCREEN; 941 else if (WinQueryButtonCheckstate(hwnd, CMD_MINIMIZED)) 942 temp.flags = MINIMIZED; 943 else if (WinQueryButtonCheckstate(hwnd, CMD_MAXIMIZED)) 944 temp.flags = MAXIMIZED; 945 else if (WinQueryButtonCheckstate(hwnd, CMD_INVISIBLE)) 946 temp.flags = INVISIBLE; 947 if (WinQueryButtonCheckstate(hwnd, CMD_KEEP)) 948 temp.flags |= KEEP; 949 if (WinQueryButtonCheckstate(hwnd, CMD_PROMPT)) 950 temp.flags |= PROMPT; 951 if (WinQueryButtonCheckstate(hwnd, CMD_ONCE)) 952 temp.flags |= ONCE;*/ 953 *env = 0; 954 WinQueryDlgItemText(hwnd, CMD_ENVIRON, 1000, env); 955 bstripcr(env); 956 if (*env) { 957 strcpy(temp.env, env); 958 } 959 if (fCancelAction){ 960 fCancelAction = FALSE; 961 free(temp.pszCmdLine); 962 break; 963 } 964 else 965 info = add_command(&temp); 966 if (!info) { 967 saymsg(MB_ENTER, hwnd, GetPString(IDS_ERRORTEXT), 968 GetPString(IDS_CANTADDCOMMANDTEXTDUP), temp.title); 969 } 780 970 else { 781 CHAR env[1002];782 783 *env = 0;784 WinQueryDlgItemText(hwnd, CMD_ENVIRON, 1000, env);785 bstripcr(env);786 if (*env) {787 PrfWriteProfileString(fmprof, FM3Str, temp.pszCmdLine, env);788 }789 971 x = (SHORT) WinSendDlgItemMsg(hwnd, 790 972 CMD_LISTBOX, … … 806 988 free(temp.pszCmdLine); 807 989 } 808 x = (SHORT) WinSendDlgItemMsg(hwnd,809 CMD_LISTBOX,810 LM_QUERYSELECTION,811 MPFROMSHORT(LIT_FIRST), MPVOID);812 WinDismissDlg(hwnd, 0);813 break;814 815 case DID_CANCEL:816 WinDismissDlg(hwnd, 0);817 break;818 819 case IDM_HELP:820 if (hwndHelp)821 WinSendMsg(hwndHelp,822 HM_DISPLAY_HELP,823 MPFROM2SHORT(HELP_COMMAND, 0), MPFROMSHORT(HM_RESOURCEID));824 break;825 826 case CMD_ADD:827 {828 COMMAND temp;829 PSZ pszWorkBuf;830 APIRET ret;831 832 memset(&temp, 0, sizeof(COMMAND));833 temp.pszCmdLine = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);834 if (!temp.pszCmdLine)835 break; //already complained836 pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__);837 if (!pszWorkBuf) {838 free(temp.pszCmdLine);839 break; //already complained840 }841 WinQueryDlgItemText(hwnd, CMD_CL, MaxComLineStrg, temp.pszCmdLine);842 NormalizeCmdLine(pszWorkBuf, temp.pszCmdLine);843 memcpy(temp.pszCmdLine, pszWorkBuf, strlen(pszWorkBuf) + 1);844 free(pszWorkBuf);845 if (!strchr(temp.pszCmdLine, '%') && !fCancelAction){846 ret = saymsg(MB_YESNO,847 HWND_DESKTOP,848 NullStr,849 GetPString(IDS_TOACTONSELECTEDTEXT));850 if (ret == MBID_YES)851 strcat(temp.pszCmdLine, " %a");852 }853 WinQueryDlgItemText(hwnd, CMD_TITLE, sizeof(temp.title), temp.title);854 if (WinQueryButtonCheckstate(hwnd, CMD_DEFAULT))855 temp.flags = 0;856 else if (WinQueryButtonCheckstate(hwnd, CMD_FULLSCREEN))857 temp.flags = FULLSCREEN;858 else if (WinQueryButtonCheckstate(hwnd, CMD_MINIMIZED))859 temp.flags = MINIMIZED;860 else if (WinQueryButtonCheckstate(hwnd, CMD_MAXIMIZED))861 temp.flags = MAXIMIZED;862 else if (WinQueryButtonCheckstate(hwnd, CMD_INVISIBLE))863 temp.flags = INVISIBLE;864 if (WinQueryButtonCheckstate(hwnd, CMD_KEEP))865 temp.flags |= KEEP;866 if (WinQueryButtonCheckstate(hwnd, CMD_PROMPT))867 temp.flags |= PROMPT;868 if (WinQueryButtonCheckstate(hwnd, CMD_ONCE))869 temp.flags |= ONCE;870 if (fCancelAction){871 fCancelAction = FALSE;872 free(temp.pszCmdLine);873 break;874 }875 else876 info = add_command(&temp);877 if (!info) {878 saymsg(MB_ENTER, hwnd, GetPString(IDS_ERRORTEXT),879 GetPString(IDS_CANTADDCOMMANDTEXTDUP), temp.title);880 }881 else {882 CHAR env[1002];883 884 *env = 0;885 WinQueryDlgItemText(hwnd, CMD_ENVIRON, 1000, env);886 bstripcr(env);887 if (*env) {888 PrfWriteProfileString(fmprof, FM3Str, temp.title, env);889 }890 x = (SHORT) WinSendDlgItemMsg(hwnd,891 CMD_LISTBOX,892 LM_INSERTITEM,893 MPFROM2SHORT(LIT_END, 0),894 MPFROMP(temp.title));895 if (x >= 0) {896 WinSendDlgItemMsg(hwnd,897 CMD_LISTBOX,898 LM_SETITEMHANDLE,899 MPFROMSHORT(x), MPFROMP(info));900 WinSendDlgItemMsg(hwnd,901 CMD_LISTBOX,902 LM_SELECTITEM,903 MPFROMSHORT(x), MPFROMSHORT(TRUE));904 save_commands();905 }906 }907 free(temp.pszCmdLine);908 }909 990 break; 910 991 911 992 case CMD_DELETE: 912 993 { 913 CHAR temp[100]; 994 CHAR temp[100]; 995 CHAR keyID[120]; 996 CHAR keyHotKeyID[120]; 997 CHAR keyenv[120]; 914 998 915 999 WinQueryDlgItemText(hwnd, CMD_TITLE, 100, temp); 916 bstrip(temp); 917 PrfWriteProfileString(fmprof, FM3Str, temp, NULL); 1000 bstripcr(temp); 1001 sprintf(keyID, "COMMAND.%sID", temp); 1002 sprintf(keyHotKeyID, "COMMAND.%sHotKeyID", temp); 1003 sprintf(keyenv, "COMMAND.%senv", temp); 1004 PrfWriteProfileData(fmprof, FM3Str, keyID, NULL, NULL); 1005 PrfWriteProfileData(fmprof, FM3Str, keyHotKeyID, NULL, NULL); 1006 PrfWriteProfileString(fmprof, FM3Str, keyenv, NULL); 918 1007 if (!kill_command(temp)) 919 1008 Runtime_Error(pszSrcFile, __LINE__, "kill_command"); … … 932 1021 MPFROMSHORT(LIT_NONE), MPFROMSHORT(FALSE)); 933 1022 } 934 1023 save_commands(); 935 1024 } 936 1025 } … … 942 1031 COMMAND temp; 943 1032 APIRET ret; 1033 CHAR keyID[120]; 1034 CHAR keyHotKeyID[120]; 1035 CHAR keyenv[120]; 1036 CHAR env[1002]; 1037 INT ID = 0; 1038 INT HotKeyID = 0; 1039 ULONG size; 944 1040 945 1041 pszWorkBuf = xmalloc(MaxComLineStrg, pszSrcFile, __LINE__); … … 976 1072 MPFROMSHORT(LIT_CURSOR), MPVOID); 977 1073 WinQueryDlgItemText(hwnd, CMD_TITLE, sizeof(temp.title), temp.title); 978 bstrip(temp.title); 979 PrfWriteProfileString(fmprof, FM3Str, temp.title, NULL); 1074 bstripcr(temp.title); 1075 sprintf(keyID, "COMMAND.%sID", temp.title); 1076 sprintf(keyHotKeyID, "COMMAND.%sHotKeyID", temp.title); 1077 sprintf(keyenv, "COMMAND.%senv", temp.title); 1078 PrfQueryProfileData(fmprof, FM3Str, keyID, &ID, &size); 1079 PrfQueryProfileData(fmprof, FM3Str, keyHotKeyID, &HotKeyID, &size); 1080 PrfQueryProfileString(fmprof, FM3Str, keyenv, NullStr, env, sizeof(env)); 1081 temp.ID = ID; 1082 temp.HotKeyID = HotKeyID; 1083 if (env != NullStr) 1084 strcpy(temp.env, env); 1085 PrfWriteProfileData(fmprof, FM3Str, keyID, NULL, NULL); 1086 PrfWriteProfileData(fmprof, FM3Str, keyHotKeyID, NULL, NULL); 1087 PrfWriteProfileString(fmprof, FM3Str, keyenv, NULL); 980 1088 if (kill_command(temp.title)){ 981 1089 x = (SHORT) WinSendDlgItemMsg(hwnd, … … 993 1101 } 994 1102 } // then do an add 995 if (WinQueryButtonCheckstate(hwnd, CMD_DEFAULT)) 1103 temp.flags = CheckExecutibleFlags(hwnd, 3); 1104 /*if (WinQueryButtonCheckstate(hwnd, CMD_DEFAULT)) 996 1105 temp.flags = 0; 997 1106 else if (WinQueryButtonCheckstate(hwnd, CMD_FULLSCREEN)) … … 1008 1117 temp.flags |= PROMPT; 1009 1118 if (WinQueryButtonCheckstate(hwnd, CMD_ONCE)) 1010 temp.flags |= ONCE; 1119 temp.flags |= ONCE;*/ 1120 *env = 0; 1121 WinQueryDlgItemText(hwnd, CMD_ENVIRON, 1000, env); 1122 bstripcr(env); 1123 if (*env) 1124 strcpy(temp.env, env); 1125 if (!*env && temp.env != NullStr) 1126 strcpy(temp.env, NullStr); 1011 1127 info = add_command(&temp); 1012 1128 if (!info) { … … 1017 1133 1018 1134 else { 1019 CHAR env[1002]; 1020 1021 *env = 0; 1022 WinQueryDlgItemText(hwnd, CMD_ENVIRON, 1000, env); 1023 bstripcr(env); 1024 if (*env) { 1025 PrfWriteProfileString(fmprof, FM3Str, temp.title, env); 1026 } //put item back in original place 1135 //put item back in original place 1027 1136 x = (SHORT) WinSendDlgItemMsg(hwnd, 1028 1137 CMD_LISTBOX, … … 1089 1198 LINKCMDS *info; 1090 1199 1091 DbgMsg(pszSrcFile, __LINE__,"ID %i", cx);1092 1200 list = BuildList(hwnd); 1093 1201 x = 0; 1094 1202 info = cmdhead; 1095 1203 while (info) { 1096 //x++;1097 1204 if (cx < 4300) { 1098 1205 if (info->ID == cx) … … 1108 1215 1109 1216 INT flags; 1110 CHAR env[1002];1111 1217 1112 1218 x--; … … 1119 1225 flags |= SEPARATE; 1120 1226 flags &= ~(KEEP | DIEAFTER); 1121 PrfQueryProfileString(fmprof, FM3Str, info->title, NullStr, env, sizeof(env));1122 1227 if (!strchr(info->pszCmdLine, '%')) { 1123 1228 CHAR *fakelist[2]; … … 1127 1232 ExecOnList(hwnd, 1128 1233 info->pszCmdLine, 1129 flags, env, fakelist, GetPString(IDS_EXECCMDTITLETEXT), 1234 flags, info->env != NullStr ? info->env : NULL, 1235 fakelist, GetPString(IDS_EXECCMDTITLETEXT), 1130 1236 pszSrcFile, __LINE__); 1131 1237 } … … 1141 1247 ExecOnList(hwnd, 1142 1248 info->pszCmdLine, 1143 flags, env, fakelist, GetPString(IDS_EXECCMDTITLETEXT), 1249 flags, info->env != NullStr ? info->env : NULL, 1250 fakelist, GetPString(IDS_EXECCMDTITLETEXT), 1144 1251 pszSrcFile, __LINE__); 1145 1252 } … … 1148 1255 ExecOnList(hwnd, 1149 1256 info->pszCmdLine, 1150 flags, env, list, GetPString(IDS_EXECCMDTITLETEXT), 1257 flags, info->env != NullStr ? info->env : NULL, 1258 list, GetPString(IDS_EXECCMDTITLETEXT), 1151 1259 pszSrcFile, __LINE__); 1152 1260 else -
trunk/dll/command.h
r1486 r1488 11 11 01 Mar 08 GKY Move from fm3dll.h to here 12 12 22 Jun 08 GKY Moved free_commands here for fortify checking 13 21 Dec 09 GKY Fix the environment so it can be saved, deleted and used consistently. 13 14 14 15 ***********************************************************************/ … … 31 32 PSZ pszCmdLine; 32 33 CHAR *title; 34 CHAR *env; 33 35 ULONG flags; 34 36 ULONG ID; -
trunk/dll/fm3dll2.h
r1486 r1488 31 31 15 Sep 09 SHL Add rescan progress timer 32 32 22 Nov 09 GKY Add LVM.EXE to partition submenu 33 21 Dec 09 GKY Added 20 new hot keys for commands. 33 34 34 35 Align with spaces only - no tabs please … … 524 525 #define IDM_COMMANDNUM18 4319 525 526 #define IDM_COMMANDNUM19 4320 527 #define IDM_COMMANDNUM20 4321 528 #define IDM_COMMANDNUM21 4322 529 #define IDM_COMMANDNUM22 4323 530 #define IDM_COMMANDNUM23 4324 531 #define IDM_COMMANDNUM24 4325 532 #define IDM_COMMANDNUM25 4326 533 #define IDM_COMMANDNUM26 4327 534 #define IDM_COMMANDNUM27 4328 535 #define IDM_COMMANDNUM28 4329 536 #define IDM_COMMANDNUM29 4330 537 #define IDM_COMMANDNUM30 4331 538 #define IDM_COMMANDNUM31 4332 539 #define IDM_COMMANDNUM32 4333 540 #define IDM_COMMANDNUM33 4334 541 #define IDM_COMMANDNUM34 4335 542 #define IDM_COMMANDNUM35 4336 543 #define IDM_COMMANDNUM36 4337 544 #define IDM_COMMANDNUM37 4338 545 #define IDM_COMMANDNUM38 4339 546 #define IDM_COMMANDNUM39 4340 526 547 527 548 #define IDM_QUICKTOOLSTART 4899 -
trunk/dll/fm3res.rc
r1480 r1488 48 48 15 Nov 09 GKY Add ZEROBYTETEXT 49 49 22 Nov 09 GKY Add LVM.EXE to partition submenu 50 21 Dec 09 GKY Added 20 new hot keys for commands. 51 21 Dec 09 GKY Allow command menu reorder without changing the "ID" or hot key for a command. 52 Added load_inicommand to load the IDs from the ini file.(new error strings) 50 53 51 54 ***********************************************************************/ … … 614 617 "(", IDM_COMMANDNUM18, SHIFT,CONTROL 615 618 ")", IDM_COMMANDNUM19, SHIFT,CONTROL 619 "1", IDM_COMMANDNUM20, ALT 620 "2", IDM_COMMANDNUM21, ALT 621 "3", IDM_COMMANDNUM22, ALT 622 "4", IDM_COMMANDNUM23, ALT 623 "5", IDM_COMMANDNUM24, ALT 624 "6", IDM_COMMANDNUM25, ALT 625 "7", IDM_COMMANDNUM26, ALT 626 "8", IDM_COMMANDNUM27, ALT 627 "9", IDM_COMMANDNUM28, ALT 628 "0", IDM_COMMANDNUM29, ALT 629 "!", IDM_COMMANDNUM30, SHIFT,ALT 630 "@", IDM_COMMANDNUM31, SHIFT,ALT 631 "#", IDM_COMMANDNUM32, SHIFT,ALT 632 "$", IDM_COMMANDNUM33, SHIFT,ALT 633 "%", IDM_COMMANDNUM34, SHIFT,ALT 634 94, IDM_COMMANDNUM35, CHAR,SHIFT,ALT 635 "&", IDM_COMMANDNUM36, SHIFT,ALT 636 "*", IDM_COMMANDNUM37, SHIFT,ALT 637 "(", IDM_COMMANDNUM38, SHIFT,ALT 638 ")", IDM_COMMANDNUM39, SHIFT,ALT 616 639 "k", IDM_HELPKEYS, CONTROL 617 640 "O", IDM_OPENWALK, CONTROL,SHIFT … … 670 693 "(", IDM_COMMANDNUM18, SHIFT,CONTROL 671 694 ")", IDM_COMMANDNUM19, SHIFT,CONTROL 695 "1", IDM_COMMANDNUM20, ALT 696 "2", IDM_COMMANDNUM21, ALT 697 "3", IDM_COMMANDNUM22, ALT 698 "4", IDM_COMMANDNUM23, ALT 699 "5", IDM_COMMANDNUM24, ALT 700 "6", IDM_COMMANDNUM25, ALT 701 "7", IDM_COMMANDNUM26, ALT 702 "8", IDM_COMMANDNUM27, ALT 703 "9", IDM_COMMANDNUM28, ALT 704 "0", IDM_COMMANDNUM29, ALT 705 "!", IDM_COMMANDNUM30, SHIFT,ALT 706 "@", IDM_COMMANDNUM31, SHIFT,ALT 707 "#", IDM_COMMANDNUM32, SHIFT,ALT 708 "$", IDM_COMMANDNUM33, SHIFT,ALT 709 "%", IDM_COMMANDNUM34, SHIFT,ALT 710 94, IDM_COMMANDNUM35, CHAR,SHIFT,ALT 711 "&", IDM_COMMANDNUM36, SHIFT,ALT 712 "*", IDM_COMMANDNUM37, SHIFT,ALT 713 "(", IDM_COMMANDNUM38, SHIFT,ALT 714 ")", IDM_COMMANDNUM39, SHIFT,ALT 672 715 "k", IDM_HELPKEYS, CONTROL 673 716 "T", IDM_SETTARGET, CONTROL,SHIFT … … 2468 2511 IDS_MISSINGTEXT "Some text is missing" 2469 2512 IDS_TOOLHELPTEXTBLANK "You need to provide both button text & help." 2513 IDS_COMMANDSLIMITTITLETEXT "Commands Limit Has Been Reached" 2514 IDS_COMMANDSLIMITREACHEDTEXT "You have used all the IDs (300) available for user added commands. You must delete an existing command before adding a new one." 2470 2515 IDS_COLSELECTEDHELP "This window shows you how many objects\rand how many bytes are selected.\rDrop on me to collect objects.\rClick me for the select menu." 2471 2516 IDS_COLTOTALSHELP "This window shows you how many objects\rand how many bytes are in the Collector.\rDrop on me to collect objects." -
trunk/dll/fm3str.h
r1479 r1488 38 38 15 Sep 09 SHL Add ids for rescan progress messages 39 39 15 Nov 09 GKY Add ZEROBYTETEXT (58) 40 21 Dec 09 GKY Allow command menu reorder without changing the "ID" or hot key for a command. 41 Added load_inicommand to load the IDs from the ini file.(new error strings) 40 42 41 43 ***********************************************************************/ … … 149 151 #define IDS_10SYSTEMVIOTEXT 106 150 152 #define IDS_10SYSTEMMONOTEXT 107 153 #define IDS_COMMANDSLIMITTITLETEXT 108 154 #define IDS_COMMANDSLIMITREACHEDTEXT 109 151 155 #define IDS_COLSELECTEDHELP 110 152 156 #define IDS_COLTOTALSHELP 111 -
trunk/dll/misc.c
r1486 r1488 63 63 22 Jul 09 GKY Check if drives support EAs add driveflag for this 64 64 22 Jul 09 GKY Allow .LONGNAME to be displayed for FAT drives. 65 21 Dec 09 GKY Allow command menu reorder without changing the "ID" or hot key for a command. 66 Added load_inicommand to load the IDs from the ini file. 65 67 66 68 ***********************************************************************/ … … 1320 1322 MPVOID, MPVOID); 1321 1323 WinSendMsg(mit.hwndSubMenu, MM_DELETEITEM, MPFROMSHORT(-1), MPVOID); 1322 //for (x = 0; x < numitems; x++)1323 1324 info = cmdhead; 1324 1325 while (info) { 1325 1326 WinSendMsg(mit.hwndSubMenu, MM_DELETEITEM, 1326 1327 MPFROMSHORT((SHORT) (info->ID)), MPVOID); 1328 x++; 1327 1329 info = info->next; 1330 } 1331 while (numitems != MIT_ERROR) { // Delete items that were deleted from commands since the ID is gone 1332 numitems = (SHORT) WinSendMsg(mit.hwndSubMenu, MM_ITEMIDFROMPOSITION, 1333 MPFROMSHORT((SHORT) 1), MPVOID); 1334 WinSendMsg(mit.hwndSubMenu, MM_DELETEITEM, 1335 MPFROMSHORT(numitems), MPVOID); 1328 1336 } 1329 1337 if (hwndCnr && cmdhead) { … … 1332 1340 while (info) { 1333 1341 1334 1342 CHAR s[CCHMAXPATH + 24]; 1335 1343 1336 1344 sprintf(s, 1337 "%s {%i} %s%s ",1345 "%s {%i} %s%s%s", 1338 1346 info->title, info->ID, 1339 info->HotKeyID ? "\tCtrl + " : NullStr, 1340 info->HotKeyID && info->HotKeyID > 4310 ? "Shift + " : NullStr); 1347 info->HotKeyID && info->HotKeyID < IDM_COMMANDNUM20 ? "\tCtrl + " : NullStr, 1348 info->HotKeyID && info->HotKeyID > IDM_COMMANDNUM19 ? "\tAlt + " : NullStr, 1349 info->HotKeyID && ((info->HotKeyID > IDM_COMMANDNUM9 && 1350 info->HotKeyID < IDM_COMMANDNUM20) || 1351 info->HotKeyID > IDM_COMMANDNUM29) ? "Shift + " : NullStr); 1341 1352 if (info->HotKeyID) 1342 1353 sprintf(&s[strlen(s)], "%d", 1343 (((info->HotKeyID - 4301) % 10) + 1) == 10 ? 0 :1344 ((info->HotKeyID - 4301) % 10) + 1);1345 mi.id = info->ID; //IDM_COMMANDSTART + x;1354 (((info->HotKeyID - IDM_COMMANDNUM0) % 10) + 1) == 10 ? 0 : 1355 ((info->HotKeyID - IDM_COMMANDNUM0) % 10) + 1); 1356 mi.id = info->ID; 1346 1357 mi.afAttribute = (info->flags & ONCE ? MIA_CHECKED : 0) | 1347 1358 (info->flags & PROMPT ? MIA_FRAMED : 0); 1348 1359 mi.afStyle = MIS_TEXT; 1349 if (!(x % 2 4) && x && info->next)1360 if (!(x % 20) && x && info->next) 1350 1361 mi.afStyle |= MIS_BREAK; 1351 1362 WinSendMsg(mit.hwndSubMenu, MM_INSERTITEM, MPFROMP(&mi), MPFROMP(s)); -
trunk/dll/systemf.c
r1480 r1488 27 27 Dos/Win programs from being inserted into the execute dialog with message why. 28 28 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 29 30 30 31 ***********************************************************************/ … … 64 65 static PSZ pszSrcFile = __FILE__; 65 66 67 66 68 //static HAPP Exec(HWND hwndNotify, BOOL child, char *startdir, char *env, 67 69 // 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 76 ULONG 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 } 68 115 69 116 /** -
trunk/dll/systemf.h
r1394 r1488 10 10 11 11 Change log 12 21 Dec 09 GKY Added CheckExecutibleFlags to streamline code in command.c assoc.c & cmdline.c 12 13 13 14 ***********************************************************************/ … … 48 49 EXECARGS; 49 50 51 ULONG CheckExecutibleFlags(HWND hwnd, INT caller); 50 52 INT ExecOnList(HWND hwnd, PSZ command, INT flags, PSZ tpath, 51 53 PSZ *list, PCSZ prompt, PCSZ pszCallingFile, UINT uiLineNumber);
Note:
See TracChangeset
for help on using the changeset viewer.