Results 1 to 1 of 1

Thread: Hide Desktop

  1. #1

    Thread Starter
    Addicted Member spyk3's Avatar
    Join Date
    Apr 2009
    Location
    Dothan, AL
    Posts
    218

    Hide Desktop

    A really simple class I made for another program that is easy to you use, there might be something's within it's events you might want to change. For example, as is, it will take whatever form you launch it with and remove it from being topmost, also, you can enter the name (or any part of) another window/process that you want to take topmost and it will pass it to that. So if those aren't feautures you're interest in, just go to region " Event Subs " and remove the first event entirely(write your own if you want) and remove the following lines from second event:
    a Code:
    1. GetWindowRect(MyBase.Handle, MYr)
    2.             SetWindowPos(MyBase.Handle, hWndEnum.HWND_NOTOPMOST, MYr.rLeft, MYr.rTop, 0, 0, SWPenum.TOPMOST_FLAGS)
    Do that, and you will have the VERY base class of hiding the desktop.
    Just build (as usual) then add refrence to the dll or just use the form in your project.
    Use of this class is very simple:

    Establish class:
    establishClass Code:
    1. ' if you just used form or if you added refrence and remembered to put Import tag at top of your form
    2. Public hideDesk As hideDesktop

    On FormLoad Event:
    onFormLoad Code:
    1. hideDesk = New hideDesktop(Me.Handle, "NotePad")
    2.  ' Obviously replace notepad with whatever other process you want, or just leave it blank like so...
    3. hideDesk = New hideDesktop(Me.Handle)
    4.  
    5.  ' then
    6.  
    7. hideDesk.hide(hideDesktop.hideWhat.Desktop) = True

    On FormClosed Event
    onFormClose Code:
    1. hideDesk.hide(hideDesktop.hideWhat.Desktop) = False        
    2. hideDesk.Dispose()
    Attached Files Attached Files
    Last edited by spyk3; Mar 18th, 2010 at 03:51 PM. Reason: Forgot Attachment

Posting Permissions

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



Click Here to Expand Forum to Full Width