1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

UIstuff desiderata

Discussion in 'Plugins' started by Steve Fabian, Jan 24, 2013.

  1. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    Charles:

    1/ MKSC - when the command is used to display properties of existing shortcuts, it would be nice to be able to list only selected ones. A model: option /F of Vince Fatica's WHICHWIN (in sysutils.dll). Suboptions could indicate if all properties displayed should be on a single line, and (for tabular display) the display width of each field (for single line mode only). There should be an option to display the linkfile on the same line, and whether or not it should be shown with or without path (analogous to the fp, fn and fpn fields of PDIR). Another feature could be that not naming a linkfile on the command line implies * (i.e., all) in the same manner as it does in DIR and PDIR.

    2/ @SCINFO - the quoted/unquoted flag should be available as a mnemonic, instead of usable only with the numeric property selectors; there should be a code for linkfile; there should be width selection.

    3/ @SCINFO - even using it inside @SAFEEXP it does not always return the "symbolic command separator" in its symbolic form %+ but converts it to its current definition (sometimes only the first one when there are two in the arguments field.

    TIA!
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    Actually, there is a way to do that already. Precede the letter with a question mark: %@SCINFO[myfile.lnk,?T] (or ?A or ?D or whatever).

    (Why a question mark? For a fairly dumb reason: the function allows you to prepend a forward slash -- which is ignored -- so you can make that arg look even more like an MKSC option. And the question mark happens to be on the same key as the slash.)

    Huh? An option to just return the input filename? Why push it through a function at all, then?

    I don't get this one, either. There are already several internal functions to truncate strings in various ways.
     
  3. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    1/ ? is not very mnemonic to control quoting... BTW, ? and / are on the same key only for English keyboards. For example, Hungarian keyboard puts ? over the comma, / over 6...

    2/ Why push link file name through the function? To be able to select either full pathname or just file name without invoking a separate function, control quoting, and remain independent of the loop control strategy (FOR uses filename, FOR /R uses full pathname...).

    3/ Why format result strings? To avoid using a separate function, and special quoting rules. Analogous to the = parameter in @EVAL.
     
  4. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    I'm putting up a new build which addresses a few of these.

    MKSC has a new option /F: controlling which fields to report. I'm not adding width specifiers, justification, or suchlike; it'd be a lot of work for cosmetic purposes, and I don't really want to reinvent PDIR. You can omit the filespec in display mode only; it will default to all .LNK files (or all .LNK and .PIF files, depending) in the current directory.

    I'm not sure why the %+ is getting expanded sometimes. That's happening in SafeChars, inside a call to ExpandVariables(), for reasons mysterious to me. But UIStuff already has SafeChars-type code built in. I'm adding a bit to @SCINFO to support that.
     
  5. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    Charles:
    Regarding the SCREENRES command - does it check first whether or not the requested screen properties actually require a change? It would seem worthwhile to do that (but not worth a new release a new version just to implement this feature).
     
  6. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    The command calls ChangeDisplaySettingsEx() only if your specified settings would change any of the display width, height, color depth, or refresh rate. If they all match, you'll instead get a message like

    Code:
    NVIDIA GeForce FX 5200 on ViewSonic VE710s-2 is already 1280 x 1024 (32) at  60 Hz
    
     
  7. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    Thanks for the response. However, there are times when you do not want ANY visible output from the SCREENRES command (with the possible exception of error messages); I know it can be done by redirecting the command output, but IMHO it would be simpler if the /Q option would make the command Quiet unconditionally. My present practice is to execute SCREENRES only if a change is actually required (an IF test before executing SCRRENRES), but it is an unnecessary step.
    --
    Steve
     
  8. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    It seems I don't have source for the most recent version here. I'll take a look tomorrow. (Might make it a different option though, as I'd intended /Q specifically to prevent the prompt.)
     
  9. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    A different option, or a /Qx-type suboption, is perfectly fine. Or even /Nx in the style of internal commands of the last few years.
     
  10. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    Hunh. Guess I've already implemented that. Try the /NR option.
     
  11. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    Well, on WinXP SP3 (32b) the /NR does not seem to work using
    UIStuff.dll 0.64.2 2013-01-24@13:34:44 75,264

    This command:
    screenres /q /nr /x:1024 /y:768

    displays:
    on Default monitor is already 1024 x 768 (32) at default refresh rate

    Using only one of /q and /nr does not make any difference. BTW, the first word ("on") is superfluous!
     
  12. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    Got it. Fixed.

    It's missing the name of the video card. Is it also missing when you do e.g. SCREENRES /A ?
     
  13. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    No video adapter identification on my desktop...
     
  14. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    Really? What do you get if you
    Code:
    echo "%@screenres[,5]"
    
    Anything at all between the quote marks?
     
  15. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
  16. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    Well, if the descriptive string is empty, I guess I should fall back on the device name. It's ugly, but better than nothing. I'm putting up a new build which fixes that and another cosmetic issue.

    (So, what kind of video card is this? Something pretty old? Generic? Bet I could, like, totally kick your butt at Quake, dude!)
     
  17. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    My desktop (actually, floor) system is home-built, the AGP video adapter is possibly more than 8 years old. I would need to take the system apart to find out more details, but the "video codec" is Intel Indeo 5.10. That's all the information from Control Panel's "System" applet. The "Display" applet provides no maker or model information, only the list of modes.

    On my Dell D610 laptop the SCREENRES /Q /NR command (when not changing anything) reports
    Mobile Intel(R) 915GM/GMS,910GML Express Chipset Family on Plug and Play Monitor is already 1024 x 768 (32) at 60 Hz
    The options prevent output when there is a change.

    The only difference between the two systems is the adapter and monitor description. Both provide a report when SCREENRES makes no changes, despite the presence of either or both of /NR and /Q options.

    Personally, I'd not want the adapter and monitor descriptions to be displayed unless specifically requested, only the monitor number, and that only for a multimonitor system. Why? It's basically of interest only for visitors accustomed to other systems. The only time a regular user would regularly benefit from adapter/monitor model information is when there is more than one set which are not identical, and there is frequent switching of monitors to adapters, so what was monitor 0 the last time may not be monitor 0 now. I suspect that is a very rare event. On my laptop with internal monitor active only when opened, normal use at home is docked with external monitor, when opened the displays are identical, and SCREENRES /M:1 responds with a monitor not found message.
     
  18. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    If the Display applet can't identify it, then I won't worry too much about my plugin failing to do so.
     
  19. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    Identifying the type of device is not what I complained of. It is that I do not want to see output to say "I didn't need to do anything" when I can suppress the message "I did the job". Total silence is desired (possibly an error message).
     
  20. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,307
    Likes Received:
    39
    /NR does that now.
     
  21. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    Happy to verify that using v0.64 b5 option /NR indeed suppresses output on both of my systems.
     

Share This Page