|
-
Jun 10th, 2000, 01:35 PM
#1
Thread Starter
New Member
I came across this problem in a recent project I was working on....Does anyone know how to do it?
-
Jun 10th, 2000, 03:43 PM
#2
transcendental analytic
There should be good samples on my homepage, i'm not sure i put up that one with hiding and showing, but you put this in the same module
Code:
Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Property Get Windowvisible(hwnd&) As Boolean
clockvisible = IsWindowVisible(hwnd)
End Property
Property Let Windowvisible(hwnd&,newvalue As Boolean)
ShowWindow hwnd, newvalue * -5
End Property
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 11th, 2000, 09:36 AM
#3
Here's a good code I used for my program:
Code:
Declare Function findwindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Declare Function showWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) 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
Public Const SW_HIDE = 0
Public Const SW_SHOW = 5
Private Const WM_COMMAND As Long = &H111
Private Const MIN_ALL As Long = 419
Private Const MIN_ALL_UNDO As Long = 416
'Hide
Dim progman&
Dim shelldlldefview&
Dim syslistview&
progman& = FindWindow("progman", vbNullString)
shelldlldefview& = FindWindowEx(progman&, 0&, "shelldll_defview", vbNullString)
syslistview& = FindWindowEx(shelldlldefview&, 0&, "syslistview32", vbNullString)
tray& = findwindow("Shell_TrayWnd")
X = showWindow(syslistview&, SW_HIDE)
Y = showWindow(tray&, SW_HIDE)
-----
'Show
Dim progman&
Dim shelldlldefview&
Dim syslistview&
progman& = FindWindow("progman", vbNullString)
shelldlldefview& = FindWindowEx(progman&, 0&, "shelldll_defview", vbNullString)
syslistview& = FindWindowEx(shelldlldefview&, 0&, "syslistview32", vbNullString)
tray& = findwindow("Shell_TrayWnd")
Y = showWindow(syslistview&, SW_SHOW)
X = showWindow(tray&, SW_SHOW)
'To minimize any window that remains..:
Public Sub MinimizeAll()
On Error Resume Next
Dim lngHwnd As Long
lngHwnd = findwindow("Shell_TrayWnd", vbNullString)
Call PostMessage(lngHwnd, WM_COMMAND, MIN_ALL, 0&)
End Sub
'Restore all windows:
Public Sub RestoreAll()
Dim lngHwnd As Long
lngHwnd = findwindow("Shell_TrayWnd", vbNullString)
Call PostMessage(lngHwnd, WM_COMMAND, MIN_ALL_UNDO, 0&)
End Sub
'Restore your program only:
Public Sub RestoreMe()
Dim i
Dim lngHwnd As Long
i = hWnd 'form's hWnd
lngHwnd = findwindow(i, vbNullString)
Call PostMessage(lngHwnd, WM_COMMAND, MIN_ALL_UNDO, 0&)
End Sub
Hope that helps.
[Edited by Matthew Gates on 06-11-2000 at 10:42 PM]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|