Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hide Top-Level Form Taskbar button
Message
From
10/07/2001 03:22:29
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Hide Top-Level Form Taskbar button
Miscellaneous
Thread ID:
00528500
Message ID:
00528500
Views:
57
I am attempting to create a top-level form that still has it's caption/title bar but does not appear in the windows taskbar.

I don't want to use Titlebar=0 because it removes the caption and title bar of the form but I want the same effect. I found an API and tons of VB examples but I don't know how to translate it to FoxPro. Here's the VB code. Can anyone help to translate it to FoxPro?

*** VB Code for hiding Taskbar Buttons for forms

Option Explicit
Public Declare Function ShowWindow Lib "user32" _
(ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Public Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex
As Long) _
As Long

'**********************************
'** Constant Definitions:
Public Const WS_EX_APPWINDOW = &H40000
Public Const SW_HIDE = 0
Public Const SW_SHOW = 5
Public Const GWL_EXSTYLE = (-20)

Public Sub ToggleTaskbarButton(hwnd As Long)
Dim lCurrent As Long
Dim lAppWin As Long

lCurrent = GetWindowLong(hwnd, GWL_EXSTYLE)

If lCurrent And WS_EX_APPWINDOW Then
lAppWin = lCurrent And (Not WS_EX_APPWINDOW)
Else
lAppWin = lCurrent Or WS_EX_APPWINDOW
End If

ShowWindow hwnd, SW_HIDE
SetWindowLong hwnd, GWL_EXSTYLE, lAppWin
ShowWindow hwnd, SW_SHOW

End Sub
Craig Person
Next
Reply
Map
View

Click here to load this message in the networking platform