notify.inc 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2007 Free Pascal development team.
  4. See the file COPYING.FPC, included in this distribution,
  5. for details about the copyright.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. **********************************************************************
  10. Automatically converted by H2Pas 1.0.0 from notify.h
  11. The following command line parameters were used:
  12. -d
  13. -c
  14. -w
  15. notify.h
  16. }
  17. {$ifdef read_interface}
  18. const
  19. NOTIFICATION_EVENT_NONE = 0;
  20. NOTIFICATION_EVENT_TIME_CHANGE = 1;
  21. NOTIFICATION_EVENT_SYNC_END = 2;
  22. NOTIFICATION_EVENT_ON_AC_POWER = 3;
  23. NOTIFICATION_EVENT_OFF_AC_POWER = 4;
  24. NOTIFICATION_EVENT_NET_CONNECT = 5;
  25. NOTIFICATION_EVENT_NET_DISCONNECT = 6;
  26. NOTIFICATION_EVENT_DEVICE_CHANGE = 7;
  27. NOTIFICATION_EVENT_IR_DISCOVERED = 8;
  28. NOTIFICATION_EVENT_RS232_DETECTED = 9;
  29. NOTIFICATION_EVENT_RESTORE_END = 10;
  30. NOTIFICATION_EVENT_WAKEUP = 11;
  31. NOTIFICATION_EVENT_TZ_CHANGE = 12;
  32. NOTIFICATION_EVENT_MACHINE_NAME_CHANGE = 13;
  33. NOTIFICATION_EVENT_LAST = NOTIFICATION_EVENT_MACHINE_NAME_CHANGE;
  34. {
  35. * String passed on the command line when an app is run as the result
  36. * of a call to CeRunAppAtTime().
  37. }
  38. APP_RUN_AT_TIME = 'AppRunAtTime';
  39. {
  40. * Prefix of the command line when the user requests to run the application
  41. * that "owns" a notification. It is followed by a space, and the
  42. * stringized version of the notification handle.
  43. }
  44. APP_RUN_TO_HANDLE_NOTIFICATION = 'AppRunToHandleNotification';
  45. {
  46. * Strings passed on the command line when an event occurs that the
  47. * app has requested via CeRunAppAtEvent. Note that some of these
  48. * strings will be used as the command line *prefix*, since the rest
  49. * of the command line will be used as a parameter.
  50. }
  51. APP_RUN_AFTER_TIME_CHANGE = 'AppRunAfterTimeChange';
  52. APP_RUN_AFTER_SYNC = 'AppRunAfterSync';
  53. APP_RUN_AT_AC_POWER_ON = 'AppRunAtAcPowerOn';
  54. APP_RUN_AT_AC_POWER_OFF = 'AppRunAtAcPowerOff';
  55. APP_RUN_AT_NET_CONNECT = 'AppRunAtNetConnect';
  56. APP_RUN_AT_NET_DISCONNECT = 'AppRunAtNetDisconnect';
  57. APP_RUN_AT_DEVICE_CHANGE = 'AppRunDeviceChange';
  58. APP_RUN_AT_IR_DISCOVERY = 'AppRunAtIrDiscovery';
  59. APP_RUN_AT_RS232_DETECT = 'AppRunAtRs232Detect';
  60. APP_RUN_AFTER_RESTORE = 'AppRunAfterRestore';
  61. APP_RUN_AFTER_WAKEUP = 'AppRunAfterWakeup';
  62. APP_RUN_AFTER_TZ_CHANGE = 'AppRunAfterTzChange';
  63. APP_RUN_AFTER_EXTENDED_EVENT = 'AppRunAfterExtendedEvent';
  64. {
  65. * Strings passed on the end of the command line for the event,
  66. * NOTIFICATION_EVENT_DEVICE_CHANGE. The general form will be
  67. * "/op devicename" for instance "/ADD COM2:"
  68. }
  69. NOTIFY_DEVICE_ADD = '/ADD';
  70. NOTIFY_DEVICE_REMOVE = '/REMOVE';
  71. {
  72. * @struct CE_USER_NOTIFICATION | User Notification Structure
  73. *
  74. * @comm This structure is passed in to <f CeGetUserNotificationPreferences>.
  75. * Initial settings are used to populate the dialog. If the function
  76. * returns TRUE, the returned settings should be saved, and considered when
  77. * calling <f CeSetUserNotification>. Settings for hardware not on the
  78. * current device will be ignored.
  79. *
  80. * It is also used when calling <f CeSetUserNotification>, to describe
  81. * what should happen when the notification time is reached.
  82. }
  83. { PUN_* flags. Flags not valid on a given }
  84. { hardware platform will be ignored. }
  85. PUN_LED = 1; {@flag PUN_LED | LED flag. Set if the LED should be }
  86. { flashed when the notification occurs. }
  87. PUN_VIBRATE = 2; {@flag PUN_VIBRATE | Vibrate flag. Set if the device should }
  88. { be vibrated. }
  89. PUN_DIALOG = 4; {@flag PUN_DIALOG | Dialog flag. Set if a dialog should be }
  90. { displayed (the app must provide title and text }
  91. { when calling <f CeSetUserNotification>). }
  92. PUN_SOUND = 8; {@flag PUN_SOUND | Sound flag. Set if the sound specified }
  93. { in pwszSound should be played. }
  94. PUN_REPEAT = 16; {@flag PUN_REPEAT | Sound repeat flag. Set if the sound }
  95. { specified in pwszSound should be repeated progressively. }
  96. PUN_PRIVATE = 32; {@flag PUN_PRIVATE | Dialog box z-order flag. Set if the }
  97. { notification dialog box should come up behind the password. }
  98. {@field Action Flags. Any combination of the }
  99. {@field Dialog Title. Required if PUN_DIALOG is set, ignored }
  100. { otherwise. Ignored by CeGetUserNotificationPreferences(). }
  101. {@field Dialog Text. Required if PUN_DIALOG is set, ignored }
  102. { otherwise. Ignored by CeGetUserNotificationPreferences(). }
  103. {@field Sound string as supplied to sndPlaySound. }
  104. { CeSetUserNotification() ignores it if PUN_SOUND is not set. }
  105. {@field Max Sound string length. Specifies the }
  106. { maximum length of the string that can be copied }
  107. { into the pwszSound buffer by }
  108. { CeGetUserNotificationPreferences(). }
  109. { Should be at least MAX_PATH * sizeof(TCHAR). }
  110. { Ignored by CeSetUserNotification(). }
  111. { union }
  112. {@field Reserved. Must be NULL or a pointer to }
  113. { platform-defined expansion structure. }
  114. { The first dword of the structure }
  115. { indicates the size of the structure. }
  116. { void *pExpansion; }
  117. { ; }
  118. type
  119. UserNotificationType = record
  120. ActionFlags : DWORD;
  121. pwszDialogTitle : ^TCHAR;
  122. pwszDialogText : ^TCHAR;
  123. pwszSound : ^TCHAR;
  124. nMaxSound : DWORD;
  125. dwReserved : DWORD;
  126. end;
  127. CE_USER_NOTIFICATION = UserNotificationType;
  128. PCE_USER_NOTIFICATION = ^UserNotificationType;
  129. const
  130. CNT_EVENT = 1; {@flag CNT_EVENT | System event notification }
  131. CNT_TIME = 2; {@flag CNT_TIME | Time-based notification }
  132. CNT_PERIOD = 3; {@flag CNT_PERIOD | Time-based notification is active for }
  133. { time period between stStart and stEnd }
  134. CNT_CLASSICTIME = 4; {@flag CNT_CLASSICTIME | equivalent to using (obsolete) }
  135. { CeSetUserNotification function - standard command line is }
  136. { supplied. lpszArguments must be NULL }
  137. {@field dwType Notification type }
  138. {@field dwEvent - type of event if dwType == CNT_EVENT }
  139. {@field lpszApplication - name of application to execute }
  140. {@field lpszArguments - command line (sans app name) }
  141. {@field stStartTime - begin of notification period }
  142. {@field stEndTime - end of notification period }
  143. type
  144. UserNotificationTrigger = record
  145. dwSize : DWORD;
  146. dwType : DWORD;
  147. dwEvent : DWORD;
  148. lpszApplication : ^TCHAR;
  149. lpszArguments : ^TCHAR;
  150. stStartTime : SYSTEMTIME;
  151. stEndTime : SYSTEMTIME;
  152. end;
  153. CE_NOTIFICATION_TRIGGER = UserNotificationTrigger;
  154. PCE_NOTIFICATION_TRIGGER = ^UserNotificationTrigger;
  155. { }
  156. { Application name can be prefixed with the following strings to specify different }
  157. { named objects rather than an application. The action varies depending on the prefix. }
  158. { In case of named event, the event gets signaled. }
  159. { }
  160. const
  161. NAMED_EVENT_PREFIX_TEXT = '\\.\Notifications\NamedEvents\';
  162. NAMED_EVENT_PREFIX_LEN = 30;
  163. CNS_SIGNALLED = 1;
  164. type
  165. UserNotificationInfoHeader = record
  166. hNotification : HANDLE;
  167. dwStatus : DWORD;
  168. pcent : ^CE_NOTIFICATION_TRIGGER;
  169. pceun : ^CE_USER_NOTIFICATION;
  170. end;
  171. CE_NOTIFICATION_INFO_HEADER = UserNotificationInfoHeader;
  172. PCE_NOTIFICATION_INFO_HEADER = ^UserNotificationInfoHeader;
  173. { Declarations of User Notification APIs. }
  174. { C++ extern C conditionnal removed }
  175. {__cplusplus }
  176. { @CESYSGEN IF GWES_NOTIFY }
  177. function CeGetUserNotificationPreferences(hWndParent:HWND; lpNotification:PCE_USER_NOTIFICATION):BOOL;external KernelDLL name 'CeGetUserNotificationPreferences';
  178. function CeSetUserNotificationEx(hNotification:HANDLE; pcnt:PCE_NOTIFICATION_TRIGGER; pceun:PCE_USER_NOTIFICATION):HANDLE;external KernelDLL name 'CeSetUserNotificationEx';
  179. function CeClearUserNotification(hNotification:HANDLE):BOOL;external KernelDLL name 'CeClearUserNotification';
  180. function CeGetUserNotification(hNotification:HANDLE; cBufferSize:DWORD; pcBytesNeeded:LPDWORD; pBuffer:LPBYTE):BOOL;external KernelDLL name 'CeGetUserNotification';
  181. function CeGetUserNotificationHandles(rghNotifications:PHANDLE; cHandles:DWORD; pcHandlesNeeded:LPDWORD):BOOL;external KernelDLL name 'CeGetUserNotificationHandles';
  182. { Obsolete; provided to maintain compatibility only }
  183. function CeSetUserNotification(hNotification:HANDLE; pwszAppName:pTCHAR; var lpTime:SYSTEMTIME; lpUserNotification:PCE_USER_NOTIFICATION):HANDLE;external KernelDLL name 'CeSetUserNotification';
  184. function CeRunAppAtTime(pwszAppName:pTCHAR; var lpTime:SYSTEMTIME):BOOL;external KernelDLL name 'CeRunAppAtTime';
  185. function CeRunAppAtEvent(pwszAppName:pTCHAR; lWhichEvent:LONG):BOOL;external KernelDLL name 'CeRunAppAtEvent';
  186. function CeHandleAppNotifications(pwszAppName:pTCHAR):BOOL;external KernelDLL name 'CeHandleAppNotifications';
  187. {$endif read_interface}