MiniGUI API Reference (MiniGUI-Standalone)  v5.0.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
window.h
Go to the documentation of this file.
1 //
3 // IMPORTANT NOTICE
4 //
5 // The following open source license statement does not apply to any
6 // entity in the Exception List published by FMSoft.
7 //
8 // For more information, please visit:
9 //
10 // https://www.fmsoft.cn/exception-list
11 //
13 
57 /*
58  * $Id: window.h 13674 2010-12-06 06:45:01Z wanzheng $
59  *
60  * MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
61  * pSOS, ThreadX, NuCleus, OSE, and Win32.
62  */
63 
64 #ifndef _MGUI_WINDOW_H
65 #define _MGUI_WINDOW_H
66 
67 #include "common.h"
68 
69 #include <stddef.h>
70 #include <stdlib.h>
71 
72 #ifdef _MGHAVE_VIRTUAL_WINDOW
73 #include <pthread.h>
74 #include <semaphore.h>
75 #endif
76 
77 #ifdef HAVE_POLL
78 #include <poll.h>
79 #endif
80 
81 #ifdef __cplusplus
82 extern "C" {
83 #endif /* __cplusplus */
84 
90 /* Definitions of common messages. */
91 #define MSG_NULLMSG 0x0000
92 #define MSG_SYNCMSG 0x0000
93 
99 /* Group 1 from 0x0001 to 0x000F, the mouse messages. */
100 #define MSG_FIRSTMOUSEMSG 0x0001
101 
124 #define MSG_LBUTTONDOWN 0x0001
125 
145 #define MSG_LBUTTONUP 0x0002
146 
166 #define MSG_LBUTTONDBLCLK 0x0003
167 
187 #define MSG_MOUSEMOVE 0x0004
188 
211 #define MSG_RBUTTONDOWN 0x0005
212 
232 #define MSG_RBUTTONUP 0x0006
233 
253 #define MSG_RBUTTONDBLCLK 0x0007
254 
276 #define MSG_MBUTTONDOWN 0x0008
277 
299 #define MSG_MBUTTONUP 0x0009
300 
320 #define MSG_MBUTTONDBLCLK 0x000A
321 
322 #define MSG_NCMOUSEOFF 0x000A
323 
343 #define MSG_NCLBUTTONDOWN 0x000B
344 
364 #define MSG_NCLBUTTONUP 0x000C
365 
385 #define MSG_NCLBUTTONDBLCLK 0x000D
386 
406 #define MSG_NCMOUSEMOVE 0x000E
407 
427 #define MSG_NCRBUTTONDOWN 0x000F
428 
448 #define MSG_NCRBUTTONUP 0x0010
449 
469 #define MSG_NCRBUTTONDBLCLK 0x0011
470 
490 #define MSG_NCMBUTTONDOWN 0x0012
491 
511 #define MSG_NCMBUTTONUP 0x0013
512 
532 #define MSG_NCMBUTTONDBLCLK 0x0014
533 
534 #define MSG_LASTMOUSEMSG 0x0014
535 
543 /* Group 2 from 0x0015 to 0x001F, the key messages. */
544 #define MSG_FIRSTKEYMSG 0x0015
545 
568 #define MSG_KEYDOWN 0x0015
569 
596 #define MSG_CHAR 0x0016
597 
616 #define MSG_KEYUP 0x0017
617 
636 #define MSG_SYSKEYDOWN 0x0018
637 
656 #define MSG_SYSCHAR 0x0019
657 
676 #define MSG_SYSKEYUP 0x001A
677 
678 
679 /* keyboard longpress supported */
680 
694 #define MSG_KEYLONGPRESS 0x001B
695 
710 #define MSG_KEYALWAYSPRESS 0x001C
711 
737 #define MSG_KEYSYM 0x001D
738 
761 #define MSG_UTF8CHAR 0x001E
762 
769 #define DEF_LPRESS_TIME 200
770 
777 #define DEF_APRESS_TIME 1000
778 
783 #define DEF_INTERVAL_TIME 200
784 
785 extern DWORD __mg_key_longpress_time;
786 extern DWORD __mg_key_alwayspress_time;
787 extern DWORD __mg_interval_time;
788 
793 #define SetKeyLongPressTime(time) \
794  do { \
795  __mg_key_longpress_time = time; \
796  } while (0)
797 
802 #define SetKeyAlwaysPressTime(time) \
803  do { \
804  __mg_key_alwayspress_time = time; \
805  } while (0)
806 
811 #define SetIntervalTime(time) \
812  do { \
813  __mg_interval_time = time; \
814  } while (0)
815 
816 #define MSG_LASTKEYMSG 0x001F
817 
825 /* Group 3 from 0x0020 to 0x005F, User-machine Interaction messages. */
826 #define MSG_FIRSTPOSTMSG 0x0020
827 
852 #define MSG_SETCURSOR 0x0020
853 
854  #define HT_MASK 0xFF
855 
856  #define HT_UNKNOWN 0x00
857  #define HT_OUT 0x01
858  #define HT_MENUBAR 0x02
859  #define HT_TRANSPARENT 0x03
860 
861  #define HT_BORDER 0x04
862  #define HT_CLIENT 0x0C
863 
864  #define HT_NEEDCAPTURE 0x10
865  #define HT_ICON 0x14
866  #define HT_CLOSEBUTTON 0x15
867  #define HT_MAXBUTTON 0x16
868  #define HT_MINBUTTON 0x17
869  #define HT_HSCROLL 0x18
870  #define HT_VSCROLL 0x19
871 
872  #define HT_DRAGGABLE 0x20
873  #define HT_CAPTION 0x20
874 
875  /*indicate cursor at border */
876  #define HT_BORDER_MASK 0x28
877  #define HT_BORDER_TOP 0x28
878  #define HT_BORDER_BOTTOM 0x29
879  #define HT_BORDER_LEFT 0x2A
880  #define HT_BORDER_RIGHT 0x2B
881 
882  /*indicate cursor at border corner*/
883  #define HT_CORNER_MASK 0x2C
884  #define HT_CORNER_TL 0x2C
885  #define HT_CORNER_TR 0x2D
886  #define HT_CORNER_BL 0x2E
887  #define HT_CORNER_BR 0x2F
888 
889  /*new scrollbar hittest value
890  * can be AND'ed with HT_NEEDCAPTURE*/
891  #define HT_SB_MASK 0x50
892 
893  #define HT_SB_LEFTARROW 0x50
894  #define HT_SB_RIGHTARROW 0x51
895  #define HT_SB_LEFTSPACE 0x52
896  #define HT_SB_RIGHTSPACE 0x53
897  #define HT_SB_HTHUMB 0x54
898 
899  #define HT_SB_VMASK 0x58
900 
901  #define HT_SB_UPARROW 0x58
902  #define HT_SB_DOWNARROW 0x59
903  #define HT_SB_UPSPACE 0x5a
904  #define HT_SB_DOWNSPACE 0x5b
905  #define HT_SB_VTHUMB 0x5c
906 
907  #define HT_SB_UNKNOWN 0x5f
908 
909 /*user defined hittest code are 0x80 ~ 0x8F*/
910 #define HT_USER_MASK 0x80
911 
912 
918 #define MSG_NCHITTEST 0x0021
919 
926 #define MSG_HITTEST MSG_NCHITTEST
927 
932 #define MSG_CHANGESIZE 0x0022
933 
934 /* reserved */
935 #define MSG_QUERYNCRECT 0x0023
936 
941 #define MSG_QUERYCLIENTAREA 0x0024
942 
966 #define MSG_SIZECHANGING 0x0025
967 
990 #define MSG_SIZECHANGED 0x0026
991 
1008 #define MSG_CSIZECHANGED 0x0027
1009 
1020 #define MSG_SETFOCUS 0x0030
1021 
1032 #define MSG_KILLFOCUS 0x0031
1033 
1042 #define MSG_MOUSEACTIVE 0x0032
1043 
1052 #define MSG_ACTIVE 0x0033
1053 
1058 #define MSG_CHILDHIDDEN 0x0034
1059  #define RCTM_CLICK 1
1060  #define RCTM_KEY 2
1061  #define RCTM_MESSAGE 3
1062  #define RCTM_SHOWCTRL 4
1063 
1088 #define MSG_ACTIVEMENU 0x0040
1089 
1107 #define MSG_DEACTIVEMENU 0x0041
1108 
1119 #define SB_LINEUP 0x01a
1120 
1126 #define SB_LINEDOWN 0x02
1127 
1133 #define SB_LINELEFT 0x03
1134 
1140 #define SB_LINERIGHT 0x04
1141 
1147 #define SB_PAGEUP 0x05
1148 
1154 #define SB_PAGEDOWN 0x06
1155 
1161 #define SB_PAGELEFT 0x07
1162 
1168 #define SB_PAGERIGHT 0x08
1169 
1175 #define SB_THUMBPOSITION 0x09
1176 
1182 #define SB_THUMBTRACK 0x0A
1183 
1189 #define SB_TOP 0x0B
1190 
1196 #define SB_BOTTOM 0x0C
1197 
1203 #define SB_ENDSCROLL 0x0D
1204 
1235 #define MSG_HSCROLL 0x0042
1236 
1265 #define MSG_VSCROLL 0x0043
1266 
1279 #define MSG_NCSETCURSOR 0x0044
1280 
1296 #define MSG_MOUSEMOVEIN 0x0050
1297 
1303 #define MSG_WINDOWDROPPED 0x0051
1304 
1305 #define MSG_LASTPOSTMSG 0x005F
1306 
1314  /* Group 4 from 0x0060 to 0x007F, the creation messages. */
1315 #define MSG_FIRSTCREATEMSG 0x0060
1316 
1352 #define MSG_CREATE 0x0060
1353 
1382 #define MSG_NCCREATE 0x0061
1383 
1384 /*Not use*/
1385 #define MSG_INITPANES 0x0062
1386 #define MSG_DESTROYPANES 0x0063
1387 
1401 #define MSG_DESTROY 0x0064
1402 
1403 /* Not use */
1404 #define MSG_NCDESTROY 0x0065
1405 
1413 #define MSG_CLOSE 0x0066
1414 
1415 /* Not use */
1416 #define MSG_NCCALCSIZE 0x0067
1417 
1418 /*
1419  * Not implemented, this message is reserved for future use.
1420  *
1421  * \def MSG_MAXIMIZE
1422  * \brief Indicates the user has clicked the maximizing box on the caption.
1423  *
1424  * This message is sent to the window when the user has clicked the maximizing
1425  * box on the caption of the window.
1426  */
1427 #define MSG_MAXIMIZE 0x0068
1428 
1429 /*
1430  * Not implemented, this message is reserved for future use.
1431  *
1432  * \def MSG_MINIMIZE
1433  * \brief Indicates the user has clicked the minimizing box on the caption.
1434  *
1435  * This message is sent to the window when the user has clicked the
1436  * minimizing box on the caption of the window.
1437  */
1438 #define MSG_MINIMIZE 0x0069
1439 
1440 /*
1441  * Not implemented, this message is reserved for future use.
1442  *
1443  * \def MSG_HELP
1444  * \brief Indicates the user has clicked the help box on the caption.
1445  *
1446  * This message is sent to the window when the user has clicked the
1447  * help box on the caption of the window.
1448  */
1449 #define MSG_HELP 0x006A
1450 
1451 #define MSG_LASTCREATEMSG 0x006F
1452 
1481  /* Group 4 from 0x0070 to 0x009F, the extra input messages. */
1482 #define MSG_FIRSTEXTRAINPUTMSG 0x0070
1483 
1484 #define AXIS_SCROLL_INVALID 0
1485 #define AXIS_SCROLL_VERTICAL 1
1486 #define AXIS_SCROLL_HORIZONTAL 2
1487 
1488 #define AXIS_SOURCE_INVALID 0
1489 #define AXIS_SOURCE_WHEEL 1
1490 #define AXIS_SOURCE_FINGER 2
1491 #define AXIS_SOURCE_CONTINUOUS 3
1492 #define AXIS_SOURCE_WHEEL_TILT 4
1493 
1515 #define MSG_EXIN_AXIS 0x0070
1516 
1535 #define MSG_EXIN_BUTTONDOWN 0x0071
1536 
1555 #define MSG_EXIN_BUTTONUP 0x0072
1556 
1569 #define MSG_EXIN_TOUCH_DOWN 0x0073
1570 
1577 #define MSG_EXIN_TOUCH_UP 0x0074
1578 
1591 #define MSG_EXIN_TOUCH_MOTION 0x0075
1592 
1599 #define MSG_EXIN_TOUCH_CANCEL 0x0076
1600 
1619 #define MSG_EXIN_TOUCH_FRAME 0x0077
1620 
1621 #define SWITCH_INVALID 0
1622 #define SWITCH_LID 1
1623 #define SWITCH_TABLET_MODE 2
1624 
1625 #define SWITCH_STATE_INVALID 0
1626 #define SWITCH_STATE_ON 1
1627 #define SWITCH_STATE_OFF 2
1628 
1644 #define MSG_EXIN_SWITCH_TOGGLE 0x007A
1645 
1657 #define MSG_EXIN_GESTURE_SWIPE_BEGIN 0x0080
1658 
1674 #define MSG_EXIN_GESTURE_SWIPE_UPDATE 0x0081
1675 
1689 #define MSG_EXIN_GESTURE_SWIPE_END 0x0082
1690 
1707 #define MSG_EXIN_GESTURE_PINCH_BEGIN 0x0083
1708 
1730 #define MSG_EXIN_GESTURE_PINCH_UPDATE 0x0084
1731 
1750 #define MSG_EXIN_GESTURE_PINCH_END 0x0085
1751 
1764 #define MSG_EXIN_END_CHANGES 0x008F
1765 
1766 #define TABLET_TOOL_X 0
1767 #define TABLET_TOOL_Y 1
1768 #define TABLET_TOOL_PRESSURE 2
1769 #define TABLET_TOOL_DISTANCE 3
1770 #define TABLET_TOOL_TILT_X 4
1771 #define TABLET_TOOL_TILT_Y 5
1772 #define TABLET_TOOL_ROTATION 6
1773 #define TABLET_TOOL_SLIDER 7
1774 #define TABLET_TOOL_SIZE_MAJOR 8
1775 #define TABLET_TOOL_SIZE_MINOR 9
1776 #define TABLET_TOOL_WHEEL 10
1777 
1778 #define TABLET_TOOL_PROXIMITY_STATE_INVALID 0
1779 #define TABLET_TOOL_PROXIMITY_STATE_OUT 1
1780 #define TABLET_TOOL_PROXIMITY_STATE_IN 2
1781 
1782 #define TABLET_TOOL_TIP_INVALID 0
1783 #define TABLET_TOOL_TIP_UP 1
1784 #define TABLET_TOOL_TIP_DOWN 2
1785 
1786 #define TABLET_BUTTON_STATE_INVALID 0
1787 #define TABLET_BUTTON_STATE_RELEASED 1
1788 #define TABLET_BUTTON_STATE_PRESSED 2
1789 
1838 #define MSG_EXIN_TABLET_TOOL_AXIS 0x0090
1839 
1861 #define MSG_EXIN_TABLET_TOOL_PROXIMITY 0x0091
1862 
1884 #define MSG_EXIN_TABLET_TOOL_TIP 0x0092
1885 
1901 #define MSG_EXIN_TABLET_TOOL_BUTTON 0x0093
1902 
1920 #define MSG_EXIN_TABLET_PAD_BUTTON 0x0094
1921 
1922 #define TABLET_PAD_RING_SOURCE_UNKNOWN 0
1923 #define TABLET_PAD_RING_SOURCE_FINGER 1
1924 
1948 #define MSG_EXIN_TABLET_PAD_RING 0x0095
1949 
1950 #define TABLET_PAD_STRIP_SOURCE_UNKNOWN 0
1951 #define TABLET_PAD_STRIP_SOURCE_FINGER 1
1952 
1975 #define MSG_EXIN_TABLET_PAD_STRIP 0x0096
1976 
1990 #define MSG_EXIN_USER_BEGIN 0x009A
1991 
2005 #define MSG_EXIN_USER_UPDATE 0x009B
2006 
2020 #define MSG_EXIN_USER_END 0x009C
2021 
2022 #define MSG_LASTEXTRAINPUTMSG 0x009F
2023 
2031 /* Group 5 from 0x00A0 to 0x00CF, the paint messages. */
2032 #define MSG_FIRSTPAINTMSG 0x00A0
2033 
2058 #define MSG_SHOWWINDOW 0x00A0
2059 
2081 #define MSG_MOVEWINDOW 0x00A1
2082 
2101 #define MSG_ERASEBKGND 0x00B0 /* this is an async message */
2102 
2116 #define MSG_PAINT 0x00B1
2117 
2133 #define MSG_NCPAINT 0x00B2
2134 
2139 #define MSG_NCACTIVATE 0x00B3
2140 
2145 #define MSG_SYNCPAINT 0x00B4
2146 
2147 #define MSG_LASTPAINTMSG 0x00BF
2148 
2156 /* Group 6 from 0x00C0 to 0x00EF, the internal desktop messages. */
2157 #define MSG_FIRSTSESSIONMSG 0x00C0
2158 
2159 #define MSG_STARTSESSION 0x00C0
2160 #define MSG_QUERYENDSESSION 0x00C1
2161 #define MSG_ENDSESSION 0x00C2
2162 #define MSG_REINITSESSION 0x00C3
2163 
2164 /* Since 5.0.0 */
2165 #define MSG_REINITDESKOPS 0x00C4
2166 
2167 #define MSG_ERASEDESKTOP 0x00CE
2168 #define MSG_PAINTDESKTOP 0x00CF
2169 
2170 #define MSG_DT_MOUSEOFF 0x00D0
2171 
2189 #define MSG_DT_LBUTTONDOWN 0x00D1
2190 
2208 #define MSG_DT_LBUTTONUP 0x00D2
2209 
2227 #define MSG_DT_LBUTTONDBLCLK 0x00D3
2228 
2246 #define MSG_DT_MOUSEMOVE 0x00D4
2247 
2266 #define MSG_DT_RBUTTONDOWN 0x00D5
2267 
2285 #define MSG_DT_RBUTTONUP 0x00D6
2286 
2304 #define MSG_DT_RBUTTONDBLCLK 0x00D7
2305 
2324 #define MSG_DT_MBUTTONDOWN 0x00D8
2325 
2343 #define MSG_DT_MBUTTONUP 0x00D9
2344 
2362 #define MSG_DT_MBUTTONDBLCLK 0x00DA
2363 
2364 #define MSG_DT_KEYOFF 0x00CB
2365 
2383 #define MSG_DT_KEYDOWN 0x00E0
2384 
2385 #define MSG_DT_CHAR 0x00E1
2386 
2403 #define MSG_DT_KEYUP 0x00E2
2404 
2405 #define MSG_DT_SYSKEYDOWN 0x00E3
2406 #define MSG_DT_SYSCHAR 0x00E4
2407 #define MSG_DT_SYSKEYUP 0x00E5
2408 
2409 #define MSG_DT_KEYLONGPRESS 0x00E6
2410 #define MSG_DT_KEYALWAYSPRESS 0x00E7
2411 
2412 #define MSG_LASTSESSIONMSG 0x00EF
2413 
2421 /* Group 7 from 0x00F0 to 0x010F, Internal window management messages. */
2422 #define MSG_FIRSTWINDOWMSG 0x00F0
2423 
2424 #define MSG_ADDNEWMAINWIN 0x00F0
2425 #define MSG_REMOVEMAINWIN 0x00F1
2426 #define MSG_MOVETOTOPMOST 0x00F2
2427 #define MSG_SETACTIVEMAIN 0x00F3
2428 #define MSG_GETACTIVEMAIN 0x00F4
2429 #define MSG_SHOWMAINWIN 0x00F5
2430 #define MSG_HIDEMAINWIN 0x00F6
2431 #define MSG_MOVEMAINWIN 0x00F7
2432 #define MSG_SETCAPTURE 0x00F8
2433 #define MSG_GETCAPTURE 0x00F9
2434 
2435 #define MSG_ENDTRACKMENU 0x00FA
2436 #define MSG_TRACKPOPUPMENU 0x00FB
2437 #define MSG_CLOSEMENU 0x00FC
2438 #define MSG_SCROLLMAINWIN 0x00FD
2439 #define MSG_CARET_CREATE 0x00FE
2440 #define MSG_CARET_DESTROY 0x00FF
2441 
2442 #define MSG_ENABLEMAINWIN 0x0100
2443 #define MSG_ISENABLED 0x0101
2444 
2445 #define MSG_SETWINCURSOR 0x0102
2446 
2447 #define MSG_GETNEXTMAINWIN 0x0103
2448 
2449 /* Since 5.0.0 */
2450 #define MSG_SETALWAYSTOP 0x0104
2451 
2452 typedef struct _COMPOSITINGINFO {
2453  int type;
2454  DWORD arg;
2455 } COMPOSITINGINFO;
2456 
2457 /* Since 5.0.0 */
2458 #define MSG_SETCOMPOSITING 0x0105
2459 
2460 /* Since 5.0.0 */
2461 #define MSG_DUMPZORDER 0x0106
2462 
2463 /* Since 5.0.0 */
2464 #define MSG_SETAUTOREPEAT 0x0107
2465 
2466 #define MSG_SHOWGLOBALCTRL 0x010A
2467 #define MSG_HIDEGLOBALCTRL 0x010B
2468 
2469 typedef struct _DRAGINFO {
2470  int location;
2471  int init_x, init_y;
2472 } DRAGINFO;
2473 
2474 /* client to server; wParam: hwnd, lParam: DRAGINFO. */
2475 #define MSG_STARTDRAGWIN 0x010C
2476 /* client to server; wParam: hwnd, lParam: 0L. */
2477 #define MSG_CANCELDRAGWIN 0x010D
2478 
2479 #define MSG_CHANGECAPTION 0x010E
2480 
2481 struct _RECT4MASK;
2482 typedef struct _WINMASKINFO {
2483  int nr_rcs;
2484  struct _RECT4MASK* rcs;
2485 } WINMASKINFO;
2486 
2487 /* Since 5.0.0 */
2488 #define MSG_SETWINDOWMASK 0x010F
2489 
2490 #define MSG_LASTWINDOWMSG 0x010F
2491 
2499 /* Group 8 from 0x0120 to 0x013F, the dialog and control messages. */
2500 #define MSG_FIRSTCONTROLMSG 0x0120
2501 
2533 #define MSG_COMMAND 0x0120
2534 
2539 #define MSG_SYSCOMMAND 0x0121
2540 
2545 #define MSG_GETDLGCODE 0x0122
2546 
2573 #define MSG_INITDIALOG 0x0123
2574 
2575 /*Reserved*/
2576 #define MSG_NEXTDLGCTRL 0x0124
2577 #define MSG_ENTERIDLE 0x0125
2578 
2583 #define MSG_DLG_GETDEFID 0x0126
2584 
2589 #define MSG_DLG_SETDEFID 0x0127
2590 
2591 /* #define MSG_DLG_REPOSITION 0x0128 */
2592 
2599 #define MSG_ISDIALOG 0x0128
2600 
2618 #define MSG_INITPAGE 0x0129
2619 
2640 #define MSG_SHOWPAGE 0x012A
2641 
2661 #define MSG_SHEETCMD 0x012B
2662 
2682 #define MSG_INITCONTAINER 0x012C
2683 
2712 #define MSG_SVCONTCMD 0x012D
2713 
2732 #define MSG_FREEZECTRL 0x012E
2733 
2752 #define MSG_FONTCHANGING 0x0130
2753 
2754 
2762 #define MSG_FONTCHANGED 0x0131
2763 
2783 #define MSG_GETTEXTLENGTH 0x0132
2784 
2808 #define MSG_GETTEXT 0x0133
2809 
2832 #define MSG_SETTEXT 0x0134
2833 
2847 #define MSG_ENABLE 0x0135
2848 
2872 #define MSG_NOTIFICATION 0x0136
2873 
2874 #define MSG_LASTCONTROLMSG 0x013F
2875 
2883 /* Group 9 from 0x0140 to 0x016F, the system messages. */
2884 #define MSG_FIRSTSYSTEMMSG 0x0140
2885 
2886 #define MSG_QUIT 0x0140
2887 
2895 #define MSG_IDLE 0x0142
2896 
2897 #define MSG_TIMEOUT 0x0143
2898 
2914 #define MSG_TIMER 0x0144
2915 
2916 #define MSG_CARETBLINK 0x0145
2917 
2918 #ifdef HAVE_SELECT
2919 
2949 #define MSG_FDEVENT 0x0146
2950 
2951 #endif /* defined HAVE_SELECT */
2952 
2953 #ifdef _MGRM_PROCESSES
2954 
2968 #define MSG_SRVNOTIFY 0x0147
2969 
2970 #define MSG_UPDATECLIWIN 0x0148
2971 
2972 /* Since 5.0.0; the server send this message to the client
2973  if the client moved to a new layer */
2974 #define MSG_LAYERCHANGED 0x0149
2975 
2976 #endif /* defined _MGRM_PROCESSES */
2977 
2978 /* Since 5.0.0: for managing message thread */
2979 #define MSG_MANAGE_MSGTHREAD 0x014A
2980  #define MSGTHREAD_SIGNIN 0x00
2981  #define MSGTHREAD_SIGNOUT 0x01
2982 
2983 /* Since 5.0.0: for calculating the default position */
2984 #define MSG_CALC_POSITION 0x014B
2985 
2999 #define MSG_DOESNEEDIME 0x0150
3000 
3001 /* flag code. */
3002 #define IME_STATUS_REGISTERED 0x0000
3003 #define IME_STATUS_ENABLED 0x0001
3004 #define IME_STATUS_AUTOTRACK 0x0002
3005 #define IME_STATUS_LANGUAGE 0x0003
3006  #define IME_LANGUAGE_UNKNOWN 0x0000
3007  #define IME_LANGUAGE_LATIN 0x0001
3008  #define IME_LANGUAGE_ZHCN 0x0002
3009  #define IME_LANGUAGE_ZHTW 0x0003
3010 #define IME_STATUS_ENCODING 0x0004
3011  #define IME_ENCODING_LOCAL 0x0000
3012  #define IME_ENCODING_UTF8 0x0001
3013 #define IME_STATUS_VERSION 0x0005
3014 #define IME_STATUS_USER_MIN 0x0006
3015 #define IME_STATUS_USER_MAX 0x0020
3016 
3017 /* IME edit type */
3018 #define IME_WINDOW_TYPE_NOT_EDITABLE 0x0000
3019 #define IME_WINDOW_TYPE_EDITABLE 0x0001
3020 #define IME_WINDOW_TYPE_READONLY 0x0002
3021 #define IME_WINDOW_TYPE_PASSWORD 0x0003
3022 
3023 /*Internal use*/
3024 #define MSG_IME_REGISTER 0x0151
3025 #define MSG_IME_UNREGISTER 0x0152
3026 #define MSG_IME_OPEN 0x0153
3027 #define MSG_IME_CLOSE 0x0154
3028 #define MSG_IME_SETSTATUS 0x0156
3029 #define MSG_IME_GETSTATUS 0x0157
3030 #define MSG_IME_SETTARGET 0x0158
3031 #define MSG_IME_GETTARGET 0x0159
3032 #define MSG_IME_SETPOS 0x015A
3033 #define MSG_IME_GETPOS 0x015B
3034 
3035 /* new ime msg. */
3036 #define MSG_IME_SET_TARGET_INFO 0x015C
3037 #define MSG_IME_GET_TARGET_INFO 0x015D
3038 
3039 #define MSG_SHOWMENU 0x0160
3040 #define MSG_HIDEMENU 0x0161
3041 
3042 #define MSG_ADDTIMER 0x0162
3043 #define MSG_REMOVETIMER 0x0163
3044 #define MSG_RESETTIMER 0x0164
3045 
3046 #define MSG_WINDOWCHANGED 0x0165
3047 
3048 #define MSG_BROADCASTMSG 0x0166
3049 
3050 #define MSG_REGISTERWNDCLASS 0x0167
3051 #define MSG_UNREGISTERWNDCLASS 0x0168
3052 #define MSG_NEWCTRLINSTANCE 0x0169
3053 #define MSG_REMOVECTRLINSTANCE 0x016A
3054 #define MSG_GETCTRLCLASSINFO 0x016B
3055 #define MSG_CTRLCLASSDATAOP 0x016C
3056  #define CCDOP_GETCCI 0x01
3057  #define CCDOP_SETCCI 0x02
3058 
3059 #define MSG_REGISTERHOOKFUNC 0x016D
3060 #define MSG_REGISTERHOOKWIN 0x016E
3061 #define MSG_UNREGISTERHOOKWIN 0x016F
3062 
3063 #define MSG_LASTSYSTEMMSG 0x016F
3064 
3072 /* Group 10 from 0x0170 to 0x018F, the menu messages */
3073 #define MSG_FIRSTMENUMSG 0x0170
3074 
3075 /*Internal use*/
3076 #define MSG_INITMENU 0x0170
3077 #define MSG_INITMENUPOPUP 0x0171
3078 #define MSG_MENUSELECT 0x0172
3079 #define MSG_MENUCHAR 0x0173
3080 #define MSG_ENTERMENULOOP 0x0174
3081 #define MSG_EXITMENULOOP 0x0175
3082 #define MSG_CONTEXTMENU 0x0176
3083 #define MSG_NEXTMENU 0x0177
3084 
3085 #define MSG_LASTMENUMSG 0x018F
3086 
3094 #define MSG_FIRSTUSERMSG 0x0800
3095 
3096 
3104 #define MSG_USER 0x0800
3105 
3106 #define MSG_LASTUSERMSG 0xEFFF
3107 
3131 typedef struct _MSG
3132 {
3146 #ifdef _MGHAVE_VIRTUAL_WINDOW
3147  /* pointer to the sync MSG (internal use) */
3148  void* pSyncMsg;
3149 #endif
3150 } MSG;
3151 typedef MSG* PMSG;
3152 
3158 #define PM_NOREMOVE 0x0000
3159 
3165 #define PM_REMOVE 0x0001
3166 
3172 #define PM_NOYIELD 0x0002
3173 
3201 MG_EXPORT BOOL GUIAPI PeekMessageEx (PMSG pMsg, HWND hWnd,
3202  UINT nMsgFilterMin, UINT nMsgFilterMax,
3203  BOOL bWait, UINT uRemoveMsg);
3204 
3223 static inline BOOL GUIAPI GetMessage (PMSG pMsg, HWND hWnd)
3224 {
3225  return PeekMessageEx (pMsg, hWnd, 0, 0, TRUE, PM_REMOVE);
3226 }
3227 
3244 MG_EXPORT BOOL GUIAPI WaitMessage (PMSG pMsg, HWND hMainWnd);
3245 
3260 MG_EXPORT BOOL GUIAPI HavePendingMessage (HWND hMainWnd);
3261 
3288 static inline BOOL GUIAPI PeekMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
3289  UINT nMsgFilterMax, UINT uRemoveMsg)
3290 {
3291  return PeekMessageEx (pMsg, hWnd, nMsgFilterMin, nMsgFilterMax,
3292  FALSE, uRemoveMsg);
3293 }
3294 
3321 MG_EXPORT BOOL GUIAPI PeekPostMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
3322  UINT nMsgFilterMax, UINT uRemoveMsg);
3323 
3345 MG_EXPORT int GUIAPI PostMessage (HWND hWnd, UINT nMsg,
3346  WPARAM wParam, LPARAM lParam);
3347 
3376 MG_EXPORT LRESULT GUIAPI SendMessage (HWND hWnd, UINT nMsg,
3377  WPARAM wParam, LPARAM lParam);
3378 
3394 MG_EXPORT void GUIAPI SetAutoRepeatMessage (HWND hwnd, UINT msg,
3395  WPARAM wParam, LPARAM lParam);
3396 
3397 #ifdef _MGRM_PROCESSES
3398 
3399 #define CLIENTS_TOPMOST -1
3400 #define CLIENTS_ALL -2
3401 #define CLIENTS_EXCEPT_TOPMOST -3
3402 #define CLIENT_ACTIVE -4
3403 
3434 int GUIAPI Send2Client (const MSG* msg, int cli);
3435 
3455 BOOL GUIAPI Send2TopMostClients (UINT nMsg, WPARAM wParam, LPARAM lParam);
3456 
3477 BOOL GUIAPI Send2ActiveWindow (const MG_Layer* layer,
3478  UINT nMsg, WPARAM wParam, LPARAM lParam);
3479 
3480 #endif /* _MGRM_PROCESSES */
3481 
3482 #ifdef _MGHAVE_VIRTUAL_WINDOW
3483 
3505 MG_EXPORT LRESULT GUIAPI PostSyncMessage (HWND hWnd, UINT nMsg,
3506  WPARAM wParam, LPARAM lParam);
3507 
3530 MG_EXPORT LRESULT GUIAPI SendAsyncMessage (HWND hWnd, UINT nMsg,
3531  WPARAM wParam, LPARAM lParam);
3532 
3533 #else /* defined _MGHAVE_VIRTUAL_WINDOW */
3534 
3542 #define SendAsyncMessage SendMessage
3543 
3544 #endif /* not defined _MGHAVE_VIRTUAL_WINDOW */
3545 
3565 MG_EXPORT int GUIAPI SendNotifyMessage (HWND hWnd, UINT nMsg,
3566  WPARAM wParam, LPARAM lParam);
3567 
3587 MG_EXPORT int GUIAPI SendPriorNotifyMessage (HWND hWnd, UINT nMsg,
3588  WPARAM wParam, LPARAM lParam);
3589 
3616 MG_EXPORT int GUIAPI NotifyWindow (HWND hWnd, LINT id, int code,
3617  DWORD dwAddData);
3618 
3633 MG_EXPORT int GUIAPI BroadcastMessage (UINT nMsg, WPARAM wParam, LPARAM lParam);
3634 
3635 #ifdef _MGHAVE_VIRTUAL_WINDOW
3636 
3657 MG_EXPORT int GUIAPI BroadcastMessageInThisThread (UINT nMsg,
3658  WPARAM wParam, LPARAM lParam);
3659 
3660 #else /* defined _MGHAVE_VIRTUAL_WINDOW */
3661 
3662 #define BroadcastMessageInThisThread BroadcastMessage
3663 
3664 #endif /* not defined _MGHAVE_VIRTUAL_WINDOW */
3665 
3678 MG_EXPORT int GUIAPI PostQuitMessage (HWND hWnd);
3679 
3680 #define KBD_LAYOUT_DEFAULT "default"
3681 #define KBD_LAYOUT_FRPC "frpc"
3682 #define KBD_LAYOUT_FR "fr"
3683 #define KBD_LAYOUT_DE "de"
3684 #define KBD_LAYOUT_DELATIN1 "delatin1"
3685 #define KBD_LAYOUT_IT "it"
3686 #define KBD_LAYOUT_ES "es"
3687 #define KBD_LAYOUT_ESCP850 "escp850"
3688 #define KBD_LAYOUT_HEBREW "hebrew"
3689 #define KBD_LAYOUT_ARABIC "arabic"
3690 
3728 MG_EXPORT BOOL GUIAPI SetKeyboardLayout (const char* kbd_layout);
3729 
3730 #ifdef _MGCHARSET_UNICODE
3731 
3732 MG_EXPORT int GUIAPI ToUnicode (UINT keycode, const BYTE* kbd_state,
3733  wchar_t* wcs, int wcs_len, const char* kbd_layout);
3734 
3735 MG_EXPORT int GUIAPI ToAscii (UINT keycode, const BYTE* kbd_state,
3736  WORD* ch, const char* kbd_layout);
3737 
3738 #endif /* _MGCHARSET_UNICODE */
3739 
3760 MG_EXPORT BOOL GUIAPI TranslateMessage (PMSG pMsg);
3761 
3784 MG_EXPORT BOOL GUIAPI TranslateKeyMsgToChar (int message,
3785  WPARAM wParam, LPARAM lParam, WORD *ch);
3786 
3803 MG_EXPORT LRESULT GUIAPI DispatchMessage (PMSG pMsg);
3804 
3817 MG_EXPORT int GUIAPI ThrowAwayMessages (HWND pMainWnd);
3818 
3832 MG_EXPORT BOOL GUIAPI EmptyMessageQueue (HWND hWnd);
3833 
3834 #ifdef _MGHAVE_MSG_STRING
3835 
3850 MG_EXPORT const char* GUIAPI Message2Str (UINT message);
3851 
3868 MG_EXPORT void GUIAPI PrintMessage (FILE* fp, HWND hWnd,
3869  UINT nMsg, WPARAM wParam, LPARAM lParam);
3870 
3871 #endif /* defined _MGHAVE_MSG_STRING */
3872 
3875 #ifdef HAVE_SELECT
3876 
3907 #define MAX_NR_LISTEN_FD 4
3908 
3909 #ifdef WIN32
3910 #ifndef POLLIN
3911 #define POLLIN 0x001
3912 #endif
3913 
3914 #ifndef POLLOUT
3915 #define POLLOUT 0x004
3916 #endif
3917 
3918 #ifndef POLLERR
3919 #define POLLERR 0x008
3920 #endif
3921 
3922 #endif /* WIN32 */
3923 
3950 MG_EXPORT BOOL GUIAPI RegisterListenFD (int fd, int type,
3951  HWND hwnd, void* context);
3952 
3967 MG_EXPORT BOOL GUIAPI UnregisterListenFD (int fd);
3968 
3971 #endif /* defined HAVE_SELECT */
3972 
3978 #define HOOK_OP_MASK 0x00FF
3979 #define HOOK_GOON 0x0000
3980 #define HOOK_STOP 0x0001
3981 
3982 #define HOOK_EVENT_MASK 0xFF00
3983 #define HOOK_EVENT_KEY 0x0100
3984 #define HOOK_EVENT_MOUSE 0x0200
3985 #define HOOK_EVENT_EXTRA 0x0400
3986 
3987 
4009 typedef int (* MSGHOOK) (void* context, HWND dst_wnd,
4010  UINT msg, WPARAM wparam, LPARAM lparam);
4011 
4044 MG_EXPORT MSGHOOK GUIAPI RegisterEventHookFunc (int event_type,
4045  MSGHOOK hook, void* context);
4046 
4063 static inline MSGHOOK GUIAPI RegisterKeyMsgHook (void* context, MSGHOOK hook)
4064 {
4065  return RegisterEventHookFunc (HOOK_EVENT_KEY, hook, context);
4066 }
4067 
4084 static inline MSGHOOK GUIAPI RegisterMouseMsgHook (void* context, MSGHOOK hook)
4085 {
4086  return RegisterEventHookFunc (HOOK_EVENT_MOUSE, hook, context);
4087 }
4088 
4121 MG_EXPORT BOOL GUIAPI RegisterEventHookWindow (HWND hwnd, DWORD flags);
4122 
4138 MG_EXPORT BOOL GUIAPI UnregisterEventHookWindow (HWND hwnd);
4139 
4157 MG_EXPORT HWND GUIAPI RegisterKeyHookWindow (HWND hwnd, DWORD flag);
4158 
4176 MG_EXPORT HWND GUIAPI RegisterMouseHookWindow (HWND hwnd, DWORD flag);
4177 
4178 #ifndef _MGRM_THREADS
4179 
4196 typedef int (* SRVEVTHOOK) (PMSG pMsg);
4197 
4216 MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
4217 
4218 #endif /* not defined _MGRM_THREADS */
4219 
4231 #define WS_CTRLMASK 0x0000FFFFL
4232 
4237 #define WS_NONE 0x00000000L
4238 
4239 /* bits in this mask are only for main windows */
4240 #define WS_CAPTIONBAR_MASK 0xF0000000L
4241 
4247 #define WS_MINIMIZEBOX 0x80000000L
4248 
4254 #define WS_MAXIMIZEBOX 0x40000000L
4255 
4260 #define WS_CAPTION 0x20000000L
4261 
4266 #define WS_SYSMENU 0x10000000L
4267 
4268 /* bits in this mask are both for main windows and controls */
4269 #define WS_STATUS_MASK 0x0F000000L
4270 
4275 #define WS_VISIBLE 0x08000000L
4276 
4281 #define WS_DISABLED 0x04000000L
4282 
4283 /* Main window states -- reserved for future use. */
4284 #define WS_MINIMIZE 0x02000000L
4285 #define WS_MAXIMIZE 0x01000000L
4286 
4287 /* bits in this mask are reuse for main windows and controls;
4288  bits have different meanings for main windows and controls.*/
4289 #define WS_REUSE_MASK 0x00E00000L
4290 
4296 #define WS_DLGFRAME 0x00800000L
4297 
4302 #define WS_THICKFRAME 0x00400000L
4303 
4308 #define WS_THINFRAME 0x00200000L
4309 
4315 #define WS_GROUP 0x00800000L
4316 
4323 #define WS_TABSTOP 0x00400000L
4324 
4331 #define WS_ALWAYSTOP 0x00100000L
4332 
4333 /* bits in this mask are both for main windows and controls */
4334 #define WS_MISC_MASK 0x000F0000L
4335 
4340 #define WS_CHILD 0x00080000L
4341 
4346 #define WS_VSCROLL 0x00040000L
4347 
4352 #define WS_HSCROLL 0x00020000L
4353 
4358 #define WS_BORDER 0x00010000L
4359 
4360 /* Obsolete styles, back-compatibility definitions. */
4361 #define WS_OVERLAPPED 0x00000000L
4362 #define WS_ABSSCRPOS 0x00000000L
4363 
4364 #define WS_MAINWIN_ONLY_MASK (WS_CAPTIONBAR_MASK | WS_ALWAYSTOP)
4365 #define WS_CONTROL_ONLY_MASK (WS_CTRLMASK)
4366 
4371 #define WS_EX_NONE 0x00000000L
4372 
4377 #define WS_EX_CONTROL_MASK 0x0000000FL
4378 
4432 #define WS_EX_WINTYPE_MASK 0x0000000FL
4433 
4451 #define WS_EX_WINTYPE_TOOLTIP 0x00000001L
4452 
4466 #define WS_EX_WINTYPE_GLOBAL 0x00000002L
4467 
4486 #define WS_EX_WINTYPE_SCREENLOCK 0x00000003L
4487 
4507 #define WS_EX_WINTYPE_DOCKER 0x00000004L
4508 
4524 #define WS_EX_WINTYPE_HIGHER 0x00000005L
4525 
4541 #define WS_EX_WINTYPE_NORMAL 0x00000006L
4542 
4562 #define WS_EX_WINTYPE_LAUNCHER 0x00000007L
4563 
4570 #define WS_EX_TROUNDCNS 0x00000010L
4571 
4576 #define WS_EX_BROUNDCNS 0x00000020L
4577 
4584 #define WS_EX_USEPRIVATECDC 0x00000040L
4585 
4590 #define WS_EX_NOTDRAGGABLE 0x00000080L
4591 #define WS_EX_DRAGGABLE 0x00000000L
4592 
4597 #define WS_EX_USEPARENTFONT 0x00000100L
4598 
4603 #define WS_EX_USEPARENTCURSOR 0x00000200L
4604 
4609 #define WS_EX_USEPARENTRDR 0x00000400L
4610 
4617 #define WS_EX_NOPARENTNOTIFY 0x00000800L
4618 
4625 #define WS_EX_AUTOSECONDARYDC 0x00001000L
4626 
4632 #define WS_EX_TRANSPARENT 0x00002000L
4633 
4650 #define WS_EX_TOPMOST 0x00004000L
4651 
4656 #define WS_EX_TOOLWINDOW 0x00008000L
4657 
4658 /* The group reserved for BIDI support */
4659 #define WS_EX_RIGHT 0x00010000L
4660 #define WS_EX_LEFT 0x00000000L
4661 #define WS_EX_RTLREADING 0x00020000L
4662 #define WS_EX_LTRREADING 0x00000000L
4663 
4668 #define WS_EX_LEFTSCROLLBAR 0x00040000L
4669 
4674 #define WS_EX_RIGHTSCROLLBAR 0x00000000L
4675 
4680 #define WS_EX_DLGHIDE 0x00100000L
4681 
4696 #define WS_EX_AUTOPOSITION 0x00200000L
4697 
4702 #define WS_EX_NOCLOSEBOX 0x00400000L
4703 
4708 #define WS_EX_CLIPCHILDREN 0x00800000L
4709 
4714 #define WS_EX_LFRDR_MASK 0x0F000000L
4715 
4721 #define WS_EX_LFRDR_CUSTOM1 0x01000000L
4722 
4729 #define WS_EX_LFRDR_CUSTOM2 0x02000000L
4730 
4737 #define WS_EX_LFRDR_CUSTOM3 0x04000000L
4738 
4745 #define WS_EX_LFRDR_CUSTOM4 0x08000000L
4746 
4747 /* Obsolete style, back-compatibility definitions. */
4748 #define WS_EX_IMECOMPOSE 0x00000000L
4749 
4756 #define WS_EX_INTERNAL_MASK 0xF0000000L
4757 
4774 #define WE_FONTS_NUMBER 4
4775 
4780 #define WE_METRICS_NUMBER 6
4781 
4786 #define WE_COLORS_NUMBER 14
4787 
4788 /* Window type mask */
4789 #define WE_ATTR_TYPE_MASK 0xF000
4790 #define WE_ATTR_TYPE_COLOR_MASK 0x0F00
4791 #define WE_ATTR_INDEX_MASK 0x00FF
4792 
4793 #define WE_ATTR_TYPE_FONT 0x1000
4794 #define WE_ATTR_TYPE_METRICS 0x2000
4795 
4796 #define WE_ATTR_TYPE_COLOR 0x3000
4797 #define WE_ATTR_TYPE_FGC 0x3000
4798 #define WE_ATTR_TYPE_BGCA 0x3100
4799 #define WE_ATTR_TYPE_BGCB 0x3200
4800 
4801 /* window element id */
4802 #define WE_CAPTION 0
4803 #define WE_MENU 1
4804 #define WE_MESSAGEBOX 2
4805 #define WE_TOOLTIP 3
4806 #define WE_WND_BORDER 4
4807 #define WE_SCROLLBAR 5
4808 #define WE_INACTIVE_CAPTION 6
4809 #define WE_WINDOW 7
4810 #define WE_THREED_BODY 8
4811 #define WE_SELECTED_ITEM 9
4812 #define WE_DISABLED_ITEM 10
4813 #define WE_HIGHLIGHT_ITEM 11
4814 #define WE_SIGNIFICANT_ITEM 12
4815 #define WE_DESKTOP 13
4816 
4817 /* window element attr id */
4818 
4819 /* Window caption */
4820 #define WE_FONT_CAPTION (WE_CAPTION | WE_ATTR_TYPE_FONT)
4821 #define WE_METRICS_CAPTION (WE_CAPTION | WE_ATTR_TYPE_METRICS)
4822 #define WE_FGC_ACTIVE_CAPTION (WE_CAPTION | WE_ATTR_TYPE_FGC)
4823 #define WE_BGCA_ACTIVE_CAPTION (WE_CAPTION | WE_ATTR_TYPE_BGCA)
4824 #define WE_BGCB_ACTIVE_CAPTION (WE_CAPTION | WE_ATTR_TYPE_BGCB)
4825 
4826 /* Menu */
4827 #define WE_FONT_MENU (WE_MENU | WE_ATTR_TYPE_FONT)
4828 #define WE_METRICS_MENU (WE_MENU | WE_ATTR_TYPE_METRICS)
4829 #define WE_FGC_MENU (WE_MENU | WE_ATTR_TYPE_FGC)
4830 #define WE_BGC_MENU (WE_MENU | WE_ATTR_TYPE_BGCA)
4831 
4832 /* Message box */
4833 #define WE_FONT_MESSAGEBOX (WE_MESSAGEBOX | WE_ATTR_TYPE_FONT)
4834 #define WE_FGC_MESSAGEBOX (WE_MESSAGEBOX | WE_ATTR_TYPE_FGC)
4835 
4836 /* Tool tips */
4837 #define WE_FONT_TOOLTIP (WE_TOOLTIP | WE_ATTR_TYPE_FONT)
4838 #define WE_FGC_TOOLTIP (WE_TOOLTIP | WE_ATTR_TYPE_FGC)
4839 #define WE_BGC_TOOLTIP (WE_TOOLTIP | WE_ATTR_TYPE_BGCA)
4840 
4841 /* Window border */
4842 #define WE_METRICS_WND_BORDER (WE_WND_BORDER | WE_ATTR_TYPE_METRICS)
4843 #define WE_FGC_ACTIVE_WND_BORDER (WE_WND_BORDER | WE_ATTR_TYPE_FGC)
4844 #define WE_FGC_INACTIVE_WND_BORDER (WE_WND_BORDER | WE_ATTR_TYPE_BGCA)
4845 
4846 /* Scroll bar */
4847 #define WE_METRICS_SCROLLBAR (WE_SCROLLBAR | WE_ATTR_TYPE_METRICS)
4848 
4849 /* Inactive caption */
4850 #define WE_FGC_INACTIVE_CAPTION (WE_INACTIVE_CAPTION | WE_ATTR_TYPE_FGC)
4851 #define WE_BGCA_INACTIVE_CAPTION (WE_INACTIVE_CAPTION | WE_ATTR_TYPE_BGCA)
4852 #define WE_BGCB_INACTIVE_CAPTION (WE_INACTIVE_CAPTION | WE_ATTR_TYPE_BGCB)
4853 
4854 /* Window */
4855 #define WE_FGC_WINDOW (WE_WINDOW | WE_ATTR_TYPE_FGC)
4856 #define WE_BGC_WINDOW (WE_WINDOW | WE_ATTR_TYPE_BGCA)
4857 
4858 /* 3d body */
4859 #define WE_FGC_THREED_BODY (WE_THREED_BODY | WE_ATTR_TYPE_FGC)
4860 #define WE_MAINC_THREED_BODY (WE_THREED_BODY | WE_ATTR_TYPE_BGCA)
4861 
4862 /* Selected items */
4863 #define WE_FGC_SELECTED_ITEM (WE_SELECTED_ITEM | WE_ATTR_TYPE_FGC)
4864 #define WE_BGC_SELECTED_ITEM (WE_SELECTED_ITEM | WE_ATTR_TYPE_BGCA)
4865 #define WE_BGC_SELECTED_LOSTFOCUS (WE_SELECTED_ITEM | WE_ATTR_TYPE_BGCB)
4866 
4867 /* Invalidate items */
4868 #define WE_FGC_DISABLED_ITEM (WE_DISABLED_ITEM | WE_ATTR_TYPE_FGC)
4869 #define WE_BGC_DISABLED_ITEM (WE_DISABLED_ITEM | WE_ATTR_TYPE_BGCA)
4870 
4871 /* Highlight items */
4872 #define WE_FGC_HIGHLIGHT_ITEM (WE_HIGHLIGHT_ITEM | WE_ATTR_TYPE_FGC)
4873 #define WE_BGC_HIGHLIGHT_ITEM (WE_HIGHLIGHT_ITEM | WE_ATTR_TYPE_BGCA)
4874 
4875 /* Significant items */
4876 #define WE_FGC_SIGNIFICANT_ITEM (WE_SIGNIFICANT_ITEM | WE_ATTR_TYPE_FGC)
4877 #define WE_BGC_SIGNIFICANT_ITEM (WE_SIGNIFICANT_ITEM | WE_ATTR_TYPE_BGCA)
4878 
4879 /* Desktop */
4880 #define WE_BGC_DESKTOP (WE_DESKTOP | WE_ATTR_TYPE_BGCA)
4881 
4882 #define WE_ATTR_TYPE_ICON 0x4000
4883 #define WE_ATTR_TYPE_ICON_MASK 0x0F00
4884 #define WE_ATTR_TYPE_SMALLICON 0x4000
4885 #define WE_ATTR_TYPE_LARGEICON 0x4100
4886 
4887 #define WE_LARGEICON_APPLICATION (WE_ATTR_TYPE_LARGEICON | 0x00)
4888 #define WE_LARGEICON_HAND (WE_ATTR_TYPE_LARGEICON | 0x01)
4889 #define WE_LARGEICON_QUESTION (WE_ATTR_TYPE_LARGEICON | 0x02)
4890 #define WE_LARGEICON_EXCLAMATION (WE_ATTR_TYPE_LARGEICON | 0x03)
4891 #define WE_LARGEICON_ASTERISK (WE_ATTR_TYPE_LARGEICON | 0x04)
4892 #define WE_LARGEICON_STOP WE_LARGEICON_HAND
4893 #define WE_LARGEICON_INFORMATION WE_LARGEICON_ASTERISK
4894 
4895 #define WE_SMALLICON_APPLICATION (WE_ATTR_TYPE_SMALLICON | 0x00)
4896 #define WE_SMALLICON_HAND (WE_ATTR_TYPE_SMALLICON | 0x01)
4897 #define WE_SMALLICON_QUESTION (WE_ATTR_TYPE_SMALLICON | 0x02)
4898 #define WE_SMALLICON_EXCLAMATION (WE_ATTR_TYPE_SMALLICON | 0x03)
4899 #define WE_SMALLICON_ASTERISK (WE_ATTR_TYPE_SMALLICON | 0x04)
4900 #define WE_SMALLICON_STOP WE_SMALLICON_HAND
4901 #define WE_SMALLICON_INFORMATION WE_SMALLICON_ASTERISK
4902 
4907 #define WE_ATTR_TYPE_RDR 0x5000
4908 
4909 #define WE_LFFLAT_NUMBER 1
4910 #ifdef _MGLF_RDR_FLAT
4911 
4912 #define WE_LFFLAT_TAB_NRMLCLR (WE_ATTR_TYPE_RDR | 0)
4913 #endif
4914 
4915 #define WE_LFSKIN_NUMBER 28
4916 #ifdef _MGLF_RDR_SKIN
4917 #define WE_LFSKIN_WND_BKGND (WE_ATTR_TYPE_RDR | 0)
4918 
4919 #define WE_LFSKIN_CAPTION (WE_ATTR_TYPE_RDR | 1)
4920 #define WE_LFSKIN_CAPTION_BTN (WE_ATTR_TYPE_RDR | 2)
4921 
4922 #define WE_LFSKIN_SCROLLBAR_VSHAFT (WE_ATTR_TYPE_RDR | 3)
4923 #define WE_LFSKIN_SCROLLBAR_VTHUMB (WE_ATTR_TYPE_RDR | 4)
4924 #define WE_LFSKIN_SCROLLBAR_HSHAFT (WE_ATTR_TYPE_RDR | 5)
4925 #define WE_LFSKIN_SCROLLBAR_HTHUMB (WE_ATTR_TYPE_RDR | 6)
4926 #define WE_LFSKIN_SCROLLBAR_ARROWS (WE_ATTR_TYPE_RDR | 7)
4927 
4928 #define WE_LFSKIN_BORDER_TOP (WE_ATTR_TYPE_RDR | 8)
4929 #define WE_LFSKIN_BORDER_BOTTOM (WE_ATTR_TYPE_RDR | 9)
4930 #define WE_LFSKIN_BORDER_LEFT (WE_ATTR_TYPE_RDR | 10)
4931 #define WE_LFSKIN_BORDER_RIGHT (WE_ATTR_TYPE_RDR | 11)
4932 
4933 #define WE_LFSKIN_ARROWS (WE_ATTR_TYPE_RDR | 12)
4934 #define WE_LFSKIN_ARROWS_SHELL (WE_ATTR_TYPE_RDR | 13)
4935 
4936 #define WE_LFSKIN_RADIOBUTTON (WE_ATTR_TYPE_RDR | 14)
4937 #define WE_LFSKIN_CHECKBUTTON (WE_ATTR_TYPE_RDR | 15)
4938 #define WE_LFSKIN_PUSHBUTTON (WE_ATTR_TYPE_RDR | 16)
4939 
4940 #define WE_LFSKIN_TREE (WE_ATTR_TYPE_RDR | 17)
4941 
4942 #define WE_LFSKIN_HEADER (WE_ATTR_TYPE_RDR | 18)
4943 #define WE_LFSKIN_TAB (WE_ATTR_TYPE_RDR | 19)
4944 
4945 #define WE_LFSKIN_PROGRESS_HCHUNK (WE_ATTR_TYPE_RDR | 20)
4946 #define WE_LFSKIN_PROGRESS_VCHUNK (WE_ATTR_TYPE_RDR | 21)
4947 #define WE_LFSKIN_PROGRESS_HTRACKBAR (WE_ATTR_TYPE_RDR | 22)
4948 #define WE_LFSKIN_PROGRESS_VTRACKBAR (WE_ATTR_TYPE_RDR | 23)
4949 
4950 #define WE_LFSKIN_TBSLIDER_H (WE_ATTR_TYPE_RDR | 24)
4951 #define WE_LFSKIN_TRACKBAR_VERT (WE_ATTR_TYPE_RDR | 25)
4952 #define WE_LFSKIN_TRACKBAR_HORZ (WE_ATTR_TYPE_RDR | 26)
4953 #define WE_LFSKIN_TBSLIDER_V (WE_ATTR_TYPE_RDR | 27)
4954 #endif
4955 
4961 
4982 typedef void (* NOTIFPROC) (HWND hwnd, LINT id, int nc, DWORD add_data);
4983 
4985 typedef struct _WINDOW_ELEMENT_ATTR {
4991 
4993 typedef struct _WINDOW_ELEMENT_RENDERER* PWERENDERER;
4994 
4995 #define SBS_NORMAL 0x00
4996 #define SBS_DISABLED 0x01
4997 #define SBS_HIDE 0x02
4998 
5002 typedef struct _LFSCROLLBARINFO {
5004  int minPos;
5006  int maxPos;
5008  int curPos;
5016  int barLen;
5018  int status;
5019 } LFSCROLLBARINFO;
5020 
5022 
5026 typedef struct _SCROLLBARDATA {
5028  int minPos;
5030  int maxPos;
5032  int curPos;
5040  int barLen;
5041  /* mouse position before tracking thumb.
5042  * it represents the distance from x mouse postion to barStart
5043  * for horizontal scrollbar.
5044  * it represents the distance from y mouse postion to barStart
5045  * for vertical scrollbar.
5046  */
5047  int track_pos;
5049  int status;
5050 } SCROLLBARDATA;
5051 
5052 typedef SCROLLBARDATA* PSCROLLBARDATA;
5053 
5055 #define SBS_DISABLED_LTUP 0x0100
5056 
5058 #define SBS_DISABLED_BTDN 0x0200
5059 
5061 #define SBS_HILITE_LTUP 0x0400
5062 
5064 #define SBS_HILITE_BTDN 0x0800
5065 
5067 #define SBS_HILITE_THUMB 0x0010
5068 
5070 #define SBS_PRESSED_LTUP 0x0020
5071 
5073 #define SBS_PRESSED_BTDN 0x0040
5074 
5076 #define SBS_PRESSED_THUMB 0x0080
5077 
5078 
5079 #define LFRDR_WINTYPE_UNKNOWN 0
5080 #define LFRDR_WINTYPE_DIALOG 1
5081 #define LFRDR_WINTYPE_MAINWIN 2
5082 #define LFRDR_WINTYPE_CONTROL 3
5083 
5087 typedef struct _LFRDR_WINSTYLEINFO
5088 {
5090  int dwStyle;
5091 
5100  int winType;
5102 
5108 typedef struct _LFRDR_TRACKBARINFO
5109 {
5110  int nMin;
5111  int nMax;
5112  int nPos;
5113  int nTickFreq;
5115 
5116 #define LFRDR_METRICS_MASK 0xFF00
5117 #define LFRDR_METRICS_BORDER 0x0100
5118 #define LFRDR_METRICS_CAPTION_H 0x0200
5119 #define LFRDR_METRICS_ICON_H 0x0300
5120 #define LFRDR_METRICS_ICON_W 0x0400
5121 #define LFRDR_METRICS_MENU_H 0x0500
5122 #define LFRDR_METRICS_VSCROLL_W 0x0600
5123 #define LFRDR_METRICS_HSCROLL_H 0x0700
5124 #define LFRDR_METRICS_MINWIN_WIDTH 0x0800
5125 #define LFRDR_METRICS_MINWIN_HEIGHT 0x0900
5126 
5127 #define LFRDR_SB_MINBARLEN 10
5128 
5133 #define LEN_RENDERER_NAME 15
5134 
5135 /* button status used by button and 3dbox. */
5136 #define LFRDR_BTN_STATUS_MASK 0x03
5137 #define LFRDR_BTN_STATUS_NORMAL 0x00
5138 #define LFRDR_BTN_STATUS_HILITE 0x01
5139 #define LFRDR_BTN_STATUS_PRESSED 0x02
5140 #define LFRDR_BTN_STATUS_DISABLED 0x03
5141 
5142 /* a flag used by radio button and check button. */
5143 #define LFRDR_BTN_STATUS_SELECTED 0x04
5144 
5145 /* a flag used by button on capton bar. */
5146 #define LFRDR_BTN_STATUS_INACTIVE 0x08
5147 
5148 /* thick or thin frame used by 3dbox. */
5149 #define LFRDR_3DBOX_THICKFRAME 0x20
5150 
5151 /* filled 3dbox */
5152 #define LFRDR_3DBOX_FILLED 0x40
5153 
5154 /*select status used by checkmark or radio.*/
5155 #define LFRDR_MARK_SELECTED_MASK 0x05
5156 #define LFRDR_MARK_ALL_SELECTED 0x01
5157 #define LFRDR_MARK_HALF_SELECTED 0x04
5158 
5159 /* a flag whether a checkmark or radio has a shell or not.*/
5160 #define LFRDR_MARK_HAVESHELL 0x02
5161 
5162 /*the direction of arrow.*/
5163 #define LFRDR_ARROW_DIRECT_MASK 0x0F00
5164 #define LFRDR_ARROW_LEFT 0x0000
5165 #define LFRDR_ARROW_RIGHT 0x0100
5166 #define LFRDR_ARROW_UP 0x0200
5167 #define LFRDR_ARROW_DOWN 0x0300
5168 
5169 /* hollow arrow or filled */
5170 #define LFRDR_ARROW_NOFILL 0x1000
5171 #define LFRDR_ARROW_HAVESHELL 0x2000
5172 
5173 /* minimum of menu margin */
5174 #define LFRDR_MENUITEMOFFY_MIN 4
5175 
5176 #define LFRDR_3DBOX_COLOR_LIGHTEST 0x01
5177 #define LFRDR_3DBOX_COLOR_DARKEST 0x02
5178 #define LFRDR_3DBOX_COLOR_LIGHTER 0x03
5179 #define LFRDR_3DBOX_COLOR_DARKER 0x04
5180 
5181 /* flag of propsheet tab */
5182 #define LFRDR_TAB_BOTTOM 0x0001
5183 #define LFRDR_TAB_ACTIVE 0x0010
5184 #define LFRDR_TAB_ICON 0x0100
5185 
5186 /* for fold icon*/
5187 #define LFRDR_TREE_WITHICON 0x08
5188 #define LFRDR_TREE_FOLD 0x01
5189 
5190 /* for connecting line*/
5191 #define LFRDR_TREE_CHILD 0x02
5192 #define LFRDR_TREE_NEXT 0x04
5193 
5194 #define SYSICO_ITEM_NUMBER 5
5195 
5199  const char name[LEN_RENDERER_NAME+1];
5200 
5205  int (*init) (PWERENDERER renderer);
5206 
5211  int (*deinit) (PWERENDERER renderer);
5212 
5227  DWORD (*calc_3dbox_color) (DWORD color, int flag);
5228 
5248  void (*draw_3dbox) (HDC hdc, const RECT* pRect, DWORD color, DWORD flag);
5249 
5250 
5261  void (*draw_radio) (HDC hdc, const RECT* pRect, DWORD color, int status);
5262 
5266  void (*draw_checkbox) (HDC hdc, const RECT* pRect, DWORD color,
5267  int status);
5268 
5272  void (*draw_checkmark) (HDC hdc, const RECT* pRect, DWORD color,
5273  int status);
5274 
5291  void (*draw_arrow) (HWND hWnd, HDC hdc, const RECT* pRect, DWORD color, int status);
5292 
5306  void (*draw_fold) (HWND hWnd, HDC hdc, const RECT* pRect, DWORD color,
5307  int status, int next);
5308 
5310  void (*draw_focus_frame) (HDC hdc, const RECT *pRect, DWORD color);
5311 
5313  void (*draw_normal_item) (HWND hWnd, HDC hdc, const RECT* pRect,
5314  DWORD color);
5315 
5317  void (*draw_hilite_item) (HWND hWnd, HDC hdc, const RECT* pRect,
5318  DWORD color);
5319 
5321  void (*draw_disabled_item) (HWND hWnd, HDC hdc, const RECT* pRect,
5322  DWORD color);
5323 
5325  void (*draw_significant_item) (HWND hWnd, HDC hdc, const RECT* pRect,
5326  DWORD color);
5327 
5341  void (*draw_push_button) (HWND hWnd, HDC hdc, const RECT* pRect,
5342  DWORD color1, DWORD color2, int status);
5343 
5360  void (*draw_radio_button) (HWND hWnd, HDC hdc, const RECT* pRect, int status);
5361 
5378  void (*draw_check_button) (HWND hWnd, HDC hdc, const RECT* pRect, int status);
5379 
5381  void (*draw_border) (HWND hWnd, HDC hdc, BOOL is_active);
5382 
5384  void (*draw_caption) (HWND hWnd, HDC hdc, BOOL is_active);
5385 
5399  void (*draw_caption_button) (HWND hwnd, HDC hdc, int ht_code, int state);
5400 
5415  void (*draw_scrollbar) (HWND hWnd, HDC hdc, int sb_pos);
5416 
5418  void (*calc_trackbar_rect) (HWND hWnd, LFRDR_TRACKBARINFO *info,
5419  DWORD dwStyle, const RECT* rcClient, RECT* rcRuler,
5420  RECT* rcBar, RECT* rcBorder);
5421 
5423  void (*draw_trackbar) (HWND hWnd, HDC hdc, LFRDR_TRACKBARINFO *info);
5424 
5431  int (*calc_we_area) (HWND hWnd, int which, RECT* we_area);
5432 
5455  int (*calc_we_metrics) (HWND hWnd,
5456  LFRDR_WINSTYLEINFO* style_info, int which);
5457 
5463  int (*hit_test) (HWND hWnd, int x, int y);
5464 
5466  int (*on_click_hotspot) (HWND hWnd, int which);
5467 
5477  void (*draw_custom_hotspot) (HWND hWnd, HDC hdc, int ht_code, int state);
5478 
5485  void (*calc_thumb_area) (HWND hWnd, BOOL vertical,
5486  LFSCROLLBARINFO* sb_info);
5487 
5489  void (*disabled_text_out) (HWND hWnd, HDC hdc, const char* spText,
5490  PRECT rc, DWORD dt_fmt);
5491 
5502  void (*draw_tab) (HWND hWnd, HDC hdc, RECT *rect, char *title,
5503  DWORD color, int flag, HICON icon);
5504 
5506  void (*draw_progress) (HWND hWnd, HDC hdc,
5507  int nMax, int nMin, int nPos, BOOL fVertical);
5508 
5512  void (*draw_header) (HWND hWnd, HDC hdc, const RECT* pRect, DWORD color);
5513 
5518  DWORD (*on_get_rdr_attr) (struct _WINDOW_ELEMENT_RENDERER*, int we_attr_id);
5519 
5526  DWORD (*on_set_rdr_attr) (struct _WINDOW_ELEMENT_RENDERER*, int we_attr_id, DWORD we_attr, BOOL change);
5527 
5529  void (*erase_background) (HWND hWnd, HDC hdc, const RECT *rect);
5530 
5532  void (*draw_normal_menu_item) (HWND hWnd, HDC hdc, const RECT* pRect,
5533  DWORD color);
5534 
5536  void (*draw_hilite_menu_item) (HWND hWnd, HDC hdc, const RECT* pRect,
5537  DWORD color);
5538 
5540  void (*draw_disabled_menu_item) (HWND hWnd, HDC hdc, const RECT* pRect,
5541  DWORD color);
5542 
5545 
5548 
5551 
5553  HICON we_icon [2][SYSICO_ITEM_NUMBER];
5554 
5556  unsigned int refcount;
5557 
5559  const void* private_info;
5561 
5568 typedef struct _WINDOWINFO
5569 {
5570  unsigned char _padding1;
5571  unsigned char _padding2;
5572  unsigned short _padding3;
5573  void* _padding4;
5574 
5576  const char* spCaption;
5577 
5582 
5585 
5588 
5593 
5594  void* _padding5;
5595  void* _padding6;
5596  void* _padding7;
5597  void* _padding8;
5598  void* _padding9;
5599 
5601  int left, top;
5602  int right, bottom;
5603 
5605  int cl, ct;
5606  int cr, cb;
5607 
5612 
5617 
5620 
5633 
5638 
5641 } WINDOWINFO;
5642 
5654 static inline const WINDOWINFO* GUIAPI GetWindowInfo (HWND hWnd)
5655 {
5656  return (WINDOWINFO*)hWnd;
5657 }
5658 
5670 MG_EXPORT BOOL GUIAPI InitWindowElementAttrs (PWERENDERER rdr);
5671 
5764 MG_EXPORT DWORD GUIAPI GetWindowElementAttr (HWND hwnd, int we_attr_id);
5765 
5782 MG_EXPORT DWORD GUIAPI SetWindowElementAttr (HWND hwnd, int we_attr_id,
5783  DWORD we_attr);
5784 
5804 MG_EXPORT gal_pixel GUIAPI GetWindowElementPixelEx (HWND hwnd,
5805  HDC hdc, int we_attr_id);
5806 
5821 MG_EXPORT WINDOW_ELEMENT_RENDERER*
5822  GUIAPI GetWindowRendererFromName (const char* name);
5823 
5836 MG_EXPORT BOOL GUIAPI AddWindowElementRenderer (const char* name,
5837  const WINDOW_ELEMENT_RENDERER* we_rdr);
5838 
5849 MG_EXPORT BOOL GUIAPI RemoveWindowElementRenderer (const char* name);
5850 
5862 MG_EXPORT WINDOW_ELEMENT_RENDERER*
5863  GUIAPI GetDefaultWindowElementRenderer (void);
5864 
5876 MG_EXPORT const char* GUIAPI SetDefaultWindowElementRenderer (const char* name);
5877 
5896 MG_EXPORT BOOL GUIAPI SetWindowElementRenderer (HWND hWnd,
5897  const char* werdr_name, const WINDOW_ELEMENT_ATTR* we_attrs);
5898 
5911 MG_EXPORT BOOL InitRendererSystemIcon (const char* rdr_name,
5912  HICON *small_icon, HICON *large_icon);
5913 
5924 MG_EXPORT void TermRendererSystemIcon (HICON *small_icon,
5925  HICON *large_icon);
5926 
5947 MG_EXPORT BOOL GUIAPI RegisterResFromFile (HDC hdc, const char* file);
5948 
5949 
5968 MG_EXPORT BOOL GUIAPI RegisterResFromMem (HDC hdc, const char* file,
5969  const unsigned char* data, size_t data_size);
5970 
5984 MG_EXPORT BOOL GUIAPI RegisterResFromBitmap (const char* file, const BITMAP* bmp);
5985 
5998 MG_EXPORT const BITMAP* GUIAPI RetrieveRes (const char *file);
5999 
6013 MG_EXPORT void GUIAPI UnregisterRes (const char *file);
6014 
6033 MG_EXPORT BOOL GUIAPI RegisterSystemBitmap (HDC hdc, const char* rdr_name,
6034  const char* id);
6035 
6051 MG_EXPORT void GUIAPI UnregisterSystemBitmap (HDC hdc, const char* rdr_name,
6052  const char* id);
6053 
6054 /* define the key of resource */
6055 typedef DWORD RES_KEY;
6056 #define RES_KEY_INVALID 0
6057 
6058 /* define the incore res type */
6059 typedef struct _INNER_RES {
6060  RES_KEY key;
6061  const Uint8* data;
6062  size_t data_len;
6063 
6064  /* A special param recognized by the TYPE_OPS; normally is NULL.
6065  * If the data is a raw png, jpeg, bmp file content,
6066  * it should be the extention name of the filename:
6067  * INNER_RES res[]= { ... { ..., ... ,.., "png" } .. };
6068  * */
6069  const void* additional;
6070 } INNER_RES;
6071 
6074  RES_TYPE_INVALID = 0xFF,
6075 
6081 
6087 
6093 
6094 #ifdef _MGHAVE_CURSOR
6095 
6100 #endif
6101 
6108 
6109  /* NOT IMPLEMENT */
6110  RES_TYPE_TEXT,
6111  /* NOT IMPLEMENT */
6112  RES_TYPE_MENU,
6113  /* NOT IMPLEMENT */
6114  RES_TYPE_WINDOW,
6115 
6124 
6129 
6134 
6135  /*
6136  * The max valid value of resource type;
6137  * the user defined type must less this value.
6138  */
6139  RES_TYPE_USER_MAX = 0x7F
6140 };
6141 
6142 /* the return value of LoadResource with type RES_TYPE_MEM_RES */
6143 typedef struct _MEM_RES {
6144  Uint8 *data;
6145  size_t data_len;
6146 } MEM_RES;
6147 
6148 typedef struct _FONT_RES {
6149  LOGFONT logfont;
6150  RES_KEY key;
6151 } FONT_RES;
6152 
6153 /* the original source of resource
6154  * depend on the values, the res manager
6155  * would select corrent loader to
6156  * load resource form disk or mem
6157  */
6158 
6159 #define REF_SRC_NOTYPE 0x00
6160 
6161 /* indicate that the resource is stored in disk */
6162 #define REF_SRC_FILE 0x01
6163 
6164 /* indicate that the resource is stored in memory*/
6165 #define REF_SRC_INNER 0x02
6166 
6167 /* indicate that the resource is stored in shared memory*/
6168 #define REF_SRC_SHARED 0x03
6169 
6170 /* indicate that the resource is stored in outside( NOT SUPPORTED) */
6171 #define REF_SRC_OUTSIDE 0x04
6172 
6173 /* indicate that the resource is stored in a stream object (NOT SUPPORTED) */
6174 #define REF_SRC_STREAM 0x05
6175 
6176 /* indicate that the resource is create by MiniGUI */
6177 #define REF_SRC_LOGIC 0x06
6178 
6179 /* the RESOUCE type for loadding */
6180 typedef struct _RESOURCE {
6181  void* data; // store the pointer of cached resource
6182  union {
6183  void* src;
6184  INNER_RES* inner;
6185  char* file;
6186  } source; // indicate the stored format of resource
6187 } RESOURCE;
6188 
6189 /* The operations of one type of resource */
6190 typedef struct _RES_TYPE_OPS {
6191  /* To get a resource
6192  * return the buffered resource pointer
6193  * param res the in and out param of resource.
6194  * param src_type, one of REF_SRC_XXX
6195  * param usr_param
6196  * */
6197  void* (*get_res_data)(RESOURCE* res, int src_type, DWORD usr_param);
6198  /* To unload a buffered resource
6199  */
6200  void (*unload)(RESOURCE* res, int src_type);
6201 } RES_TYPE_OPS;
6202 
6203 /* Return value and error code of resource manager */
6204 enum emResReturn {
6205  RES_RET_OK = 0,
6206  RES_RET_INVALID_PARAM,
6207  RES_RET_NOT_EXIST_KEY, //RES_KEY is not exist
6208  RES_RET_LOAD_FILE_FAILED,
6209  RES_RET_LOAD_MEM_FAILED,
6210  RES_RET_UNKNOWN_TYPE,
6211  RES_RET_NOT_IMPLEMENTED,
6212  RES_RET_INUSED //the res or object is in used, cannot be unloaded
6213 };
6214 
6224 MG_EXPORT const char* GetResPath (void);
6225 
6239 MG_EXPORT int SetResPath (const char* path);
6240 
6254 MG_EXPORT int AddInnerRes (INNER_RES* inner_res, int count, BOOL copy);
6255 
6256 /*
6257  * NOT IMPLEMENT
6258  */
6259 MG_EXPORT int AddSharedRes (const char* shared_name);
6260 
6273 MG_EXPORT int RegisterResType (int type, RES_TYPE_OPS* ops);
6274 
6285 MG_EXPORT int UnregisterResType (int type);
6286 
6324 MG_EXPORT void* LoadResource (const char* res_name, int type, DWORD usr_param);
6325 
6339 MG_EXPORT void* GetResource (RES_KEY key);
6340 
6356 MG_EXPORT int AddResRef (RES_KEY key);
6357 
6369 MG_EXPORT int ReleaseRes (RES_KEY key);
6370 
6371 #define LoadMyBitmapFromRes(res_name, pal) \
6372  (MYBITMAP*)LoadResource(res_name, \
6373  RES_TYPE_MYBITMAP, (DWORD)(pal))
6374 
6375 #define GetMyBitmapFromRes(key) \
6376  (MYBITMAP*)GetResource(key)
6377 
6378 #define LoadBitmapFromRes(hdc, res_name) \
6379  (BITMAP*)LoadResource(res_name, RES_TYPE_IMAGE, (DWORD)hdc)
6380 
6381 #define GetBitmapFromRes(key) \
6382  (BITMAP*)GetResource(key)
6383 
6384 #define GetIconFromRes(key) \
6385  (HICON)GetResource(key)
6386 
6387 #ifndef _MGHAVE_CURSOR
6388 #define GetCursorFromRes(key) \
6389  (HCURSOR)GetResource(key)
6390 #endif
6391 
6392 #define GetEtcFromRes(key) \
6393  (GHANDLE)GetResource(key)
6394 
6395 #define LoadLogicFontFromRes(font_name) \
6396  (PLOGFONT)LoadResource(font_name, RES_TYPE_FONT, 0)
6397 
6398 #define GetLogicFontFromRes(font_name) \
6399  (PLOGFONT)GetResource(Str2Key(font_name))
6400 
6401 #define ReleaseLogicFont(font) \
6402  ReleaseRes(((FONT_RES*)(font))->key)
6403 
6404 #define ReleaseLogicFontByName(font_name) \
6405  ReleaseRes(Str2Key(font_name))
6406 
6418 MG_EXPORT RES_KEY Str2Key (const char* str);
6419 
6420 
6421 #ifdef __TARGET_MSTUDIO__
6422 
6431 MG_EXPORT int GUIAPI GetWindowZOrder(HWND hWnd);
6432 
6442 MG_EXPORT int GUIAPI SetWindowZOrder(HWND hWnd, int zorder);
6443 #endif /* defined __TARGET_MSTUDIO__ */
6444 
6452 #ifdef _MGHAVE_VIRTUAL_WINDOW
6453 
6595 MG_EXPORT int GUIAPI CreateThreadForMessaging (pthread_t* thread,
6596  pthread_attr_t* attr, void * (*start_routine)(void *), void* arg,
6597  BOOL joinable, size_t stack_size);
6598 
6611 MG_EXPORT BOOL GUIAPI GetThreadByWindow (HWND hWnd, pthread_t* thread);
6612 
6624 MG_EXPORT BOOL GUIAPI IsWindowInThisThread (HWND hWnd);
6625 
6645 MG_EXPORT BOOL GUIAPI VirtualWindowCleanup (HWND hVirtWnd);
6646 
6672 MG_EXPORT HWND GUIAPI CreateVirtualWindow (HWND hHosting, WNDPROC WndProc,
6673  const char* spCaption, LINT id, DWORD dwAddData);
6674 
6693 MG_EXPORT BOOL GUIAPI DestroyVirtualWindow (HWND hWnd);
6694 
6697 #endif /* defined _MGHAVE_VIRTUAL_WINDOW */
6698 
6704 extern MG_EXPORT HWND __mg_hwnd_desktop;
6705 
6710 #define HWND_DESKTOP __mg_hwnd_desktop
6711 
6716 #define HWND_NULL ((HWND)0)
6717 
6722 #define HWND_INVALID ((HWND)-1)
6723 
6724 #define HWND_OTHERPROC ((HWND)-1)
6725 
6729 typedef struct _MAINWINCREATE {
6732 
6735 
6737  const char* spCaption;
6738 
6741 
6744 
6747 
6749  HWND hHosting;
6750 
6752  LRESULT (*MainWindowProc)(HWND, UINT, WPARAM, LPARAM);
6753 
6755  int lx, ty, rx, by;
6756 
6761 
6764 
6767 } MAINWINCREATE;
6768 typedef MAINWINCREATE* PMAINWINCREATE;
6769 
6770 #ifdef _MGRM_THREADS
6771 
6789 static inline int GUIAPI CreateThreadForMainWindow (pthread_t* thread,
6790  pthread_attr_t* attr, void * (*start_routine)(void *), void* arg)
6791 {
6792  return CreateThreadForMessaging (thread, attr, start_routine, arg,
6793  TRUE, 16);
6794 }
6795 
6806 static inline pthread_t GUIAPI GetMainWinThread (HWND hMainWnd)
6807 {
6808 #ifdef WIN32
6809  pthread_t ret;
6810  memset (&ret, 0, sizeof (pthread_t));
6811 #else
6812  pthread_t ret = 0;
6813 #endif
6814 
6815  GetThreadByWindow (hMainWnd, &ret);
6816  return ret;
6817 }
6818 
6838 MG_EXPORT int GUIAPI WaitMainWindowClose (HWND hWnd, void** returnval);
6839 #endif /* defined _MGRM_THREADS */
6840 
6862 MG_EXPORT BOOL GUIAPI MainWindowCleanup (HWND hMainWnd);
6863 
6876 static inline BOOL MainWindowThreadCleanup (HWND hMainWnd)
6877 {
6878  return MainWindowCleanup (hMainWnd);
6879 }
6880 
6881 /* The flags for the surface pixel format */
6882 #define ST_PIXEL_MASK 0x00FF
6883 #define ST_PIXEL_DEFAULT 0x0000
6884 #define ST_PIXEL_ARGB4444 0x0001
6885 #define ST_PIXEL_ARGB1555 0x0002
6886 #define ST_PIXEL_ARGB8888 0x0003
6887 
6888 /* other flags for future use */
6889 
6890 /* for default surface flags */
6891 #define ST_DEFAULT (ST_PIXEL_DEFAULT)
6892 
6893 #define CT_SYSTEM_MASK 0X0000FF
6894 #define CT_OPAQUE 0x000000
6895 #define CT_COLORKEY 0x000001
6896 #define CT_ALPHACHANNEL 0x000002
6897 #define CT_LOGICALPIXEL 0x000003
6898 #define CT_ALPHAPIXEL 0x000004
6899 #define CT_BLURRED 0x000005
6900 #define CT_MAX_VALUE 0xFFFFFF
6901 
6958 MG_EXPORT HWND GUIAPI CreateMainWindowEx2 (PMAINWINCREATE create_info, LINT id,
6959  const char* werdr_name, const WINDOW_ELEMENT_ATTR* we_attrs,
6960  unsigned int surf_flag, DWORD bkgnd_color,
6961  int compos_type, DWORD ct_arg);
6962 
6996 static inline HWND GUIAPI CreateMainWindowEx (PMAINWINCREATE pCreateInfo,
6997  const char* werdr_name, const WINDOW_ELEMENT_ATTR* we_attrs,
6998  const char* window_name, const char* layer_name)
6999 {
7000  return CreateMainWindowEx2 (pCreateInfo, 0L, werdr_name, we_attrs,
7001  ST_DEFAULT, 0xFFFFFFFFUL, CT_OPAQUE, 0);
7002 }
7003 
7014 static inline HWND GUIAPI CreateMainWindow (PMAINWINCREATE pCreateInfo)
7015 {
7016  return CreateMainWindowEx (pCreateInfo, NULL, NULL, NULL, NULL);
7017 }
7018 
7037 MG_EXPORT BOOL GUIAPI DestroyMainWindow (HWND hWnd);
7038 
7039 typedef void (*CB_FREE_LOCAL_DATA) (DWORD local_data);
7040 
7067 MG_EXPORT BOOL GUIAPI SetWindowLocalData (HWND hwnd, const char* data_name,
7068  DWORD local_data, CB_FREE_LOCAL_DATA cb_free);
7069 
7090 MG_EXPORT BOOL GUIAPI RemoveWindowLocalData (HWND hwnd, const char* data_name);
7091 
7115 MG_EXPORT BOOL GUIAPI GetWindowLocalData (HWND hwnd, const char* data_name,
7116  DWORD *local_data, CB_FREE_LOCAL_DATA* cb_free);
7117 
7132 MG_EXPORT BOOL GUIAPI SetWindowMask (HWND hWnd, const MYBITMAP* mask);
7133 
7149 MG_EXPORT BOOL GUIAPI SetWindowMaskEx (HWND hWnd, HDC hdc, const BITMAP* mask);
7150 
7167 MG_EXPORT BOOL GUIAPI SetMainWindowAlwaysTop (HWND hWnd, BOOL fSet);
7168 
7169 #ifdef _MGSCHEMA_COMPOSITING
7170 
7222 MG_EXPORT BOOL GUIAPI SetMainWindowCompositing (HWND hWnd,
7223  int type, DWORD arg);
7224 
7225 #endif /* defined _MGSCHEMA_COMPOSITING */
7226 
7236 BOOL GUIAPI SetWindowRegion (HWND hWnd, const CLIPRGN* region);
7237 
7257 BOOL GUIAPI GetWindowRegion (HWND hWnd, CLIPRGN* region);
7258 
7259 LRESULT GUIAPI PreDefMainWinProc (HWND hWnd, UINT message,
7260  WPARAM wParam, LPARAM lParam);
7261 
7262 LRESULT GUIAPI PreDefDialogProc (HWND hWnd,
7263  UINT message, WPARAM wParam, LPARAM lParam);
7264 
7265 LRESULT GUIAPI PreDefControlProc (HWND hWnd, UINT message,
7266  WPARAM wParam, LPARAM lParam);
7267 
7268 #ifdef _MGHAVE_VIRTUAL_WINDOW
7269 LRESULT GUIAPI PreDefVirtualWinProc (HWND hWnd, UINT message,
7270  WPARAM wParam, LPARAM lParam);
7271 #endif
7272 
7290 MG_EXPORT LRESULT GUIAPI DefaultWindowProc (HWND hWnd, UINT message,
7291  WPARAM wParam, LPARAM lParam);
7292 
7298 #ifdef _MGHAVE_VIRTUAL_WINDOW
7299 extern MG_EXPORT WNDPROC __mg_def_proc[4];
7300 #else
7301 extern MG_EXPORT WNDPROC __mg_def_proc[3];
7302 #endif
7303 
7318 #define DefaultMainWinProc (__mg_def_proc[0])
7319 
7336 #define DefaultDialogProc (__mg_def_proc[1])
7337 
7351 #define DefaultControlProc (__mg_def_proc[2])
7352 
7353 #ifdef _MGHAVE_VIRTUAL_WINDOW
7354 
7367 #define DefaultVirtualWinProc (__mg_def_proc[3])
7368 #endif /* defined _MGHAVE_VIRTUAL_WINDOW */
7369 
7370 #ifdef _DEBUG
7371 MG_EXPORT void GUIAPI DumpWindow (FILE* fp, HWND hWnd);
7372 #endif /* _DEBUG */
7373 
7381 #define SW_HIDE 0x0000
7382 #define SW_SHOW 0x0010
7383 #define SW_SHOWNORMAL 0x0100
7384 
7400 MG_EXPORT void GUIAPI UpdateWindow (HWND hWnd, BOOL bErase);
7401 
7416 MG_EXPORT void GUIAPI UpdateInvalidClient (HWND hWnd, BOOL bErase);
7417 
7436 MG_EXPORT BOOL GUIAPI ShowWindow (HWND hWnd, int iCmdShow);
7437 
7454 MG_EXPORT BOOL GUIAPI EnableWindow (HWND hWnd, BOOL fEnable);
7455 
7470 MG_EXPORT BOOL GUIAPI IsWindowEnabled (HWND hWnd);
7471 
7492 MG_EXPORT BOOL GUIAPI GetClientRect(HWND hWnd, PRECT prc);
7493 
7506 MG_EXPORT gal_pixel GUIAPI DWORD2PixelByWindow (HWND hWnd, DWORD dwColor);
7507 
7523 MG_EXPORT gal_pixel GUIAPI GetWindowBkColor (HWND hWnd);
7524 
7543 MG_EXPORT gal_pixel GUIAPI SetWindowBkColor (HWND hWnd, gal_pixel new_bkcolor);
7544 
7557 MG_EXPORT PLOGFONT GUIAPI GetWindowFont (HWND hWnd);
7558 
7578 MG_EXPORT PLOGFONT GUIAPI SetWindowFont (HWND hWnd, PLOGFONT pLogFont);
7579 
7592 MG_EXPORT HCURSOR GUIAPI GetWindowCursor (HWND hWnd);
7593 
7607 MG_EXPORT HCURSOR GUIAPI SetWindowCursor (HWND hWnd, HCURSOR hNewCursor);
7608 
7621 MG_EXPORT HICON GUIAPI GetWindowIcon (HWND hWnd);
7622 
7640 MG_EXPORT HICON GUIAPI SetWindowIcon (HWND hWnd, HICON hIcon, BOOL bRedraw);
7641 
7653 MG_EXPORT DWORD GUIAPI GetWindowStyle (HWND hWnd);
7654 
7666 MG_EXPORT DWORD GUIAPI GetWindowExStyle (HWND hWnd);
7667 
7687 MG_EXPORT BOOL GUIAPI ExcludeWindowStyle (HWND hWnd, DWORD dwStyle);
7688 
7707 MG_EXPORT BOOL GUIAPI IncludeWindowStyle (HWND hWnd, DWORD dwStyle);
7708 
7727 MG_EXPORT BOOL GUIAPI ExcludeWindowExStyle (HWND hWnd, DWORD dwStyle);
7728 
7748 MG_EXPORT BOOL GUIAPI IncludeWindowExStyle (HWND hWnd, DWORD dwStyle);
7749 
7762 MG_EXPORT WNDPROC GUIAPI GetWindowCallbackProc (HWND hWnd);
7763 
7781 MG_EXPORT WNDPROC GUIAPI SetWindowCallbackProc (HWND hWnd, WNDPROC newProc);
7782 
7795 MG_EXPORT DWORD GUIAPI GetWindowAdditionalData (HWND hWnd);
7796 
7815 MG_EXPORT DWORD GUIAPI SetWindowAdditionalData (HWND hWnd, DWORD newData);
7816 
7829 MG_EXPORT DWORD GUIAPI GetWindowAdditionalData2 (HWND hWnd);
7830 
7848 MG_EXPORT DWORD GUIAPI SetWindowAdditionalData2 (HWND hWnd, DWORD newData);
7849 
7866 MG_EXPORT DWORD GUIAPI GetWindowClassAdditionalData (HWND hWnd);
7867 
7883 MG_EXPORT DWORD GUIAPI SetWindowClassAdditionalData (HWND hWnd, DWORD newData);
7884 
7897 MG_EXPORT const char* GUIAPI GetWindowCaption (HWND hWnd);
7898 
7912 MG_EXPORT BOOL GUIAPI SetWindowCaption (HWND hWnd, const char* spCaption);
7913 
7932 MG_EXPORT BOOL GUIAPI InvalidateRect (HWND hWnd,
7933  const RECT* prc, BOOL bEraseBkgnd);
7934 
7971 MG_EXPORT BOOL GUIAPI InvalidateRegion (HWND hWnd, const CLIPRGN* pRgn, BOOL bErase);
7972 
7998 MG_EXPORT BOOL GUIAPI ValidateRect (HWND hWnd, const RECT* rect);
7999 
8026 MG_EXPORT BOOL GUIAPI ValidateRegion (HWND hWnd, const CLIPRGN* pRgn);
8027 
8043 MG_EXPORT HDC GUIAPI BeginPaint(HWND hWnd);
8044 
8058 MG_EXPORT void GUIAPI EndPaint(HWND hWnd, HDC hdc);
8059 
8075 MG_EXPORT BOOL GUIAPI GetUpdateRect (HWND hWnd, RECT* update_rect);
8076 
8096 MG_EXPORT int GUIAPI GetUpdateRegion (HWND hWnd, PCLIPRGN pRgn);
8097 
8114 MG_EXPORT int GUIAPI ClientWidthToWindowWidthEx (DWORD dwStyle,
8115  int win_type, int cw);
8116 
8133 MG_EXPORT int GUIAPI ClientHeightToWindowHeightEx (DWORD dwStyle,
8134  int win_type, int ch, BOOL hasMenu);
8135 
8136 #define ClientWidthToWindowWidth(dwStyle, cw) \
8137  ClientWidthToWindowWidthEx (dwStyle, LFRDR_WINTYPE_MAINWIN, cw)
8138 
8139 #define ClientHeightToWindowHeight(dwStyle, ch, hasMenu) \
8140  ClientHeightToWindowHeightEx (dwStyle, LFRDR_WINTYPE_MAINWIN, ch, hasMenu)
8141 
8180 MG_EXPORT BOOL GUIAPI AdjustWindowRectEx (RECT* pRect, DWORD dwStyle,
8181  BOOL bMenu, DWORD dwExStyle);
8182 
8196 MG_EXPORT void GUIAPI ClientToScreen (HWND hWnd, int* x, int* y);
8197 
8211 MG_EXPORT void GUIAPI ScreenToClient (HWND hWnd, int* x, int* y);
8212 
8226 MG_EXPORT void GUIAPI ClientToWindow(HWND hWnd, int* x, int* y);
8227 
8241 MG_EXPORT void GUIAPI WindowToClient(HWND hWnd, int* x, int* y);
8242 
8243 
8257 MG_EXPORT void GUIAPI WindowToScreen (HWND hWnd, int* x, int* y);
8258 
8272 MG_EXPORT void GUIAPI ScreenToWindow (HWND hWnd, int* x, int* y);
8273 
8287 MG_EXPORT BOOL GUIAPI IsMainWindow (HWND hWnd);
8288 
8289 #ifdef _MGHAVE_VIRTUAL_WINDOW
8290 
8303 MG_EXPORT BOOL GUIAPI IsVirtualWindow (HWND hWnd);
8304 #endif /* defined _MGHAVE_VIRTUAL_WINDOW */
8305 
8318 MG_EXPORT BOOL GUIAPI IsControl (HWND hWnd);
8319 
8333 MG_EXPORT BOOL GUIAPI IsWindow (HWND hWnd);
8334 
8348 MG_EXPORT BOOL GUIAPI IsDialog (HWND hWnd);
8349 
8367 MG_EXPORT HWND GUIAPI GetParent (HWND hWnd);
8368 
8384 MG_EXPORT HWND GUIAPI GetMainWindowHandle (HWND hWnd);
8385 
8400 MG_EXPORT BOOL GUIAPI IsWindowVisible (HWND hWnd);
8401 
8419 MG_EXPORT BOOL GUIAPI GetWindowRect (HWND hWnd, PRECT prc);
8420 
8445 MG_EXPORT HWND GUIAPI GetNextChild (HWND hWnd, HWND hChild);
8446 
8464 MG_EXPORT HWND GUIAPI GetNextMainWindow (HWND hMainWnd);
8465 
8466 #define WIN_SEARCH_METHOD_MASK 0xFF00
8467 #define WIN_SEARCH_METHOD_BFS 0x0000
8468 #define WIN_SEARCH_METHOD_DFS 0x0100
8469 
8470 #define WIN_SEARCH_FILTER_MASK 0x00FF
8471 #define WIN_SEARCH_FILTER_MAIN 0x0001
8472 #define WIN_SEARCH_FILTER_VIRT 0x0002
8473 
8509 MG_EXPORT HWND GUIAPI GetHostedById (HWND hHosting,
8510  LINT lId, DWORD dwSearchFlags);
8511 
8524 MG_EXPORT LINT GUIAPI GetWindowId (HWND hWnd);
8525 
8539 MG_EXPORT LINT GUIAPI SetWindowId (HWND hWnd, LINT lNewId);
8540 
8560 MG_EXPORT HWND GUIAPI GetRootWindow (int* nrWins);
8561 
8585 MG_EXPORT HWND GUIAPI GetHosting (HWND hWnd);
8586 
8607 MG_EXPORT HWND GUIAPI GetFirstHosted (HWND hHosting);
8608 
8632 MG_EXPORT HWND GUIAPI GetNextHosted (HWND hHosting, HWND hHosted);
8633 
8648 MG_EXPORT int GUIAPI GetWindowTextLength (HWND hWnd);
8649 
8666 MG_EXPORT int GUIAPI GetWindowText (HWND hWnd, char* spString, int nMaxLen);
8667 
8683 MG_EXPORT BOOL GUIAPI SetWindowText (HWND hWnd, const char* spString);
8684 
8699 MG_EXPORT HWND GUIAPI GetFocusChild (HWND hParent);
8700 
8714 MG_EXPORT HWND GUIAPI SetNullFocus (HWND hParent);
8715 
8729 MG_EXPORT HWND GUIAPI SetFocusChild (HWND hWnd);
8730 
8735 #define SetFocus SetFocusChild
8736 
8741 #define GetFocus GetFocusChild
8742 
8754 MG_EXPORT HWND GUIAPI GetActiveWindow (void);
8755 
8769 MG_EXPORT HWND GUIAPI SetActiveWindow (HWND hMainWnd);
8770 
8775 #define GetForegroundWindow GetActiveWindow
8776 
8781 #define SetForegroundWindow SetActiveWindow
8782 
8797 MG_EXPORT HWND GUIAPI GetCapture(void);
8798 
8814 MG_EXPORT HWND GUIAPI SetCapture(HWND hWnd);
8815 
8827 MG_EXPORT void GUIAPI ReleaseCapture(void);
8828 
8841 MG_EXPORT HWND GUIAPI GetWindowUnderCursor (void);
8842 
8857 MG_EXPORT HWND GUIAPI WindowFromPointEx (POINT pt, BOOL bRecursion);
8858 
8859 #define WindowFromPoint(pt) WindowFromPointEx(pt, TRUE)
8860 
8861 #define CWP_ALL 0x0000
8862 #define CWP_SKIPINVISIBLE 0x0001
8863 #define CWP_SKIPDISABLED 0x0002
8864 #define CWP_SKIPTRANSPARENT 0x0004
8865 
8902 MG_EXPORT HWND GUIAPI ChildWindowFromPointEx (HWND hParent, POINT pt,
8903  UINT uFlags);
8904 
8916 static inline HWND GUIAPI ChildWindowFromPoint (HWND hParent, POINT pt)
8917 {
8918  return ChildWindowFromPointEx (hParent, pt, CWP_ALL);
8919 }
8920 
8942 MG_EXPORT BOOL GUIAPI MoveWindow (HWND hWnd, int x, int y, int w, int h,
8943  BOOL fPaint);
8944 
8945 #define SW_INVALIDATE 0x01
8946 #define SW_ERASE 0x02
8947 #define SW_SCROLLCHILDREN 0x04
8948 
9020 MG_EXPORT int GUIAPI ScrollWindowEx (HWND hWnd, int dx, int dy,
9021  const RECT *prcScroll, const RECT *prcClip,
9022  PCLIPRGN pRgnUpdate, PRECT prcUpdate, UINT flags);
9023 
9044 static inline void GUIAPI ScrollWindow (HWND hWnd, int dx, int dy,
9045  const RECT* prcScroll, const RECT* prcClip)
9046 {
9047  ScrollWindowEx (hWnd, dx, dy, prcScroll, prcClip,
9048  NULL, NULL, SW_ERASE | SW_INVALIDATE | SW_SCROLLCHILDREN);
9049 }
9050 
9051 #if 0
9052 /* deprecated. */
9053 #define GetWindowElementColor(iItem) \
9054  GetWindowElementPixelEx(HWND_NULL, (HDC)-1, iItem)
9055 
9056 /* deprecated. */
9057 #define GetWindowElementColorEx(hWnd, iItem) \
9058  GetWindowElementPixelEx(hWnd, (HDC)-1, iItem)
9059 #endif
9060 
9066 #define GetWindowElementPixel(hWnd, iItem) \
9067  GetWindowElementPixelEx(hWnd, HDC_INVALID, iItem)
9068 
9075 #define SYSBMP_RADIOBUTTON "radiobutton"
9076 #define SYSBMP_CHECKBUTTON "checkbutton"
9077 #define SYSBMP_BGPICTURE "bgpicture"
9078 #define SYSBMP_BGPICPOS "bgpicpos"
9079 
9080 /* Obsolete definitions; back-compatibility definitions. */
9081 #define SYSBMP_IMECTRLBTN "IMEctrlbtn"
9082 #define SYSBMP_LOGO "logo"
9083 
9114 MG_EXPORT const BITMAP* GUIAPI GetSystemBitmapEx2 (HDC hdc,
9115  const char* rdr_name, const char* id);
9116 
9138 static inline const BITMAP* GUIAPI GetSystemBitmapEx (const char* rdr_name,
9139  const char* id)
9140 {
9141  return GetSystemBitmapEx2 (HDC_SCREEN, rdr_name, id);
9142 }
9143 
9163 MG_EXPORT const BITMAP* GUIAPI GetSystemBitmap (HWND hWnd, const char* id);
9164 
9171 #define GetSystemBitmapByHwnd(hWnd, id) GetSystemBitmap ((hWnd), (id))
9172 
9192 MG_EXPORT void GUIAPI TermSystemBitmapEx (const char* id,
9193  const char* rdr_name, PBITMAP bmp);
9194 
9213 MG_EXPORT void GUIAPI TermSystemBitmap (HWND hWnd, const char* id, PBITMAP bmp);
9214 
9215 /*for backward compatibility */
9216 #define IDI_APPLICATION 0
9217 #define IDI_HAND 1
9218 #define IDI_STOP IDI_HAND
9219 #define IDI_QUESTION 2
9220 #define IDI_EXCLAMATION 3
9221 #define IDI_ASTERISK 4
9222 #define IDI_INFORMATION IDI_ASTERISK
9223 
9224 #define SYSICON_FT_DIR "dir"
9225 #define SYSICON_FT_FILE "file"
9226 
9227 #define SYSICON_TREEFOLD "treefold"
9228 #define SYSICON_TREEUNFOLD "treeunfold"
9229 
9247 MG_EXPORT HICON GUIAPI LoadSystemIconEx (HDC hdc,
9248  const char* rdr_name, const char* szItemName, int which);
9249 
9264 MG_EXPORT HICON GUIAPI LoadSystemIcon (const char* szItemName, int which);
9265 
9286 MG_EXPORT HICON GUIAPI GetLargeSystemIconEx (HWND hWnd, int iItem);
9287 
9308 MG_EXPORT HICON GUIAPI GetSmallSystemIconEx (HWND hWnd, int iItem);
9309 
9316 #define GetLargeSystemIcon(iItem) GetLargeSystemIconEx(HWND_NULL, iItem)
9317 
9324 #define GetSmallSystemIcon(iItem) GetSmallSystemIconEx(HWND_NULL, iItem)
9325 
9333 #define SB_HORZ 1
9334 #define SB_VERT 2
9335 
9354 MG_EXPORT BOOL GUIAPI EnableScrollBar (HWND hWnd, int iSBar, BOOL bEnable);
9355 
9377 MG_EXPORT BOOL GUIAPI GetScrollPos (HWND hWnd, int iSBar, int* pPos);
9378 
9403 MG_EXPORT BOOL GUIAPI GetScrollRange (HWND hWnd, int iSBar,
9404  int* pMinPos, int* pMaxPos);
9405 
9428 MG_EXPORT BOOL GUIAPI SetScrollPos (HWND hWnd, int iSBar, int iNewPos);
9429 
9454 MG_EXPORT BOOL GUIAPI SetScrollRange (HWND hWnd, int iSBar,
9455  int iMinPos, int iMaxPos);
9456 
9476 MG_EXPORT BOOL GUIAPI ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow);
9477 
9478 #define SIF_RANGE 0x0001
9479 #define SIF_PAGE 0x0002
9480 #define SIF_POS 0x0004
9481 #define SIF_DISABLENOSCROLL 0x0008
9482 #define SIF_TRACKPOS 0x0010
9483 #define SIF_ALL (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)
9484 
9486 #define SB_ARROW_LTUP 0x0001
9487 
9489 #define SB_ARROW_BTDN 0x0002
9490 
9492 #define SB_ARROW_BOTH (SB_ARROW_LTUP | SB_ARROW_BTDN)
9493 
9497 typedef struct _SCROLLINFO
9498 {
9500  UINT cbSize;
9513  UINT fMask;
9515  int nMin;
9517  int nMax;
9519  UINT nPage;
9521  int nPos;
9522 #if 0
9523  int nTrackPos;
9524 #endif
9526 
9550 MG_EXPORT BOOL GUIAPI SetScrollInfo (HWND hWnd, int iSBar,
9551  const SCROLLINFO* lpsi, BOOL fRedraw);
9552 
9575 MG_EXPORT BOOL GUIAPI GetScrollInfo (HWND hWnd, int iSBar, PSCROLLINFO lpsi);
9576 
9584 /* Class styles -- not supported so far */
9585 #define CS_VREDRAW 0x0001
9586 #define CS_HREDRAW 0x0002
9587 #define CS_KEYCVTWINDOW 0x0004
9588 #define CS_DBLCLKS 0x0008
9589 
9590 #define CS_OWNDC 0x0020
9591 #define CS_CLASSDC 0x0040
9592 #define CS_PARENTDC 0x0080
9593 
9594 #define CS_NOKEYCVT 0x0100
9595 #define CS_NOCLOSE 0x0200
9596 #define CS_SAVEBITS 0x0800
9597 
9598 #define CS_BYTEALIGNCLIENT 0x1000
9599 #define CS_BYTEALIGNWINDOW 0x2000
9600 #define CS_GLOBALCLASS 0x4000
9601 #define CS_IME 0x8000
9602 
9603 #define COP_STYLE 0x0001
9604 #define COP_HCURSOR 0x0002
9605 #define COP_BKCOLOR 0x0004
9606 #define COP_WINPROC 0x0008
9607 #define COP_ADDDATA 0x0010
9608 
9612 typedef struct _WNDCLASS {
9614  const char* spClassName;
9615 
9629 
9632 
9635 
9638 
9639 #ifndef _MGSCHEMA_COMPOSITING
9640 
9658 #else /* not defined _MGSCHEMA_COMPOSITING */
9659 
9669  DWORD dwBkColor;
9670 #endif /* defined _MGSCHEMA_COMPOSITING */
9671 
9673  LRESULT (*WinProc) (HWND, UINT, WPARAM, LPARAM);
9674 
9677 } WNDCLASS;
9678 typedef WNDCLASS* PWNDCLASS;
9679 
9680 #define MAINWINCLASSNAME ("MAINWINDOW")
9681 #define VIRTWINCLASSNAME ("VIRTWINDOW")
9682 #define ROOTWINCLASSNAME ("ROOTWINDOW")
9683 
9702 MG_EXPORT BOOL GUIAPI RegisterWindowClass (PWNDCLASS pWndClass);
9703 
9717 MG_EXPORT BOOL GUIAPI UnregisterWindowClass (const char* szClassName);
9718 
9732 MG_EXPORT const char* GUIAPI GetClassName (HWND hWnd);
9733 
9749 MG_EXPORT BOOL GUIAPI GetWindowClassInfo (PWNDCLASS pWndClass);
9750 
9765 MG_EXPORT BOOL GUIAPI SetWindowClassInfo (const WNDCLASS* pWndClass);
9766 
9811 MG_EXPORT HWND GUIAPI CreateWindowEx2 (const char* spClassName,
9812  const char* spCaption, DWORD dwStyle, DWORD dwExStyle,
9813  LINT id, int x, int y, int w, int h, HWND hParentWnd,
9814  const char* werdr_name, const WINDOW_ELEMENT_ATTR* we_attrs,
9815  DWORD dwAddData);
9816 
9829 static inline HWND GUIAPI CreateWindowEx (const char* spClassName,
9830  const char* spCaption, DWORD dwStyle, DWORD dwExStyle,
9831  LINT id, int x, int y, int w, int h, HWND hParentWnd,
9832  DWORD dwAddData)
9833 {
9834  return CreateWindowEx2 (spClassName, spCaption, dwStyle, dwExStyle,
9835  id, x, y, w, h, hParentWnd, NULL, NULL, dwAddData);
9836 }
9837 
9850 MG_EXPORT BOOL GUIAPI DestroyWindow (HWND hWnd);
9851 
9887 MG_EXPORT NOTIFPROC GUIAPI SetNotificationCallback (HWND hwnd,
9888  NOTIFPROC notif_proc);
9889 
9903 MG_EXPORT NOTIFPROC GUIAPI GetNotificationCallback (HWND hwnd);
9904 
9912 static inline HWND GUIAPI CreateWindow (const char* spClassName,
9913  const char* spCaption, DWORD dwStyle,
9914  LINT id, int x, int y, int w, int h, HWND hParentWnd,
9915  DWORD dwAddData)
9916 {
9917  return CreateWindowEx2 (spClassName, spCaption, dwStyle, WS_EX_NONE,
9918  id, x, y, w, h, hParentWnd, NULL, NULL, dwAddData);
9919 }
9920 
9923 /******************************** Timer Support ******************************/
9946 typedef BOOL (* TIMERPROC)(HWND, LINT, DWORD);
9947 
9989 MG_EXPORT BOOL GUIAPI SetTimerEx (HWND hWnd, LINT id, DWORD speed,
9990  TIMERPROC timer_proc);
9991 
9998 #define SetTimer(hwnd, id, speed) \
9999  SetTimerEx(hwnd, id, speed, NULL)
10000 
10018 MG_EXPORT int GUIAPI KillTimer (HWND hWnd, LINT id);
10019 
10042 MG_EXPORT BOOL GUIAPI ResetTimerEx (HWND hWnd, LINT id, DWORD speed,
10043  TIMERPROC timer_proc);
10044 
10051 #define ResetTimer(hwnd, id, speed) \
10052  ResetTimerEx(hwnd, id, speed, (TIMERPROC)INV_PTR)
10053 
10071 MG_EXPORT BOOL GUIAPI IsTimerInstalled (HWND hWnd, LINT id);
10072 
10085 MG_EXPORT BOOL GUIAPI HaveFreeTimer (void);
10086 
10097 typedef struct _IME_TARGET_INFO
10098 {
10111 
10112  /* The position of the caret */
10113  POINT ptCaret;
10114 
10115  /* The rect of the edit box */
10116  RECT rcEditBox;
10117 } IME_TARGET_INFO;
10118 
10137 MG_EXPORT int GUIAPI RegisterIMEWindow (HWND hWnd);
10138 
10153 MG_EXPORT int GUIAPI UnregisterIMEWindow (HWND hWnd);
10154 
10198 MG_EXPORT int GUIAPI GetIMEStatus (int StatusCode);
10199 
10215 MG_EXPORT int GUIAPI SetIMEStatus (int StatusCode, int Value);
10216 
10230 MG_EXPORT int GUIAPI GetIMETargetInfo (IME_TARGET_INFO *info);
10231 
10247 MG_EXPORT int GUIAPI SetIMETargetInfo (const IME_TARGET_INFO *info);
10248 
10265 MG_EXPORT int GUIAPI GetIMEPos (POINT* pt);
10266 
10284 MG_EXPORT int GUIAPI SetIMEPos (const POINT* pt);
10285 
10304 MG_EXPORT HACCEL GUIAPI CopyAcceleratorTable (HACCEL hacc);
10305 
10319 MG_EXPORT int GUIAPI DeleteAccelerators (HACCEL hacc, int key, DWORD keymask);
10320 
10321 #define ACCEL_SHIFT KS_SHIFT
10322 #define ACCEL_ALT KS_ALT
10323 #define ACCEL_CTRL KS_CTRL
10324 
10353 MG_EXPORT int GUIAPI AddAccelerators (HACCEL hacc, int key,
10354  DWORD keymask, WPARAM wParam, LPARAM lParam);
10355 
10370 MG_EXPORT int GUIAPI DestroyAcceleratorTable (HACCEL hacc);
10371 
10383 MG_EXPORT HACCEL GUIAPI CreateAcceleratorTable (HWND hWnd);
10384 
10396 MG_EXPORT int GUIAPI TranslateAccelerator (HACCEL hAccel, PMSG pMsg);
10397 
10423 MG_EXPORT BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap,
10424  int nWidth, int nHeight);
10425 
10441 MG_EXPORT BOOL GUIAPI ChangeCaretSize (HWND hWnd, int newWidth, int newHeight);
10442 
10455 MG_EXPORT BOOL GUIAPI ActiveCaret (HWND hWnd);
10456 
10472 MG_EXPORT UINT GUIAPI GetCaretBlinkTime (HWND hWnd);
10473 
10490 MG_EXPORT BOOL GUIAPI SetCaretBlinkTime (HWND hWnd, UINT uTime);
10491 
10504 MG_EXPORT BOOL GUIAPI DestroyCaret (HWND hWnd);
10505 
10523 MG_EXPORT BOOL GUIAPI HideCaretEx (HWND hWnd, BOOL ime);
10524 
10539 static inline BOOL GUIAPI HideCaret (HWND hWnd)
10540 {
10541  return HideCaretEx (hWnd, TRUE);
10542 }
10543 
10561 MG_EXPORT BOOL GUIAPI ShowCaretEx (HWND hWnd, BOOL ime);
10562 
10577 static inline BOOL GUIAPI ShowCaret (HWND hWnd)
10578 {
10579  return ShowCaretEx (hWnd, TRUE);
10580 }
10581 
10598 MG_EXPORT BOOL GUIAPI SetCaretPos (HWND hWnd, int x, int y);
10599 
10614 MG_EXPORT BOOL GUIAPI GetCaretPos (HWND hWnd, PPOINT pPt);
10615 
10623 /* Menu flags */
10624 #define MF_INSERT 0x00000000L
10625 #define MF_CHANGE 0x00000080L
10626 #define MF_APPEND 0x00000100L
10627 #define MF_DELETE 0x00000200L
10628 #define MF_REMOVE 0x00001000L
10629 
10630 #define MF_BYCOMMAND 0x00000000L
10631 #define MF_BYPOSITION 0x00000400L
10632 
10633 #define MF_SEPARATOR 0x00000800L
10634 
10635 #define MF_ENABLED 0x00000000L
10636 #define MF_GRAYED 0x00000001L
10637 #define MF_DISABLED 0x00000002L
10638 
10639 #define MF_UNCHECKED 0x00000000L
10640 #define MF_CHECKED 0x00000008L
10641 #define MF_USECHECKBITMAPS 0x00000200L
10642 
10643 #define MF_STRING 0x00000000L
10644 #define MF_BITMAP 0x00000004L
10645 #define MF_OWNERDRAW 0x00000100L
10646 
10647 #define MF_POPUP 0x00000010L
10648 #define MF_MENUBARBREAK 0x00000020L
10649 #define MF_MENUBREAK 0x00000040L
10650 
10651 #define MF_UNHILITE 0x00000000L
10652 #define MF_HILITE 0x00000080L
10653 
10654 #define MF_DEFAULT 0x00001000L
10655 #define MF_SYSMENU 0x00002000L
10656 #define MF_HELP 0x00004000L
10657 #define MF_RIGHTJUSTIFY 0x00004000L
10658 
10659 #define MF_MOUSESELECT 0x00008000L
10660 #define MF_END 0x00000080L
10661 
10662 #define MFT_STRING MF_STRING /* 0x00000000L */
10663 #define MFT_BITMAP MF_BITMAP /* 0x00000004L */
10664 #define MFT_BMPSTRING 0x00010000L
10665 #define MFT_MENUBARBREAK MF_MENUBARBREAK /* 0x00000020L */
10666 #define MFT_MENUBREAK MF_MENUBREAK /* 0x00000040L */
10667 #define MFT_OWNERDRAW MF_OWNERDRAW /* 0x00000100L */
10668 #define MFT_RADIOCHECK 0x00000200L
10669 #define MFT_MARKCHECK 0x00000400L
10670 #define MFT_SEPARATOR MF_SEPARATOR /* 0x00000800L */
10671 
10672 #define MFT_RIGHTORDER 0x00002000L
10673 #define MFT_RIGHTJUSTIFY MF_RIGHTJUSTIFY
10674 
10675 #define MFS_GRAYED 0x00000003L
10676 #define MFS_DISABLED MFS_GRAYED
10677 #define MFS_CHECKED MF_CHECKED
10678 #define MFS_HILITE MF_HILITE
10679 #define MFS_ENABLED MF_ENABLED
10680 #define MFS_UNCHECKED MF_UNCHECKED
10681 #define MFS_UNHILITE MF_UNHILITE
10682 #define MFS_DEFAULT MF_DEFAULT
10683 
10684 /* System Menu Command Values */
10685  #define SC_SIZE 0xF000
10686  #define SC_MOVE 0xF010
10687  #define SC_MINIMIZE 0xF020
10688  #define SC_MAXIMIZE 0xF030
10689  #define SC_NEXTWINDOW 0xF040
10690  #define SC_PREVWINDOW 0xF050
10691  #define SC_CLOSE 0xF060
10692  #define SC_VSCROLL 0xF070
10693  #define SC_HSCROLL 0xF080
10694  #define SC_MOUSEMENU 0xF090
10695  #define SC_KEYMENU 0xF100
10696  #define SC_ARRANGE 0xF110
10697  #define SC_RESTORE 0xF120
10698  #define SC_TASKLIST 0xF130
10699  #define SC_SCREENSAVE 0xF140
10700  #define SC_HOTKEY 0xF150
10701 
10702  #define SC_DEFAULT 0xF160
10703  #define SC_MONITORPOWER 0xF170
10704  #define SC_CONTEXTHELP 0xF180
10705  #define SC_SEPARATOR 0xF00F
10706 
10707 /* MENUITEMINFO flags */
10708  #define MIIM_STATE 0x00000001
10709  #define MIIM_ID 0x00000002
10710  #define MIIM_SUBMENU 0x00000004
10711  #define MIIM_CHECKMARKS 0x00000008
10712  #define MIIM_TYPE 0x00000010
10713  #define MIIM_DATA 0x00000020
10714  #define MIIM_STRING 0x00000040
10715  #define MIIM_BITMAP 0x00000080
10716  #define MIIM_FTYPE 0x00000100
10717 
10718 
10719 /* Flags for TrackPopupMenu */
10720  #define TPM_LEFTBUTTON 0x0000L
10721  #define TPM_RIGHTBUTTON 0x0002L
10722  #define TPM_LEFTALIGN 0x0000L
10723  #define TPM_CENTERALIGN 0x0004L
10724  #define TPM_RIGHTALIGN 0x0008L
10725  #define TPM_TOPALIGN 0x0000L
10726  #define TPM_VCENTERALIGN 0x0010L
10727  #define TPM_BOTTOMALIGN 0x0020L
10728 
10729  #define TPM_HORIZONTAL 0x0000L /* Horz alignment matters more */
10730  #define TPM_VERTICAL 0x0040L /* Vert alignment matters more */
10731  #define TPM_NONOTIFY 0x0080L /* Don't send any notification msgs */
10732  #define TPM_RETURNCMD 0x0100L
10733 
10734  #define TPM_DESTROY 0x1000L /* Destroy menu after tracking */
10735  #define TPM_SYSCMD 0x2000L /* Send system command */
10736  #define TPM_DEFAULT 0x0000L /* Default tracking flag */
10737 
10738 /* return codes for MSG_MENUCHAR */
10739 #define MNC_IGNORE 0
10740 #define MNC_CLOSE 1
10741 #define MNC_EXECUTE 2
10742 #define MNC_SELECT 3
10743 
10747 typedef struct _MENUITEMINFO {
10748 
10765  UINT mask;
10766 
10793  UINT type;
10794 
10808  UINT state;
10809 
10813  LINT id;
10814 
10817 
10820 
10823 
10826 
10829 
10834  UINT cch;
10835 } MENUITEMINFO;
10836 typedef MENUITEMINFO* PMENUITEMINFO;
10837 
10849 MG_EXPORT HMENU GUIAPI CreateMenu (void);
10850 
10865 MG_EXPORT HMENU GUIAPI CreatePopupMenu ( PMENUITEMINFO pmii);
10866 
10881 MG_EXPORT HMENU GUIAPI CreateSystemMenu (HWND hwnd, DWORD dwStyle);
10882 
10911 MG_EXPORT int GUIAPI InsertMenuItem (HMENU hmnu, LINT item,
10912  UINT flag, PMENUITEMINFO pmii);
10913 
10940 MG_EXPORT int GUIAPI RemoveMenu (HMENU hmnu, LINT item, UINT flag);
10941 
10967 MG_EXPORT int GUIAPI DeleteMenu (HMENU hmnu, LINT item, UINT flag);
10968 
10985 MG_EXPORT int GUIAPI DestroyMenu (HMENU hmnu);
10986 
11001 MG_EXPORT int GUIAPI IsMenu (HMENU hmnu);
11002 
11017 MG_EXPORT HMENU GUIAPI SetMenu (HWND hwnd, HMENU hmnu);
11018 
11031 MG_EXPORT HMENU GUIAPI GetMenu (HWND hwnd);
11032 
11045 MG_EXPORT void GUIAPI DrawMenuBar (HWND hwnd);
11046 
11061 MG_EXPORT int GUIAPI TrackMenuBar (HWND hwnd, int pos);
11062 
11100 MG_EXPORT int GUIAPI TrackPopupMenu (HMENU hmnu, UINT uFlags,
11101  int x, int y, HWND hwnd);
11102 
11120 MG_EXPORT HMENU GUIAPI GetMenuBarItemRect (HWND hwnd, int pos, RECT* prc);
11121 
11122 #define LFRDR_MENU_STATE_HILITE 0x01
11123 #define LFRDR_MENU_STATE_NORMAL 0x02
11124 #define LFRDR_MENU_STATE_DISABLED 0x04
11125 
11147 MG_EXPORT BOOL GUIAPI HiliteMenuBarItem (HWND hwnd, int pos, UINT flag);
11148 
11161 MG_EXPORT int GUIAPI GetMenuItemCount (HMENU hmnu);
11162 
11180 MG_EXPORT LINT GUIAPI GetMenuItemID (HMENU hmnu, int pos);
11181 
11207 MG_EXPORT int GUIAPI GetMenuItemInfo (HMENU hmnu, LINT item,
11208  UINT flag, PMENUITEMINFO pmii);
11209 
11210 /*Reserved*/
11211 int GUIAPI GetMenuItemRect (HWND hwnd, HMENU hmnu,
11212  LINT item, PRECT prc);
11213 
11226 MG_EXPORT HMENU GUIAPI GetPopupSubMenu (HMENU hpppmnu);
11227 
11240 MG_EXPORT HMENU GUIAPI StripPopupHead (HMENU hpppmnu);
11241 
11259 MG_EXPORT HMENU GUIAPI GetSubMenu (HMENU hmnu, int pos);
11260 
11278 MG_EXPORT HMENU GUIAPI GetSystemMenu (HWND hwnd, BOOL flag);
11279 
11301 MG_EXPORT UINT GUIAPI EnableMenuItem (HMENU hmnu, LINT item, UINT flag);
11302 
11329 MG_EXPORT int GUIAPI CheckMenuRadioItem (HMENU hmnu, LINT first, LINT last,
11330  LINT checkitem, UINT flag);
11331 
11357 MG_EXPORT int GUIAPI SetMenuItemBitmaps (HMENU hmnu, LINT item, UINT flag,
11358  PBITMAP hBmpUnchecked, PBITMAP hBmpChecked);
11359 
11383 MG_EXPORT int GUIAPI SetMenuItemInfo (HMENU hmnu, LINT item,
11384  UINT flag, PMENUITEMINFO pmii);
11385 
11393 /* Dialog codes */
11398 #define DLGC_WANTARROWS 0x0001
11399 
11403 #define DLGC_WANTTAB 0x0002
11404 
11408 #define DLGC_WANTALLKEYS 0x0004
11409 
11413 #define DLGC_WANTCHARS 0x0008
11414 
11419 #define DLGC_WANTENTER 0x0010
11420 
11424 #define DLGC_HASSETSEL 0x0080
11425 
11430 #define DLGC_DEFPUSHBUTTON 0x0100
11431 
11435 #define DLGC_PUSHBUTTON 0x0200
11436 
11440 #define DLGC_RADIOBUTTON 0x0400
11441 
11445 #define DLGC_3STATE 0x0800
11446 
11450 #define DLGC_STATIC 0x1000
11451 
11455 #define DLGC_BUTTON 0x2000
11456 
11460 typedef struct _CTRLDATA
11461 {
11463  const char* class_name;
11467  int x, y, w, h;
11471  LINT id;
11473  const char* caption;
11478 
11480  const char* werdr_name;
11481 
11484 } CTRLDATA;
11485 typedef CTRLDATA* PCTRLDATA;
11486 
11494 typedef struct _DLGTEMPLATE
11495 {
11501  int x, y, w, h;
11503  const char* caption;
11511  PCTRLDATA controls;
11514 } DLGTEMPLATE;
11515 typedef DLGTEMPLATE* PDLGTEMPLATE;
11516 
11548 MG_EXPORT HWND GUIAPI CreateMainWindowIndirectParamEx (PDLGTEMPLATE pDlgTemplate,
11549  HWND hOwner, WNDPROC WndProc, LPARAM lParam,
11550  const char* werdr_name, WINDOW_ELEMENT_ATTR* we_attrs,
11551  const char* window_name, const char* layer_name);
11552 
11565 static inline HWND GUIAPI CreateMainWindowIndirectParam (
11566  PDLGTEMPLATE pDlgTemplate, HWND hOwner,
11567  WNDPROC WndProc, LPARAM lParam)
11568 {
11569  return CreateMainWindowIndirectParamEx (pDlgTemplate, hOwner,
11570  WndProc, lParam, NULL, NULL, NULL, NULL);
11571 }
11572 
11584 static inline HWND GUIAPI CreateMainWindowIndirect (
11585  PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC WndProc)
11586 {
11587  return CreateMainWindowIndirectParam (pDlgTemplate, hOwner, WndProc, 0);
11588 }
11589 
11601 MG_EXPORT BOOL GUIAPI DestroyMainWindowIndirect (HWND hMainWin);
11602 
11636 MG_EXPORT int GUIAPI DialogBoxIndirectParamEx (PDLGTEMPLATE pDlgTemplate,
11637  HWND hOwner, WNDPROC DlgProc, LPARAM lParam,
11638  const char* werdr_name, WINDOW_ELEMENT_ATTR* we_attrs,
11639  const char* window_name, const char* layer_name);
11640 
11652 static inline int GUIAPI DialogBoxIndirectParam (PDLGTEMPLATE pDlgTemplate,
11653  HWND hOwner, WNDPROC DlgProc, LPARAM lParam)
11654 {
11655  return DialogBoxIndirectParamEx (pDlgTemplate, hOwner, DlgProc, lParam,
11656  NULL, NULL, NULL, NULL);
11657 }
11658 
11676 MG_EXPORT BOOL GUIAPI EndDialog (HWND hDlg, int endCode);
11677 
11688 MG_EXPORT void GUIAPI DestroyAllControls (HWND hWnd);
11689 
11701 MG_EXPORT HWND GUIAPI GetDlgDefPushButton (HWND hWnd);
11702 
11717 MG_EXPORT LINT GUIAPI GetDlgCtrlID (HWND hwndCtl);
11718 
11733 MG_EXPORT HWND GUIAPI GetDlgItem (HWND hDlg, LINT nIDDlgItem);
11734 
11767 MG_EXPORT UINT GUIAPI GetDlgItemInt (HWND hDlg, LINT nIDDlgItem,
11768  BOOL *lpTranslated, BOOL bSigned);
11769 
11792 MG_EXPORT int GUIAPI GetDlgItemText (HWND hDlg, LINT nIDDlgItem,
11793  char* lpString, int nMaxCount);
11794 
11815 MG_EXPORT char* GUIAPI GetDlgItemText2 (HWND hDlg, LINT id, int* lenPtr);
11816 
11836 MG_EXPORT HWND GUIAPI GetNextDlgGroupItem (HWND hDlg,
11837  HWND hCtl, BOOL bPrevious);
11838 
11857 MG_EXPORT HWND GUIAPI GetNextDlgTabItem (HWND hDlg, HWND hCtl, BOOL bPrevious);
11858 
11880 MG_EXPORT LRESULT GUIAPI SendDlgItemMessage (HWND hDlg, LINT nIDDlgItem,
11881  UINT message, WPARAM wParam, LPARAM lParam);
11882 
11905 MG_EXPORT BOOL GUIAPI SetDlgItemInt (HWND hDlg, LINT nIDDlgItem,
11906  UINT uValue, BOOL bSigned);
11907 
11927 MG_EXPORT BOOL GUIAPI SetDlgItemText (HWND hDlg, LINT nIDDlgItem,
11928  const char* lpString);
11929 
11930 #ifdef _MGCTRL_BUTTON
11931 
11956 MG_EXPORT void GUIAPI CheckDlgButton (HWND hDlg, LINT nIDDlgItem, int nCheck);
11957 
11979 MG_EXPORT void GUIAPI CheckRadioButton (HWND hDlg,
11980  LINT idFirstButton, LINT idLastButton, LINT idCheckButton);
11981 
12009 MG_EXPORT int GUIAPI IsDlgButtonChecked (HWND hDlg, LINT idButton);
12010 #endif
12011 
12019 #if defined(_MGCTRL_STATIC) && defined (_MGCTRL_BUTTON)
12020 
12021 /* Standard control IDs */
12022 #define IDC_STATIC 0
12023 #define IDOK 1
12024 #define IDCANCEL 2
12025 #define IDABORT 3
12026 #define IDRETRY 4
12027 #define IDIGNORE 5
12028 #define IDYES 6
12029 #define IDNO 7
12030 
12031 #define MINID_RESERVED 0xF001
12032 #define MAXID_RESERVED 0xFFFF
12033 
12034 #define MB_OK 0x00000000
12035 #define MB_OKCANCEL 0x00000001
12036 #define MB_YESNO 0x00000002
12037 #define MB_RETRYCANCEL 0x00000003
12038 #define MB_ABORTRETRYIGNORE 0x00000004
12039 #define MB_YESNOCANCEL 0x00000005
12040 #define MB_CANCELASBACK 0x00000008 /* customized style */
12041 #define MB_TYPEMASK 0x00000007
12042 
12043 #define MB_ICONHAND 0x00000010
12044 #define MB_ICONQUESTION 0x00000020
12045 #define MB_ICONEXCLAMATION 0x00000030
12046 #define MB_ICONASTERISK 0x00000040
12047 #define MB_ICONMASK 0x000000F0
12048 
12049 #define MB_ICONINFORMATION MB_ICONASTERISK
12050 #define MB_ICONSTOP MB_ICONHAND
12051 
12052 #define MB_DEFBUTTON1 0x00000000
12053 #define MB_DEFBUTTON2 0x00000100
12054 #define MB_DEFBUTTON3 0x00000200
12055 #define MB_DEFMASK 0x00000F00
12056 
12057 /* #define MB_APPLMODAL 0x00000000 */
12058 /* #define MB_SYSTEMMODAL 0x00001000 */
12059 /* #define MB_TASKMODAL 0x00002000 */
12060 
12061 #define MB_NOFOCUS 0x00008000
12062 
12063 #define MB_ALIGNCENTER 0x00000000
12064 #define MB_ALIGNTOPLEFT 0x00010000
12065 #define MB_ALIGNBTMLEFT 0x00020000
12066 #define MB_ALIGNTOPRIGHT 0x00030000
12067 #define MB_ALIGNBTMRIGHT 0x00040000
12068 #define MB_ALIGNMASK 0x00070000
12069 
12070 #define MB_BASEDONPARENT 0x00080000 /* default is desktop. */
12071 
12174 MG_EXPORT int GUIAPI MessageBox (HWND hParentWnd, const char* pszText,
12175  const char* pszCaption, DWORD dwStyle);
12176 
12177 #endif /* _MGCTRL_STATIC && _MGCTRL_BUTTON */
12178 
12189 MG_EXPORT void GUIAPI MessageBeep (DWORD dwBeep);
12190 
12195 #ifdef __cplusplus
12196 }
12197 #endif /* __cplusplus */
12198 
12199 #endif /* _MGUI_WINDOW_H */
12200 
GHANDLE HACCEL
Handle to accelarator.
Definition: common.h:437
const char * caption
Definition: window.h:11503
LRESULT(* WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Type of the window callback procedure.
Definition: window.h:4960
HMENU hMenu
Definition: window.h:11507
MG_EXPORT int UnregisterResType(int type)
Unregister a user-defined resource type.
MG_EXPORT DWORD GUIAPI GetWindowElementAttr(HWND hwnd, int we_attr_id)
Get a window element data.
MG_EXPORT int GUIAPI BroadcastMessage(UINT nMsg, WPARAM wParam, LPARAM lParam)
Broadcast a message to all main windows on the desktop.
MG_EXPORT LINT GUIAPI GetDlgCtrlID(HWND hwndCtl)
Get the integer identifier of a control.
MG_EXPORT BOOL GUIAPI IsMainWindow(HWND hWnd)
Determine whether a window is a main window.
const char * spCaption
Definition: window.h:6737
MG_EXPORT HMENU GUIAPI GetMenuBarItemRect(HWND hwnd, int pos, RECT *prc)
Retrieve the rect of a menu bar item.
MG_EXPORT int RegisterResType(int type, RES_TYPE_OPS *ops)
Register a new user-defined type into resource manager, so that the LoadResource can load the special...
HCURSOR hCursor
Definition: window.h:6743
MG_EXPORT void GUIAPI UnregisterRes(const char *file)
Unregister the BITMAP object from cache according to the specified resource file name.
#define PM_REMOVE
Definition: window.h:3165
MG_EXPORT HWND GUIAPI GetFocusChild(HWND hParent)
Retrieve the handle to the window&#39;s active child that has the keyboard focus.
MG_EXPORT void TermRendererSystemIcon(HICON *small_icon, HICON *large_icon)
Release large and small system icon resources.
MG_EXPORT BOOL GUIAPI UnregisterEventHookWindow(HWND hwnd)
Unregister an input event message hook window.
DWORD typedata
Definition: window.h:10828
MG_EXPORT HMENU GUIAPI StripPopupHead(HMENU hpppmnu)
Strips the title of the popup menu.
WPARAM wParam
Definition: window.h:3139
MG_EXPORT BOOL GUIAPI GetScrollPos(HWND hWnd, int iSBar, int *pPos)
Retrieve the current position of the scroll box (thumb) in the specified scroll bar.
MG_EXPORT WINDOW_ELEMENT_RENDERER *GUIAPI GetDefaultWindowElementRenderer(void)
Get the default window renderer.
struct _DLGTEMPLATE DLGTEMPLATE
Definition: common.h:966
struct _LFRDR_TRACKBARINFO LFRDR_TRACKBARINFO
int BOOL
A type definition for boolean value.
Definition: common.h:343
static const BITMAP *GUIAPI GetSystemBitmapEx(const char *rdr_name, const char *id)
Retrieve the system bitmap object by identifier.
Definition: window.h:9138
MG_EXPORT void GUIAPI CheckRadioButton(HWND hDlg, LINT idFirstButton, LINT idLastButton, LINT idCheckButton)
Adds a check mark to (checks) a specified radio button in a group and removes a check mark from (clea...
MG_EXPORT int GUIAPI TranslateAccelerator(HACCEL hAccel, PMSG pMsg)
Translates an accelerator key message to MSG_COMMAND messge and sends it to the window procedure...
MG_EXPORT gal_pixel GUIAPI DWORD2PixelByWindow(HWND hWnd, DWORD dwColor)
Convert a DWORD color to gal_pixel for a window.
MG_EXPORT HICON GUIAPI SetWindowIcon(HWND hWnd, HICON hIcon, BOOL bRedraw)
Set the current icon of a window.
static BOOL GUIAPI HideCaret(HWND hWnd)
Hides a caret.
Definition: window.h:10539
MG_EXPORT int GUIAPI GetUpdateRegion(HWND hWnd, PCLIPRGN pRgn)
Copy the update region of a window to a region.
int nPos
Definition: window.h:9521
gal_pixel iBkColor
Definition: window.h:6760
MG_EXPORT BOOL GUIAPI VirtualWindowCleanup(HWND hVirtWnd)
Cleanup the system resource associated with a virtual window.
unsigned char BYTE
A type definition for an 8-bit unsigned character (byte).
Definition: common.h:460
MG_EXPORT LRESULT GUIAPI SendMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Send a message to a window and wait for the handling result.
MG_EXPORT BOOL GUIAPI SetScrollPos(HWND hWnd, int iSBar, int iNewPos)
Set the position of the scroll box (thumb) of the specified scroll bar.
MG_EXPORT gal_pixel GUIAPI GetWindowElementPixelEx(HWND hwnd, HDC hdc, int we_attr_id)
Get the pixel value of a window element.
MG_EXPORT int GUIAPI CreateThreadForMessaging(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *arg, BOOL joinable, size_t stack_size)
Create a message thread for main windows or virtual windows.
#define HDC_SCREEN
Handle to the device context of the whole screen or the fake screen when MiniGUI is running under Min...
Definition: gdi.h:1366
MG_EXPORT HWND GUIAPI CreateMainWindowEx2(PMAINWINCREATE create_info, LINT id, const char *werdr_name, const WINDOW_ELEMENT_ATTR *we_attrs, unsigned int surf_flag, DWORD bkgnd_color, int compos_type, DWORD ct_arg)
Creates a main window with specified compositing type and identifier.
MG_EXPORT DWORD GUIAPI SetWindowAdditionalData2(HWND hWnd, DWORD newData)
Set the second additional data of a window.
MG_EXPORT int GUIAPI GetIMEStatus(int StatusCode)
Retrieve status of the current IME window.
MG_EXPORT DWORD GUIAPI GetWindowAdditionalData(HWND hWnd)
Retrieve the first additional data of a window.
MG_EXPORT UINT GUIAPI GetCaretBlinkTime(HWND hWnd)
Returns the elapsed time, in milliseconds, required to invert the caret&#39;s pixels. ...
PBITMAP uncheckedbmp
Definition: window.h:10819
MG_EXPORT int GUIAPI SetIMETargetInfo(const IME_TARGET_INFO *info)
Set the target info of the current IME window.
MG_EXPORT HWND GUIAPI GetNextMainWindow(HWND hMainWnd)
Retrieve the next main window in the system according to the zorder.
MG_EXPORT int GUIAPI KillTimer(HWND hWnd, LINT id)
Destroys a timer.
HICON hIcon
Definition: window.h:11505
MG_EXPORT HWND GUIAPI GetActiveWindow(void)
Retrieve the main window handle of the active main window.
DWORD dwAddData
Definition: window.h:11513
MG_EXPORT LRESULT GUIAPI DefaultWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
The default window callback procedure.
MG_EXPORT HWND GUIAPI CreateVirtualWindow(HWND hHosting, WNDPROC WndProc, const char *spCaption, LINT id, DWORD dwAddData)
Create a virtual window.
DWORD dwAddData
Definition: window.h:11475
MG_EXPORT const char *GUIAPI GetClassName(HWND hWnd)
Retrieve the name of the class to which the specified window belongs.
MG_EXPORT int GUIAPI PostMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Posts a message into the message queue of a window and returns immediatly.
MG_EXPORT void GUIAPI WindowToClient(HWND hWnd, int *x, int *y)
Converts the window coordinates to client coordinates.
MG_EXPORT int GUIAPI SetMenuItemBitmaps(HMENU hmnu, LINT item, UINT flag, PBITMAP hBmpUnchecked, PBITMAP hBmpChecked)
Associates the specified bitmap with a menu item.
HMENU hsubmenu
Definition: window.h:10816
MG_EXPORT void GUIAPI UpdateInvalidClient(HWND hWnd, BOOL bErase)
Updates the invalid client areas in a window.
struct _SCROLLBARDATA SCROLLBARDATA
MG_EXPORT BOOL GUIAPI CreateCaret(HWND hWnd, PBITMAP pBitmap, int nWidth, int nHeight)
Creates a new shape for the system caret and assigns ownership of the caret to the specified window...
MG_EXPORT BOOL GUIAPI DestroyMainWindow(HWND hWnd)
Destroys a main window.
int nMax
Definition: window.h:9517
MG_EXPORT HMENU GUIAPI GetSubMenu(HMENU hmnu, int pos)
Retrieve the handle to the submenu activated by the specified menu item.
NOTIFPROC NotifProc
Definition: window.h:5587
HMENU hMenu
Definition: window.h:6740
MG_EXPORT WINDOW_ELEMENT_RENDERER *GUIAPI GetWindowRendererFromName(const char *name)
Get window renderer from name.
MG_EXPORT BOOL GUIAPI RegisterEventHookWindow(HWND hwnd, DWORD flags)
Register an input event message hook window.
DWORD(* on_set_rdr_attr)(struct _WINDOW_ELEMENT_RENDERER *, int we_attr_id, DWORD we_attr, BOOL change)
Definition: window.h:5526
MG_EXPORT BOOL InitRendererSystemIcon(const char *rdr_name, HICON *small_icon, HICON *large_icon)
Initialize large and small system icons in the specified renderer rdr_name.
MG_EXPORT int GUIAPI ClientHeightToWindowHeightEx(DWORD dwStyle, int win_type, int ch, BOOL hasMenu)
Calculates window height from the height of the client area.
MG_EXPORT BOOL GUIAPI GetWindowLocalData(HWND hwnd, const char *data_name, DWORD *local_data, CB_FREE_LOCAL_DATA *cb_free)
Retrieve the local data bound with a name for a window.
MG_EXPORT int GUIAPI GetMenuItemInfo(HMENU hmnu, LINT item, UINT flag, PMENUITEMINFO pmii)
Retrieve information about a menu item.
MG_EXPORT HICON GUIAPI GetLargeSystemIconEx(HWND hWnd, int iItem)
Retrieve a large system icon by its identifier in default renderer.
MG_EXPORT HWND GUIAPI SetActiveWindow(HWND hMainWnd)
Set a main window to be the active main window.
MG_EXPORT PLOGFONT GUIAPI SetWindowFont(HWND hWnd, PLOGFONT pLogFont)
Set the default font of a window.
MG_EXPORT BOOL GUIAPI HiliteMenuBarItem(HWND hwnd, int pos, UINT flag)
Draws the specified menubar item with 3D effect.
static HWND GUIAPI CreateMainWindow(PMAINWINCREATE pCreateInfo)
A simplified version of CreateMainWindowEx.
Definition: window.h:7014
MG_EXPORT void * LoadResource(const char *res_name, int type, DWORD usr_param)
Load a resource from disk or memory.
HMENU hSysMenu
Definition: window.h:5630
MG_EXPORT int GUIAPI DeleteMenu(HMENU hmnu, LINT item, UINT flag)
Deletes an item from the specified menu.
MG_EXPORT void GUIAPI WindowToScreen(HWND hWnd, int *x, int *y)
Converts the window coordinates of a point to screen coordinates.
WNDPROC WinProc
Definition: window.h:5584
MG_EXPORT HWND GUIAPI CreateWindowEx2(const char *spClassName, const char *spCaption, DWORD dwStyle, DWORD dwExStyle, LINT id, int x, int y, int w, int h, HWND hParentWnd, const char *werdr_name, const WINDOW_ELEMENT_ATTR *we_attrs, DWORD dwAddData)
Creates a child window with extended style, renderer and attributes table.
const WINDOW_ELEMENT_ATTR * we_attrs
Definition: window.h:11483
MG_EXPORT void GUIAPI DestroyAllControls(HWND hWnd)
Destroys all controls in a window.
MG_EXPORT BOOL GUIAPI EnableWindow(HWND hWnd, BOOL fEnable)
Enables of disables a window.
MG_EXPORT BOOL GUIAPI SetWindowMaskEx(HWND hWnd, HDC hdc, const BITMAP *mask)
Set window (a main window, or a child window which is also known as "control")&#39;s Mask Rect with BITMA...
int nMin
Definition: window.h:9515
Definition: common.h:936
gal_pixel iBkColor
Definition: window.h:9657
MG_EXPORT BOOL GUIAPI PeekPostMessage(PMSG pMsg, HWND hWnd, UINT nMsgFilterMin, UINT nMsgFilterMax, UINT uRemoveMsg)
Peek a post message from the message queue of a main window.
const char * spClassName
Definition: window.h:9614
MG_EXPORT HMENU GUIAPI CreateSystemMenu(HWND hwnd, DWORD dwStyle)
Creates a system menu.
static HWND GUIAPI CreateMainWindowIndirect(PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC WndProc)
A simplified version of CreateMainWindowIndirectParam.
Definition: window.h:11584
MG_EXPORT int GUIAPI ThrowAwayMessages(HWND pMainWnd)
Removes all messages in the message queue associated with a window.
#define WE_COLORS_NUMBER
The number of window element color attributes.
Definition: window.h:4786
MG_EXPORT HCURSOR GUIAPI GetWindowCursor(HWND hWnd)
Retrieve the current cursor of a window.
Uint32 gal_pixel
Data type of pixel value.
Definition: common.h:1106
MG_EXPORT int GUIAPI RemoveMenu(HMENU hmnu, LINT item, UINT flag)
Deletes a menu item or detaches a submenu from the specified menu.
DWORD dwAddData
Definition: window.h:5590
MG_EXPORT HWND GUIAPI SetNullFocus(HWND hParent)
Cancels the current active child and set the focus child to be null.
HICON hIcon
Definition: window.h:5628
MG_EXPORT HICON GUIAPI LoadSystemIconEx(HDC hdc, const char *rdr_name, const char *szItemName, int which)
Loads an icon from information defined in MiniGUI.cfg.
MG_EXPORT int GUIAPI GetDlgItemText(HWND hDlg, LINT nIDDlgItem, char *lpString, int nMaxCount)
Retrieve the title or text associated with a control in a dialog box.
PBITMAP checkedbmp
Definition: window.h:10822
MG_EXPORT HWND GUIAPI SetFocusChild(HWND hWnd)
Set the active child of a window.
MG_EXPORT BOOL GUIAPI GetScrollInfo(HWND hWnd, int iSBar, PSCROLLINFO lpsi)
Retrieve the parameters of a scroll bar.
MG_EXPORT BOOL GUIAPI SetWindowText(HWND hWnd, const char *spString)
Set the text of a window.
MG_EXPORT HWND GUIAPI GetWindowUnderCursor(void)
Retrieve the handle to the window (if any) which is just beneath the mouse cursor.
void(* draw_hilite_menu_item)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:5536
struct _MSG MSG
DWORD dwReserved
Definition: window.h:6766
HACCEL hAccel
Definition: window.h:5624
const char * spCaption
Definition: window.h:5576
HWND hHosting
Definition: window.h:6749
MG_EXPORT const char * GetResPath(void)
Get the currrent user&#39;s resource path.
MG_EXPORT int SetResPath(const char *path)
Set user&#39;s resource path into the search paths of resource manager.
MG_EXPORT int GUIAPI ScrollWindowEx(HWND hWnd, int dx, int dy, const RECT *prcScroll, const RECT *prcClip, PCLIPRGN pRgnUpdate, PRECT prcUpdate, UINT flags)
Scrolls the content of a window&#39;s client area.
static MSGHOOK GUIAPI RegisterKeyMsgHook(void *context, MSGHOOK hook)
Register a key message hook function.
Definition: window.h:4063
MG_EXPORT HCURSOR GUIAPI SetWindowCursor(HWND hWnd, HCURSOR hNewCursor)
Set the current cursor of a window.
static BOOL GUIAPI ShowCaret(HWND hWnd)
Shows a caret.
Definition: window.h:10577
int(* SRVEVTHOOK)(PMSG pMsg)
The type of the event hook.
Definition: window.h:4196
MG_EXPORT BOOL GUIAPI GetClientRect(HWND hWnd, PRECT prc)
Retrieve the client rectangle of a window.
MG_EXPORT DWORD GUIAPI GetWindowClassAdditionalData(HWND hWnd)
Retrieve the additional data of a control class.
MG_EXPORT BOOL GUIAPI GetWindowClassInfo(PWNDCLASS pWndClass)
Retrieve the information of the specified window class.
MG_EXPORT int GUIAPI NotifyWindow(HWND hWnd, LINT id, int code, DWORD dwAddData)
Send a notification message to a window.
#define WS_EX_NONE
No any extended window style.
Definition: window.h:4371
void(* NOTIFPROC)(HWND hwnd, LINT id, int nc, DWORD add_data)
Type of the notification callback procedure.
Definition: window.h:4982
UINT message
Definition: window.h:3136
UINT fMask
Definition: window.h:9513
MG_EXPORT BOOL GUIAPI TranslateKeyMsgToChar(int message, WPARAM wParam, LPARAM lParam, WORD *ch)
Translates a key down and key up message to a corresponding character.
MG_EXPORT const BITMAP *GUIAPI GetSystemBitmapEx2(HDC hdc, const char *rdr_name, const char *id)
Retrieve the system bitmap object by identifier.
const void * private_info
Definition: window.h:5559
DWORD dwStyle
Definition: window.h:11497
MG_EXPORT BOOL GUIAPI PeekMessageEx(PMSG pMsg, HWND hWnd, UINT nMsgFilterMin, UINT nMsgFilterMax, BOOL bWait, UINT uRemoveMsg)
Peek a message from the message queue of a main window.
DWORD dwExStyle
Definition: window.h:6734
MG_EXPORT BOOL GUIAPI SetWindowLocalData(HWND hwnd, const char *data_name, DWORD local_data, CB_FREE_LOCAL_DATA cb_free)
Set the local data bound with a name for a window.
int idx_znode
Definition: window.h:5616
MG_EXPORT HWND GUIAPI GetFirstHosted(HWND hHosting)
Retrieve the first hosted window of a main window or a virtual window.
MG_EXPORT void GUIAPI ClientToWindow(HWND hWnd, int *x, int *y)
Converts the client coordinates to the window coordinates.
LFSCROLLBARINFO vscroll
Definition: window.h:5635
MG_EXPORT BOOL GUIAPI SetScrollInfo(HWND hWnd, int iSBar, const SCROLLINFO *lpsi, BOOL fRedraw)
Set the parameters of a scroll bar.
MG_EXPORT int GUIAPI GetWindowText(HWND hWnd, char *spString, int nMaxLen)
Copies the text of a window&#39;s into a buffer.
static MSGHOOK GUIAPI RegisterMouseMsgHook(void *context, MSGHOOK hook)
Register a mouse message hook function.
Definition: window.h:4084
GHANDLE HDC
Handle to device context.
Definition: common.h:412
MG_EXPORT void GUIAPI ScreenToWindow(HWND hWnd, int *x, int *y)
Converts the screen coordinates of a point to window coordinates.
MG_EXPORT WNDPROC GUIAPI SetWindowCallbackProc(HWND hWnd, WNDPROC newProc)
Set the callback procedure of a window.
MG_EXPORT void GUIAPI UnregisterSystemBitmap(HDC hdc, const char *rdr_name, const char *id)
Unregister a BITMAP object from the system BITMAP cache.
MG_EXPORT int GUIAPI InsertMenuItem(HMENU hmnu, LINT item, UINT flag, PMENUITEMINFO pmii)
Inserts a new menu item at the specified position in a menu.
DWORD itemdata
Definition: window.h:10825
MG_EXPORT BOOL GUIAPI SetKeyboardLayout(const char *kbd_layout)
Set a new keyboard layout.
int left
Definition: window.h:5601
MG_EXPORT BOOL GUIAPI SetWindowElementRenderer(HWND hWnd, const char *werdr_name, const WINDOW_ELEMENT_ATTR *we_attrs)
Set a window element renderer and window element attributes for window specified by hwnd...
MG_EXPORT BOOL GUIAPI RemoveWindowLocalData(HWND hwnd, const char *data_name)
Remove the local data bound with a name for a window.
MG_EXPORT BOOL GUIAPI IsWindowVisible(HWND hWnd)
Retrieve the visibility state of the specified window.
MG_EXPORT BOOL GUIAPI DestroyWindow(HWND hWnd)
Destroys a specified control.
MG_EXPORT UINT GUIAPI GetDlgItemInt(HWND hDlg, LINT nIDDlgItem, BOOL *lpTranslated, BOOL bSigned)
Translates the text of a control in a dialog box into an integer value.
BOOL(* TIMERPROC)(HWND, LINT, DWORD)
Type of the timer callback procedure.
Definition: window.h:9946
MG_EXPORT BOOL GUIAPI UnregisterWindowClass(const char *szClassName)
Undoes the effect of RegisterWindowClass.
MG_EXPORT BOOL GUIAPI SetScrollRange(HWND hWnd, int iSBar, int iMinPos, int iMaxPos)
Set the minimum and maximum position values for the specified scroll bar.
int controlnr
Definition: window.h:11509
MG_EXPORT BOOL GUIAPI ExcludeWindowExStyle(HWND hWnd, DWORD dwStyle)
Removes the specific extended style of a window.
DWORD dwExStyle
Definition: window.h:11477
#define TRUE
TRUE value, defined as 1 by MiniGUI.
Definition: common.h:358
MG_EXPORT void GUIAPI UpdateWindow(HWND hWnd, BOOL bErase)
Updates a window.
HMENU hMenu
Definition: window.h:5622
MG_EXPORT BOOL GUIAPI EmptyMessageQueue(HWND hWnd)
Empty a message queue.
MG_EXPORT void * GetResource(RES_KEY key)
Retrieve and return a buffered resource by the key.
DWORD we_colors[WE_COLORS_NUMBER][3]
Definition: window.h:5547
MG_EXPORT BOOL GUIAPI SetMainWindowAlwaysTop(HWND hWnd, BOOL fSet)
Set or cancel a main window being always top.
MG_EXPORT BOOL GUIAPI SetCaretPos(HWND hWnd, int x, int y)
Moves the caret to a new position.
MG_EXPORT int ReleaseRes(RES_KEY key)
Release the buffered resource. It will decrease the reference count of the resource. If the reference count is less then 0, the resource will be released.
DWORD dwExStyle
Definition: window.h:5611
MG_EXPORT HWND GUIAPI RegisterMouseHookWindow(HWND hwnd, DWORD flag)
Registers a mouse message hook window.
MG_EXPORT int GUIAPI DestroyMenu(HMENU hmnu)
Destroys the specified menu and frees any memory that the menu occupies.
MG_EXPORT HICON GUIAPI LoadSystemIcon(const char *szItemName, int which)
Uses default renderer and HDC_SCREEN to load an icon from information defined in MiniGUI.cfg.
MG_EXPORT LINT GUIAPI GetWindowId(HWND hWnd)
Get the identifier of a window.
static const WINDOWINFO *GUIAPI GetWindowInfo(HWND hWnd)
Get the handle of window information.
Definition: window.h:5654
MG_EXPORT BOOL GUIAPI GetThreadByWindow(HWND hWnd, pthread_t *thread)
Get the thread identifier which a window belongs to.
GHANDLE HWND
Handle to main window or control.
Definition: common.h:407
MG_EXPORT void GUIAPI TermSystemBitmap(HWND hWnd, const char *id, PBITMAP bmp)
Release the system bitmap object by identifier.
MG_EXPORT DWORD GUIAPI SetWindowAdditionalData(HWND hWnd, DWORD newData)
Set the first additional data of a window.
MG_EXPORT BOOL GUIAPI SetWindowCaption(HWND hWnd, const char *spCaption)
Set the caption of a window.
MG_EXPORT BOOL GUIAPI AdjustWindowRectEx(RECT *pRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle)
Calculates the required size of the window rectangle based on the desired size of the client rectangl...
MG_EXPORT BOOL GUIAPI IsWindowInThisThread(HWND hWnd)
Determine whether a window was created in this thread.
MG_EXPORT LRESULT GUIAPI PostSyncMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Post a synchronical message to a window which is in different thread.
MG_EXPORT BOOL GUIAPI ValidateRegion(HWND hWnd, const CLIPRGN *pRgn)
Validates the client area within a region by removing the region from the current update region of th...
MG_EXPORT int GUIAPI DestroyAcceleratorTable(HACCEL hacc)
Destroys an accelerator table.
DWORD dwStyle
Definition: window.h:6731
MG_EXPORT const char *GUIAPI SetDefaultWindowElementRenderer(const char *name)
Set a window element renderer as the default system renderer.
MG_EXPORT DWORD GUIAPI GetWindowStyle(HWND hWnd)
Retrieve the style of a window.
MG_EXPORT BOOL GUIAPI HavePendingMessage(HWND hMainWnd)
Check if there is any pending message in the message queue of a main window.
MG_EXPORT BOOL GUIAPI GetWindowRect(HWND hWnd, PRECT prc)
Retrieve the dimensions of the bounding rectangle of a window.
MG_EXPORT HWND GUIAPI WindowFromPointEx(POINT pt, BOOL bRecursion)
Retrieve a handle to the window that contains the specified point.
DWORD dwExStyle
Definition: window.h:9634
MG_EXPORT int GUIAPI GetIMEPos(POINT *pt)
Retrieve the position of the current IME window.
PLOGFONT we_fonts[WE_FONTS_NUMBER]
Definition: window.h:5550
MG_EXPORT int GUIAPI MessageBox(HWND hParentWnd, const char *pszText, const char *pszCaption, DWORD dwStyle)
Displays a message box within one, two, or three push buttons.
const char * class_name
Definition: window.h:11463
MG_EXPORT LRESULT GUIAPI SendAsyncMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Send an asynchronical message to a window.
MG_EXPORT BOOL GUIAPI RegisterSystemBitmap(HDC hdc, const char *rdr_name, const char *id)
Register a device-dependent bitmap from id to BITMAP cache.
MG_EXPORT int GUIAPI TrackMenuBar(HWND hwnd, int pos)
Displays the specified submenu.
int(* MSGHOOK)(void *context, HWND dst_wnd, UINT msg, WPARAM wparam, LPARAM lparam)
Type of message hook function.
Definition: window.h:4009
MG_EXPORT HMENU GUIAPI GetSystemMenu(HWND hwnd, BOOL flag)
Allows the application to access the window menu (also known as the system menu) for copying and modi...
struct _WINDOWINFO WINDOWINFO
MG_EXPORT HWND GUIAPI GetDlgItem(HWND hDlg, LINT nIDDlgItem)
Retrieve the handle to a control in a dialog box.
MG_EXPORT BOOL GUIAPI InitWindowElementAttrs(PWERENDERER rdr)
static HWND GUIAPI ChildWindowFromPoint(HWND hParent, POINT pt)
Retrieve a handle to the child window that contains the speicified point.
Definition: window.h:8916
static HWND GUIAPI CreateMainWindowIndirectParam(PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC WndProc, LPARAM lParam)
A simplified version of CreateMainWindowIndirectParamEx.
Definition: window.h:11565
MG_EXPORT BOOL GUIAPI SetTimerEx(HWND hWnd, LINT id, DWORD speed, TIMERPROC timer_proc)
Creates a timer with the specified timeout value.
LONG_PTR LINT
Signed integer which has pointer precision.
Definition: common.h:577
struct _LFSCROLLBARINFO LFSCROLLBARINFO
PLOGFONT pLogFont
Definition: window.h:5632
MG_EXPORT DWORD GUIAPI GetWindowExStyle(HWND hWnd)
Retrieve the extended style of a window.
MG_EXPORT int GUIAPI DialogBoxIndirectParamEx(PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC DlgProc, LPARAM lParam, const char *werdr_name, WINDOW_ELEMENT_ATTR *we_attrs, const char *window_name, const char *layer_name)
Creates a modal dialog box from a dialog box template in memory and other information.
#define LEN_RENDERER_NAME
The maximum length of a renderer name.
Definition: window.h:5133
MG_EXPORT BOOL GUIAPI IncludeWindowStyle(HWND hWnd, DWORD dwStyle)
Includes the specific style of a window.
HWND hwnd
Definition: window.h:3134
MG_EXPORT LRESULT GUIAPI SendDlgItemMessage(HWND hDlg, LINT nIDDlgItem, UINT message, WPARAM wParam, LPARAM lParam)
Send a message to the specified control in a dialog box.
void(* erase_background)(HWND hWnd, HDC hdc, const RECT *rect)
Definition: window.h:5529
MG_EXPORT BOOL GUIAPI ExcludeWindowStyle(HWND hWnd, DWORD dwStyle)
Removes the specific style of a window.
static HWND GUIAPI CreateWindowEx(const char *spClassName, const char *spCaption, DWORD dwStyle, DWORD dwExStyle, LINT id, int x, int y, int w, int h, HWND hParentWnd, DWORD dwAddData)
A shortcut version of CreateWindowEx2.
Definition: window.h:9829
MG_EXPORT HWND GUIAPI GetNextDlgTabItem(HWND hDlg, HWND hCtl, BOOL bPrevious)
Retrieve the handle to the first control that has the WS_TABSTOP style that precedes (or follows) the...
MG_EXPORT int GUIAPI BroadcastMessageInThisThread(UINT nMsg, WPARAM wParam, LPARAM lParam)
Broadcast a message to all main/virtual windows in the current thread.
GHANDLE HCURSOR
Handle to cursor.
Definition: common.h:422
MG_EXPORT BOOL GUIAPI IsWindowEnabled(HWND hWnd)
Determine whether the specified window is enabled for mouse and keyboard input.
MG_EXPORT BOOL GUIAPI IncludeWindowExStyle(HWND hWnd, DWORD dwStyle)
Includes the specific extended style of a window.
DWORD dwStyle
Definition: window.h:9631
DWORD dwStyle
Definition: window.h:5609
MG_EXPORT DWORD GUIAPI GetWindowAdditionalData2(HWND hWnd)
Retrieve the second additional data of a window.
BOOL GUIAPI GetWindowRegion(HWND hWnd, CLIPRGN *region)
The function obtains a copy of the window region of a window.
MG_EXPORT BOOL GUIAPI SetWindowClassInfo(const WNDCLASS *pWndClass)
Set the information of the specified window class.
#define NULL
A value indicates null pointer.
Definition: common.h:369
int we_metrics[WE_METRICS_NUMBER]
Definition: window.h:5544
static HWND GUIAPI CreateMainWindowEx(PMAINWINCREATE pCreateInfo, const char *werdr_name, const WINDOW_ELEMENT_ATTR *we_attrs, const char *window_name, const char *layer_name)
Creates a main window.
Definition: window.h:6996
static void GUIAPI ScrollWindow(HWND hWnd, int dx, int dy, const RECT *prcScroll, const RECT *prcClip)
Scrolls the content of a window&#39;s client area.
Definition: window.h:9044
BOOL GUIAPI SetWindowRegion(HWND hWnd, const CLIPRGN *region)
Set window&#39;s Mask Rect with CLIPRGN data.
MG_EXPORT const char *GUIAPI GetWindowCaption(HWND hWnd)
Retrieve the caption of a window.
MG_EXPORT LINT GUIAPI SetWindowId(HWND hWnd, LINT lNewId)
Set the identifier of a window.
MG_EXPORT BOOL GUIAPI IsTimerInstalled(HWND hWnd, LINT id)
Determine whether a timer is installed.
Definition: gdi.h:788
unsigned char Uint8
A type definition for an 8-bit unsigned character.
Definition: common.h:157
MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook(SRVEVTHOOK SrvEvtHook)
Set an event hook in the server of MiniGUI-Processes.
MG_EXPORT int GUIAPI AddAccelerators(HACCEL hacc, int key, DWORD keymask, WPARAM wParam, LPARAM lParam)
Adds an accelerator to the accelerator table.
UINT_PTR LPARAM
A type definition for the second message paramter.
Definition: common.h:712
MG_EXPORT BOOL GUIAPI RegisterWindowClass(PWNDCLASS pWndClass)
Registers a window class.
MG_EXPORT void GUIAPI SetAutoRepeatMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Set the auto-repeat message.
MG_EXPORT gal_pixel GUIAPI GetWindowBkColor(HWND hWnd)
Returns the current background color of a window.
MG_EXPORT BOOL GUIAPI WaitMessage(PMSG pMsg, HWND hMainWnd)
Wait for a message from the message queue of a main window.
MG_EXPORT BOOL GUIAPI DestroyVirtualWindow(HWND hWnd)
Destroy a virtual window.
MG_EXPORT HMENU GUIAPI GetMenu(HWND hwnd)
Retrieve the handle to the menu assigned to the given main window.
UINT cbSize
Definition: window.h:9500
MG_EXPORT BOOL GUIAPI SetCaretBlinkTime(HWND hWnd, UINT uTime)
Set the caret blink time to the specified number of milliseconds.
MG_EXPORT void GUIAPI ClientToScreen(HWND hWnd, int *x, int *y)
Converts the client coordinates of a point to screen coordinates.
static BOOL GUIAPI PeekMessage(PMSG pMsg, HWND hWnd, UINT nMsgFilterMin, UINT nMsgFilterMax, UINT uRemoveMsg)
Peek a message from the message queue of a main window.
Definition: window.h:3288
MG_EXPORT WNDPROC __mg_def_proc[4]
The default window callback procedure array.
HCURSOR hCursor
Definition: window.h:9637
MG_EXPORT BOOL GUIAPI TranslateMessage(PMSG pMsg)
Translates key down and key up messages to MSG_CHAR message and post it into the message queue...
MG_EXPORT int GUIAPI UnregisterIMEWindow(HWND hWnd)
Unregisters an IME window.
Definition: window.h:3131
struct _MENUITEMINFO MENUITEMINFO
LFSCROLLBARINFO hscroll
Definition: window.h:5637
MG_EXPORT HWND GUIAPI GetParent(HWND hWnd)
Retrieve the handle to a child window&#39;s parent window.
MG_EXPORT BOOL GUIAPI IsWindow(HWND hWnd)
Determine whether a window handle identifies an existing window.
MG_EXPORT HMENU GUIAPI SetMenu(HWND hwnd, HMENU hmnu)
Assigns a new menu to the specified main window.
MG_EXPORT void GUIAPI MessageBeep(DWORD dwBeep)
Makes a sound of beep.
MG_EXPORT BOOL GUIAPI RemoveWindowElementRenderer(const char *name)
Remove a window renderer from MiniGUI.
DWORD opMask
Definition: window.h:9628
DWORD dwAddData2
Definition: window.h:5592
MG_EXPORT const BITMAP *GUIAPI GetSystemBitmap(HWND hWnd, const char *id)
Retrieve the system bitmap object by identifier.
MG_EXPORT NOTIFPROC GUIAPI GetNotificationCallback(HWND hwnd)
Get the notification callback procedure of a control.
MG_EXPORT DWORD GUIAPI SetWindowClassAdditionalData(HWND hWnd, DWORD newData)
Set the additional data of a control class.
MG_EXPORT BOOL GUIAPI ValidateRect(HWND hWnd, const RECT *rect)
Validates the client area within a rectangle by removing the rectangle from the update region of the ...
MG_EXPORT int GUIAPI SendPriorNotifyMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Send a prior notification message to a window.
MG_EXPORT HACCEL GUIAPI CopyAcceleratorTable(HACCEL hacc)
Copies the specified accelerator table.
MG_EXPORT BOOL GUIAPI GetCaretPos(HWND hWnd, PPOINT pPt)
Get the caret position.
MG_EXPORT BOOL GUIAPI IsVirtualWindow(HWND hWnd)
Determine whether a window is a virtual window.
MG_EXPORT char *GUIAPI GetDlgItemText2(HWND hDlg, LINT id, int *lenPtr)
Retrieve the title or text associated with a control in a dialog box.
HICON we_icon[2][SYSICO_ITEM_NUMBER]
Definition: window.h:5553
WORD_HPTR WORD
A type definition for an unsigned integer (word).
Definition: common.h:541
struct _LFRDR_WINSTYLEINFO LFRDR_WINSTYLEINFO
MG_EXPORT BOOL GUIAPI HaveFreeTimer(void)
Determine whether there is any free timer slot in the current thread.
static BOOL GUIAPI GetMessage(PMSG pMsg, HWND hWnd)
Get a message from the message queue of a main window.
Definition: window.h:3223
MG_EXPORT BOOL GUIAPI DestroyMainWindowIndirect(HWND hMainWin)
Destroys a main window created by CreateMainWindowIndirectParam.
DWORD dwExStyle
Definition: window.h:11499
MG_EXPORT BOOL GUIAPI InvalidateRect(HWND hWnd, const RECT *prc, BOOL bEraseBkgnd)
Makes a rectangle region in the client area of a window invalid.
const char * werdr_name
Definition: window.h:11480
MG_EXPORT BOOL GUIAPI IsControl(HWND hWnd)
Determine whether a window is a control.
UINT_PTR WPARAM
A type definition for the first message paramter.
Definition: common.h:706
MG_EXPORT HICON GUIAPI GetWindowIcon(HWND hWnd)
Retrieve the current icon of a window.
MG_EXPORT int GUIAPI GetWindowTextLength(HWND hWnd)
Retrieve the length of a window&#39;s text.
DWORD_PTR DWORD
A unsigned long type definition for pointer precision.
Definition: common.h:604
static int GUIAPI DialogBoxIndirectParam(PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC DlgProc, LPARAM lParam)
A simplified version of DialogBoxIndirectParamEx.
Definition: window.h:11652
MG_EXPORT HMENU GUIAPI CreatePopupMenu(PMENUITEMINFO pmii)
Creates a drop-down menu or submenu.
MG_EXPORT int GUIAPI SendNotifyMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Send a notification message to a window.
LONG_PTR LRESULT
Signed result of message processing.
Definition: common.h:583
DWORD dwAddData
Definition: window.h:9676
DWORD dwAddData
Definition: window.h:6763
MG_EXPORT void GUIAPI ScreenToClient(HWND hWnd, int *x, int *y)
Converts the screen coordinates of a point to client coordinates.
Definition: gdi.h:10989
struct _SCROLLINFO SCROLLINFO
MG_EXPORT PLOGFONT GUIAPI GetWindowFont(HWND hWnd)
Retrieve the default font of a window.
MG_EXPORT HWND GUIAPI GetNextChild(HWND hWnd, HWND hChild)
Retrieve the next control in a window.
MG_EXPORT BOOL GUIAPI GetScrollRange(HWND hWnd, int iSBar, int *pMinPos, int *pMaxPos)
Retrieve the minimum and maximum position values for the specified scroll bar.
MG_EXPORT HWND GUIAPI GetNextDlgGroupItem(HWND hDlg, HWND hCtl, BOOL bPrevious)
Retrieve the handle to the first control in a group of controls that precedes (or follows) the specif...
#define WE_METRICS_NUMBER
The number of window element metric attributes.
Definition: window.h:4780
LINT id
Definition: window.h:5581
MG_EXPORT int GUIAPI IsMenu(HMENU hmnu)
Determine whether a handle is a menu handle.
MG_EXPORT int GUIAPI CheckMenuRadioItem(HMENU hmnu, LINT first, LINT last, LINT checkitem, UINT flag)
Check a specified menu item and makes it a radio item.
LPARAM lParam
Definition: window.h:3142
MG_EXPORT HWND GUIAPI CreateMainWindowIndirectParamEx(PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC WndProc, LPARAM lParam, const char *werdr_name, WINDOW_ELEMENT_ATTR *we_attrs, const char *window_name, const char *layer_name)
Uses a dialog template and other information to create a modeless main window and controls in it...
MG_EXPORT void GUIAPI CheckDlgButton(HWND hDlg, LINT nIDDlgItem, int nCheck)
Changes the check status of a button control.
MG_EXPORT LRESULT GUIAPI DispatchMessage(PMSG pMsg)
Dispatches a message to the window&#39;s callback procedure.
unsigned int refcount
Definition: window.h:5556
MG_EXPORT int GUIAPI GetIMETargetInfo(IME_TARGET_INFO *info)
Retrieve the target info of the current IME window.
struct _WINDOW_ELEMENT_ATTR WINDOW_ELEMENT_ATTR
MG_EXPORT BOOL GUIAPI ResetTimerEx(HWND hWnd, LINT id, DWORD speed, TIMERPROC timer_proc)
Adjusts a timer with a different timeout value or different timer callback procedure.
MG_EXPORT HWND GUIAPI GetMainWindowHandle(HWND hWnd)
Retrieve the handle to the main window contains a window.
MG_EXPORT BOOL GUIAPI ShowCaretEx(HWND hWnd, BOOL ime)
Shows a caret.
This file includes macro definitions and typedefs that commonly used by MiniGUI.
MG_EXPORT BOOL GUIAPI EnableScrollBar(HWND hWnd, int iSBar, BOOL bEnable)
Enables or disables one scroll bar arrows.
MG_EXPORT void GUIAPI TermSystemBitmapEx(const char *id, const char *rdr_name, PBITMAP bmp)
Release the system bitmap object by identifier.
MG_EXPORT RES_KEY Str2Key(const char *str)
Translate a string to an unsigned long (RES_KEY), which is used to find a resource in the resource ma...
struct _CTRLDATA CTRLDATA
DWORD time
Definition: window.h:3145
MG_EXPORT HWND GUIAPI GetNextHosted(HWND hHosting, HWND hHosted)
Retrieve the next hosted window of a main window or a virtual window.
MG_EXPORT gal_pixel GUIAPI SetWindowBkColor(HWND hWnd, gal_pixel new_bkcolor)
Set the background color of a window.
MG_EXPORT HDC GUIAPI BeginPaint(HWND hWnd)
Prepares a window for painting.
MG_EXPORT int GUIAPI RegisterIMEWindow(HWND hWnd)
Registers an IME window.
DWORD dwStyle
Definition: window.h:11465
MG_EXPORT HWND GUIAPI RegisterKeyHookWindow(HWND hwnd, DWORD flag)
Register a key message hook window.
#define FALSE
FALSE value, defined as 0 by MiniGUI.
Definition: common.h:351
MG_EXPORT int GUIAPI PostQuitMessage(HWND hWnd)
Puts a MSG_QUIT message into the message queue of a main window.
Definition: gdi.h:6379
gal_pixel iBkColor
Definition: window.h:5619
void(* draw_normal_menu_item)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:5532
const char * caption
Definition: window.h:11473
MG_EXPORT HWND GUIAPI GetHosting(HWND hWnd)
Retrieve the hosting window of a main window or a virtual window.
MG_EXPORT BOOL GUIAPI EndDialog(HWND hDlg, int endCode)
Destroys a modal dialog box, causing MiniGUI to end any processing for the dialog box...
MG_EXPORT BOOL GUIAPI MainWindowCleanup(HWND hMainWnd)
Cleans up system resource associated with a main window.
HCURSOR hCursor
Definition: window.h:5626
MG_EXPORT BOOL GUIAPI RegisterResFromMem(HDC hdc, const char *file, const unsigned char *data, size_t data_size)
Register a device-dependent bitmap to bitmap cache from memory.
unsigned int UINT
A type definition for unsigned integer.
Definition: common.h:664
struct _IME_TARGET_INFO IME_TARGET_INFO
MG_EXPORT BOOL GUIAPI ShowWindow(HWND hWnd, int iCmdShow)
Shows or hides a window.
MG_EXPORT BOOL GUIAPI MoveWindow(HWND hWnd, int x, int y, int w, int h, BOOL fPaint)
Changes the position and dimensions of a window.
MG_EXPORT int GUIAPI SetIMEStatus(int StatusCode, int Value)
Set the status of the current IME window.
MG_EXPORT HWND GUIAPI GetHostedById(HWND hHosting, LINT lId, DWORD dwSearchFlags)
Retrieve a hosted main window or virtual window by identifier.
struct _WINDOW_ELEMENT_RENDERER WINDOW_ELEMENT_RENDERER
MG_EXPORT void GUIAPI EndPaint(HWND hWnd, HDC hdc)
Marks the end of painting in a window.
MG_EXPORT BOOL GUIAPI ShowScrollBar(HWND hWnd, int iSBar, BOOL bShow)
Shows or hides the specified scroll bar.
MG_EXPORT UINT GUIAPI EnableMenuItem(HMENU hmnu, LINT item, UINT flag)
Enables, disables, or grays the specified menu item.
MG_EXPORT HWND GUIAPI ChildWindowFromPointEx(HWND hParent, POINT pt, UINT uFlags)
Retrieve a handle to the child window that contains the speicified point and meets the certain criter...
void(* draw_disabled_menu_item)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:5540
MG_EXPORT int GUIAPI TrackPopupMenu(HMENU hmnu, UINT uFlags, int x, int y, HWND hwnd)
Displays and tracks a popup menu.
GHANDLE HMENU
Handle to menu.
Definition: common.h:432
MG_EXPORT BOOL GUIAPI ActiveCaret(HWND hWnd)
Activates the caret owned by a window.
MG_EXPORT BOOL GUIAPI ChangeCaretSize(HWND hWnd, int newWidth, int newHeight)
Changes the size of the caret.
MG_EXPORT BOOL GUIAPI AddWindowElementRenderer(const char *name, const WINDOW_ELEMENT_RENDERER *we_rdr)
Add a window element renderer to the system.
MG_EXPORT BOOL GUIAPI RegisterResFromBitmap(const char *file, const BITMAP *bmp)
Register a device-dependent bitmap to bitmap cache.
MG_EXPORT int AddResRef(RES_KEY key)
Increase the reference count of a buffered resource.
MG_EXPORT DWORD GUIAPI SetWindowElementAttr(HWND hwnd, int we_attr_id, DWORD we_attr)
Set a new window element data specified by we_attr_id.
HICON hIcon
Definition: window.h:6746
MG_EXPORT HWND GUIAPI GetDlgDefPushButton(HWND hWnd)
Get the default push button control in a window.
emResType
Definition: window.h:6073
MG_EXPORT BOOL GUIAPI InvalidateRegion(HWND hWnd, const CLIPRGN *pRgn, BOOL bErase)
Invalidates the client area within the specified region.
MG_EXPORT BOOL GUIAPI RegisterResFromFile(HDC hdc, const char *file)
Register a device-dependent bitmap from a file.
MG_EXPORT int GUIAPI SetMenuItemInfo(HMENU hmnu, LINT item, UINT flag, PMENUITEMINFO pmii)
Changes information about a menu item.
#define WE_FONTS_NUMBER
The number of window element font attributes.
Definition: window.h:4774
MG_EXPORT int GUIAPI GetMenuItemCount(HMENU hmnu)
Determine the number of items in a menu.
MG_EXPORT HWND GUIAPI GetCapture(void)
Retrieve the handle to the window (if any) that has captured the mouse.
MG_EXPORT HWND GUIAPI SetCapture(HWND hWnd)
Set the mouse capture to the specified window.
MG_EXPORT void GUIAPI DrawMenuBar(HWND hwnd)
Redraws the menu bar of the specified main window.
PCTRLDATA controls
Definition: window.h:11511
MG_EXPORT const BITMAP *GUIAPI RetrieveRes(const char *file)
Get a BITMAP object from cache according to the specified resource file name.
MG_EXPORT WNDPROC GUIAPI GetWindowCallbackProc(HWND hWnd)
Retrieve the callback procedure of a window.
WINDOW_ELEMENT_RENDERER * we_rdr
Definition: window.h:5640
MG_EXPORT BOOL GUIAPI GetUpdateRect(HWND hWnd, RECT *update_rect)
Retrieve the bounding box of the update region of a window.
MG_EXPORT MSGHOOK GUIAPI RegisterEventHookFunc(int event_type, MSGHOOK hook, void *context)
Registers an input event message hook function.
MG_EXPORT HICON GUIAPI GetSmallSystemIconEx(HWND hWnd, int iItem)
Retrieve a small system icon by its identifier.
MG_EXPORT int GUIAPI IsDlgButtonChecked(HWND hDlg, LINT idButton)
Determine whether a button control has a check mark next to it or whether a three-state button contro...
MG_EXPORT HMENU GUIAPI GetPopupSubMenu(HMENU hpppmnu)
Retrieve the submenu of the specified popup menu.
MG_EXPORT HMENU GUIAPI CreateMenu(void)
Creates an empty menu.
static BOOL MainWindowThreadCleanup(HWND hMainWnd)
Cleanup the main window.
Definition: window.h:6876
MG_EXPORT HWND GUIAPI GetRootWindow(int *nrWins)
Retrieve the root window of the current thread.
UINT nPage
Definition: window.h:9519
MG_EXPORT NOTIFPROC GUIAPI SetNotificationCallback(HWND hwnd, NOTIFPROC notif_proc)
Set a new notification callback procedure for a window.
MG_EXPORT void GUIAPI ReleaseCapture(void)
Releases the mouse capture from a window and restores normal mouse input processing.
struct _MAINWINCREATE MAINWINCREATE
MG_EXPORT int GUIAPI ClientWidthToWindowWidthEx(DWORD dwStyle, int win_type, int cw)
Calculates main window width from the width of the client area.
MG_EXPORT BOOL GUIAPI DestroyCaret(HWND hWnd)
Destroys a caret.
MG_EXPORT LINT GUIAPI GetMenuItemID(HMENU hmnu, int pos)
Retrieve the menu item identifier of a menu item at specified position in a menu. ...
MG_EXPORT int GUIAPI DeleteAccelerators(HACCEL hacc, int key, DWORD keymask)
Deletes an accelerator from the accelerator table.
MG_EXPORT HACCEL GUIAPI CreateAcceleratorTable(HWND hWnd)
Creates an empty accelerator table.
LINT id
Definition: window.h:11471
GHANDLE HICON
Handle to icon.
Definition: common.h:427
MG_EXPORT BOOL GUIAPI SetDlgItemInt(HWND hDlg, LINT nIDDlgItem, UINT uValue, BOOL bSigned)
Set the text of a control in a dialog box to the string representation of a specified integer value...
MG_EXPORT BOOL GUIAPI IsDialog(HWND hWnd)
Determine whether a window handle identifies a dialog window.
MG_EXPORT BOOL GUIAPI SetWindowMask(HWND hWnd, const MYBITMAP *mask)
Set window (a main window, or a child window which is also known as "control")&#39;s Mask Rect with MYBIT...
struct _WNDCLASS WNDCLASS