| 2552 | |
| 2553 | |
| 2554 | static int inputBoxWinConsole( |
| 2555 | char * aoBuff , |
| 2556 | char const * aTitle , /* NULL or "" */ |
| 2557 | char const * aMessage , /* NULL or "" may NOT contain \n nor \t */ |
| 2558 | char const * aDefaultInput ) /* "" , if NULL it's a passwordBox */ |
| 2559 | { |
| 2560 | char lDialogString[MAX_PATH_OR_CMD]; |
| 2561 | char lDialogFile[MAX_PATH_OR_CMD]; |
| 2562 | FILE * lIn; |
| 2563 | int lResult; |
| 2564 | |
| 2565 | strcpy(lDialogFile, getenv("TEMP")); |
| 2566 | strcat(lDialogFile, "\\tinyfd.txt"); |
| 2567 | strcpy(lDialogString , "echo|set /p=1 >" ) ; |
| 2568 | strcat(lDialogString, lDialogFile); |
| 2569 | strcat( lDialogString , " & " ) ; |
| 2570 | |
| 2571 | strcat( lDialogString , "dialog " ) ; |
| 2572 | if ( aTitle && strlen(aTitle) ) |
| 2573 | { |
| 2574 | strcat(lDialogString, "--title \"") ; |
| 2575 | strcat(lDialogString, aTitle) ; |
| 2576 | strcat(lDialogString, "\" ") ; |
| 2577 | } |
| 2578 | |
| 2579 | strcat(lDialogString, "--backtitle \"") ; |
| 2580 | strcat(lDialogString, "tab: move focus") ; |
| 2581 | if ( ! aDefaultInput ) |
| 2582 | { |
| 2583 | strcat(lDialogString, " (sometimes nothing, no blink nor star, is shown in text field)") ; |
| 2584 | } |
| 2585 | |
| 2586 | strcat(lDialogString, "\" ") ; |
| 2587 | |
| 2588 | if ( ! aDefaultInput ) |
| 2589 | { |
| 2590 | strcat( lDialogString , "--insecure --passwordbox" ) ; |
| 2591 | } |
| 2592 | else |
| 2593 | { |
| 2594 | strcat( lDialogString , "--inputbox" ) ; |
| 2595 | } |
| 2596 | strcat( lDialogString , " \"" ) ; |
| 2597 | if ( aMessage && strlen(aMessage) ) |
| 2598 | { |
| 2599 | strcat(lDialogString, aMessage) ; |
| 2600 | } |
| 2601 | strcat(lDialogString,"\" 10 60 ") ; |
| 2602 | if ( aDefaultInput && strlen(aDefaultInput) ) |
| 2603 | { |
| 2604 | strcat(lDialogString, "\"") ; |
| 2605 | strcat(lDialogString, aDefaultInput) ; |
| 2606 | strcat(lDialogString, "\" ") ; |
| 2607 | } |
| 2608 | |
| 2609 | strcat(lDialogString, "2>>"); |
| 2610 | strcpy(lDialogFile, getenv("TEMP")); |
| 2611 | strcat(lDialogFile, "\\tinyfd.txt"); |
no test coverage detected