VB Code:
  1. Option Explicit
  2. 'Always on top stuff
  3. Private Const HWND_TOPMOST = -1
  4. Private Const SWP_NOSIZE = &H1
  5. Private Const SWP_NOMOVE = &H2
  6. Private Const SWP_NOACTIVATE = &H10
  7. Private Const SWP_SHOWWINDOW = &H40
  8.  
  9. Private Declare Sub SetWindowPos Lib "user32" ( _
  10.     ByVal hwnd As Long, _
  11.     ByVal hWndInsertAfter As Long, _
  12.     ByVal x As Long, _
  13.     ByVal y As Long, _
  14.     ByVal cx As Long, _
  15.     ByVal cy As Long, _
  16.     ByVal wFlags As Long _
  17. )
  18. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
  19. ByVal lpClassName As String, _
  20. ByVal lpWindowName As String _
  21. ) As Long
  22.  
  23. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
  24. ByVal hwnd As Long, _
  25. ByVal wMsg As Long, _
  26. ByVal wParam As Long, _
  27. lParam As Any _
  28. ) As Long
  29.  
  30. Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" ( _
  31. ByVal hWnd1 As Long, _
  32. ByVal hWnd2 As Long, _
  33. ByVal lpsz1 As String, _
  34. ByVal lpsz2 As String _
  35. ) As Long
  36. Dim hWndFrm As Long
  37. Dim hWndtxtBox As Long
  38.  Dim strCaptionFrm As String
  39.  Dim strClassNameTxtBox As String
  40.  Dim strCaptionTxtBox As String
  41.  
  42. Private Sub cmdStart_Click()
  43. 'make window always on top
  44.  SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or _
  45.     SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
  46.  'set the system-wide low level mouse hook
  47.  Call SetMouseHook
  48.  hWndFrm = FindWindow(vbNullString, strCaptionFrm)
  49.  hWndtxtBox = FindWindowEx(hWndFrm, 0, strClassNameTxtBox, strCaptionTxtBox)
  50. End Sub
  51.  
  52.  
  53. Private Sub Form_Load()
  54. strCaptionFrm = "icopmsgAIM"
  55. strClassNameTxtBox = txtclassname.Text
  56. strCaptionTxtBox = txtcaption.Text
  57. End Sub
  58.  
  59. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  60.  Call RemoveMouseHook
  61. End Sub

still nothing.man this is way hard for such a simple thing.