Ryan's District
November 22, 2008, 02:22:01 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: You are not allowed to view links.
Register or Login
How to Unlock Nokia mobile Phones

You are not allowed to view links.
Register or Login
Request any TV Show / series / Episodes / movie and we will get it for you for free

 
   Home   Help Search Chat Calendar Chess Shop Login Register  
Digg This!
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: How to Hide a Non-Visual Basic Window or Icon  (Read 3934 times)
0 Members and 1 Guest are viewing this topic.
ben2ong2
Quality Poster
Paid
Hero Member
*****

Reputation: 17
Offline Offline

Gender: Male
Posts: 2374
9976.80 RD$

View Inventory
Send Money to ben2ong2

View Profile Awards
« on: October 07, 2006, 04:01:23 PM »

PRODUCT :Microsoft Visual Basic for Windows
PROD/VER:1.00 2.00 3.00
OPER/SYS:WINDOWS
KEYWORDS:kbprg kbcode

----------------------------------------------------------------------
The following information applies to:

 - Standard and Professional Editions of Microsoft Visual Basic for
   Windows, versions 2.0 and 3.0
 - Microsoft Professional Toolkit for Visual Basic 1.0 for Windows
----------------------------------------------------------------------

SUMMARY
=======

Occasionally, it is desirable to hide a window from a Visual Basic
application that is not owned by the Visual Basic application. For example,
when using the GRAPH.VBX custom control provided with the Microsoft
Professional Toolkit for Visual Basic version 1.0 for Windows and with the
Professional Edition of Visual Basic version 2.0 for Windows, an icon
appears at the bottom of the screen for the graphics server. This icon
represents a program that is a support module for the graph control and so
serves no direct purpose for the user. You can hide the icon by issuing two
Windows API calls.

MORE INFORMATION
================

The FindWindow and ShowWindow Windows APIs can be used to hide a
window. FindWindow uses the title on the top of the window to get a
handle that can then be used by ShowWindow. ShowWindow can perform
several different operations. In this case it makes a window invisible.

The following example hides the Graphics Server icon started by the Graph
control. You can use this same technique to hide any window currently
active in Windows.

Step-by-Step Example
--------------------
1. Start Visual Basic or from the File menu, choose New Project (ALT, F, N)
   if Visual Basic is already running. Form1 is created by default.

2. From the File menu, choose Add File. In the Files box, select the
   GRAPH.VBX custom control file. The GRAPH tool appears in the Toolbox.
   This starts the Graphics Server at the bottom of your screen.

3. Add a command button (Command1) to Form1.

4. Enter the following code into the global module taking care to enter
   each Declare statement entirely on one, single line:

  Declare Function FindWindow Lib "User" (ByVal lpClassName As Any,
      ByVal lpWindowName As Any) As Integer
   Declare Function ShowWindow Lib "User" (ByVal hWnd As Integer,
      ByVal nCmdShow As Integer) As Integer

5. Enter the following code into the Command1 click event procedure:

   Sub Command1_Click()
      Dim Handle As Integer
      Dim WindowName As String

      WindowName = "Graphics Server"
      Const SW_Hide = 0

      Handle = FindWindow(0&, WindowName)
      X% = ShowWindow(Handle, SW_Hide)
   End Sub

6. Press F5 to run the application.

When you choose the Command1 button, the Graphics Server icon becomes
invisible.

Additional reference words: 1.00 2.00 3.00
KBCategory: kbprg kbcode
KBSubcategory: APrgOther

=============================================================================

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS
PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.  MICROSOFT DISCLAIMS
ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO
EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.  SOME STATES DO NOT ALLOW THE EXCLUSION
OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES
SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1995.
Logged

You are not allowed to view links.
Register or Login
Free Paid Survey & Home Business Resources.

You are not allowed to view links.
Register or Login
Free Article Directory | Quality Content
Ryan's District
« on: October 07, 2006, 04:01:23 PM »

 Logged
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

Archive - WAP2 - WAP - imode
Sponsors: RAYAN.tv
-

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 1.658 seconds with 30 queries.

Google visited last this page Today at 04:42:03 AM