|
|
|
AD: Upgrade ArcaOS to NeoWPS level
- Install original PNG icons drawed by designer, specialized at OS/2 adornation.
- Install eSchemes 2019 to change colors and buttons on desktop.
|
TITLE: Interaction of processes
DATE: 2012-08-11 17:56:09
AUTHOR: Capricorn
Please use online translator go to http://translate.google.com and request the translation of http://ru.ecomstation./showarticle.php?id=273 to your language |
........
..... ..........., ....... ..... .... ... ............. OS (. . .... ... ...... .......... .. ..........) .... ... ...... ............ . .............. .......... .............. ..... ........... ..........., ....... ...... ........ . ....... . OS/2 ... .... .... .......... ......... ..........: ........, ....., ..... (...........) ......, ........ .... . ....... ..... ... .....-..... ....... . ............ ....... .......... .., .. ....... . ..... ...... ......-.. ........ .......... .. ... ......, .......... ............. .... ...... ...... - ........ ........... ...... ......... . .... ............ .. .. .............. .. ......., .......... ...... ....
........
........ ...... ..... ....: ............. .......... . ........ ...... .... 2 .........: "....." . "........". .... ............. ....... . ..., ... ............... ....... ........ ........., ..... .. ......., . .... .., ............ ..... .......... 2 .... .........: ...... . ........
.) ....... .... "event" (".......") ..... ... ...., ..... ......... ...... ..... ........., .... ...... .... ........ ......... .......
......:
/*************/
/* */
/* ....... 1 */
/* */
/*************/
#define INCL_DOS
#include
PSZ szSemName = "\\SEM32\\EVENT"; /* ... ......... ...... ..... ....... \SEM32\ */
HEV hevEvent1 = 0; /* .......... ........ */
if (DosCreateEventSem(szSemName, /* ... ............ ........ */
&hevEvent1, /* .... ..... ......... .......... ........ */
DC_SEM_SHARED, /* ........... ....... */
FALSE)) /* ....... ....... . .......... (.......) ......... */
return 1; /* ....... ....... .. ....... */
/* ... ...-.. ......
.. ..... ....... ...... .... ..... .....
............ (............) ........ */
DosPostEventSem(hevEvent); /* ......... ........ ......... (............) */
/* .......... ...... */
DosCloseEventSem(hevEvent1); /* ........... .. ........ */
/*************/
/* */
/* ....... 2 */
/* */
/*************/
..... (pipes)
[..........]
........... ......
[..........]
.......
... .... ...... .............. ..... .......... - ....... (queues). ... ... .......... ....., ....... ......-.. ........ ......... . ...... .... (pipes). .. ... ......, .......... ............. ..... ..... ....... ........... ....... ........ .., ... ..-........
...., ....... ............ ..... ........ ...... ............ ... ...-.. .......... ....... ......... Presentation Manager'., .. .... ............ ........, ....... .. ..... .. ....... ....... ........ ....... . ..., ... .. ...... .. ........, ....... ..... ........ .. ...... . ...... .........., ........ (FIFO), .. . . ...... ..... (LIFO), . ....., .. ............
....... ...... ............
.... ....., .... ....... (....), ....... .. ....... ....... ........, ....... ....... . ....... ..., ...... (....... .. .........), ......... .. . ..... .... .......... .........., ... ............ ....... ....... ............ .....
......:
/**********************/
/* */
/* ....... 1 (......) */
/* */
/**********************/
#define INCL_DOS
#include
#define QUEUE_FIFO 0 // .......
#define QUEUE_LIFO 1 // ....
#define QUEUE_PRIO 2 // .. ...........
#define MSG_QUIT 0x0001 /* ............. ......... ... .......... ..... */
#define QUEUE_NAME "\\QUEUES\\special.que" /* ... ........
* ...... ..... ....... \QUEUES\
*/
/* ......., ....... ..... ............ ......... */
BOOL processMessage(ULONG ulMessageId, ULONG ulDataSize, PVOID pvData);
int main(void)
.
HQUEUE hQueue; /* .... ..... ....... ..... ....... */
APIRET rc; /* ......... ...... ....... API */
/* ......... ....... */
rc = DosCreateQueue(&hQueue, QUEUE_FIFO, QUE_NAME);
if (rc)
return rc;
/* .... ......... ......... .. ....... */
while(TRUE)
.
REQUESTDATA requestData; /* ......... ... ......... ...... ....... */
ULONG ulDataSize; /* .... ..... ....... ..... .......... ...... */
PVOID pvData; /* .... ..... ........ ...... .. .......... ...... */
rc = DosReadQueue(hQueue, /* ..... ....... */
&requestData, /* ...... ....... */
&ulDataSize, /* ..... .......... ...... */
&pvData, /* .......... ...... */
0, /* ...... ...... ....... .. ....... */
FALSE, /* .... */
0, /* ......... .. ..... */
NULLHANDLE); /* ..... ........-....... .. ..... */
if (rc || requestData.ulData==MSG_QUIT)
break;
processMessage(ulMessageId, ulDataSize, pvData);
.
rc = DosCloseQueue(hQueue); /* ....... ....... */
return rc;
.
/**********************/
/* */
/* ....... 2 (......) */
/* */
/**********************/
#define MSG_QUIT 0x0001 /* ............. ......... ... .......... ..... */
#define QUEUE_NAME "\\QUEUES\\special.que" /* ... ........
* ...... ..... ....... \QUEUES\
#define INCL_DOS
#include
int main(void)
.
HQUEUE hQueue; /* .... ..... ....... ..... ....... */
APIRET rc; /* ......... ...... ....... API */
PID pid; /* ............. ........, .......... ....... */
/* ......... ....... */
rc = DosOpenQueue(&pid, &hQueue, QUE_NAME);
if (rc)
return rc;
rc = DosWriteQueue(hQueue, MSG_QUIT, 0L, NULL, 0L); /* .......... . ....... .........*/
rc = DosCloseQueue(hQueue); /* ......... ....... */
return rc;
.
. ...... ....... .. ...... ....... ....... . ....... ........ ...... ....... ......... ....... . .......... .... ............ .... ......... . .......... ...... (MSG_QUIT). ...... ......., ....... ... ........., ......... .... .......
........ ........, ... ....... DosCloseQueue() .. ...., ....... ..... ........ ... ...... ... ...... ....... ..... ......., ........ . .... ........
... . ... .. ............ ........ ..... .......? .... . ..., ... ... ............. .... .. .......... ..... .... . ........... ....... ....... ... ......, ..... .......... ......... .......... ....... ...... ....... .. ..... ...... ..... ...... .... ...... ....., ..... .... ....... ....... ....... . ..... ........ ... ......... .....-.. ......., .. ....... ...... ....... ...... ............ . ...... ...... ....... ....... ......., .. .. ........., .......... . ....... ... ... . ........ ..... .........
|
Test the program:
|
Weather Widget - view current temperature (forecast for the next few days where available).
|
Comments: Comment this article.
|
The development of software for eComStation is profitable: a) system API is effective and considered. b) The market is not so infinite as Windows. All eCS users know about your product. c) Every developer is influencing on the OS significantly. |
|
|
 |
IBM OS/2 Warp
|