allora.. nel mio programma ho questa funzione
codice:
SetWindowPos hWnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED Or SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOZORDER
ke mi viene gestita da questo modulo
codice:
Option Explicit

Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crey As Byte, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
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_STYLE = (-16)
Private Const GWL_EXSTYLE = (-20)
Private Const WS_CAPTION = &HC00000     'WS_BORDER Or WS_DLGFRAME
Private Const WS_EX_APPWINDOW = &H40000
Private Const WS_EX_TOOLWINDOW = &H80
Private Const WS_EX_TRANSPARENT = &H20
Private Const WS_SYSMENU = &H80000
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const WS_THICKFRAME = &H40000

Private Const WS_EX_LAYERED = &H80000
Private Const LWA_ALPHA = &H2&

Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal CX As Long, ByVal CY As Long, ByVal wFlags As Long) As Long
Private Const SWP_FRAMECHANGED = &H20
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOZORDER = &H4

Global Const WOT_SWP_NOMOVE = 2
Global Const WOT_SWP_NOSIZE = 1
Global Const WOT_FLAGS = WOT_SWP_NOMOVE Or WOT_SWP_NOSIZE
Global Const WOT_HWND_TOPMOST = -1
Global Const WOT_HWND_TOP = 0
Global Const WOT_HWND_NOTOPMOST = -2

'Per regolare la forma XXXX a TOPMOST, usi il seguente codice:
'successo = SetWindowPos(XXXX.hWnd, wot_HWND_TOPMOST, 0, 0, 0, 0,
' _successo < > 0 di rem delle BANDIERINE)

'per ripristinare la forma XXXX a NON-TOPMOST, usi il seguente codice:
'successo = SetWindowPos(XXXX.hWnd, wot_HWND_NOTOPMOST, 0, 0, 0, 0,
' _successo < > 0 di rem delle BANDIERINE)

'Mostro la finestra di windows
Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
    'Selettori di ShowWindow
    Const SW_HIDE = 0
    Const SW_SHOW = 5

Sub extwinONTOP(ewinFORM As Form, locONTOP As Integer)

    Dim succESS As Long, flags As Long
    Dim frmL As Long, frmT As Long, frmW As Long, frmH As Long
    
    frmL = ewinFORM.Left
    frmT = ewinFORM.Top
    frmW = ewinFORM.Width
    frmH = ewinFORM.Height
    
    If locONTOP <> 0 Then
        succESS = SetWindowPos(ewinFORM.hWnd, WOT_HWND_TOPMOST, frmL, frmT, 0, 0, WOT_FLAGS)
    Else
        succESS = SetWindowPos(ewinFORM.hWnd, WOT_HWND_NOTOPMOST, frmL, frmT, 0, 0, WOT_FLAGS)
    End If

    ewinFORM.Show

End Sub


Private Sub SetWindowStyle(ByVal hWnd As Long, ByVal extended_style As Boolean, ByVal style_value As Long, ByVal new_value As Boolean, ByVal brefresh As Boolean)
   
   Dim style_type As Long
   Dim style As Long
   
   If extended_style Then
      style_type = GWL_EXSTYLE
   Else
      style_type = GWL_STYLE
   End If
   
   'Stile corrente
   style = GetWindowLong(hWnd, style_type)
   
   'Aggiorno o rimnuovo i valori
   If new_value Then
      style = style Or style_value
   Else
      style = style And Not style_value
   End If
   
   'Nascondo la finestra se apro task-maneger
   If brefresh Then
      ShowWindow hWnd, SW_HIDE
   End If
   
   'Imposto lo stile
   SetWindowLong hWnd, style_type, style
   
   'Mostro la finestra se apro task-maneger
   If brefresh Then
      ShowWindow hWnd, SW_SHOW
   End If
   
   'Ridisegno la finestra
   SetWindowPos hWnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED Or _
                                     SWP_NOMOVE Or _
                                     SWP_NOSIZE Or _
                                     SWP_NOZORDER
End Sub
Quando ho inserito questo

codice:
Private Declare Function DrawText Lib "User32.dll" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
Private Declare Function GetTickCount Lib "Kernel32.dll" () As Long

Public Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type
mi ha causato un errore, e mi segna errore su Form_Load dove ho la funzione SetWindows.... e mi segna in particolare questo pezzo di funzione: SWP_FRAMECHANGED

Qualcuno sa spiegarmi dove e xke sbaglio?
Grazie e scusate Moderatori per la lunghezza ma non sapevo come mettere il tutto