PeDre wrote:
Hello Barry,
there is a window directly under the Desktop: title "Start", class "Button",
not under 'Shell_TrayWnd'.
You can use 'Microsoft Spy++' to find all windows.
Peter
Peter,
It has been a while since I worked with RB versions of Windows API calls (and I'm not sure I entirely understood it then), so I'm having trouble getting it to work.
Forget the question about finding the OS Version; I think you've given me enough information to handle that. Where I'm having trouble is changing the actual code for the pushbutton for the Hide Start Button and the pushbutton for the Show Start Button.
Here's what the code for the pushbutton for the Hide Start Button was (it works for Windows XP):
Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( lpClassName As CString, lpWindowName As CString ) As Integer
Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" ( hWnd1 As Integer, hWnd2 As Integer, lpsz1 As CString, lpsz2 As Integer ) As Integer
Declare Function ShowWindow Lib "user32.dll" ( hwnd As Integer, nCmdShow As Integer ) As Integer
Dim TaskBar As Integer
Dim StartButton As Integer
Dim ReturnValue As Integer
TaskBar = FindWindow("Shell_TrayWnd", "")
StartButton = FindWindowEx(TaskBar, 0, "button", 0)
ReturnValue =ShowWindow(StartButton, 0)
Here's what the code for the pushbutton for the Show Start Button was (it works for Windows XP):
Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( lpClassName As CString, lpWindowName As CString ) As Integer
Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" ( hWnd1 As Integer, hWnd2 As Integer, lpsz1 As CString, lpsz2 As Integer ) As Integer
Declare Function ShowWindow Lib "user32.dll" ( hwnd As Integer, nCmdShow As Integer ) As Integer
Dim TaskBar As Integer
Dim StartButton as Integer
Dim ReturnValue As Integer
TaskBar = FindWindow("Shell_TrayWnd", "")
StartButton = FindWindowEx(TaskBar, 0, "button", 0)
ReturnValue =ShowWindow(StartButton, 4)
Exactly what changes do I make for it to work with Windows 7? For example, do I replace Shell_TrayWnd with Start or Button or Desktop or something else? (I spent a lot of time with Aaron Ballman's code before I got my code to work, and even then, I'm not sure I got it right, even though it worked.)
Barry Traver