Results 1 to 4 of 4

Thread: Win 98 destop shortcut for Win 95

Hybrid View

  1. #1
    New Member
    Join Date
    Nov 00
    Posts
    6

    Question

    At work my wife has to use Win 95 but at home she has gotten use to Win 98. She asked me to make her a little app that will sit in the system tray that will act like the desktop icon that is in the shortcut part of the status bar in Win 98.

    Something that will just bring the desktop forward no matter what else is open.

    I tried getting the hwnd of the desktop which works fine. Then I tried to use the SetWindowPos API to set its z order to be on top but it does not work.

    Has anyone done this? it seemd like something simple is escapping me.

    Any help would be appreciated.

  2. #2
    Guest
    Why not just minimize everything and that will show the desktop.


    To minimize all Windows:

    Code:
    Private Declare Function FindWindow Lib "user32" _
    Alias "FindWindowA" (ByVal lpClassName As String, ByVal _
    lpWindowName As String) As Long
    
    Private Declare Function PostMessage Lib "user32" _
    Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As _
    Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    
    Private Const WM_COMMAND As Long = &H111
    Private Const MIN_ALL As Long = 419
    Private Const MIN_ALL_UNDO As Long = 416
    
    
    Private Sub MinimizeAll()
    
        Dim lngHwnd As Long
         lngHwnd = findwindow("Shell_TrayWnd", vbNullString)
        Call PostMessage(lngHwnd, WM_COMMAND, MIN_ALL, 0&)
    
    End Sub
    
      
    Usage
    
    MinimizeAll
    To restore all:

    Code:
    Private Sub RestoreAll()
      
        Dim lngHwnd As Long
        lngHwnd = findwindow("Shell_TrayWnd", vbNullString)
        Call PostMessage(lngHwnd, WM_COMMAND, MIN_ALL_UNDO, 0&)
      
    End Sub
    
    Usage
    
    RestoreAll
    And when you minimize all programs, it minimizes your program as well, here is how to restore just your program:

    Code:
    Private Sub Restore(frm As Form)
    
      Dim lngHwnd As Long
      lngHwnd = frm.hwnd
      Call PostMessage(lngHwnd, WM_COMMAND, MIN_ALL_UNDO, 0&)
      
    End Sub
    
    
    Usage
    
    Restore Me

  3. #3
    Cyberman Lord Orwell's Avatar
    Join Date
    Feb 01
    Location
    Elberfeld, IN
    Posts
    7,419
    The button activates a command built into internet explorer 4.0 and higher. copy the button onto a floppy disk and install it on her desktop. It should work.

    matthew, couldn't you just broadcast a minimize to every open window by setting the handle to HWND_BROADCAST?
    Public Const HWND_BROADCAST = &HFFFF&
    I never tried it, but i thought that this is what it was for.
    I thought about using it for something similar. The only problem i could come up with is that it would restore windows that were minimized to start with. You could read the handle of all top-level windows into an array, then run a test on each one to see if it is already minimized. If so, remove it from the first array. Then when you restore, it will only restore windows it has listed in the array.
    As a side note, i have win 95 on another machine. I have the "Internet Explorer desktop enhancements" package installed that comes with full versions of internet explorer 4.0 and higher. It gives you active desktop, etc. and the button she wants emulated.
    Last edited by Lord Orwell; Mar 1st, 2001 at 04:34 AM.
    John Lord, Evansville Indiana

  4. #4
    New Member
    Join Date
    Nov 00
    Posts
    6
    Thanks guys,

    I was able to write a very small app that I put into the startup folder.

    It sits in the system tray and it just atlernates between minimize all and minimize all undo upon clicking it.

    Thanks again for helping me attack this from a different angle.

Posting Permissions

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