我想让自己的程序运行后始终为顶级窗口,无论焦点是否存在,怎么样能实现呢?希望提供代码,嘿嘿

解决方案 »

  1.   

    http://download.cqwin.com/soft/program/article/vb/vb357.html
      

  2.   

    模块:Public 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
    Public Const HWND_TOPMOST = -1Public Function OnTop(ByVal hWnd As Long, ByVal frmlef As Long, ByVal frmtop As Long, ByVal frmwid As Long, ByVal frmhei As Long)
    SetWindowPos hWnd, HWND_TOPMOST, frmlef / Screen.TwipsPerPixelX, frmtop \ Screen.TwipsPerPixelY, frmwid \ Screen.TwipsPerPixelX, frmhei \ Screen.TwipsPerPixelY, 0
    End Function窗体:
    private sub form_load()
    call ontop(me.hwnd,me.left,me.top,me.width,me.height)
    end sub
      

  3.   

    http://download.cqwin.com/soft/program/article/vb/vb357.html 
    在XP下运行会溢出