1 Replies - 2459 Views - Last Post: 17 December 2012 - 02:02 PM Rate Topic: -----

#1 Eminence  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 16-December 12

Task - Show/Hide windows in taskbar with instance swap functionality

Posted 16 December 2012 - 06:08 PM

Hey all,

I'm trying to create show and hide buttons in Access that will hide all open windows and create sort of an 'instance' or 'group' every time I click hide, then probably through the use of a list box I need to be able to manage those instances and toggle which is shown or hidden. I'm really new to programming and I'm basically just learning through reading forum posts. Below is what I have so far, it would be great to get some insight as to where I'm going wrong and what direction I need to head in next.

I'm trying to start by just getting the windows to show and hide in the taskbar with the use of two buttons (show/hide), I'm not getting any errors though. I've read that apparently that can happen when trying to use API calls?


Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
  (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
  (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_APPWINDOW = &H40000

Private Sub Command1_Click()
Dim WindowsFlags
WindowsFlags = SetWindowLong(hWnd, GWL_EXSTYLE, Style)    'get current flags
NewFlags = WindowsFlags And Not WS_EX_APPWINDOW
SetWindowLong Me.hWnd, GWL_EXSTYLE, (NewFlags)
' hide this form from the taskbar
  SetWindowLong Me.hWnd, GWL_EXSTYLE, (GetWindowLong(hWnd, _
    GWL_EXSTYLE) And Not WS_EX_APPWINDOW)
    
End Sub


Private Sub Command2_Click()
Dim WindowsFlags
WindowsFlags = SetWindowLong(hWnd, GWL_EXSTYLE, Style)    'get current flags
NewFlags = WindowsFlags And Not WS_EX_APPWINDOW
SetWindowLong Me.hWnd, GWL_EXSTYLE, (NewFlags)
' show this form from the taskbar
  SetWindowLong Me.hWnd, GWL_EXSTYLE, (GetWindowLong(hWnd, _
    GWL_EXSTYLE) Or WS_EX_APPWINDOW)
End Sub

This post has been edited by Atli: 16 December 2012 - 06:29 PM
Reason for edit:: Use [code] tags when posting code.


Is This A Good Question/Topic? 0
  • +

Replies To: Task - Show/Hide windows in taskbar with instance swap functionality

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10376
  • View blog
  • Posts: 38,415
  • Joined: 27-December 08

Re: Task - Show/Hide windows in taskbar with instance swap functionality

Posted 17 December 2012 - 02:02 PM

Please don't duplicate post.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1