home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1999 April / CD_Shareware_Magazine_31.iso / Free / Prg / e-checker.exe / General.Bas < prev    next >
Encoding:
BASIC Source File  |  1998-08-07  |  3.2 KB  |  106 lines

  1. Attribute VB_Name = "General"
  2. 'Systray
  3. Declare Function Shell_NotifyIconA Lib "SHELL32" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
  4.  
  5. Type NOTIFYICONDATA
  6.      cbSize As Long
  7.      hwnd As Long
  8.      uID As Long
  9.      uFlags As Long
  10.      uCallbackMessage As Long
  11.      hIcon As Long
  12.      szTip As String * 64
  13. End Type
  14.  
  15. Global Const NIM_ADD = &H0& 'constants & flags for NotifyIcons
  16. Global Const NIM_MODIFY = &H1
  17. Global Const NIM_DELETE = &H2
  18. Global Const NIF_MESSAGE = &H1
  19. Global Const NIF_ICON = &H2
  20. Global Const NIF_TIP = &H4
  21. Global Const WM_MOUSEMOVE = &H200
  22. Global NI As NOTIFYICONDATA
  23.  
  24. 'File Dialog Open
  25. Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
  26.  
  27. Type OPENFILENAME
  28.      lStructSize As Long
  29.      hwndOwner As Long
  30.      hInstance As Long
  31.      lpstrFilter As String
  32.      lpstrCustomFilter As String
  33.      nMaxCustFilter As Long
  34.      nFilterIndex As Long
  35.      lpstrFile As String
  36.      nMaxFile As Long
  37.      lpstrFileTitle As String
  38.      nMaxFileTitle As Long
  39.      lpstrInitialDir As String
  40.      lpstrTitle As String
  41.      flags As Long
  42.      nFileOffset As Integer
  43.      nFileExtension As Integer
  44.      lpstrDefExt As String
  45.      lCustData As Long
  46.      lpfnHook As Long
  47.      lpTemplateName As String
  48. End Type
  49.  
  50. 'Constantes y flags para OpenFile Dialog
  51. Global Const OFNFileMustExist = &H1000
  52. Global Const OFNHideReadOnly = &H4
  53. Global Const OFNPathMustExist = &H800
  54. Global Const OFNHelpButton = &H10
  55. Global Const OFNExplorer = &H80000
  56.  
  57. 'Constantes para la comunicacion
  58. Global Const POP3Port = 110
  59.  
  60. 'Opciones de configuracion del programa
  61. Global pop3Host As String
  62. Global pop3User As String
  63. Global pop3Passwd As String
  64. Global Interval As String
  65. Global EmailProgram As String
  66. Global Arguments As String
  67. Global Timeout As String
  68. Global Sound As String
  69. Global Language As Integer
  70. 'Para poder hacer e-mail desde el programa
  71. Declare Function ShellExecute Lib "shell32.dll" Alias _
  72. "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
  73. ByVal lpFile As String, ByVal lpParameters As String, ByVal _
  74. lpDirectory As String, ByVal nShowCmd As Long) As Long
  75.  
  76. 'Para poner el form "always on top"
  77. Declare Function SetWindowPos& Lib "user32" _
  78. (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
  79. ByVal x As Long, ByVal y As Long, ByVal cx As Long, _
  80. ByVal cy As Long, ByVal wFlags As Long)
  81.  
  82. 'Para poder esperar un perφodo de tiempo
  83. Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
  84.  
  85. 'Para poder ejecutar un sonido
  86. Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
  87. Declare Function waveOutGetNumDevs Lib "winmm.dll" () As Long
  88. 'Check if the system has sound card
  89. Function HasSound() As Boolean
  90.     Dim rtn As Long 'declare the needed variables
  91.  
  92.     rtn = waveOutGetNumDevs() 'check for a sound card
  93.  
  94.     HasSound = rtn > 0
  95.     
  96. End Function
  97. 'Play a sound
  98. Sub PlayWarningSound(SoundFile As String)
  99.     Dim rtn As Long
  100.     Const SND_NODEFAULT = &H2
  101.     Const SND_FILENAME = &H20000
  102.     Const SND_ASYNC = &H1
  103.  
  104.     rtn = PlaySound(Sound + Chr$(0), 0&, SND_FILENAME Or SND_NODEFAULT Or SND_ASYNC)
  105. End Sub
  106.