Dunque:ciao a tutti.Posto anzitutto il codice


codice:
Const WS_EX_STATICEDGE = &H20000
Const WS_EX_TRANSPARENT = &H20&
Const WS_CHILD = &H40000000
Const WS_EX_DLGMODALFRAME = &H1&
Const CW_USEDEFAULT = &H80000000
Const SW_NORMAL = 1
Const RDW_INTERNALPAINT = &H2
Const WM_PAINT = &HF&

Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetActiveWindow Lib "user32" () As Long
Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
'Private Declare Function RedrawWindow Lib "user32" (ByVal hwnd As Long, lprcUpdate As RECT, ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As Long
'Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long


Private Sub Form_Load()
Dim desktop As RECT
Call GetWindowRect(GetDesktopWindow(), desktop)
larghezzaschermo = desktop.Right - desktop.Left
altezzaschermo = desktop.Bottom - desktop.Top
'MsgBox larghezzaschermo & "x" & altezzaschermo
posizionex = (larghezzaschermo - 200) \ 2
posizioney = (altezzaschermo - 200) \ 2
MsgBox posizionex & "x" & posizioney
mWnd = CreateWindowEx(WS_EX_STATICEDGE Or WS_EX_TRANSPARENT, "MESSAGE", "Hello World !", WS_EX_DLGMODALFRAME, 0, 0, 200, 200, 0, 0, GetActiveWindow, ByVal 0)
Call MoveWindow(mWnd, posizionex, posizioney, 200, 200, bRepaint:=True)
ShowWindow mWnd, SW_NORMAL
End Sub

Private Sub Form_Unload(Cancel As Integer)
DestroyWindow mWnd
End Sub


Per motivi che non sto qui a dilungarmi nel descrivere,devo fare tutto via api.Quindi la richiesta è e rimane sulle api.
In pratica il codice precedente crea una piccola finestra e la centra nello schermo.Il mio problema è però che sta finestra rimane invisibile a meno di non cliccarci sopra(ma bisogna trovarla nel desktop!),e anche se la si trascina,se passa nell'area di un'altra finestra assume il suo contenuto.In pratica è un problema di refresh della finestra.Come devo fare(sempre via api) a fare in modo che venga sempre..come dire..painted?
Grazie mille mille mille facciamo quattromila