** Reply to message from "Brian Henderson"on Thu, 31 Oct 2002 17:02:48 -0800 Brian: > Instead of running a program from a shortcut to the exe, change the icon for a > shortcut to the DOS program (cmd.exe) and > use a batch file to fire off the app you want to run. I don't know why a > shortcut to cmd.exe will allow a special icon > to show-up on the taskbar, but shortcuts to other .exe files won't. Here's why: it has to do with the type of "Shortcut" you're using. PIFs are for 16-bit DOS/Windows programs, they use COMMAND.COM, and they all display the same "DOS" icon in the SysTray. LNKs are for 32-bit Windows programs, they use CMD.EXE, and they are delighted to show different icons in the SysTray. Now, if you use CMD.EXE as your command processor, and it in turn launches XyWrite, you're going to establish a LNK on your Desktop (because CMD is a 32-bit program). And you do NOT need to use a BATch file -- that gains nothing. Let me break this down into two points, for clarity. First: The command that you should issue in the Shortcut is actually a bit tricky: %windir%\system32\cmd.exe /c editor.exe/e4000 [,alternative_Startup.Int] with "Start in" (or "Working" directory, in a PIF) clearly pointing at Editor's directory. What's so tricky? Well, we haven't specified a d:\path\ to editor.exe in the main command line. Why? Because we want to tell XyWrite to use 4Mb of expanded memory, AND additionally Martin wants to specify an alternative Startup.INT file. You cannot do BOTH with normal syntax. Here's the rule: You can either say: %windir%\system32\cmd.exe /c d:\path\editor.exe /e4000 (note the space between EXE and /E4000 -- normal argument syntax, in other words) or alternatively you say (WITHOUT d:\path\ in front of editor!!): %windir%\system32\cmd.exe /c editor.exe/e4000 ,d:\path\startup2.int (NOTE that there is NO SPACE between EDITOR.EXE and /E4000, and no d:\path\ in front of editor -- if you use a d:\path\, it crashes! This is the format that Martin should use.) It makes sense to say what will NOT work. These all fail (the first crashes at DOS; the second & third load, but won't look for startup2): %windir%\system32\cmd.exe /c d:\path\editor.exe/e4000 %windir%\system32\cmd.exe /c d:\path\editor.exe /e4000 ,d:\path\startup2.int %windir%\system32\cmd.exe /c editor.exe /e4000 ,d:\path\startup2.int In short, the differences are quite subtle, but crucial. Second: If you want you very own icon to illuminate in the SysTray, you have to use a LNK-style Shortcut. These LNK/PIF Shortcut files (if you look for them, you'll find them buried in the bootdrive) are Windows' crappy simulation of a program Object (it's really just a kludge, like so much of Windows). But to use a LNK file, you can't call editor directly. This fails: editor.exe/e4000 ,startup2.int because Windows will make a PIF out of it. Even if you cheat and *start out* with a LNK by writing a Shortcut to, say, CMD.EXE all by itself, then you go into Properties and change the command line from cmd.exe to editor.exe -- guess what! Windows converts the Shortcut into a PIF. No good. So that's why we call an instance of CMD.EXE and make it, in turn, launch EDITOR -- to preserve the LNK. You can assign any legitimate icon to it, either derived from a DLL or EXE or a standalone ICO file, and it will display in the SysTray when editor is running. What do you sacrifice by using a LNK? Not much. You lose the built-in capacity to call alternative CONFIGs and AUTOEXECs -- but you could overcome that with a BATch file, I suppose. Truth is, there's very little reason to use an alternative. Basically the difference is this: the Properties displayed by a LNK on the Desktop are the exact same Properties displayed by a PIF *after* the PIF program is running in a window and you RMB [RightMouseButton] on the SystemMenu (Taskbar) and select Properties. In other words, a PIF offers two different sets of Properties: one displayed by RMBing on the Desktop icon, the other via the SystemMenu when running. Take it from there. Put this in your Tips and Tricks file, Brian. If you comb back through the XyList archives, you'll find thousands of these things. By the way, did you know that the cyberpolice are after you? You sent us a virus, actually two of them, today, and a virus scanner at Pomona University flagged it and sent warnings to the list. Your machine is infected, it would seem. Don't send any attachments to anybody until you clean it up. Your up-to-date AV software ought to be able to handle it -- right? Ahem. For what it's worth, I attach my own XyWrite icon, which I made and converted from OS/2 (during conversion, it acquired a black surround, which I don't much like, but... hey, it's free, and it sure stands out in the SysTray). ----------------------------- Robert Holmgren holmgren@xxxxxxxx ----------------------------- Attachment: xyw.ico
Description: Binary data