Results 1 to 12 of 12
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    NT's equivalent of desktop.scf

    Hi

    What is NT's equivalent of Windows 2000's "desktop.scf"? (That is, what do you execute to minimise all applications?)

    Thanks for your help
    Dale

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: NT's equivalent of desktop.scf

    If you have a Windows-enahnced keyoboard (one with the little MS flag next to the space bar) you can press Win+M to accomplish this. Alternately, if you can locate a copy of IE4, you can install the Active Desktop, which will enable the shell extensions that allow this button to work. It must BE IE4, though, because the Active Desktop is not an option in subsequent versions of Internet Explorer.
    -Mark

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: NT's equivalent of desktop.scf

    Thanks, Mark. But I want to do it programmatically. In Windows 2000, you can execute "Desktop.scf" and all applications get minimised. I'm looking for the equivalent executable in Windows NT.

    Do you know what it is?

    Thanks
    Dale

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: NT's equivalent of desktop.scf

    Dale, as I understand it that was a new extension enabled by the active desktop.

    If you'll recall, when NT 4.0 and Windows 95 were at their prime, there was no such thing as an Active Desktop (and when it came out it was bug-ridden). Then, all of a sudden, Netscape had the gall to come up with something better and Microsoft had to not only stomp them, but foist their browser everywhere - and hence the integration into the Windows shell, which we now take for granted.

    DESKTOP.SCF has been around since the very first time anyone ever mixed IE and OS (they should have let someone else drive because the original implementation was designed by a drunken fool). But it had to be added to Windows 95 and NT 4.0.

    When you say that you want to do this programatically, which is your language of choice? If you're calling this in a BAT file, I think you're stuck. But there are other options if you're writing actual code and not scripting.
    -Mark

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: NT's equivalent of desktop.scf

    Thanks, Mark

    I want to put a button on a custom dialog box (created using Visual Basic for Word).

    I presume there's an executable, somewhere. Otherwise, what functionality does the Quick Launch icon (and the WindowsKey+M) use?

    Thanks again for your help
    Dale

  6. #6
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: NT's equivalent of desktop.scf

    Sorry about the delay getting back to you, Dale. Take a look at this page from MSDN. I wasn't able to find much detail on how the shell commands work, but this might do it for you. <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16>
    -Mark

  7. #7
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: NT's equivalent of desktop.scf

    Hi,
    It's a little bit of a kludge, but the following should work from VBA:
    <pre>Private Declare Sub keybd_event Lib "user32" ( _
    ByVal bVk As Byte, _
    ByVal bScan As Byte, _
    ByVal dwFlags As Long, _
    ByVal dwExtraInfo As Long)

    Const KEYEVENTF_KEYUP = &H2
    Const VK_LWIN = &H5B

    Private Sub Command1_Click()
    ' 77 is the character code for the letter 'M'
    Call keybd_event(VK_LWIN, 0, 0, 0)
    Call keybd_event(77, 0, 0, 0)
    Call keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0)
    End Sub
    </pre>

    It's basically a glorified SendKeys macro using API calls, but it does the job! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Regards,
    Rory

    Microsoft MVP - Excel

  8. #8
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: NT's equivalent of desktop.scf

    Thanks, Rory and Mark

    I tried your code, Rory, and it works like a bought one.

  9. #9
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: NT's equivalent of desktop.scf

    Dale,
    To use Mark's suggestion you need to set a reference to the Microsoft Shell Controls and Automation object library. You can then use something like:
    <pre>Sub MinimiseAllWins()
    Dim oShell As Shell
    Set oShell = New Shell
    oShell.MinimizeAll
    set oShell = nothing
    End Sub
    </pre>

    Alternatively, you can do it without setting the reference by using late binding, something like this:
    <pre>Sub MinimiseAllWins()
    Dim oShell As Object
    Set oShell = CreateObject("Shell.Application")
    oShell.MinimizeAll
    set oShell = Nothing
    End Sub
    </pre>

    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  10. #10
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: NT's equivalent of desktop.scf

    Thanks, Rory. They work fine in Word 2000.

    But, I can't get them to work in Word 97/NT. For example, the second one gives this message ""ActiveX component can't create object". Do I need to set up a "Reference"?

    Dale

  11. #11
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: NT's equivalent of desktop.scf

    Which version of IE do you have on the NT4 machine? It needs to be 4 or later to provide the correct version of the shell32.dll I believe.
    Regards,
    Rory

    Microsoft MVP - Excel

  12. #12
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: NT's equivalent of desktop.scf

    It's IE5.5, Rory, so that doesnt' seem to be the problem.

    I wonder if there's a "Reference" missing. (I don't know enough about these things myself, so don't know what's likely to be important.)

    Thanks for your help
    Dale

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •