如何把窗体钉在桌面上就是不能最小话,鼠标点击任务栏的[显示桌面]或Win+D键也不会消失的Form  这个Form可以响应event
   不Top Form       请大家帮帮我,,,thank you......

解决方案 »

  1.   

    Public Const HWND_TOP = 0
    Public Const HWND_BOTTOM = 1
    Public Const HWND_TOPMOST = -1
    Public Const HWND_NOTOPMOST = -2Public Const SWP_NOSIZE = &H1
    Public Const SWP_NOMOVE = &H2
    Public Const SWP_NOZORDER = &H4
    Public Const SWP_NOREDRAW = &H8'设置当前窗体到最上面,且不可移动、改变大小
    SetWindowPos Form.nWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE
      

  2.   

    网上有人说  用 Createparams 重载函数  可以实现  但怎么用啊
      

  3.   

    貌似可以设置为桌面SysListview的子窗体
      

  4.   

    Private Const HWND_TOP = 0
    Private Const HWND_BOTTOM = 1
    Private Const HWND_TOPMOST = -1
    Private Const HWND_NOTOPMOST = -2Private Const SWP_NOSIZE = &H1
    Private Const SWP_NOMOVE = &H2
    Private Const SWP_NOZORDER = &H4
    Private Const SWP_NOREDRAW = &H8Private 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 Sub Form_Load()    '设置当前窗体到最上面,且不可移动、改变大小
        SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVEEnd Sub
      

  5.   

    Option Explicit
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
    Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
    '设置窗体的BorderStyle属性为1
    Private Sub Form_Load()
        Dim mhwnd As Long
        mhwnd = FindWindow("Progman", "Program Manager")
        mhwnd = FindWindowEx(mhwnd, 0&, "SHELLDLL_DefView", vbNullString)
        mhwnd = FindWindowEx(mhwnd, 0&, "SysListView32", vbNullString)
        SetParent Me.hwnd, mhwnd
    End Sub
      

  6.   

    谢谢你 rainstormmaster(暴风雨 v2.0)  每次都是你把问题 给我解决    实再是高