MiniGUI API Reference (MiniGUI-Threads)  v4.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 #ifdef __cplusplus
68 extern "C" {
69 #endif /* __cplusplus */
70 
76 /* Definitions of common messages. */
77 #define MSG_NULLMSG 0x0000
78 #define MSG_SYNCMSG 0x0000
79 
85 /* Group 1 from 0x0001 to 0x000F, the mouse messages. */
86 #define MSG_FIRSTMOUSEMSG 0x0001
87 
110 #define MSG_LBUTTONDOWN 0x0001
111 
131 #define MSG_LBUTTONUP 0x0002
132 
152 #define MSG_LBUTTONDBLCLK 0x0003
153 
173 #define MSG_MOUSEMOVE 0x0004
174 
197 #define MSG_RBUTTONDOWN 0x0005
198 
218 #define MSG_RBUTTONUP 0x0006
219 
239 #define MSG_RBUTTONDBLCLK 0x0007
240 
262 #define MSG_MBUTTONDOWN 0x0008
263 
285 #define MSG_MBUTTONUP 0x0009
286 
306 #define MSG_MBUTTONDBLCLK 0x000A
307 
308 #define MSG_NCMOUSEOFF 0x000A
309 
329 #define MSG_NCLBUTTONDOWN 0x000B
330 
350 #define MSG_NCLBUTTONUP 0x000C
351 
371 #define MSG_NCLBUTTONDBLCLK 0x000D
372 
392 #define MSG_NCMOUSEMOVE 0x000E
393 
413 #define MSG_NCRBUTTONDOWN 0x000F
414 
434 #define MSG_NCRBUTTONUP 0x0010
435 
455 #define MSG_NCRBUTTONDBLCLK 0x0011
456 
476 #define MSG_NCMBUTTONDOWN 0x0012
477 
497 #define MSG_NCMBUTTONUP 0x0013
498 
518 #define MSG_NCMBUTTONDBLCLK 0x0014
519 
520 #define MSG_LASTMOUSEMSG 0x0014
521 
529 /* Group 2 from 0x0015 to 0x001F, the key messages. */
530 #define MSG_FIRSTKEYMSG 0x0015
531 
554 #define MSG_KEYDOWN 0x0015
555 
582 #define MSG_CHAR 0x0016
583 
602 #define MSG_KEYUP 0x0017
603 
622 #define MSG_SYSKEYDOWN 0x0018
623 
642 #define MSG_SYSCHAR 0x0019
643 
662 #define MSG_SYSKEYUP 0x001A
663 
664 
665 /* keyboard longpress supported */
666 
680 #define MSG_KEYLONGPRESS 0x001B
681 
696 #define MSG_KEYALWAYSPRESS 0x001C
697 
723 #define MSG_KEYSYM 0x001D
724 
747 #define MSG_UTF8CHAR 0x001E
748 
755 #define DEF_LPRESS_TIME 200
756 
763 #define DEF_APRESS_TIME 1000
764 
769 #define DEF_INTERVAL_TIME 200
770 
771 extern DWORD __mg_key_longpress_time;
772 extern DWORD __mg_key_alwayspress_time;
773 extern DWORD __mg_interval_time;
774 
779 #define SetKeyLongPressTime(time) \
780  do { \
781  __mg_key_longpress_time = time; \
782  } while (0)
783 
788 #define SetKeyAlwaysPressTime(time) \
789  do { \
790  __mg_key_alwayspress_time = time; \
791  } while (0)
792 
797 #define SetIntervalTime(time) \
798  do { \
799  __mg_interval_time = time; \
800  } while (0)
801 
802 #define MSG_LASTKEYMSG 0x001F
803 
811 /* Group 3 from 0x0020 to 0x005F, User-machine Interaction messages. */
812 #define MSG_FIRSTPOSTMSG 0x0020
813 
838 #define MSG_SETCURSOR 0x0020
839 
840  #define HT_MASK 0xFF
841 
842  #define HT_UNKNOWN 0x00
843  #define HT_OUT 0x01
844  #define HT_MENUBAR 0x02
845  #define HT_TRANSPARENT 0x03
846 
847  #define HT_BORDER 0x04
848  #define HT_CLIENT 0x0C
849 
850  #define HT_NEEDCAPTURE 0x10
851  #define HT_ICON 0x14
852  #define HT_CLOSEBUTTON 0x15
853  #define HT_MAXBUTTON 0x16
854  #define HT_MINBUTTON 0x17
855  #define HT_HSCROLL 0x18
856  #define HT_VSCROLL 0x19
857 
858  #define HT_DRAGGABLE 0x20
859  #define HT_CAPTION 0x20
860 
861  /*indicate cursor at border */
862  #define HT_BORDER_MASK 0x28
863  #define HT_BORDER_TOP 0x28
864  #define HT_BORDER_BOTTOM 0x29
865  #define HT_BORDER_LEFT 0x2A
866  #define HT_BORDER_RIGHT 0x2B
867 
868  /*indicate cursor at border corner*/
869  #define HT_CORNER_MASK 0x2C
870  #define HT_CORNER_TL 0x2C
871  #define HT_CORNER_TR 0x2D
872  #define HT_CORNER_BL 0x2E
873  #define HT_CORNER_BR 0x2F
874 
875  /*new scrollbar hittest value
876  * can be AND'ed with HT_NEEDCAPTURE*/
877  #define HT_SB_MASK 0x50
878 
879  #define HT_SB_LEFTARROW 0x50
880  #define HT_SB_RIGHTARROW 0x51
881  #define HT_SB_LEFTSPACE 0x52
882  #define HT_SB_RIGHTSPACE 0x53
883  #define HT_SB_HTHUMB 0x54
884 
885  #define HT_SB_VMASK 0x58
886 
887  #define HT_SB_UPARROW 0x58
888  #define HT_SB_DOWNARROW 0x59
889  #define HT_SB_UPSPACE 0x5a
890  #define HT_SB_DOWNSPACE 0x5b
891  #define HT_SB_VTHUMB 0x5c
892 
893  #define HT_SB_UNKNOWN 0x5f
894 
895 /*user defined hittest code are 0x80 ~ 0x8F*/
896 #define HT_USER_MASK 0x80
897 
898 
904 #define MSG_NCHITTEST 0x0021
905 
912 #define MSG_HITTEST MSG_NCHITTEST
913 
918 #define MSG_CHANGESIZE 0x0022
919 
920 /* reserved */
921 #define MSG_QUERYNCRECT 0x0023
922 
927 #define MSG_QUERYCLIENTAREA 0x0024
928 
952 #define MSG_SIZECHANGING 0x0025
953 
976 #define MSG_SIZECHANGED 0x0026
977 
994 #define MSG_CSIZECHANGED 0x0027
995 
1006 #define MSG_SETFOCUS 0x0030
1007 
1018 #define MSG_KILLFOCUS 0x0031
1019 
1028 #define MSG_MOUSEACTIVE 0x0032
1029 
1038 #define MSG_ACTIVE 0x0033
1039 
1044 #define MSG_CHILDHIDDEN 0x0034
1045  #define RCTM_CLICK 1
1046  #define RCTM_KEY 2
1047  #define RCTM_MESSAGE 3
1048  #define RCTM_SHOWCTRL 4
1049 
1074 #define MSG_ACTIVEMENU 0x0040
1075 
1093 #define MSG_DEACTIVEMENU 0x0041
1094 
1105 #define SB_LINEUP 0x01a
1106 
1112 #define SB_LINEDOWN 0x02
1113 
1119 #define SB_LINELEFT 0x03
1120 
1126 #define SB_LINERIGHT 0x04
1127 
1133 #define SB_PAGEUP 0x05
1134 
1140 #define SB_PAGEDOWN 0x06
1141 
1147 #define SB_PAGELEFT 0x07
1148 
1154 #define SB_PAGERIGHT 0x08
1155 
1161 #define SB_THUMBPOSITION 0x09
1162 
1168 #define SB_THUMBTRACK 0x0A
1169 
1175 #define SB_TOP 0x0B
1176 
1182 #define SB_BOTTOM 0x0C
1183 
1189 #define SB_ENDSCROLL 0x0D
1190 
1221 #define MSG_HSCROLL 0x0042
1222 
1251 #define MSG_VSCROLL 0x0043
1252 
1265 #define MSG_NCSETCURSOR 0x0044
1266 
1282 #define MSG_MOUSEMOVEIN 0x0050
1283 
1289 #define MSG_WINDOWDROPPED 0x0051
1290 
1291 #define MSG_LASTPOSTMSG 0x005F
1292 
1300  /* Group 4 from 0x0060 to 0x007F, the creation messages. */
1301 #define MSG_FIRSTCREATEMSG 0x0060
1302 
1330 #define MSG_CREATE 0x0060
1331 
1360 #define MSG_NCCREATE 0x0061
1361 
1362 /*Not use*/
1363 #define MSG_INITPANES 0x0062
1364 #define MSG_DESTROYPANES 0x0063
1365 
1379 #define MSG_DESTROY 0x0064
1380 
1381 /* Not use */
1382 #define MSG_NCDESTROY 0x0065
1383 
1391 #define MSG_CLOSE 0x0066
1392 
1393 /* Not use */
1394 #define MSG_NCCALCSIZE 0x0067
1395 
1396 /*
1397  * Not implemented, this message is reserved for future use.
1398  *
1399  * \def MSG_MAXIMIZE
1400  * \brief Indicates the user has clicked the maximizing box on the caption.
1401  *
1402  * This message is sent to the window when the user has clicked the maximizing
1403  * box on the caption of the window.
1404  */
1405 #define MSG_MAXIMIZE 0x0068
1406 
1407 /*
1408  * Not implemented, this message is reserved for future use.
1409  *
1410  * \def MSG_MINIMIZE
1411  * \brief Indicates the user has clicked the minimizing box on the caption.
1412  *
1413  * This message is sent to the window when the user has clicked the
1414  * minimizing box on the caption of the window.
1415  */
1416 #define MSG_MINIMIZE 0x0069
1417 
1418 /*
1419  * Not implemented, this message is reserved for future use.
1420  *
1421  * \def MSG_HELP
1422  * \brief Indicates the user has clicked the help box on the caption.
1423  *
1424  * This message is sent to the window when the user has clicked the
1425  * help box on the caption of the window.
1426  */
1427 #define MSG_HELP 0x006A
1428 
1429 #define MSG_LASTCREATEMSG 0x006F
1430 
1459  /* Group 4 from 0x0070 to 0x009F, the extra input messages. */
1460 #define MSG_FIRSTEXTRAINPUTMSG 0x0070
1461 
1462 #define AXIS_SCROLL_INVALID 0
1463 #define AXIS_SCROLL_VERTICAL 1
1464 #define AXIS_SCROLL_HORIZONTAL 2
1465 
1466 #define AXIS_SOURCE_INVALID 0
1467 #define AXIS_SOURCE_WHEEL 1
1468 #define AXIS_SOURCE_FINGER 2
1469 #define AXIS_SOURCE_CONTINUOUS 3
1470 #define AXIS_SOURCE_WHEEL_TILT 4
1471 
1493 #define MSG_EXIN_AXIS 0x0070
1494 
1513 #define MSG_EXIN_BUTTONDOWN 0x0071
1514 
1533 #define MSG_EXIN_BUTTONUP 0x0072
1534 
1547 #define MSG_EXIN_TOUCH_DOWN 0x0073
1548 
1555 #define MSG_EXIN_TOUCH_UP 0x0074
1556 
1569 #define MSG_EXIN_TOUCH_MOTION 0x0075
1570 
1577 #define MSG_EXIN_TOUCH_CANCEL 0x0076
1578 
1597 #define MSG_EXIN_TOUCH_FRAME 0x0077
1598 
1599 #define SWITCH_INVALID 0
1600 #define SWITCH_LID 1
1601 #define SWITCH_TABLET_MODE 2
1602 
1603 #define SWITCH_STATE_INVALID 0
1604 #define SWITCH_STATE_ON 1
1605 #define SWITCH_STATE_OFF 2
1606 
1622 #define MSG_EXIN_SWITCH_TOGGLE 0x007A
1623 
1635 #define MSG_EXIN_GESTURE_SWIPE_BEGIN 0x0080
1636 
1652 #define MSG_EXIN_GESTURE_SWIPE_UPDATE 0x0081
1653 
1667 #define MSG_EXIN_GESTURE_SWIPE_END 0x0082
1668 
1685 #define MSG_EXIN_GESTURE_PINCH_BEGIN 0x0083
1686 
1708 #define MSG_EXIN_GESTURE_PINCH_UPDATE 0x0084
1709 
1728 #define MSG_EXIN_GESTURE_PINCH_END 0x0085
1729 
1742 #define MSG_EXIN_END_CHANGES 0x008F
1743 
1744 #define TABLET_TOOL_X 0
1745 #define TABLET_TOOL_Y 1
1746 #define TABLET_TOOL_PRESSURE 2
1747 #define TABLET_TOOL_DISTANCE 3
1748 #define TABLET_TOOL_TILT_X 4
1749 #define TABLET_TOOL_TILT_Y 5
1750 #define TABLET_TOOL_ROTATION 6
1751 #define TABLET_TOOL_SLIDER 7
1752 #define TABLET_TOOL_SIZE_MAJOR 8
1753 #define TABLET_TOOL_SIZE_MINOR 9
1754 #define TABLET_TOOL_WHEEL 10
1755 
1756 #define TABLET_TOOL_PROXIMITY_STATE_INVALID 0
1757 #define TABLET_TOOL_PROXIMITY_STATE_OUT 1
1758 #define TABLET_TOOL_PROXIMITY_STATE_IN 2
1759 
1760 #define TABLET_TOOL_TIP_INVALID 0
1761 #define TABLET_TOOL_TIP_UP 1
1762 #define TABLET_TOOL_TIP_DOWN 2
1763 
1764 #define TABLET_BUTTON_STATE_INVALID 0
1765 #define TABLET_BUTTON_STATE_RELEASED 1
1766 #define TABLET_BUTTON_STATE_PRESSED 2
1767 
1816 #define MSG_EXIN_TABLET_TOOL_AXIS 0x0090
1817 
1839 #define MSG_EXIN_TABLET_TOOL_PROXIMITY 0x0091
1840 
1862 #define MSG_EXIN_TABLET_TOOL_TIP 0x0092
1863 
1879 #define MSG_EXIN_TABLET_TOOL_BUTTON 0x0093
1880 
1898 #define MSG_EXIN_TABLET_PAD_BUTTON 0x0094
1899 
1900 #define TABLET_PAD_RING_SOURCE_UNKNOWN 0
1901 #define TABLET_PAD_RING_SOURCE_FINGER 1
1902 
1926 #define MSG_EXIN_TABLET_PAD_RING 0x0095
1927 
1928 #define TABLET_PAD_STRIP_SOURCE_UNKNOWN 0
1929 #define TABLET_PAD_STRIP_SOURCE_FINGER 1
1930 
1953 #define MSG_EXIN_TABLET_PAD_STRIP 0x0096
1954 
1968 #define MSG_EXIN_USER_BEGIN 0x009A
1969 
1983 #define MSG_EXIN_USER_UPDATE 0x009B
1984 
1998 #define MSG_EXIN_USER_END 0x009C
1999 
2000 #define MSG_LASTEXTRAINPUTMSG 0x009F
2001 
2009 /* Group 5 from 0x00A0 to 0x00CF, the paint messages. */
2010 #define MSG_FIRSTPAINTMSG 0x00A0
2011 
2036 #define MSG_SHOWWINDOW 0x00A0
2037 
2056 #define MSG_ERASEBKGND 0x00B0 /* this is an async message */
2057 
2071 #define MSG_PAINT 0x00B1
2072 
2088 #define MSG_NCPAINT 0x00B2
2089 
2094 #define MSG_NCACTIVATE 0x00B3
2095 
2100 #define MSG_SYNCPAINT 0x00B4
2101 
2102 #define MSG_LASTPAINTMSG 0x00BF
2103 
2111 /* Group 6 from 0x00C0 to 0x00EF, the internal desktop messages. */
2112 #define MSG_FIRSTSESSIONMSG 0x00C0
2113 
2114 #define MSG_STARTSESSION 0x00C0
2115 #define MSG_QUERYENDSESSION 0x00C1
2116 #define MSG_ENDSESSION 0x00C2
2117 #define MSG_REINITSESSION 0x00C3
2118 
2119 #define MSG_ERASEDESKTOP 0x00CE
2120 #define MSG_PAINTDESKTOP 0x00CF
2121 
2122 #define MSG_DT_MOUSEOFF 0x00D0
2123 
2141 #define MSG_DT_LBUTTONDOWN 0x00D1
2142 
2160 #define MSG_DT_LBUTTONUP 0x00D2
2161 
2179 #define MSG_DT_LBUTTONDBLCLK 0x00D3
2180 
2198 #define MSG_DT_MOUSEMOVE 0x00D4
2199 
2218 #define MSG_DT_RBUTTONDOWN 0x00D5
2219 
2237 #define MSG_DT_RBUTTONUP 0x00D6
2238 
2256 #define MSG_DT_RBUTTONDBLCLK 0x00D7
2257 
2276 #define MSG_DT_MBUTTONDOWN 0x00D8
2277 
2295 #define MSG_DT_MBUTTONUP 0x00D9
2296 
2314 #define MSG_DT_MBUTTONDBLCLK 0x00DA
2315 
2316 #define MSG_DT_KEYOFF 0x00CB
2317 
2335 #define MSG_DT_KEYDOWN 0x00E0
2336 
2337 #define MSG_DT_CHAR 0x00E1
2338 
2355 #define MSG_DT_KEYUP 0x00E2
2356 
2357 #define MSG_DT_SYSKEYDOWN 0x00E3
2358 #define MSG_DT_SYSCHAR 0x00E4
2359 #define MSG_DT_SYSKEYUP 0x00E5
2360 
2361 #define MSG_DT_KEYLONGPRESS 0x00E6
2362 #define MSG_DT_KEYALWAYSPRESS 0x00E7
2363 
2364 #define MSG_LASTSESSIONMSG 0x00EF
2365 
2373 /* Group 7 from 0x00F0 to 0x010F, Internal window management messages. */
2374 #define MSG_FIRSTWINDOWMSG 0x00F0
2375 
2376 #define MSG_ADDNEWMAINWIN 0x00F0
2377 #define MSG_REMOVEMAINWIN 0x00F1
2378 #define MSG_MOVETOTOPMOST 0x00F2
2379 #define MSG_SETACTIVEMAIN 0x00F3
2380 #define MSG_GETACTIVEMAIN 0x00F4
2381 #define MSG_SHOWMAINWIN 0x00F5
2382 #define MSG_HIDEMAINWIN 0x00F6
2383 #define MSG_MOVEMAINWIN 0x00F7
2384 #define MSG_SETCAPTURE 0x00F8
2385 #define MSG_GETCAPTURE 0x00F9
2386 
2387 #define MSG_ENDTRACKMENU 0x00FA
2388 #define MSG_TRACKPOPUPMENU 0x00FB
2389 #define MSG_CLOSEMENU 0x00FC
2390 #define MSG_SCROLLMAINWIN 0x00FD
2391 #define MSG_CARET_CREATE 0x00FE
2392 #define MSG_CARET_DESTROY 0x00FF
2393 
2394 #define MSG_ENABLEMAINWIN 0x0100
2395 #define MSG_ISENABLED 0x0101
2396 
2397 #define MSG_SETWINCURSOR 0x0102
2398 
2399 #define MSG_GETNEXTMAINWIN 0x0103
2400 
2401 #define MSG_SHOWGLOBALCTRL 0x010A
2402 #define MSG_HIDEGLOBALCTRL 0x010B
2403 
2404 typedef struct _DRAGINFO {
2405  int location;
2406  int init_x, init_y;
2407 } DRAGINFO;
2408 
2409 /* client to server; wParam: hwnd, lParam: DRAGINFO. */
2410 #define MSG_STARTDRAGWIN 0x010C
2411 /* client to server; wParam: hwnd, lParam: 0L. */
2412 #define MSG_CANCELDRAGWIN 0x010D
2413 
2414 #define MSG_CHANGECAPTION 0x010E
2415 
2416 #define MSG_LASTWINDOWMSG 0x010F
2417 
2425 /* Group 8 from 0x0120 to 0x013F, the dialog and control messages. */
2426 #define MSG_FIRSTCONTROLMSG 0x0120
2427 
2457 #define MSG_COMMAND 0x0120
2458 
2463 #define MSG_SYSCOMMAND 0x0121
2464 
2469 #define MSG_GETDLGCODE 0x0122
2470 
2497 #define MSG_INITDIALOG 0x0123
2498 
2499 /*Reserved*/
2500 #define MSG_NEXTDLGCTRL 0x0124
2501 #define MSG_ENTERIDLE 0x0125
2502 
2507 #define MSG_DLG_GETDEFID 0x0126
2508 
2513 #define MSG_DLG_SETDEFID 0x0127
2514 
2515 /* #define MSG_DLG_REPOSITION 0x0128 */
2516 
2523 #define MSG_ISDIALOG 0x0128
2524 
2542 #define MSG_INITPAGE 0x0129
2543 
2564 #define MSG_SHOWPAGE 0x012A
2565 
2585 #define MSG_SHEETCMD 0x012B
2586 
2606 #define MSG_INITCONTAINER 0x012C
2607 
2636 #define MSG_SVCONTCMD 0x012D
2637 
2656 #define MSG_FREEZECTRL 0x012E
2657 
2676 #define MSG_FONTCHANGING 0x0130
2677 
2678 
2686 #define MSG_FONTCHANGED 0x0131
2687 
2705 #define MSG_GETTEXTLENGTH 0x0132
2706 
2729 #define MSG_GETTEXT 0x0133
2730 
2751 #define MSG_SETTEXT 0x0134
2752 
2766 #define MSG_ENABLE 0x0135
2767 
2768 #define MSG_LASTCONTROLMSG 0x013F
2769 
2777 /* Group 9 from 0x0140 to 0x016F, the system messages. */
2778 #define MSG_FIRSTSYSTEMMSG 0x0140
2779 
2780 #define MSG_QUIT 0x0140
2781 
2789 #define MSG_IDLE 0x0142
2790 
2791 #define MSG_TIMEOUT 0x0143
2792 
2808 #define MSG_TIMER 0x0144
2809 
2810 #define MSG_CARETBLINK 0x0145
2811 
2812 #ifndef _MGRM_THREADS
2813 
2841 #define MSG_FDEVENT 0x0146
2842 
2856 #define MSG_SRVNOTIFY 0x0147
2857 
2858 #ifdef _MGRM_PROCESSES
2859  #define MSG_UPDATECLIWIN 0x0148
2860 #endif
2861 
2862 #endif /* !_MGRM_THREADS */
2863 
2877 #define MSG_DOESNEEDIME 0x0150
2878 
2879 /* flag code. */
2880 #define IME_STATUS_REGISTERED 0x0000
2881 #define IME_STATUS_ENABLED 0x0001
2882 #define IME_STATUS_AUTOTRACK 0x0002
2883 #define IME_STATUS_LANGUAGE 0x0003
2884  #define IME_LANGUAGE_UNKNOWN 0x0000
2885  #define IME_LANGUAGE_LATIN 0x0001
2886  #define IME_LANGUAGE_ZHCN 0x0002
2887  #define IME_LANGUAGE_ZHTW 0x0003
2888 #define IME_STATUS_ENCODING 0x0004
2889  #define IME_ENCODING_LOCAL 0x0000
2890  #define IME_ENCODING_UTF8 0x0001
2891 #define IME_STATUS_VERSION 0x0005
2892 #define IME_STATUS_USER_MIN 0x0006
2893 #define IME_STATUS_USER_MAX 0x0020
2894 
2895 /* IME edit type */
2896 #define IME_WINDOW_TYPE_NOT_EDITABLE 0x0000
2897 #define IME_WINDOW_TYPE_EDITABLE 0x0001
2898 #define IME_WINDOW_TYPE_READONLY 0x0002
2899 #define IME_WINDOW_TYPE_PASSWORD 0x0003
2900 
2901 /*Internal use*/
2902 #define MSG_IME_REGISTER 0x0151
2903 #define MSG_IME_UNREGISTER 0x0152
2904 #define MSG_IME_OPEN 0x0153
2905 #define MSG_IME_CLOSE 0x0154
2906 #define MSG_IME_SETSTATUS 0x0156
2907 #define MSG_IME_GETSTATUS 0x0157
2908 #define MSG_IME_SETTARGET 0x0158
2909 #define MSG_IME_GETTARGET 0x0159
2910 #define MSG_IME_SETPOS 0x015A
2911 #define MSG_IME_GETPOS 0x015B
2912 
2913 /* new ime msg. */
2914 #define MSG_IME_SET_TARGET_INFO 0x015C
2915 #define MSG_IME_GET_TARGET_INFO 0x015D
2916 
2917 #define MSG_SHOWMENU 0x0160
2918 #define MSG_HIDEMENU 0x0161
2919 
2920 #define MSG_ADDTIMER 0x0162
2921 #define MSG_REMOVETIMER 0x0163
2922 #define MSG_RESETTIMER 0x0164
2923 
2924 #define MSG_WINDOWCHANGED 0x0165
2925 
2926 #define MSG_BROADCASTMSG 0x0166
2927 
2928 #define MSG_REGISTERWNDCLASS 0x0167
2929 #define MSG_UNREGISTERWNDCLASS 0x0168
2930 #define MSG_NEWCTRLINSTANCE 0x0169
2931 #define MSG_REMOVECTRLINSTANCE 0x016A
2932 #define MSG_GETCTRLCLASSINFO 0x016B
2933 #define MSG_CTRLCLASSDATAOP 0x016C
2934  #define CCDOP_GETCCI 0x01
2935  #define CCDOP_SETCCI 0x02
2936 
2937 #define MSG_REGISTERKEYHOOK 0x016D
2938 #define MSG_REGISTERMOUSEHOOK 0x016E
2939 
2940 #define MSG_LASTSYSTEMMSG 0x016F
2941 
2949 /* Group 10 from 0x0170 to 0x018F, the menu messages */
2950 #define MSG_FIRSTMENUMSG 0x0170
2951 
2952 /*Internal use*/
2953 #define MSG_INITMENU 0x0170
2954 #define MSG_INITMENUPOPUP 0x0171
2955 #define MSG_MENUSELECT 0x0172
2956 #define MSG_MENUCHAR 0x0173
2957 #define MSG_ENTERMENULOOP 0x0174
2958 #define MSG_EXITMENULOOP 0x0175
2959 #define MSG_CONTEXTMENU 0x0176
2960 #define MSG_NEXTMENU 0x0177
2961 
2962 #define MSG_LASTMENUMSG 0x018F
2963 
2971 #define MSG_FIRSTUSERMSG 0x0800
2972 
2973 
2981 #define MSG_USER 0x0800
2982 
2983 #define MSG_LASTUSERMSG 0xEFFF
2984 
3008 typedef struct _MSG
3009 {
3020 #ifdef _MGRM_THREADS
3021 
3022  void* pAdd;
3023 #endif
3024 } MSG;
3025 typedef MSG* PMSG;
3026 
3027 #define QS_NOTIFYMSG 0x10000000
3028 #ifdef _MGRM_THREADS
3029  #define QS_SYNCMSG 0x20000000
3030 #else
3031  #define QS_DESKTIMER 0x20000000
3032 #endif
3033 #define QS_POSTMSG 0x40000000
3034 #define QS_QUIT 0x80000000
3035 #define QS_INPUT 0x01000000
3036 #define QS_PAINT 0x02000000
3037 #define QS_TIMER 0x0000FFFF
3038 #define QS_EMPTY 0x00000000
3039 
3045 #define PM_NOREMOVE 0x0000
3046 
3052 #define PM_REMOVE 0x0001
3053 
3059 #define PM_NOYIELD 0x0002
3060 
3088 MG_EXPORT BOOL GUIAPI PeekMessageEx (PMSG pMsg, HWND hWnd,
3089  UINT nMsgFilterMin, UINT nMsgFilterMax,
3090  BOOL bWait, UINT uRemoveMsg);
3091 
3110 static inline BOOL GUIAPI GetMessage (PMSG pMsg, HWND hWnd)
3111 {
3112  return PeekMessageEx (pMsg, hWnd, 0, 0, TRUE, PM_REMOVE);
3113 }
3114 
3131 MG_EXPORT BOOL GUIAPI WaitMessage (PMSG pMsg, HWND hMainWnd);
3132 
3147 MG_EXPORT BOOL GUIAPI HavePendingMessage (HWND hMainWnd);
3148 
3175 static inline BOOL GUIAPI PeekMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
3176  UINT nMsgFilterMax, UINT uRemoveMsg)
3177 {
3178  return PeekMessageEx (pMsg, hWnd, nMsgFilterMin, nMsgFilterMax,
3179  FALSE, uRemoveMsg);
3180 }
3181 
3208 MG_EXPORT BOOL GUIAPI PeekPostMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
3209  UINT nMsgFilterMax, UINT uRemoveMsg);
3210 
3232 MG_EXPORT int GUIAPI PostMessage (HWND hWnd, UINT nMsg,
3233  WPARAM wParam, LPARAM lParam);
3234 
3250 MG_EXPORT LRESULT GUIAPI SendMessage (HWND hWnd, UINT nMsg,
3251  WPARAM wParam, LPARAM lParam);
3252 
3268 MG_EXPORT void GUIAPI SetAutoRepeatMessage (HWND hwnd, UINT msg,
3269  WPARAM wParam, LPARAM lParam);
3270 
3271 #ifndef _MGRM_THREADS
3272 
3279 #define SendAsyncMessage SendMessage
3280 
3281 #ifdef _MGRM_PROCESSES
3282 
3283 #define CLIENTS_TOPMOST -1
3284 #define CLIENTS_ALL -2
3285 #define CLIENTS_EXCEPT_TOPMOST -3
3286 #define CLIENT_ACTIVE -4
3287 
3318 int GUIAPI Send2Client (const MSG* msg, int cli);
3319 
3339 BOOL GUIAPI Send2TopMostClients (UINT nMsg, WPARAM wParam, LPARAM lParam);
3340 
3361 BOOL GUIAPI Send2ActiveWindow (const MG_Layer* layer,
3362  UINT nMsg, WPARAM wParam, LPARAM lParam);
3363 
3364 #endif /* _MGRM_PROCESSES */
3365 
3366 #else /* !_MGRM_THREADS */
3367 
3388 MG_EXPORT LRESULT GUIAPI PostSyncMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
3389 
3410 MG_EXPORT LRESULT GUIAPI SendAsyncMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
3411 #endif
3412 
3431 MG_EXPORT int GUIAPI SendNotifyMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
3432 
3447 MG_EXPORT int GUIAPI BroadcastMessage (UINT nMsg, WPARAM wParam, LPARAM lParam);
3448 
3461 MG_EXPORT int GUIAPI PostQuitMessage (HWND hWnd);
3462 
3463 #define KBD_LAYOUT_DEFAULT "default"
3464 #define KBD_LAYOUT_FRPC "frpc"
3465 #define KBD_LAYOUT_FR "fr"
3466 #define KBD_LAYOUT_DE "de"
3467 #define KBD_LAYOUT_DELATIN1 "delatin1"
3468 #define KBD_LAYOUT_IT "it"
3469 #define KBD_LAYOUT_ES "es"
3470 #define KBD_LAYOUT_ESCP850 "escp850"
3471 #define KBD_LAYOUT_HEBREW "hebrew"
3472 #define KBD_LAYOUT_ARABIC "arabic"
3473 
3511 MG_EXPORT BOOL GUIAPI SetKeyboardLayout (const char* kbd_layout);
3512 
3513 #ifdef _MGCHARSET_UNICODE
3514 
3515 #include <stddef.h>
3516 #include <stdlib.h>
3517 
3518 MG_EXPORT int GUIAPI ToUnicode (UINT keycode, const BYTE* kbd_state,
3519  wchar_t* wcs, int wcs_len, const char* kbd_layout);
3520 
3521 MG_EXPORT int GUIAPI ToAscii (UINT keycode, const BYTE* kbd_state,
3522  WORD* ch, const char* kbd_layout);
3523 
3524 #endif /* _MGCHARSET_UNICODE */
3525 
3546 MG_EXPORT BOOL GUIAPI TranslateMessage (PMSG pMsg);
3547 
3570 MG_EXPORT BOOL GUIAPI TranslateKeyMsgToChar (int message,
3571  WPARAM wParam, LPARAM lParam, WORD *ch);
3572 
3589 MG_EXPORT LRESULT GUIAPI DispatchMessage (PMSG pMsg);
3590 
3603 MG_EXPORT int GUIAPI ThrowAwayMessages (HWND pMainWnd);
3604 
3605 #ifndef _MGRM_THREADS
3606 
3621 MG_EXPORT BOOL GUIAPI EmptyMessageQueue (HWND hWnd);
3622 
3623 #endif
3624 
3625 #ifdef _MGHAVE_MSG_STRING
3626 
3641 MG_EXPORT const char* GUIAPI Message2Str (UINT message);
3642 
3659 MG_EXPORT void GUIAPI PrintMessage (FILE* fp, HWND hWnd,
3660  UINT nMsg, WPARAM wParam, LPARAM lParam);
3661 
3662 #endif
3663 
3675 #define HOOK_GOON 0
3676 
3681 #define HOOK_STOP 1
3682 
3683 #ifndef _MGRM_PROCESSES
3684 
3691 typedef int (* MSGHOOK)(void* context, HWND dst_wnd,
3692  UINT msg, WPARAM wparam, LPARAM lparam);
3693 
3697 typedef struct _HOOKINFO
3698 {
3700  void* context;
3703 } HOOKINFO;
3704 
3721 MG_EXPORT MSGHOOK GUIAPI RegisterKeyMsgHook (void* context, MSGHOOK hook);
3722 
3739 MG_EXPORT MSGHOOK GUIAPI RegisterMouseMsgHook (void* context, MSGHOOK hook);
3740 
3741 #endif /* !_MGRM_PROCESSES */
3742 
3743 #ifndef _MGRM_THREADS
3744 
3758 typedef int (* SRVEVTHOOK) (PMSG pMsg);
3759 
3773 MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
3774 
3775 #ifdef _MGRM_PROCESSES
3776 
3798 MG_EXPORT HWND GUIAPI RegisterKeyHookWindow (HWND hwnd, DWORD flag);
3799 
3821 MG_EXPORT HWND GUIAPI RegisterMouseHookWindow (HWND hwnd, DWORD flag);
3822 
3823 #endif /* _MGRM_PROCESSES */
3824 #endif /* !_MGRM_THREADS */
3825 
3826 
3838 #define WS_CTRLMASK 0x0000FFFFL
3839 
3844 #define WS_NONE 0x00000000L
3845 
3850 #define WS_CHILD 0x40000000L
3851 
3856 #define WS_CAPTION 0x20000000L
3857 
3862 #define WS_SYSMENU 0x10000000L
3863 
3868 #define WS_VISIBLE 0x08000000L
3869 
3874 #define WS_DISABLED 0x04000000L
3875 
3876 /* Main window states -- reserved for future use. */
3877 #define WS_MINIMIZE 0x02000000L
3878 #define WS_MAXIMIZE 0x01000000L
3879 
3885 #define WS_DLGFRAME 0x00800000L
3886 
3891 #define WS_BORDER 0x00400000L
3892 
3897 #define WS_THICKFRAME 0x00200000L
3898 
3903 #define WS_THINFRAME 0x00100000L
3904 
3909 #define WS_VSCROLL 0x00080000L
3910 
3915 #define WS_HSCROLL 0x00040000L
3916 
3922 #define WS_GROUP 0x00020000L
3923 
3930 #define WS_TABSTOP 0x00010000L
3931 
3932 /*
3933  * Not implemented, reserved for future use.
3934  *
3935  * \def WS_MINIMIZEBOX
3936  * \brief Creates a window with minimizing box on caption.
3937  * \note This style is valid only for main window.
3938  */
3939 #define WS_MINIMIZEBOX 0x00020000L
3940 
3941 /*
3942  * Not implemented, reserved for future use.
3943  *
3944  * \def WS_MAXIMIZEBOX
3945  * \brief Creates a window with maximizing box on caption.
3946  * \note This style is valid only for main window.
3947  */
3948 #define WS_MAXIMIZEBOX 0x00010000L
3949 
3950 /* Obsolete styles, back-compatibility definitions. */
3951 #define WS_OVERLAPPED 0x00000000L
3952 #define WS_ABSSCRPOS 0x00000000L
3953 
3958 #define WS_EX_CONTROL_MASK 0x0000000FL
3959 
3964 #define WS_EX_INTERNAL_MASK 0xF0000000L
3965 
3970 #define WS_EX_NONE 0x00000000L
3971 
3976 #define WS_EX_TROUNDCNS 0x00000010L
3977 
3982 #define WS_EX_BROUNDCNS 0x00000020L
3983 
3990 #define WS_EX_USEPRIVATECDC 0x00000040L
3991 
3996 #define WS_EX_NOTDRAGGABLE 0x00000080L
3997 #define WS_EX_DRAGGABLE 0x00000000L
3998 
4003 #define WS_EX_USEPARENTFONT 0x00000100L
4004 
4009 #define WS_EX_USEPARENTCURSOR 0x00000200L
4010 
4015 #define WS_EX_USEPARENTRDR 0x00000400L
4016 
4023 #define WS_EX_NOPARENTNOTIFY 0x00000800L
4024 
4031 #define WS_EX_AUTOSECONDARYDC 0x00001000L
4032 
4038 #define WS_EX_TRANSPARENT 0x00002000L
4039 
4044 #define WS_EX_TOPMOST 0x00004000L
4045 
4050 #define WS_EX_TOOLWINDOW 0x00008000L
4051 
4052 /* The group reserved for BIDI support */
4053 #define WS_EX_RIGHT 0x00010000L
4054 #define WS_EX_LEFT 0x00000000L
4055 #define WS_EX_RTLREADING 0x00020000L
4056 #define WS_EX_LTRREADING 0x00000000L
4057 
4062 #define WS_EX_LEFTSCROLLBAR 0x00040000L
4063 
4068 #define WS_EX_RIGHTSCROLLBAR 0x00000000L
4069 
4074 #define WS_EX_DLGHIDE 0x00100000L
4075 
4080 #define WS_EX_NOCLOSEBOX 0x00400000L
4081 
4086 #define WS_EX_CLIPCHILDREN 0x00800000L
4087 
4092 #define WS_EX_LFRDR_MASK 0x0F000000L
4093 
4099 #define WS_EX_LFRDR_CUSTOM1 0x01000000L
4100 
4107 #define WS_EX_LFRDR_CUSTOM2 0x02000000L
4108 
4115 #define WS_EX_LFRDR_CUSTOM3 0x04000000L
4116 
4123 #define WS_EX_LFRDR_CUSTOM4 0x08000000L
4124 
4125 /* Obsolete style, back-compatibility definitions. */
4126 #define WS_EX_IMECOMPOSE 0x00000000L
4127 
4144 #define WE_FONTS_NUMBER 4
4145 
4150 #define WE_METRICS_NUMBER 6
4151 
4156 #define WE_COLORS_NUMBER 14
4157 
4158 /* Window type mask */
4159 #define WE_ATTR_TYPE_MASK 0xF000
4160 #define WE_ATTR_TYPE_COLOR_MASK 0x0F00
4161 #define WE_ATTR_INDEX_MASK 0x00FF
4162 
4163 #define WE_ATTR_TYPE_FONT 0x1000
4164 #define WE_ATTR_TYPE_METRICS 0x2000
4165 
4166 #define WE_ATTR_TYPE_COLOR 0x3000
4167 #define WE_ATTR_TYPE_FGC 0x3000
4168 #define WE_ATTR_TYPE_BGCA 0x3100
4169 #define WE_ATTR_TYPE_BGCB 0x3200
4170 
4171 /* window element id */
4172 #define WE_CAPTION 0
4173 #define WE_MENU 1
4174 #define WE_MESSAGEBOX 2
4175 #define WE_TOOLTIP 3
4176 #define WE_WND_BORDER 4
4177 #define WE_SCROLLBAR 5
4178 #define WE_INACTIVE_CAPTION 6
4179 #define WE_WINDOW 7
4180 #define WE_THREED_BODY 8
4181 #define WE_SELECTED_ITEM 9
4182 #define WE_DISABLED_ITEM 10
4183 #define WE_HIGHLIGHT_ITEM 11
4184 #define WE_SIGNIFICANT_ITEM 12
4185 #define WE_DESKTOP 13
4186 
4187 /* window element attr id */
4188 
4189 /* Window caption */
4190 #define WE_FONT_CAPTION (WE_CAPTION | WE_ATTR_TYPE_FONT)
4191 #define WE_METRICS_CAPTION (WE_CAPTION | WE_ATTR_TYPE_METRICS)
4192 #define WE_FGC_ACTIVE_CAPTION (WE_CAPTION | WE_ATTR_TYPE_FGC)
4193 #define WE_BGCA_ACTIVE_CAPTION (WE_CAPTION | WE_ATTR_TYPE_BGCA)
4194 #define WE_BGCB_ACTIVE_CAPTION (WE_CAPTION | WE_ATTR_TYPE_BGCB)
4195 
4196 /* Menu */
4197 #define WE_FONT_MENU (WE_MENU | WE_ATTR_TYPE_FONT)
4198 #define WE_METRICS_MENU (WE_MENU | WE_ATTR_TYPE_METRICS)
4199 #define WE_FGC_MENU (WE_MENU | WE_ATTR_TYPE_FGC)
4200 #define WE_BGC_MENU (WE_MENU | WE_ATTR_TYPE_BGCA)
4201 
4202 /* Message box */
4203 #define WE_FONT_MESSAGEBOX (WE_MESSAGEBOX | WE_ATTR_TYPE_FONT)
4204 #define WE_FGC_MESSAGEBOX (WE_MESSAGEBOX | WE_ATTR_TYPE_FGC)
4205 
4206 /* Tool tips */
4207 #define WE_FONT_TOOLTIP (WE_TOOLTIP | WE_ATTR_TYPE_FONT)
4208 #define WE_FGC_TOOLTIP (WE_TOOLTIP | WE_ATTR_TYPE_FGC)
4209 #define WE_BGC_TOOLTIP (WE_TOOLTIP | WE_ATTR_TYPE_BGCA)
4210 
4211 /* Window border */
4212 #define WE_METRICS_WND_BORDER (WE_WND_BORDER | WE_ATTR_TYPE_METRICS)
4213 #define WE_FGC_ACTIVE_WND_BORDER (WE_WND_BORDER | WE_ATTR_TYPE_FGC)
4214 #define WE_FGC_INACTIVE_WND_BORDER (WE_WND_BORDER | WE_ATTR_TYPE_BGCA)
4215 
4216 /* Scroll bar */
4217 #define WE_METRICS_SCROLLBAR (WE_SCROLLBAR | WE_ATTR_TYPE_METRICS)
4218 
4219 /* Inactive caption */
4220 #define WE_FGC_INACTIVE_CAPTION (WE_INACTIVE_CAPTION | WE_ATTR_TYPE_FGC)
4221 #define WE_BGCA_INACTIVE_CAPTION (WE_INACTIVE_CAPTION | WE_ATTR_TYPE_BGCA)
4222 #define WE_BGCB_INACTIVE_CAPTION (WE_INACTIVE_CAPTION | WE_ATTR_TYPE_BGCB)
4223 
4224 /* Window */
4225 #define WE_FGC_WINDOW (WE_WINDOW | WE_ATTR_TYPE_FGC)
4226 #define WE_BGC_WINDOW (WE_WINDOW | WE_ATTR_TYPE_BGCA)
4227 
4228 /* 3d body */
4229 #define WE_FGC_THREED_BODY (WE_THREED_BODY | WE_ATTR_TYPE_FGC)
4230 #define WE_MAINC_THREED_BODY (WE_THREED_BODY | WE_ATTR_TYPE_BGCA)
4231 
4232 /* Selected items */
4233 #define WE_FGC_SELECTED_ITEM (WE_SELECTED_ITEM | WE_ATTR_TYPE_FGC)
4234 #define WE_BGC_SELECTED_ITEM (WE_SELECTED_ITEM | WE_ATTR_TYPE_BGCA)
4235 #define WE_BGC_SELECTED_LOSTFOCUS (WE_SELECTED_ITEM | WE_ATTR_TYPE_BGCB)
4236 
4237 /* Invalidate items */
4238 #define WE_FGC_DISABLED_ITEM (WE_DISABLED_ITEM | WE_ATTR_TYPE_FGC)
4239 #define WE_BGC_DISABLED_ITEM (WE_DISABLED_ITEM | WE_ATTR_TYPE_BGCA)
4240 
4241 /* Highlight items */
4242 #define WE_FGC_HIGHLIGHT_ITEM (WE_HIGHLIGHT_ITEM | WE_ATTR_TYPE_FGC)
4243 #define WE_BGC_HIGHLIGHT_ITEM (WE_HIGHLIGHT_ITEM | WE_ATTR_TYPE_BGCA)
4244 
4245 /* Significant items */
4246 #define WE_FGC_SIGNIFICANT_ITEM (WE_SIGNIFICANT_ITEM | WE_ATTR_TYPE_FGC)
4247 #define WE_BGC_SIGNIFICANT_ITEM (WE_SIGNIFICANT_ITEM | WE_ATTR_TYPE_BGCA)
4248 
4249 /* Desktop */
4250 #define WE_BGC_DESKTOP (WE_DESKTOP | WE_ATTR_TYPE_BGCA)
4251 
4252 #define WE_ATTR_TYPE_ICON 0x4000
4253 #define WE_ATTR_TYPE_ICON_MASK 0x0F00
4254 #define WE_ATTR_TYPE_SMALLICON 0x4000
4255 #define WE_ATTR_TYPE_LARGEICON 0x4100
4256 
4257 #define WE_LARGEICON_APPLICATION (WE_ATTR_TYPE_LARGEICON | 0x00)
4258 #define WE_LARGEICON_HAND (WE_ATTR_TYPE_LARGEICON | 0x01)
4259 #define WE_LARGEICON_QUESTION (WE_ATTR_TYPE_LARGEICON | 0x02)
4260 #define WE_LARGEICON_EXCLAMATION (WE_ATTR_TYPE_LARGEICON | 0x03)
4261 #define WE_LARGEICON_ASTERISK (WE_ATTR_TYPE_LARGEICON | 0x04)
4262 #define WE_LARGEICON_STOP WE_LARGEICON_HAND
4263 #define WE_LARGEICON_INFORMATION WE_LARGEICON_ASTERISK
4264 
4265 #define WE_SMALLICON_APPLICATION (WE_ATTR_TYPE_SMALLICON | 0x00)
4266 #define WE_SMALLICON_HAND (WE_ATTR_TYPE_SMALLICON | 0x01)
4267 #define WE_SMALLICON_QUESTION (WE_ATTR_TYPE_SMALLICON | 0x02)
4268 #define WE_SMALLICON_EXCLAMATION (WE_ATTR_TYPE_SMALLICON | 0x03)
4269 #define WE_SMALLICON_ASTERISK (WE_ATTR_TYPE_SMALLICON | 0x04)
4270 #define WE_SMALLICON_STOP WE_SMALLICON_HAND
4271 #define WE_SMALLICON_INFORMATION WE_SMALLICON_ASTERISK
4272 
4277 #define WE_ATTR_TYPE_RDR 0x5000
4278 
4279 #define WE_LFFLAT_NUMBER 1
4280 #ifdef _MGLF_RDR_FLAT
4281 
4282 #define WE_LFFLAT_TAB_NRMLCLR (WE_ATTR_TYPE_RDR | 0)
4283 #endif
4284 
4285 #define WE_LFSKIN_NUMBER 28
4286 #ifdef _MGLF_RDR_SKIN
4287 #define WE_LFSKIN_WND_BKGND (WE_ATTR_TYPE_RDR | 0)
4288 
4289 #define WE_LFSKIN_CAPTION (WE_ATTR_TYPE_RDR | 1)
4290 #define WE_LFSKIN_CAPTION_BTN (WE_ATTR_TYPE_RDR | 2)
4291 
4292 #define WE_LFSKIN_SCROLLBAR_VSHAFT (WE_ATTR_TYPE_RDR | 3)
4293 #define WE_LFSKIN_SCROLLBAR_VTHUMB (WE_ATTR_TYPE_RDR | 4)
4294 #define WE_LFSKIN_SCROLLBAR_HSHAFT (WE_ATTR_TYPE_RDR | 5)
4295 #define WE_LFSKIN_SCROLLBAR_HTHUMB (WE_ATTR_TYPE_RDR | 6)
4296 #define WE_LFSKIN_SCROLLBAR_ARROWS (WE_ATTR_TYPE_RDR | 7)
4297 
4298 #define WE_LFSKIN_BORDER_TOP (WE_ATTR_TYPE_RDR | 8)
4299 #define WE_LFSKIN_BORDER_BOTTOM (WE_ATTR_TYPE_RDR | 9)
4300 #define WE_LFSKIN_BORDER_LEFT (WE_ATTR_TYPE_RDR | 10)
4301 #define WE_LFSKIN_BORDER_RIGHT (WE_ATTR_TYPE_RDR | 11)
4302 
4303 #define WE_LFSKIN_ARROWS (WE_ATTR_TYPE_RDR | 12)
4304 #define WE_LFSKIN_ARROWS_SHELL (WE_ATTR_TYPE_RDR | 13)
4305 
4306 #define WE_LFSKIN_RADIOBUTTON (WE_ATTR_TYPE_RDR | 14)
4307 #define WE_LFSKIN_CHECKBUTTON (WE_ATTR_TYPE_RDR | 15)
4308 #define WE_LFSKIN_PUSHBUTTON (WE_ATTR_TYPE_RDR | 16)
4309 
4310 #define WE_LFSKIN_TREE (WE_ATTR_TYPE_RDR | 17)
4311 
4312 #define WE_LFSKIN_HEADER (WE_ATTR_TYPE_RDR | 18)
4313 #define WE_LFSKIN_TAB (WE_ATTR_TYPE_RDR | 19)
4314 
4315 #define WE_LFSKIN_PROGRESS_HCHUNK (WE_ATTR_TYPE_RDR | 20)
4316 #define WE_LFSKIN_PROGRESS_VCHUNK (WE_ATTR_TYPE_RDR | 21)
4317 #define WE_LFSKIN_PROGRESS_HTRACKBAR (WE_ATTR_TYPE_RDR | 22)
4318 #define WE_LFSKIN_PROGRESS_VTRACKBAR (WE_ATTR_TYPE_RDR | 23)
4319 
4320 #define WE_LFSKIN_TBSLIDER_H (WE_ATTR_TYPE_RDR | 24)
4321 #define WE_LFSKIN_TRACKBAR_VERT (WE_ATTR_TYPE_RDR | 25)
4322 #define WE_LFSKIN_TRACKBAR_HORZ (WE_ATTR_TYPE_RDR | 26)
4323 #define WE_LFSKIN_TBSLIDER_V (WE_ATTR_TYPE_RDR | 27)
4324 #endif
4325 
4327 typedef struct _WINDOW_ELEMENT_ATTR {
4333 
4335 typedef struct _WINDOW_ELEMENT_RENDERER* PWERENDERER;
4336 
4337 #define SBS_NORMAL 0x00
4338 #define SBS_DISABLED 0x01
4339 #define SBS_HIDE 0x02
4340 
4344 typedef struct _LFSCROLLBARINFO {
4346  int minPos;
4348  int maxPos;
4350  int curPos;
4358  int barLen;
4360  int status;
4361 } LFSCROLLBARINFO;
4362 
4364 
4368 typedef struct _SCROLLBARDATA {
4370  int minPos;
4372  int maxPos;
4374  int curPos;
4382  int barLen;
4383  /* mouse position before tracking thumb.
4384  * it represents the distance from x mouse postion to barStart
4385  * for horizontal scrollbar.
4386  * it represents the distance from y mouse postion to barStart
4387  * for vertical scrollbar.
4388  */
4389  int track_pos;
4391  int status;
4392 } SCROLLBARDATA;
4393 
4394 typedef SCROLLBARDATA* PSCROLLBARDATA;
4395 
4397 #define SBS_DISABLED_LTUP 0x0100
4398 
4400 #define SBS_DISABLED_BTDN 0x0200
4401 
4403 #define SBS_HILITE_LTUP 0x0400
4404 
4406 #define SBS_HILITE_BTDN 0x0800
4407 
4409 #define SBS_HILITE_THUMB 0x0010
4410 
4412 #define SBS_PRESSED_LTUP 0x0020
4413 
4415 #define SBS_PRESSED_BTDN 0x0040
4416 
4418 #define SBS_PRESSED_THUMB 0x0080
4419 
4420 
4421 #define LFRDR_WINTYPE_UNKNOWN 0
4422 #define LFRDR_WINTYPE_DIALOG 1
4423 #define LFRDR_WINTYPE_MAINWIN 2
4424 #define LFRDR_WINTYPE_CONTROL 3
4425 
4429 typedef struct _LFRDR_WINSTYLEINFO
4430 {
4432  int dwStyle;
4433 
4442  int winType;
4444 
4450 typedef struct _LFRDR_TRACKBARINFO
4451 {
4452  int nMin;
4453  int nMax;
4454  int nPos;
4455  int nTickFreq;
4457 
4458 #define LFRDR_METRICS_MASK 0xFF00
4459 #define LFRDR_METRICS_BORDER 0x0100
4460 #define LFRDR_METRICS_CAPTION_H 0x0200
4461 #define LFRDR_METRICS_ICON_H 0x0300
4462 #define LFRDR_METRICS_ICON_W 0x0400
4463 #define LFRDR_METRICS_MENU_H 0x0500
4464 #define LFRDR_METRICS_VSCROLL_W 0x0600
4465 #define LFRDR_METRICS_HSCROLL_H 0x0700
4466 #define LFRDR_METRICS_MINWIN_WIDTH 0x0800
4467 #define LFRDR_METRICS_MINWIN_HEIGHT 0x0900
4468 
4469 #define LFRDR_SB_MINBARLEN 10
4470 
4475 #define LEN_RENDERER_NAME 15
4476 
4477 /* button status used by button and 3dbox. */
4478 #define LFRDR_BTN_STATUS_MASK 0x03
4479 #define LFRDR_BTN_STATUS_NORMAL 0x00
4480 #define LFRDR_BTN_STATUS_HILITE 0x01
4481 #define LFRDR_BTN_STATUS_PRESSED 0x02
4482 #define LFRDR_BTN_STATUS_DISABLED 0x03
4483 
4484 /* a flag used by radio button and check button. */
4485 #define LFRDR_BTN_STATUS_SELECTED 0x04
4486 
4487 /* a flag used by button on capton bar. */
4488 #define LFRDR_BTN_STATUS_INACTIVE 0x08
4489 
4490 /* thick or thin frame used by 3dbox. */
4491 #define LFRDR_3DBOX_THICKFRAME 0x20
4492 
4493 /* filled 3dbox */
4494 #define LFRDR_3DBOX_FILLED 0x40
4495 
4496 /*select status used by checkmark or radio.*/
4497 #define LFRDR_MARK_SELECTED_MASK 0x05
4498 #define LFRDR_MARK_ALL_SELECTED 0x01
4499 #define LFRDR_MARK_HALF_SELECTED 0x04
4500 
4501 /* a flag whether a checkmark or radio has a shell or not.*/
4502 #define LFRDR_MARK_HAVESHELL 0x02
4503 
4504 /*the direction of arrow.*/
4505 #define LFRDR_ARROW_DIRECT_MASK 0x0F00
4506 #define LFRDR_ARROW_LEFT 0x0000
4507 #define LFRDR_ARROW_RIGHT 0x0100
4508 #define LFRDR_ARROW_UP 0x0200
4509 #define LFRDR_ARROW_DOWN 0x0300
4510 
4511 /* hollow arrow or filled */
4512 #define LFRDR_ARROW_NOFILL 0x1000
4513 #define LFRDR_ARROW_HAVESHELL 0x2000
4514 
4515 /* minimum of menu margin */
4516 #define LFRDR_MENUITEMOFFY_MIN 4
4517 
4518 #define LFRDR_3DBOX_COLOR_LIGHTEST 0x01
4519 #define LFRDR_3DBOX_COLOR_DARKEST 0x02
4520 #define LFRDR_3DBOX_COLOR_LIGHTER 0x03
4521 #define LFRDR_3DBOX_COLOR_DARKER 0x04
4522 
4523 /* flag of propsheet tab */
4524 #define LFRDR_TAB_BOTTOM 0x0001
4525 #define LFRDR_TAB_ACTIVE 0x0010
4526 #define LFRDR_TAB_ICON 0x0100
4527 
4528 /* for fold icon*/
4529 #define LFRDR_TREE_WITHICON 0x08
4530 #define LFRDR_TREE_FOLD 0x01
4531 
4532 /* for connecting line*/
4533 #define LFRDR_TREE_CHILD 0x02
4534 #define LFRDR_TREE_NEXT 0x04
4535 
4536 #define SYSICO_ITEM_NUMBER 5
4537 
4541  const char name[LEN_RENDERER_NAME+1];
4542 
4547  int (*init) (PWERENDERER renderer);
4548 
4553  int (*deinit) (PWERENDERER renderer);
4554 
4569  DWORD (*calc_3dbox_color) (DWORD color, int flag);
4570 
4590  void (*draw_3dbox) (HDC hdc, const RECT* pRect, DWORD color, DWORD flag);
4591 
4592 
4603  void (*draw_radio) (HDC hdc, const RECT* pRect, DWORD color, int status);
4604 
4608  void (*draw_checkbox) (HDC hdc, const RECT* pRect, DWORD color,
4609  int status);
4610 
4614  void (*draw_checkmark) (HDC hdc, const RECT* pRect, DWORD color,
4615  int status);
4616 
4633  void (*draw_arrow) (HWND hWnd, HDC hdc, const RECT* pRect, DWORD color, int status);
4634 
4648  void (*draw_fold) (HWND hWnd, HDC hdc, const RECT* pRect, DWORD color,
4649  int status, int next);
4650 
4652  void (*draw_focus_frame) (HDC hdc, const RECT *pRect, DWORD color);
4653 
4655  void (*draw_normal_item) (HWND hWnd, HDC hdc, const RECT* pRect,
4656  DWORD color);
4657 
4659  void (*draw_hilite_item) (HWND hWnd, HDC hdc, const RECT* pRect,
4660  DWORD color);
4661 
4663  void (*draw_disabled_item) (HWND hWnd, HDC hdc, const RECT* pRect,
4664  DWORD color);
4665 
4667  void (*draw_significant_item) (HWND hWnd, HDC hdc, const RECT* pRect,
4668  DWORD color);
4669 
4683  void (*draw_push_button) (HWND hWnd, HDC hdc, const RECT* pRect,
4684  DWORD color1, DWORD color2, int status);
4685 
4702  void (*draw_radio_button) (HWND hWnd, HDC hdc, const RECT* pRect, int status);
4703 
4720  void (*draw_check_button) (HWND hWnd, HDC hdc, const RECT* pRect, int status);
4721 
4723  void (*draw_border) (HWND hWnd, HDC hdc, BOOL is_active);
4724 
4726  void (*draw_caption) (HWND hWnd, HDC hdc, BOOL is_active);
4727 
4741  void (*draw_caption_button) (HWND hwnd, HDC hdc, int ht_code, int state);
4742 
4757  void (*draw_scrollbar) (HWND hWnd, HDC hdc, int sb_pos);
4758 
4760  void (*calc_trackbar_rect) (HWND hWnd, LFRDR_TRACKBARINFO *info,
4761  DWORD dwStyle, const RECT* rcClient, RECT* rcRuler,
4762  RECT* rcBar, RECT* rcBorder);
4763 
4765  void (*draw_trackbar) (HWND hWnd, HDC hdc, LFRDR_TRACKBARINFO *info);
4766 
4773  int (*calc_we_area) (HWND hWnd, int which, RECT* we_area);
4774 
4797  int (*calc_we_metrics) (HWND hWnd,
4798  LFRDR_WINSTYLEINFO* style_info, int which);
4799 
4805  int (*hit_test) (HWND hWnd, int x, int y);
4806 
4808  int (*on_click_hotspot) (HWND hWnd, int which);
4809 
4819  void (*draw_custom_hotspot) (HWND hWnd, HDC hdc, int ht_code, int state);
4820 
4827  void (*calc_thumb_area) (HWND hWnd, BOOL vertical,
4828  LFSCROLLBARINFO* sb_info);
4829 
4831  void (*disabled_text_out) (HWND hWnd, HDC hdc, const char* spText,
4832  PRECT rc, DWORD dt_fmt);
4833 
4844  void (*draw_tab) (HWND hWnd, HDC hdc, RECT *rect, char *title,
4845  DWORD color, int flag, HICON icon);
4846 
4848  void (*draw_progress) (HWND hWnd, HDC hdc,
4849  int nMax, int nMin, int nPos, BOOL fVertical);
4850 
4854  void (*draw_header) (HWND hWnd, HDC hdc, const RECT* pRect, DWORD color);
4855 
4860  DWORD (*on_get_rdr_attr) (struct _WINDOW_ELEMENT_RENDERER*, int we_attr_id);
4861 
4868  DWORD (*on_set_rdr_attr) (struct _WINDOW_ELEMENT_RENDERER*, int we_attr_id, DWORD we_attr, BOOL change);
4869 
4871  void (*erase_background) (HWND hWnd, HDC hdc, const RECT *rect);
4872 
4874  void (*draw_normal_menu_item) (HWND hWnd, HDC hdc, const RECT* pRect,
4875  DWORD color);
4876 
4878  void (*draw_hilite_menu_item) (HWND hWnd, HDC hdc, const RECT* pRect,
4879  DWORD color);
4880 
4882  void (*draw_disabled_menu_item) (HWND hWnd, HDC hdc, const RECT* pRect,
4883  DWORD color);
4884 
4887 
4890 
4893 
4895  HICON we_icon [2][SYSICO_ITEM_NUMBER];
4896 
4898  unsigned int refcount;
4899 
4901  const void* private_info;
4903 
4907 typedef struct _WINDOWINFO
4908 {
4910  int left, top;
4911  int right, bottom;
4912 
4914  int cl, ct;
4915  int cr, cb;
4916 
4921 
4938 
4940  char* spCaption;
4945 
4950 
4953 } WINDOWINFO;
4954 
4966 static inline const WINDOWINFO* GUIAPI GetWindowInfo (HWND hWnd)
4967 {
4968  return (WINDOWINFO*)hWnd;
4969 }
4970 
4982 MG_EXPORT BOOL GUIAPI InitWindowElementAttrs (PWERENDERER rdr);
4983 
5076 MG_EXPORT DWORD GUIAPI GetWindowElementAttr (HWND hwnd, int we_attr_id);
5077 
5094 MG_EXPORT DWORD GUIAPI SetWindowElementAttr (HWND hwnd, int we_attr_id,
5095  DWORD we_attr);
5096 
5116 MG_EXPORT gal_pixel GUIAPI GetWindowElementPixelEx (HWND hwnd,
5117  HDC hdc, int we_attr_id);
5118 
5133 MG_EXPORT WINDOW_ELEMENT_RENDERER*
5134  GUIAPI GetWindowRendererFromName (const char* name);
5135 
5148 MG_EXPORT BOOL GUIAPI AddWindowElementRenderer (const char* name,
5149  const WINDOW_ELEMENT_RENDERER* we_rdr);
5150 
5161 MG_EXPORT BOOL GUIAPI RemoveWindowElementRenderer (const char* name);
5162 
5174 MG_EXPORT WINDOW_ELEMENT_RENDERER*
5175  GUIAPI GetDefaultWindowElementRenderer (void);
5176 
5188 MG_EXPORT const char* GUIAPI SetDefaultWindowElementRenderer (const char* name);
5189 
5208 MG_EXPORT BOOL GUIAPI SetWindowElementRenderer (HWND hWnd,
5209  const char* werdr_name, const WINDOW_ELEMENT_ATTR* we_attrs);
5210 
5223 MG_EXPORT BOOL InitRendererSystemIcon (const char* rdr_name,
5224  HICON *small_icon, HICON *large_icon);
5225 
5236 MG_EXPORT void TermRendererSystemIcon (HICON *small_icon,
5237  HICON *large_icon);
5238 
5259 MG_EXPORT BOOL GUIAPI RegisterResFromFile (HDC hdc, const char* file);
5260 
5261 
5280 MG_EXPORT BOOL GUIAPI RegisterResFromMem (HDC hdc, const char* file,
5281  const unsigned char* data, size_t data_size);
5282 
5296 MG_EXPORT BOOL GUIAPI RegisterResFromBitmap (const char* file, const BITMAP* bmp);
5297 
5310 MG_EXPORT const BITMAP* GUIAPI RetrieveRes (const char *file);
5311 
5325 MG_EXPORT void GUIAPI UnregisterRes (const char *file);
5326 
5343 MG_EXPORT BOOL GUIAPI RegisterSystemBitmap (HDC hdc, const char* rdr_name,
5344  const char* id);
5345 
5360 MG_EXPORT void GUIAPI UnregisterSystemBitmap (HDC hdc, const char* rdr_name,
5361  const char* id);
5362 
5363 /* define the key of resource */
5364 typedef unsigned long RES_KEY;
5365 #define RES_KEY_INVALID 0
5366 
5367 /* define the incore res type */
5368 typedef struct _INNER_RES {
5369  RES_KEY key;
5370  const Uint8* data;
5371  int data_len;
5372 
5373  /* A special param recognized by the TYPE_OPS; normally is NULL.
5374  * If the data is a raw png, jpeg, bmp file content,
5375  * it should be the extention name of the filename:
5376  * INNER_RES res[]= { ... { ..., ... ,.., "png" } .. };
5377  * */
5378  const void* additional;
5379 } INNER_RES;
5380 
5381 /* the type of resource */
5382 enum emResType{
5383  RES_TYPE_INVALID = 0xFF,
5384 
5385  /* All kinds of image supported by MiniGUI
5386  * such as png, jpeg, bmp and so on
5387  * This type will make LoadResource return a
5388  * PBITMAP pointer
5389  */
5390  RES_TYPE_IMAGE = 0,
5391 
5392  /* All kinds of image supported by MiniGUI
5393  * This Type will make LoadResource return a MYBITMAP* pointer
5394  */
5395  RES_TYPE_MYBITMAP,
5396 
5397  /* the icon file and mem
5398  * it only make LoadResource load or get the FIRST
5399  * icon, and return HICON
5400  */
5401  RES_TYPE_ICON,
5402 
5403 #ifdef _MGHAVE_CURSOR
5404  /* the cursor file or data
5405  * Make LoadResource return HCURSOR
5406  */
5407  RES_TYPE_CURSOR,
5408 #endif
5409 
5410  /* the config file or data support by minigui
5411  * make LoadResource return GHANDLE
5412  * it should be accessed by GetValueFromEtc and GetIntValueFromEtc
5413  */
5414  RES_TYPE_ETC,
5415 
5416  /* NOT IMPLEMENT */
5417  RES_TYPE_TEXT,
5418  /* NOT IMPLEMENT */
5419  RES_TYPE_MENU,
5420  /* NOT IMPLEMENT */
5421 
5422  RES_TYPE_WINDOW,
5423  /* Make the LoadResource return the
5424  * raw data of INNER_RES, it's a pointer
5425  * of MEM_RES
5426  * only support incore Resource,
5427  * if the resource is stored in disk, LoadResource will return NULL
5428  */
5429  RES_TYPE_MEM_RES,
5430 
5431  RES_TYPE_FONT,
5432 
5433  /* the beginning of user defined type
5434  */
5435  RES_TYPE_USER,
5436 
5437  /* the max valid value of type
5438  * used defined type must less this value
5439  */
5440  RES_TYPE_USER_MAX = 0x7F
5441 };
5442 
5443 /* the return value of LoadResource with type RES_TYPE_MEM_RES */
5444 typedef struct _MEM_RES {
5445  Uint8 *data;
5446  int data_len;
5447 } MEM_RES;
5448 
5449 typedef struct _FONT_RES {
5450  LOGFONT logfont;
5451  RES_KEY key;
5452 } FONT_RES;
5453 
5454 /* the original source of resource
5455  * depend on the values, the res manager
5456  * would select corrent loader to
5457  * load resource form disk or mem
5458  */
5459 
5460 #define REF_SRC_NOTYPE 0x00
5461 
5462 /* indicate that the resource is stored in disk */
5463 #define REF_SRC_FILE 0x01
5464 
5465 /* indicate that the resource is stored in memory*/
5466 #define REF_SRC_INNER 0x02
5467 
5468 /* indicate that the resource is stored in shared memory*/
5469 #define REF_SRC_SHARED 0x03
5470 
5471 /* indicate that the resource is stored in outside( NOT SUPPORTED) */
5472 #define REF_SRC_OUTSIDE 0x04
5473 
5474 /* indicate that the resource is stored in a stream object (NOT SUPPORTED) */
5475 #define REF_SRC_STREAM 0x05
5476 
5477 /* indicate that the resource is create by MiniGUI */
5478 #define REF_SRC_LOGIC 0x06
5479 
5480 /* the RESOUCE type for loadding */
5481 typedef struct _RESOURCE {
5482  void* data; // store the pointer of cached resource
5483  union {
5484  void* src;
5485  INNER_RES* inner;
5486  char* file;
5487  } source; // indicate the stored format of resource
5488 } RESOURCE;
5489 
5490 /* The operations of one type of resource */
5491 typedef struct _RES_TYPE_OPS {
5492  /* To get a resource
5493  * return the buffered resource pointer
5494  * param res the in and out param of resource.
5495  * param src_type, one of REF_SRC_XXX
5496  * param usr_param
5497  * */
5498  void* (*get_res_data)(RESOURCE* res, int src_type, DWORD usr_param);
5499  /* To unload a buffered resource
5500  */
5501  void (*unload)(RESOURCE* res, int src_type);
5502 } RES_TYPE_OPS;
5503 
5504 /* Return value and error code of resource manager */
5505 enum emResReturn {
5506  RES_RET_OK = 0,
5507  RES_RET_INVALID_PARAM,
5508  RES_RET_NOT_EXIST_KEY, //RES_KEY is not exist
5509  RES_RET_LOAD_FILE_FAILED,
5510  RES_RET_LOAD_MEM_FAILED,
5511  RES_RET_UNKNOWN_TYPE,
5512  RES_RET_NOT_IMPLEMENTED,
5513  RES_RET_INUSED //the res or object is in used, cannot be unloaded
5514 };
5515 
5525 MG_EXPORT const char* GetResPath (void);
5526 
5540 MG_EXPORT int SetResPath (const char* path);
5541 
5555 MG_EXPORT int AddInnerRes (INNER_RES* inner_res, int count, BOOL copy);
5556 
5557 /*
5558  * NOT IMPLEMENT
5559  */
5560 MG_EXPORT int AddSharedRes (const char* shared_name);
5561 
5574 MG_EXPORT int RegisterResType (int type, RES_TYPE_OPS* ops);
5575 
5586 MG_EXPORT int UnregisterResType (int type);
5587 
5625 MG_EXPORT void* LoadResource (const char* res_name, int type, DWORD usr_param);
5626 
5640 MG_EXPORT void* GetResource (RES_KEY key);
5641 
5657 MG_EXPORT int AddResRef (RES_KEY key);
5658 
5670 MG_EXPORT int ReleaseRes (RES_KEY key);
5671 
5672 #define LoadBitmapFromRes(hdc, res_name) \
5673  (PBITMAP)LoadResource(res_name, RES_TYPE_IMAGE, (DWORD)hdc)
5674 
5675 #define GetBitmapFromRes(key) (BITMAP*)GetResource(key)
5676 
5677 #define GetIconFromRes(key) (HICON)GetResource(key)
5678 
5679 #ifndef _MGHAVE_CURSOR
5680 #define GetCursorFromRes(key) (HCURSOR)GetResource(key)
5681 #endif
5682 
5683 #define GetEtcFromRes(key) (GHANDLE)GetResource(key)
5684 
5685 #define LoadLogicFontFromRes(font_name) (PLOGFONT)LoadResource(font_name, RES_TYPE_FONT, 0)
5686 #define GetLogicFontFromRes(font_name) (PLOGFONT)GetResource(Str2Key(font_name))
5687 #define ReleaseLogicFont(font) ReleaseRes(((FONT_RES*)(font))->key)
5688 #define ReleaseLogicFontByName(font_name) ReleaseRes(Str2Key(font_name))
5689 
5701 MG_EXPORT RES_KEY Str2Key (const char* str);
5702 
5703 
5704 #ifdef __TARGET_MSTUDIO__
5705 
5714 MG_EXPORT int GUIAPI GetWindowZOrder(HWND hWnd);
5715 
5725 MG_EXPORT int GUIAPI SetWindowZOrder(HWND hWnd, int zorder);
5726 
5727 #endif
5728 
5746 
5747 extern MG_EXPORT HWND __mg_hwnd_desktop;
5748 
5753 #define HWND_DESKTOP __mg_hwnd_desktop
5754 
5759 #define HWND_NULL ((HWND)0)
5760 
5765 #define HWND_INVALID ((HWND)-1)
5766 
5767 #define HWND_OTHERPROC ((HWND)-1)
5768 
5772 typedef struct _MAINWINCREATE
5773 {
5776 
5779 
5781  const char* spCaption;
5782 
5785 
5788 
5791 
5793  HWND hHosting;
5794 
5796  LRESULT (*MainWindowProc)(HWND, UINT, WPARAM, LPARAM);
5797 
5799  int lx, ty, rx, by;
5800 
5803 
5806 
5809 }MAINWINCREATE;
5810 typedef MAINWINCREATE* PMAINWINCREATE;
5811 
5812 #ifdef _MGRM_THREADS
5813 
5824 MG_EXPORT int GUIAPI CreateThreadForMainWindow(pthread_t* thread,
5825  pthread_attr_t* attr,
5826  void * (*start_routine)(void *),
5827  void * arg);
5828 
5835 MG_EXPORT pthread_t GUIAPI GetMainWinThread(HWND hMainWnd);
5836 
5846 MG_EXPORT int GUIAPI WaitMainWindowClose(HWND hWnd, void** returnval);
5847 #endif
5848 
5864 MG_EXPORT void GUIAPI MainWindowThreadCleanup(HWND hMainWnd);
5865 
5872 #define MainWindowCleanup(hwnd) MainWindowThreadCleanup(hwnd)
5873 
5899 MG_EXPORT HWND GUIAPI CreateMainWindowEx (PMAINWINCREATE pCreateInfo,
5900  const char* werdr_name, const WINDOW_ELEMENT_ATTR* we_attrs,
5901  const char* window_name, const char* layer_name);
5902 
5913 static inline HWND GUIAPI CreateMainWindow (PMAINWINCREATE pCreateInfo)
5914 {
5915  return CreateMainWindowEx (pCreateInfo, NULL, NULL, NULL, NULL);
5916 }
5917 
5936 MG_EXPORT BOOL GUIAPI DestroyMainWindow (HWND hWnd);
5937 
5953 MG_EXPORT BOOL GUIAPI SetWindowMask (HWND hWnd, const MYBITMAP* mask);
5954 
5971 MG_EXPORT BOOL GUIAPI SetWindowMaskEx (HWND hWnd, HDC hdc, const BITMAP* mask);
5972 
5982 BOOL GUIAPI SetWindowRegion (HWND hWnd, const CLIPRGN* region);
5983 
6003 BOOL GUIAPI GetWindowRegion (HWND hWnd, CLIPRGN* region);
6004 
6005 LRESULT GUIAPI PreDefMainWinProc (HWND hWnd, UINT message,
6006  WPARAM wParam, LPARAM lParam);
6007 
6008 LRESULT GUIAPI PreDefDialogProc (HWND hWnd,
6009  UINT message, WPARAM wParam, LPARAM lParam);
6010 
6011 LRESULT GUIAPI PreDefControlProc (HWND hWnd, UINT message,
6012  WPARAM wParam, LPARAM lParam);
6013 
6031 MG_EXPORT LRESULT GUIAPI DefaultWindowProc (HWND hWnd, UINT message,
6032  WPARAM wParam, LPARAM lParam);
6033 
6039 extern MG_EXPORT WNDPROC __mg_def_proc[3];
6040 
6055 #define DefaultMainWinProc (__mg_def_proc[0])
6056 
6073 #define DefaultDialogProc (__mg_def_proc[1])
6074 
6088 #define DefaultControlProc (__mg_def_proc[2])
6089 
6090 #ifdef _DEBUG
6091 MG_EXPORT void GUIAPI DumpWindow (FILE* fp, HWND hWnd);
6092 #endif /* _DEBUG */
6093 
6101 #define SW_HIDE 0x0000
6102 #define SW_SHOW 0x0010
6103 #define SW_SHOWNORMAL 0x0100
6104 
6120 MG_EXPORT void GUIAPI UpdateWindow (HWND hWnd, BOOL bErase);
6121 
6136 MG_EXPORT void GUIAPI UpdateInvalidClient (HWND hWnd, BOOL bErase);
6137 
6156 MG_EXPORT BOOL GUIAPI ShowWindow (HWND hWnd, int iCmdShow);
6157 
6174 MG_EXPORT BOOL GUIAPI EnableWindow (HWND hWnd, BOOL fEnable);
6175 
6190 MG_EXPORT BOOL GUIAPI IsWindowEnabled (HWND hWnd);
6191 
6212 MG_EXPORT BOOL GUIAPI GetClientRect(HWND hWnd, PRECT prc);
6213 
6229 MG_EXPORT gal_pixel GUIAPI GetWindowBkColor (HWND hWnd);
6230 
6249 MG_EXPORT gal_pixel GUIAPI SetWindowBkColor (HWND hWnd, gal_pixel new_bkcolor);
6250 
6263 MG_EXPORT PLOGFONT GUIAPI GetWindowFont (HWND hWnd);
6264 
6284 MG_EXPORT PLOGFONT GUIAPI SetWindowFont (HWND hWnd, PLOGFONT pLogFont);
6285 
6298 MG_EXPORT HCURSOR GUIAPI GetWindowCursor (HWND hWnd);
6299 
6313 MG_EXPORT HCURSOR GUIAPI SetWindowCursor (HWND hWnd, HCURSOR hNewCursor);
6314 
6327 MG_EXPORT HICON GUIAPI GetWindowIcon (HWND hWnd);
6328 
6346 MG_EXPORT HICON GUIAPI SetWindowIcon (HWND hWnd, HICON hIcon, BOOL bRedraw);
6347 
6359 MG_EXPORT DWORD GUIAPI GetWindowStyle (HWND hWnd);
6360 
6372 MG_EXPORT DWORD GUIAPI GetWindowExStyle (HWND hWnd);
6373 
6387 MG_EXPORT BOOL GUIAPI ExcludeWindowStyle (HWND hWnd, DWORD dwStyle);
6388 
6402 MG_EXPORT BOOL GUIAPI IncludeWindowStyle (HWND hWnd, DWORD dwStyle);
6403 
6417 MG_EXPORT BOOL GUIAPI ExcludeWindowExStyle (HWND hWnd, DWORD dwStyle);
6418 
6432 MG_EXPORT BOOL GUIAPI IncludeWindowExStyle (HWND hWnd, DWORD dwStyle);
6433 
6446 MG_EXPORT WNDPROC GUIAPI GetWindowCallbackProc (HWND hWnd);
6447 
6465 MG_EXPORT WNDPROC GUIAPI SetWindowCallbackProc (HWND hWnd, WNDPROC newProc);
6466 
6479 MG_EXPORT DWORD GUIAPI GetWindowAdditionalData (HWND hWnd);
6480 
6499 MG_EXPORT DWORD GUIAPI SetWindowAdditionalData (HWND hWnd, DWORD newData);
6500 
6513 MG_EXPORT DWORD GUIAPI GetWindowAdditionalData2 (HWND hWnd);
6514 
6532 MG_EXPORT DWORD GUIAPI SetWindowAdditionalData2 (HWND hWnd, DWORD newData);
6533 
6550 MG_EXPORT DWORD GUIAPI GetWindowClassAdditionalData (HWND hWnd);
6551 
6567 MG_EXPORT DWORD GUIAPI SetWindowClassAdditionalData (HWND hWnd, DWORD newData);
6568 
6581 MG_EXPORT const char* GUIAPI GetWindowCaption (HWND hWnd);
6582 
6596 MG_EXPORT BOOL GUIAPI SetWindowCaption (HWND hWnd, const char* spCaption);
6597 
6616 MG_EXPORT BOOL GUIAPI InvalidateRect (HWND hWnd,
6617  const RECT* prc, BOOL bEraseBkgnd);
6618 
6655 MG_EXPORT BOOL GUIAPI InvalidateRegion (HWND hWnd, const CLIPRGN* pRgn, BOOL bErase);
6656 
6682 MG_EXPORT BOOL GUIAPI ValidateRect (HWND hWnd, const RECT* rect);
6683 
6710 MG_EXPORT BOOL GUIAPI ValidateRegion (HWND hWnd, const CLIPRGN* pRgn);
6711 
6727 MG_EXPORT HDC GUIAPI BeginPaint(HWND hWnd);
6728 
6742 MG_EXPORT void GUIAPI EndPaint(HWND hWnd, HDC hdc);
6743 
6759 MG_EXPORT BOOL GUIAPI GetUpdateRect (HWND hWnd, RECT* update_rect);
6760 
6780 MG_EXPORT int GUIAPI GetUpdateRegion (HWND hWnd, PCLIPRGN pRgn);
6781 
6798 MG_EXPORT int GUIAPI ClientWidthToWindowWidthEx (DWORD dwStyle,
6799  int win_type, int cw);
6800 
6817 MG_EXPORT int GUIAPI ClientHeightToWindowHeightEx (DWORD dwStyle,
6818  int win_type, int ch, BOOL hasMenu);
6819 
6820 #define ClientWidthToWindowWidth(dwStyle, cw) \
6821  ClientWidthToWindowWidthEx (dwStyle, LFRDR_WINTYPE_MAINWIN, cw)
6822 
6823 #define ClientHeightToWindowHeight(dwStyle, ch, hasMenu) \
6824  ClientHeightToWindowHeightEx (dwStyle, LFRDR_WINTYPE_MAINWIN, ch, hasMenu)
6825 
6864 MG_EXPORT BOOL GUIAPI AdjustWindowRectEx (RECT* pRect, DWORD dwStyle,
6865  BOOL bMenu, DWORD dwExStyle);
6866 
6880 MG_EXPORT void GUIAPI ClientToScreen (HWND hWnd, int* x, int* y);
6881 
6895 MG_EXPORT void GUIAPI ScreenToClient (HWND hWnd, int* x, int* y);
6896 
6910 MG_EXPORT void GUIAPI ClientToWindow(HWND hWnd, int* x, int* y);
6911 
6925 MG_EXPORT void GUIAPI WindowToClient(HWND hWnd, int* x, int* y);
6926 
6927 
6941 MG_EXPORT void GUIAPI WindowToScreen (HWND hWnd, int* x, int* y);
6942 
6956 MG_EXPORT void GUIAPI ScreenToWindow (HWND hWnd, int* x, int* y);
6957 
6971 MG_EXPORT BOOL GUIAPI IsMainWindow (HWND hWnd);
6972 
6985 MG_EXPORT BOOL GUIAPI IsControl (HWND hWnd);
6986 
7000 MG_EXPORT BOOL GUIAPI IsWindow (HWND hWnd);
7001 
7015 MG_EXPORT BOOL GUIAPI IsDialog (HWND hWnd);
7016 
7034 MG_EXPORT HWND GUIAPI GetParent (HWND hWnd);
7035 
7051 MG_EXPORT HWND GUIAPI GetMainWindowHandle (HWND hWnd);
7052 
7067 MG_EXPORT BOOL GUIAPI IsWindowVisible (HWND hWnd);
7068 
7086 MG_EXPORT BOOL GUIAPI GetWindowRect (HWND hWnd, PRECT prc);
7087 
7112 MG_EXPORT HWND GUIAPI GetNextChild (HWND hWnd, HWND hChild);
7113 
7131 MG_EXPORT HWND GUIAPI GetNextMainWindow (HWND hMainWnd);
7132 
7152 MG_EXPORT HWND GUIAPI GetHosting (HWND hMainWnd);
7153 
7173 MG_EXPORT HWND GUIAPI GetFirstHosted (HWND hHosting);
7174 
7199 MG_EXPORT HWND GUIAPI GetNextHosted (HWND hHosting, HWND hHosted);
7200 
7215 MG_EXPORT int GUIAPI GetWindowTextLength (HWND hWnd);
7216 
7233 MG_EXPORT int GUIAPI GetWindowText (HWND hWnd, char* spString, int nMaxLen);
7234 
7250 MG_EXPORT BOOL GUIAPI SetWindowText (HWND hWnd, const char* spString);
7251 
7266 MG_EXPORT HWND GUIAPI GetFocusChild (HWND hParent);
7267 
7281 MG_EXPORT HWND GUIAPI SetNullFocus (HWND hParent);
7282 
7296 MG_EXPORT HWND GUIAPI SetFocusChild (HWND hWnd);
7297 
7302 #define SetFocus SetFocusChild
7303 
7308 #define GetFocus GetFocusChild
7309 
7321 MG_EXPORT HWND GUIAPI GetActiveWindow (void);
7322 
7336 MG_EXPORT HWND GUIAPI SetActiveWindow (HWND hMainWnd);
7337 
7342 #define GetForegroundWindow GetActiveWindow
7343 
7348 #define SetForegroundWindow SetActiveWindow
7349 
7364 MG_EXPORT HWND GUIAPI GetCapture(void);
7365 
7381 MG_EXPORT HWND GUIAPI SetCapture(HWND hWnd);
7382 
7394 MG_EXPORT void GUIAPI ReleaseCapture(void);
7395 
7408 MG_EXPORT HWND GUIAPI GetWindowUnderCursor (void);
7409 
7424 MG_EXPORT HWND GUIAPI WindowFromPointEx (POINT pt, BOOL bRecursion);
7425 
7426 #define WindowFromPoint(pt) WindowFromPointEx(pt, TRUE)
7427 
7428 #define CWP_ALL 0x0000
7429 #define CWP_SKIPINVISIBLE 0x0001
7430 #define CWP_SKIPDISABLED 0x0002
7431 #define CWP_SKIPTRANSPARENT 0x0004
7432 
7469 MG_EXPORT HWND GUIAPI ChildWindowFromPointEx (HWND hParent, POINT pt,
7470  UINT uFlags);
7471 
7483 static inline HWND GUIAPI ChildWindowFromPoint (HWND hParent, POINT pt)
7484 {
7485  return ChildWindowFromPointEx (hParent, pt, CWP_ALL);
7486 }
7487 
7509 MG_EXPORT BOOL GUIAPI MoveWindow (HWND hWnd, int x, int y, int w, int h,
7510  BOOL fPaint);
7511 
7512 #define SW_INVALIDATE 0x01
7513 #define SW_ERASE 0x02
7514 #define SW_SCROLLCHILDREN 0x04
7515 
7587 MG_EXPORT int GUIAPI ScrollWindowEx (HWND hWnd, int dx, int dy,
7588  const RECT *prcScroll, const RECT *prcClip,
7589  PCLIPRGN pRgnUpdate, PRECT prcUpdate, UINT flags);
7590 
7611 static inline void GUIAPI ScrollWindow (HWND hWnd, int dx, int dy,
7612  const RECT* prcScroll, const RECT* prcClip)
7613 {
7614  ScrollWindowEx (hWnd, dx, dy, prcScroll, prcClip,
7615  NULL, NULL, SW_ERASE | SW_INVALIDATE | SW_SCROLLCHILDREN);
7616 }
7617 
7622 #define GetWindowElementColor(iItem) \
7623  GetWindowElementPixelEx(HWND_NULL, (HDC)-1, iItem)
7624 
7625 #define GetWindowElementColorEx(hWnd, iItem) \
7626  GetWindowElementPixelEx(hWnd, (HDC)-1, iItem)
7627 
7628 #define GetWindowElementPixel(hWnd, iItem) \
7629  GetWindowElementPixelEx(hWnd, (HDC)-1, iItem)
7630 
7637 #define SYSBMP_RADIOBUTTON "radiobutton"
7638 #define SYSBMP_CHECKBUTTON "checkbutton"
7639 #define SYSBMP_BGPICTURE "bgpicture"
7640 #define SYSBMP_BGPICPOS "bgpicpos"
7641 
7642 /* Obsolete definitions; back-compatibility definitions. */
7643 #define SYSBMP_IMECTRLBTN "IMEctrlbtn"
7644 #define SYSBMP_LOGO "logo"
7645 
7664 MG_EXPORT const BITMAP* GUIAPI GetSystemBitmapEx (const char* rdr_name,
7665  const char* id);
7666 
7685 MG_EXPORT const BITMAP* GUIAPI GetSystemBitmapByHwnd (HWND hWnd, const char* id);
7686 
7705 MG_EXPORT const BITMAP* GUIAPI GetSystemBitmap (HWND hWnd, const char* id);
7706 
7726 MG_EXPORT void GUIAPI TermSystemBitmapEx (const char* id,
7727  const char* rdr_name, PBITMAP bmp);
7728 
7747 MG_EXPORT void GUIAPI TermSystemBitmap (HWND hWnd, const char* id, PBITMAP bmp);
7748 
7749 /*for backward compatibility */
7750 #define IDI_APPLICATION 0
7751 #define IDI_HAND 1
7752 #define IDI_STOP IDI_HAND
7753 #define IDI_QUESTION 2
7754 #define IDI_EXCLAMATION 3
7755 #define IDI_ASTERISK 4
7756 #define IDI_INFORMATION IDI_ASTERISK
7757 
7758 #define SYSICON_FT_DIR "dir"
7759 #define SYSICON_FT_FILE "file"
7760 
7761 #define SYSICON_TREEFOLD "treefold"
7762 #define SYSICON_TREEUNFOLD "treeunfold"
7763 
7781 MG_EXPORT HICON GUIAPI LoadSystemIconEx (HDC hdc,
7782  const char* rdr_name, const char* szItemName, int which);
7783 
7798 MG_EXPORT HICON GUIAPI LoadSystemIcon (const char* szItemName, int which);
7799 
7820 MG_EXPORT HICON GUIAPI GetLargeSystemIconEx (HWND hWnd, int iItem);
7821 
7842 MG_EXPORT HICON GUIAPI GetSmallSystemIconEx (HWND hWnd, int iItem);
7843 
7850 #define GetLargeSystemIcon(iItem) GetLargeSystemIconEx(HWND_NULL, iItem)
7851 
7858 #define GetSmallSystemIcon(iItem) GetSmallSystemIconEx(HWND_NULL, iItem)
7859 
7867 #define SB_HORZ 1
7868 #define SB_VERT 2
7869 
7888 MG_EXPORT BOOL GUIAPI EnableScrollBar (HWND hWnd, int iSBar, BOOL bEnable);
7889 
7911 MG_EXPORT BOOL GUIAPI GetScrollPos (HWND hWnd, int iSBar, int* pPos);
7912 
7937 MG_EXPORT BOOL GUIAPI GetScrollRange (HWND hWnd, int iSBar,
7938  int* pMinPos, int* pMaxPos);
7939 
7962 MG_EXPORT BOOL GUIAPI SetScrollPos (HWND hWnd, int iSBar, int iNewPos);
7963 
7988 MG_EXPORT BOOL GUIAPI SetScrollRange (HWND hWnd, int iSBar,
7989  int iMinPos, int iMaxPos);
7990 
8010 MG_EXPORT BOOL GUIAPI ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow);
8011 
8012 #define SIF_RANGE 0x0001
8013 #define SIF_PAGE 0x0002
8014 #define SIF_POS 0x0004
8015 #define SIF_DISABLENOSCROLL 0x0008
8016 #define SIF_TRACKPOS 0x0010
8017 #define SIF_ALL (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)
8018 
8020 #define SB_ARROW_LTUP 0x0001
8021 
8023 #define SB_ARROW_BTDN 0x0002
8024 
8026 #define SB_ARROW_BOTH (SB_ARROW_LTUP | SB_ARROW_BTDN)
8027 
8031 typedef struct _SCROLLINFO
8032 {
8034  UINT cbSize;
8047  UINT fMask;
8049  int nMin;
8051  int nMax;
8053  UINT nPage;
8055  int nPos;
8056 #if 0
8057  int nTrackPos;
8058 #endif
8060 
8084 MG_EXPORT BOOL GUIAPI SetScrollInfo (HWND hWnd, int iSBar,
8085  const SCROLLINFO* lpsi, BOOL fRedraw);
8086 
8109 MG_EXPORT BOOL GUIAPI GetScrollInfo (HWND hWnd, int iSBar, PSCROLLINFO lpsi);
8110 
8118 /* Class styles -- not supported so far */
8119 #define CS_VREDRAW 0x0001
8120 #define CS_HREDRAW 0x0002
8121 #define CS_KEYCVTWINDOW 0x0004
8122 #define CS_DBLCLKS 0x0008
8123 
8124 #define CS_OWNDC 0x0020
8125 #define CS_CLASSDC 0x0040
8126 #define CS_PARENTDC 0x0080
8127 
8128 #define CS_NOKEYCVT 0x0100
8129 #define CS_NOCLOSE 0x0200
8130 #define CS_SAVEBITS 0x0800
8131 
8132 #define CS_BYTEALIGNCLIENT 0x1000
8133 #define CS_BYTEALIGNWINDOW 0x2000
8134 #define CS_GLOBALCLASS 0x4000
8135 #define CS_IME 0x8000
8136 
8137 #define COP_STYLE 0x0001
8138 #define COP_HCURSOR 0x0002
8139 #define COP_BKCOLOR 0x0004
8140 #define COP_WINPROC 0x0008
8141 #define COP_ADDDATA 0x0010
8142 
8146 typedef struct _WNDCLASS
8147 {
8149  const char* spClassName;
8150 
8164 
8167 
8170 
8173 
8176 
8178  LRESULT (*WinProc) (HWND, UINT, WPARAM, LPARAM);
8179 
8182 } WNDCLASS;
8183 typedef WNDCLASS* PWNDCLASS;
8184 
8185 #define MAINWINCLASSNAME ("MAINWINDOW")
8186 #define ROOTWINCLASSNAME ("ROOTWINDOW")
8187 
8206 MG_EXPORT BOOL GUIAPI RegisterWindowClass (PWNDCLASS pWndClass);
8207 
8221 MG_EXPORT BOOL GUIAPI UnregisterWindowClass (const char* szClassName);
8222 
8236 MG_EXPORT const char* GUIAPI GetClassName (HWND hWnd);
8237 
8253 MG_EXPORT BOOL GUIAPI GetWindowClassInfo (PWNDCLASS pWndClass);
8254 
8269 MG_EXPORT BOOL GUIAPI SetWindowClassInfo (const WNDCLASS* pWndClass);
8270 
8315 MG_EXPORT HWND GUIAPI CreateWindowEx2 (const char* spClassName,
8316  const char* spCaption, DWORD dwStyle, DWORD dwExStyle,
8317  LINT id, int x, int y, int w, int h, HWND hParentWnd,
8318  const char* werdr_name, const WINDOW_ELEMENT_ATTR* we_attrs,
8319  DWORD dwAddData);
8320 
8333 static inline HWND GUIAPI CreateWindowEx (const char* spClassName,
8334  const char* spCaption, DWORD dwStyle, DWORD dwExStyle,
8335  LINT id, int x, int y, int w, int h, HWND hParentWnd,
8336  DWORD dwAddData)
8337 {
8338  return CreateWindowEx2 (spClassName, spCaption, dwStyle, dwExStyle,
8339  id, x, y, w, h, hParentWnd, NULL, NULL, dwAddData);
8340 }
8341 
8354 MG_EXPORT BOOL GUIAPI DestroyWindow (HWND hWnd);
8355 
8369 typedef void (* NOTIFPROC) (HWND hwnd, LINT id, int nc, DWORD add_data);
8370 
8397 MG_EXPORT NOTIFPROC GUIAPI SetNotificationCallback (HWND hwnd,
8398  NOTIFPROC notif_proc);
8399 
8413 MG_EXPORT NOTIFPROC GUIAPI GetNotificationCallback (HWND hwnd);
8414 
8421 #define CreateWindow(class_name, caption, style, \
8422  id, x, y, w, h, parent, add_data) \
8423  CreateWindowEx(class_name, caption, style, 0, \
8424  id, x, y, w, h, parent, add_data)
8425 
8428 /******************************** Timer Support ******************************/
8449 typedef BOOL (* TIMERPROC)(HWND, LINT, DWORD);
8450 
8487 MG_EXPORT BOOL GUIAPI SetTimerEx (HWND hWnd, LINT id, DWORD speed,
8488  TIMERPROC timer_proc);
8489 
8496 #define SetTimer(hwnd, id, speed) \
8497  SetTimerEx(hwnd, id, speed, NULL)
8498 
8516 MG_EXPORT int GUIAPI KillTimer (HWND hWnd, LINT id);
8517 
8540 MG_EXPORT BOOL GUIAPI ResetTimerEx (HWND hWnd, LINT id, DWORD speed,
8541  TIMERPROC timer_proc);
8542 
8549 #define ResetTimer(hwnd, id, speed) \
8550  ResetTimerEx(hwnd, id, speed, (TIMERPROC)INV_PTR)
8551 
8569 MG_EXPORT BOOL GUIAPI IsTimerInstalled (HWND hWnd, LINT id);
8570 
8582 MG_EXPORT BOOL GUIAPI HaveFreeTimer (void);
8583 
8594 typedef struct _IME_TARGET_INFO
8595 {
8608 
8609  /* The position of the caret */
8610  POINT ptCaret;
8611 
8612  /* The rect of the edit box */
8613  RECT rcEditBox;
8614 } IME_TARGET_INFO;
8615 
8634 MG_EXPORT int GUIAPI RegisterIMEWindow (HWND hWnd);
8635 
8650 MG_EXPORT int GUIAPI UnregisterIMEWindow (HWND hWnd);
8651 
8695 MG_EXPORT int GUIAPI GetIMEStatus (int StatusCode);
8696 
8712 MG_EXPORT int GUIAPI SetIMEStatus (int StatusCode, int Value);
8713 
8727 MG_EXPORT int GUIAPI GetIMETargetInfo (IME_TARGET_INFO *info);
8728 
8744 MG_EXPORT int GUIAPI SetIMETargetInfo (const IME_TARGET_INFO *info);
8745 
8762 MG_EXPORT int GUIAPI GetIMEPos (POINT* pt);
8763 
8781 MG_EXPORT int GUIAPI SetIMEPos (const POINT* pt);
8782 
8801 MG_EXPORT HACCEL GUIAPI CopyAcceleratorTable (HACCEL hacc);
8802 
8816 MG_EXPORT int GUIAPI DeleteAccelerators (HACCEL hacc, int key, DWORD keymask);
8817 
8818 #define ACCEL_SHIFT KS_SHIFT
8819 #define ACCEL_ALT KS_ALT
8820 #define ACCEL_CTRL KS_CTRL
8821 
8850 MG_EXPORT int GUIAPI AddAccelerators (HACCEL hacc, int key,
8851  DWORD keymask, WPARAM wParam, LPARAM lParam);
8852 
8867 MG_EXPORT int GUIAPI DestroyAcceleratorTable (HACCEL hacc);
8868 
8880 MG_EXPORT HACCEL GUIAPI CreateAcceleratorTable (HWND hWnd);
8881 
8893 MG_EXPORT int GUIAPI TranslateAccelerator (HACCEL hAccel, PMSG pMsg);
8894 
8920 MG_EXPORT BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap,
8921  int nWidth, int nHeight);
8922 
8938 MG_EXPORT BOOL GUIAPI ChangeCaretSize (HWND hWnd, int newWidth, int newHeight);
8939 
8952 MG_EXPORT BOOL GUIAPI ActiveCaret (HWND hWnd);
8953 
8969 MG_EXPORT UINT GUIAPI GetCaretBlinkTime (HWND hWnd);
8970 
8987 MG_EXPORT BOOL GUIAPI SetCaretBlinkTime (HWND hWnd, UINT uTime);
8988 
9001 MG_EXPORT BOOL GUIAPI DestroyCaret (HWND hWnd);
9002 
9020 MG_EXPORT BOOL GUIAPI HideCaretEx (HWND hWnd, BOOL ime);
9021 
9036 static inline BOOL GUIAPI HideCaret (HWND hWnd)
9037 {
9038  return HideCaretEx (hWnd, TRUE);
9039 }
9040 
9058 MG_EXPORT BOOL GUIAPI ShowCaretEx (HWND hWnd, BOOL ime);
9059 
9074 static inline BOOL GUIAPI ShowCaret (HWND hWnd)
9075 {
9076  return ShowCaretEx (hWnd, TRUE);
9077 }
9078 
9095 MG_EXPORT BOOL GUIAPI SetCaretPos (HWND hWnd, int x, int y);
9096 
9111 MG_EXPORT BOOL GUIAPI GetCaretPos (HWND hWnd, PPOINT pPt);
9112 
9120 /* Menu flags */
9121 #define MF_INSERT 0x00000000L
9122 #define MF_CHANGE 0x00000080L
9123 #define MF_APPEND 0x00000100L
9124 #define MF_DELETE 0x00000200L
9125 #define MF_REMOVE 0x00001000L
9126 
9127 #define MF_BYCOMMAND 0x00000000L
9128 #define MF_BYPOSITION 0x00000400L
9129 
9130 #define MF_SEPARATOR 0x00000800L
9131 
9132 #define MF_ENABLED 0x00000000L
9133 #define MF_GRAYED 0x00000001L
9134 #define MF_DISABLED 0x00000002L
9135 
9136 #define MF_UNCHECKED 0x00000000L
9137 #define MF_CHECKED 0x00000008L
9138 #define MF_USECHECKBITMAPS 0x00000200L
9139 
9140 #define MF_STRING 0x00000000L
9141 #define MF_BITMAP 0x00000004L
9142 #define MF_OWNERDRAW 0x00000100L
9143 
9144 #define MF_POPUP 0x00000010L
9145 #define MF_MENUBARBREAK 0x00000020L
9146 #define MF_MENUBREAK 0x00000040L
9147 
9148 #define MF_UNHILITE 0x00000000L
9149 #define MF_HILITE 0x00000080L
9150 
9151 #define MF_DEFAULT 0x00001000L
9152 #define MF_SYSMENU 0x00002000L
9153 #define MF_HELP 0x00004000L
9154 #define MF_RIGHTJUSTIFY 0x00004000L
9155 
9156 #define MF_MOUSESELECT 0x00008000L
9157 #define MF_END 0x00000080L
9158 
9159 #define MFT_STRING MF_STRING /* 0x00000000L */
9160 #define MFT_BITMAP MF_BITMAP /* 0x00000004L */
9161 #define MFT_BMPSTRING 0x00010000L
9162 #define MFT_MENUBARBREAK MF_MENUBARBREAK /* 0x00000020L */
9163 #define MFT_MENUBREAK MF_MENUBREAK /* 0x00000040L */
9164 #define MFT_OWNERDRAW MF_OWNERDRAW /* 0x00000100L */
9165 #define MFT_RADIOCHECK 0x00000200L
9166 #define MFT_MARKCHECK 0x00000400L
9167 #define MFT_SEPARATOR MF_SEPARATOR /* 0x00000800L */
9168 
9169 #define MFT_RIGHTORDER 0x00002000L
9170 #define MFT_RIGHTJUSTIFY MF_RIGHTJUSTIFY
9171 
9172 #define MFS_GRAYED 0x00000003L
9173 #define MFS_DISABLED MFS_GRAYED
9174 #define MFS_CHECKED MF_CHECKED
9175 #define MFS_HILITE MF_HILITE
9176 #define MFS_ENABLED MF_ENABLED
9177 #define MFS_UNCHECKED MF_UNCHECKED
9178 #define MFS_UNHILITE MF_UNHILITE
9179 #define MFS_DEFAULT MF_DEFAULT
9180 
9181 /* System Menu Command Values */
9182  #define SC_SIZE 0xF000
9183  #define SC_MOVE 0xF010
9184  #define SC_MINIMIZE 0xF020
9185  #define SC_MAXIMIZE 0xF030
9186  #define SC_NEXTWINDOW 0xF040
9187  #define SC_PREVWINDOW 0xF050
9188  #define SC_CLOSE 0xF060
9189  #define SC_VSCROLL 0xF070
9190  #define SC_HSCROLL 0xF080
9191  #define SC_MOUSEMENU 0xF090
9192  #define SC_KEYMENU 0xF100
9193  #define SC_ARRANGE 0xF110
9194  #define SC_RESTORE 0xF120
9195  #define SC_TASKLIST 0xF130
9196  #define SC_SCREENSAVE 0xF140
9197  #define SC_HOTKEY 0xF150
9198 
9199  #define SC_DEFAULT 0xF160
9200  #define SC_MONITORPOWER 0xF170
9201  #define SC_CONTEXTHELP 0xF180
9202  #define SC_SEPARATOR 0xF00F
9203 
9204 /* MENUITEMINFO flags */
9205  #define MIIM_STATE 0x00000001
9206  #define MIIM_ID 0x00000002
9207  #define MIIM_SUBMENU 0x00000004
9208  #define MIIM_CHECKMARKS 0x00000008
9209  #define MIIM_TYPE 0x00000010
9210  #define MIIM_DATA 0x00000020
9211  #define MIIM_STRING 0x00000040
9212  #define MIIM_BITMAP 0x00000080
9213  #define MIIM_FTYPE 0x00000100
9214 
9215 
9216 /* Flags for TrackPopupMenu */
9217  #define TPM_LEFTBUTTON 0x0000L
9218  #define TPM_RIGHTBUTTON 0x0002L
9219  #define TPM_LEFTALIGN 0x0000L
9220  #define TPM_CENTERALIGN 0x0004L
9221  #define TPM_RIGHTALIGN 0x0008L
9222  #define TPM_TOPALIGN 0x0000L
9223  #define TPM_VCENTERALIGN 0x0010L
9224  #define TPM_BOTTOMALIGN 0x0020L
9225 
9226  #define TPM_HORIZONTAL 0x0000L /* Horz alignment matters more */
9227  #define TPM_VERTICAL 0x0040L /* Vert alignment matters more */
9228  #define TPM_NONOTIFY 0x0080L /* Don't send any notification msgs */
9229  #define TPM_RETURNCMD 0x0100L
9230 
9231  #define TPM_DESTROY 0x1000L /* Destroy menu after tracking */
9232  #define TPM_SYSCMD 0x2000L /* Send system command */
9233  #define TPM_DEFAULT 0x0000L /* Default tracking flag */
9234 
9235 /* return codes for MSG_MENUCHAR */
9236 #define MNC_IGNORE 0
9237 #define MNC_CLOSE 1
9238 #define MNC_EXECUTE 2
9239 #define MNC_SELECT 3
9240 
9244 typedef struct _MENUITEMINFO {
9245 
9262  UINT mask;
9263 
9290  UINT type;
9291 
9305  UINT state;
9306 
9310  LINT id;
9311 
9314 
9317 
9320 
9323 
9326 
9331  UINT cch;
9332 } MENUITEMINFO;
9333 typedef MENUITEMINFO* PMENUITEMINFO;
9334 
9346 MG_EXPORT HMENU GUIAPI CreateMenu (void);
9347 
9362 MG_EXPORT HMENU GUIAPI CreatePopupMenu ( PMENUITEMINFO pmii);
9363 
9378 MG_EXPORT HMENU GUIAPI CreateSystemMenu (HWND hwnd, DWORD dwStyle);
9379 
9408 MG_EXPORT int GUIAPI InsertMenuItem (HMENU hmnu, LINT item,
9409  UINT flag, PMENUITEMINFO pmii);
9410 
9437 MG_EXPORT int GUIAPI RemoveMenu (HMENU hmnu, LINT item, UINT flag);
9438 
9464 MG_EXPORT int GUIAPI DeleteMenu (HMENU hmnu, LINT item, UINT flag);
9465 
9482 MG_EXPORT int GUIAPI DestroyMenu (HMENU hmnu);
9483 
9498 MG_EXPORT int GUIAPI IsMenu (HMENU hmnu);
9499 
9514 MG_EXPORT HMENU GUIAPI SetMenu (HWND hwnd, HMENU hmnu);
9515 
9528 MG_EXPORT HMENU GUIAPI GetMenu (HWND hwnd);
9529 
9542 MG_EXPORT void GUIAPI DrawMenuBar (HWND hwnd);
9543 
9558 MG_EXPORT int GUIAPI TrackMenuBar (HWND hwnd, int pos);
9559 
9597 MG_EXPORT int GUIAPI TrackPopupMenu (HMENU hmnu, UINT uFlags,
9598  int x, int y, HWND hwnd);
9599 
9617 MG_EXPORT HMENU GUIAPI GetMenuBarItemRect (HWND hwnd, int pos, RECT* prc);
9618 
9619 #define LFRDR_MENU_STATE_HILITE 0x01
9620 #define LFRDR_MENU_STATE_NORMAL 0x02
9621 #define LFRDR_MENU_STATE_DISABLED 0x04
9622 
9644 MG_EXPORT BOOL GUIAPI HiliteMenuBarItem (HWND hwnd, int pos, UINT flag);
9645 
9658 MG_EXPORT int GUIAPI GetMenuItemCount (HMENU hmnu);
9659 
9677 MG_EXPORT LINT GUIAPI GetMenuItemID (HMENU hmnu, int pos);
9678 
9704 MG_EXPORT int GUIAPI GetMenuItemInfo (HMENU hmnu, LINT item,
9705  UINT flag, PMENUITEMINFO pmii);
9706 
9707 /*Reserved*/
9708 int GUIAPI GetMenuItemRect (HWND hwnd, HMENU hmnu,
9709  LINT item, PRECT prc);
9710 
9723 MG_EXPORT HMENU GUIAPI GetPopupSubMenu (HMENU hpppmnu);
9724 
9737 MG_EXPORT HMENU GUIAPI StripPopupHead (HMENU hpppmnu);
9738 
9756 MG_EXPORT HMENU GUIAPI GetSubMenu (HMENU hmnu, int pos);
9757 
9775 MG_EXPORT HMENU GUIAPI GetSystemMenu (HWND hwnd, BOOL flag);
9776 
9798 MG_EXPORT UINT GUIAPI EnableMenuItem (HMENU hmnu, LINT item, UINT flag);
9799 
9826 MG_EXPORT int GUIAPI CheckMenuRadioItem (HMENU hmnu, LINT first, LINT last,
9827  LINT checkitem, UINT flag);
9828 
9854 MG_EXPORT int GUIAPI SetMenuItemBitmaps (HMENU hmnu, LINT item, UINT flag,
9855  PBITMAP hBmpUnchecked, PBITMAP hBmpChecked);
9856 
9880 MG_EXPORT int GUIAPI SetMenuItemInfo (HMENU hmnu, LINT item,
9881  UINT flag, PMENUITEMINFO pmii);
9882 
9890 /* Dialog codes */
9895 #define DLGC_WANTARROWS 0x0001
9896 
9900 #define DLGC_WANTTAB 0x0002
9901 
9905 #define DLGC_WANTALLKEYS 0x0004
9906 
9910 #define DLGC_WANTCHARS 0x0008
9911 
9916 #define DLGC_WANTENTER 0x0010
9917 
9921 #define DLGC_HASSETSEL 0x0080
9922 
9927 #define DLGC_DEFPUSHBUTTON 0x0100
9928 
9932 #define DLGC_PUSHBUTTON 0x0200
9933 
9937 #define DLGC_RADIOBUTTON 0x0400
9938 
9942 #define DLGC_3STATE 0x0800
9943 
9947 #define DLGC_STATIC 0x1000
9948 
9952 #define DLGC_BUTTON 0x2000
9953 
9957 typedef struct _CTRLDATA
9958 {
9960  const char* class_name;
9964  int x, y, w, h;
9968  LINT id;
9970  const char* caption;
9975 
9977  const char* werdr_name;
9978 
9981 } CTRLDATA;
9982 typedef CTRLDATA* PCTRLDATA;
9983 
9991 typedef struct _DLGTEMPLATE
9992 {
9998  int x, y, w, h;
10000  const char* caption;
10008  PCTRLDATA controls;
10011 } DLGTEMPLATE;
10012 typedef DLGTEMPLATE* PDLGTEMPLATE;
10013 
10045 MG_EXPORT HWND GUIAPI CreateMainWindowIndirectParamEx (PDLGTEMPLATE pDlgTemplate,
10046  HWND hOwner, WNDPROC WndProc, LPARAM lParam,
10047  const char* werdr_name, WINDOW_ELEMENT_ATTR* we_attrs,
10048  const char* window_name, const char* layer_name);
10049 
10062 static inline HWND GUIAPI CreateMainWindowIndirectParam (
10063  PDLGTEMPLATE pDlgTemplate, HWND hOwner,
10064  WNDPROC WndProc, LPARAM lParam)
10065 {
10066  return CreateMainWindowIndirectParamEx (pDlgTemplate, hOwner,
10067  WndProc, lParam, NULL, NULL, NULL, NULL);
10068 }
10069 
10081 static inline HWND GUIAPI CreateMainWindowIndirect (
10082  PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC WndProc)
10083 {
10084  return CreateMainWindowIndirectParam (pDlgTemplate, hOwner, WndProc, 0);
10085 }
10086 
10098 MG_EXPORT BOOL GUIAPI DestroyMainWindowIndirect (HWND hMainWin);
10099 
10133 MG_EXPORT int GUIAPI DialogBoxIndirectParamEx (PDLGTEMPLATE pDlgTemplate,
10134  HWND hOwner, WNDPROC DlgProc, LPARAM lParam,
10135  const char* werdr_name, WINDOW_ELEMENT_ATTR* we_attrs,
10136  const char* window_name, const char* layer_name);
10137 
10149 static inline int GUIAPI DialogBoxIndirectParam (PDLGTEMPLATE pDlgTemplate,
10150  HWND hOwner, WNDPROC DlgProc, LPARAM lParam)
10151 {
10152  return DialogBoxIndirectParamEx (pDlgTemplate, hOwner, DlgProc, lParam,
10153  NULL, NULL, NULL, NULL);
10154 }
10155 
10173 MG_EXPORT BOOL GUIAPI EndDialog (HWND hDlg, int endCode);
10174 
10185 MG_EXPORT void GUIAPI DestroyAllControls (HWND hWnd);
10186 
10198 MG_EXPORT HWND GUIAPI GetDlgDefPushButton (HWND hWnd);
10199 
10214 MG_EXPORT LINT GUIAPI GetDlgCtrlID (HWND hwndCtl);
10215 
10230 MG_EXPORT HWND GUIAPI GetDlgItem (HWND hDlg, LINT nIDDlgItem);
10231 
10264 MG_EXPORT UINT GUIAPI GetDlgItemInt (HWND hDlg, LINT nIDDlgItem,
10265  BOOL *lpTranslated, BOOL bSigned);
10266 
10289 MG_EXPORT int GUIAPI GetDlgItemText (HWND hDlg, LINT nIDDlgItem,
10290  char* lpString, int nMaxCount);
10291 
10312 MG_EXPORT char* GUIAPI GetDlgItemText2 (HWND hDlg, LINT id, int* lenPtr);
10313 
10333 MG_EXPORT HWND GUIAPI GetNextDlgGroupItem (HWND hDlg,
10334  HWND hCtl, BOOL bPrevious);
10335 
10354 MG_EXPORT HWND GUIAPI GetNextDlgTabItem (HWND hDlg, HWND hCtl, BOOL bPrevious);
10355 
10377 MG_EXPORT LRESULT GUIAPI SendDlgItemMessage (HWND hDlg, LINT nIDDlgItem,
10378  UINT message, WPARAM wParam, LPARAM lParam);
10379 
10402 MG_EXPORT BOOL GUIAPI SetDlgItemInt (HWND hDlg, LINT nIDDlgItem,
10403  UINT uValue, BOOL bSigned);
10404 
10424 MG_EXPORT BOOL GUIAPI SetDlgItemText (HWND hDlg, LINT nIDDlgItem,
10425  const char* lpString);
10426 
10427 #ifdef _MGCTRL_BUTTON
10428 
10453 MG_EXPORT void GUIAPI CheckDlgButton (HWND hDlg, LINT nIDDlgItem, int nCheck);
10454 
10476 MG_EXPORT void GUIAPI CheckRadioButton (HWND hDlg,
10477  LINT idFirstButton, LINT idLastButton, LINT idCheckButton);
10478 
10506 MG_EXPORT int GUIAPI IsDlgButtonChecked (HWND hDlg, LINT idButton);
10507 #endif
10508 
10516 #if defined(_MGCTRL_STATIC) && defined (_MGCTRL_BUTTON)
10517 
10518 /* Standard control IDs */
10519 #define IDC_STATIC 0
10520 #define IDOK 1
10521 #define IDCANCEL 2
10522 #define IDABORT 3
10523 #define IDRETRY 4
10524 #define IDIGNORE 5
10525 #define IDYES 6
10526 #define IDNO 7
10527 
10528 #define MINID_RESERVED 0xF001
10529 #define MAXID_RESERVED 0xFFFF
10530 
10531 #define MB_OK 0x00000000
10532 #define MB_OKCANCEL 0x00000001
10533 #define MB_YESNO 0x00000002
10534 #define MB_RETRYCANCEL 0x00000003
10535 #define MB_ABORTRETRYIGNORE 0x00000004
10536 #define MB_YESNOCANCEL 0x00000005
10537 #define MB_CANCELASBACK 0x00000008 /* customized style */
10538 #define MB_TYPEMASK 0x00000007
10539 
10540 #define MB_ICONHAND 0x00000010
10541 #define MB_ICONQUESTION 0x00000020
10542 #define MB_ICONEXCLAMATION 0x00000030
10543 #define MB_ICONASTERISK 0x00000040
10544 #define MB_ICONMASK 0x000000F0
10545 
10546 #define MB_ICONINFORMATION MB_ICONASTERISK
10547 #define MB_ICONSTOP MB_ICONHAND
10548 
10549 #define MB_DEFBUTTON1 0x00000000
10550 #define MB_DEFBUTTON2 0x00000100
10551 #define MB_DEFBUTTON3 0x00000200
10552 #define MB_DEFMASK 0x00000F00
10553 
10554 /* #define MB_APPLMODAL 0x00000000 */
10555 /* #define MB_SYSTEMMODAL 0x00001000 */
10556 /* #define MB_TASKMODAL 0x00002000 */
10557 
10558 #define MB_NOFOCUS 0x00008000
10559 
10560 #define MB_ALIGNCENTER 0x00000000
10561 #define MB_ALIGNTOPLEFT 0x00010000
10562 #define MB_ALIGNBTMLEFT 0x00020000
10563 #define MB_ALIGNTOPRIGHT 0x00030000
10564 #define MB_ALIGNBTMRIGHT 0x00040000
10565 #define MB_ALIGNMASK 0x00070000
10566 
10567 #define MB_BASEDONPARENT 0x00080000 /* default is desktop. */
10568 
10671 MG_EXPORT int GUIAPI MessageBox (HWND hParentWnd, const char* pszText,
10672  const char* pszCaption, DWORD dwStyle);
10673 
10674 #endif /* _MGCTRL_STATIC && _MGCTRL_BUTTON */
10675 
10686 MG_EXPORT void GUIAPI MessageBeep (DWORD dwBeep);
10687 
10692 #ifdef __cplusplus
10693 }
10694 #endif /* __cplusplus */
10695 
10696 #endif /* _MGUI_WINDOW_H */
10697 
GHANDLE HACCEL
Handle to accelarator.
Definition: common.h:432
const char * caption
Definition: window.h:10000
HMENU hMenu
Definition: window.h:10004
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)
Broadcasts a message to all main window on the desktop.
MG_EXPORT LINT GUIAPI GetDlgCtrlID(HWND hwndCtl)
Gets the integer identifier of a control.
MG_EXPORT BOOL GUIAPI IsMainWindow(HWND hWnd)
Determines whether a window is a main window.
const char * spCaption
Definition: window.h:5781
MG_EXPORT HMENU GUIAPI GetMenuBarItemRect(HWND hwnd, int pos, RECT *prc)
Retrieves the rect of a menu bar item.
void * context
Definition: window.h:3700
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:5787
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:3052
MG_EXPORT HWND GUIAPI GetFocusChild(HWND hParent)
Retrieves 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.
DWORD typedata
Definition: window.h:9325
MG_EXPORT HMENU GUIAPI StripPopupHead(HMENU hpppmnu)
Strips the title of the popup menu.
WPARAM wParam
Definition: window.h:3015
MG_EXPORT BOOL GUIAPI GetScrollPos(HWND hWnd, int iSBar, int *pPos)
Retrieves 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:955
struct _LFRDR_TRACKBARINFO LFRDR_TRACKBARINFO
int BOOL
A type definition for boolean value.
Definition: common.h:338
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 pthread_t GUIAPI GetMainWinThread(HWND hMainWnd)
Get the thread id which main window belongs to.
MG_EXPORT HICON GUIAPI SetWindowIcon(HWND hWnd, HICON hIcon, BOOL bRedraw)
Sets the current icon of a window.
static BOOL GUIAPI HideCaret(HWND hWnd)
Hides a caret.
Definition: window.h:9036
MG_EXPORT int GUIAPI GetUpdateRegion(HWND hWnd, PCLIPRGN pRgn)
Copy the update region of a window to a region.
int nPos
Definition: window.h:8055
gal_pixel iBkColor
Definition: window.h:5802
unsigned char BYTE
A type definition for an 8-bit unsigned character (byte).
Definition: common.h:455
MG_EXPORT LRESULT GUIAPI SendMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Sends a message to a window.
MG_EXPORT BOOL GUIAPI SetScrollPos(HWND hWnd, int iSBar, int iNewPos)
Sets 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 a window element gal_pixel color.
gal_pixel iFgColor
Definition: window.h:4923
MG_EXPORT DWORD GUIAPI SetWindowAdditionalData2(HWND hWnd, DWORD newData)
Sets the second additional data of a window.
MG_EXPORT int GUIAPI GetIMEStatus(int StatusCode)
Retrives status of the current IME window.
MG_EXPORT DWORD GUIAPI GetWindowAdditionalData(HWND hWnd)
Retrives 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:9316
MG_EXPORT int GUIAPI SetIMETargetInfo(const IME_TARGET_INFO *info)
Sets the target info of the current IME window.
MG_EXPORT HWND GUIAPI GetNextMainWindow(HWND hMainWnd)
Retrives 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:10002
LRESULT(* WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Type of the window callback procedure.
Definition: window.h:5745
MG_EXPORT HWND GUIAPI GetActiveWindow(void)
Retrieves the main window handle to the active main window.
int x
Definition: window.h:9964
DWORD dwAddData
Definition: window.h:10010
MG_EXPORT void GUIAPI MainWindowThreadCleanup(HWND hMainWnd)
Cleans up system resource associated with a main window.
MG_EXPORT LRESULT GUIAPI DefaultWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
The default window callback procedure.
DWORD dwAddData
Definition: window.h:9972
MG_EXPORT const char *GUIAPI GetClassName(HWND hWnd)
Retrieves the name of the class to which the specified window belongs.
struct _HOOKINFO HOOKINFO
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:9313
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:8051
MG_EXPORT HMENU GUIAPI GetSubMenu(HMENU hmnu, int pos)
Retrieves the handle to the submenu activated by the specified menu item.
HMENU hMenu
Definition: window.h:5784
MG_EXPORT WINDOW_ELEMENT_RENDERER *GUIAPI GetWindowRendererFromName(const char *name)
Get window renderer from name.
DWORD(* on_set_rdr_attr)(struct _WINDOW_ELEMENT_RENDERER *, int we_attr_id, DWORD we_attr, BOOL change)
Definition: window.h:4868
MG_EXPORT HWND GUIAPI GetHosting(HWND hMainWnd)
Retrives the hosting main window of a main window.
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 int GUIAPI GetMenuItemInfo(HMENU hmnu, LINT item, UINT flag, PMENUITEMINFO pmii)
Retrieves information about a menu item.
MG_EXPORT HICON GUIAPI GetLargeSystemIconEx(HWND hWnd, int iItem)
Retrives a large system icon by its identifier in default renderer.
MG_EXPORT WNDPROC __mg_def_proc[3]
The default window callback procedure array.
MG_EXPORT HWND GUIAPI SetActiveWindow(HWND hMainWnd)
Sets a main window to be the active main window.
MG_EXPORT PLOGFONT GUIAPI SetWindowFont(HWND hWnd, PLOGFONT pLogFont)
Sets 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:5913
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:4935
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.
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:9980
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:8049
Definition: common.h:925
gal_pixel iBkColor
Definition: window.h:8175
MG_EXPORT BOOL GUIAPI PeekPostMessage(PMSG pMsg, HWND hWnd, UINT nMsgFilterMin, UINT nMsgFilterMax, UINT uRemoveMsg)
Peeks a post message from the message queue of a main window.
const char * spClassName
Definition: window.h:8149
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:10081
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:4156
MG_EXPORT HCURSOR GUIAPI GetWindowCursor(HWND hWnd)
Retrives the current cursor of a window.
Uint32 gal_pixel
Data type of pixel value.
Definition: common.h:1095
MG_EXPORT int GUIAPI RemoveMenu(HMENU hmnu, LINT item, UINT flag)
Deletes a menu item or detaches a submenu from the specified menu.
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:4933
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)
Retrieves the title or text associated with a control in a dialog box.
PBITMAP checkedbmp
Definition: window.h:9319
MG_EXPORT HWND GUIAPI SetFocusChild(HWND hWnd)
Sets the active child of a window.
MG_EXPORT BOOL GUIAPI GetScrollInfo(HWND hWnd, int iSBar, PSCROLLINFO lpsi)
Retrieves the parameters of a scroll bar.
MG_EXPORT BOOL GUIAPI SetWindowText(HWND hWnd, const char *spString)
Sets the text of a window.
MG_EXPORT HWND GUIAPI GetWindowUnderCursor(void)
Retrives the handle to the window (if any) which is just beneath the mouse cursor.
void * pAdd
Definition: window.h:3022
void(* draw_hilite_menu_item)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:4878
struct _MSG MSG
struct _MAINWINCREATE MAINWINCREATE
DWORD dwReserved
Definition: window.h:5808
HACCEL hAccel
Definition: window.h:4929
HWND hHosting
Definition: window.h:5793
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.
MG_EXPORT MSGHOOK GUIAPI RegisterKeyMsgHook(void *context, MSGHOOK hook)
Registers a key message hook.
MG_EXPORT HCURSOR GUIAPI SetWindowCursor(HWND hWnd, HCURSOR hNewCursor)
Sets the current cursor of a window.
static BOOL GUIAPI ShowCaret(HWND hWnd)
Shows a caret.
Definition: window.h:9074
MG_EXPORT BOOL GUIAPI GetClientRect(HWND hWnd, PRECT prc)
Retrives the client rectangle of a window.
MG_EXPORT DWORD GUIAPI GetWindowClassAdditionalData(HWND hWnd)
Retrives the additional data of a control class.
MG_EXPORT BOOL GUIAPI GetWindowClassInfo(PWNDCLASS pWndClass)
Retrieves the information of the specified window class.
UINT message
Definition: window.h:3013
UINT fMask
Definition: window.h:8047
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.
const void * private_info
Definition: window.h:4901
DWORD dwStyle
Definition: window.h:9994
MG_EXPORT BOOL GUIAPI PeekMessageEx(PMSG pMsg, HWND hWnd, UINT nMsgFilterMin, UINT nMsgFilterMax, BOOL bWait, UINT uRemoveMsg)
Peeks a message from the message queue of a main window.
DWORD dwExStyle
Definition: window.h:5778
MG_EXPORT HWND GUIAPI GetFirstHosted(HWND hHosting)
Retrives the first hosted main window of a main 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:4947
MG_EXPORT BOOL GUIAPI SetScrollInfo(HWND hWnd, int iSBar, const SCROLLINFO *lpsi, BOOL fRedraw)
Sets 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.
MG_EXPORT MSGHOOK GUIAPI RegisterMouseMsgHook(void *context, MSGHOOK hook)
Registers a mouse message hook.
GHANDLE HDC
Handle to device context.
Definition: common.h:407
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)
Sets the callback procedure of a window.
void(* NOTIFPROC)(HWND hwnd, LINT id, int nc, DWORD add_data)
Type of the notification callback procedure.
Definition: window.h:8369
MG_EXPORT void GUIAPI UnregisterSystemBitmap(HDC hdc, const char *rdr_name, const char *id)
Unregister a BITMAP object from 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:9322
MG_EXPORT BOOL GUIAPI SetKeyboardLayout(const char *kbd_layout)
Sets a new keyboard layout.
int left
Definition: window.h:4910
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 IsWindowVisible(HWND hWnd)
Retrieves 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:8449
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)
Sets the minimum and maximum position values for the specified scroll bar.
char * spCaption
Definition: window.h:4940
int controlnr
Definition: window.h:10006
MG_EXPORT BOOL GUIAPI ExcludeWindowExStyle(HWND hWnd, DWORD dwStyle)
Removes the specific extended style of a window.
DWORD dwExStyle
Definition: window.h:9974
#define TRUE
TRUE value, defined as 1 by MiniGUI.
Definition: common.h:353
MG_EXPORT void GUIAPI UpdateWindow(HWND hWnd, BOOL bErase)
Updates a window.
HMENU hMenu
Definition: window.h:4927
MG_EXPORT void * GetResource(RES_KEY key)
Retrive and return a buffered resource by the key.
DWORD we_colors[WE_COLORS_NUMBER][3]
Definition: window.h:4889
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:4920
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.
static const WINDOWINFO *GUIAPI GetWindowInfo(HWND hWnd)
Get the handle of window information.
Definition: window.h:4966
GHANDLE HWND
Handle to main window or control.
Definition: common.h:402
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)
Sets the first additional data of a window.
MG_EXPORT BOOL GUIAPI SetWindowCaption(HWND hWnd, const char *spCaption)
Sets 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 LRESULT GUIAPI PostSyncMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Posts 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:5775
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)
Retrives the style of a window.
MG_EXPORT BOOL GUIAPI HavePendingMessage(HWND hMainWnd)
Checks if there is any pending message in the message queue of a main window.
MG_EXPORT BOOL GUIAPI GetWindowRect(HWND hWnd, PRECT prc)
Retrives the dimensions of the bounding rectangle of a window.
MG_EXPORT HWND GUIAPI WindowFromPointEx(POINT pt, BOOL bRecursion)
Retrieves a handle to the window that contains the specified point.
DWORD dwExStyle
Definition: window.h:8169
MG_EXPORT int GUIAPI GetIMEPos(POINT *pt)
Retrives the position of the current IME window.
PLOGFONT we_fonts[WE_FONTS_NUMBER]
Definition: window.h:4892
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:9960
MG_EXPORT LRESULT GUIAPI SendAsyncMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Sends 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.
MG_EXPORT const BITMAP *GUIAPI RetrieveRes(const char *file)
Get a BITMAP object from cache according to the specified resource file name.
int(* MSGHOOK)(void *context, HWND dst_wnd, UINT msg, WPARAM wparam, LPARAM lparam)
Type of message hook function.
Definition: window.h:3691
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)
Retrives the handle to a control in a dialog box.
MG_EXPORT BOOL GUIAPI InitWindowElementAttrs(PWERENDERER rdr)
static HWND GUIAPI ChildWindowFromPoint(HWND hParent, POINT pt)
Retrives a handle to the child window that contains the speicified point.
Definition: window.h:7483
static HWND GUIAPI CreateMainWindowIndirectParam(PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC WndProc, LPARAM lParam)
A simplified version of CreateMainWindowIndirectParamEx.
Definition: window.h:10062
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:572
struct _LFSCROLLBARINFO LFSCROLLBARINFO
PLOGFONT pLogFont
Definition: window.h:4937
MG_EXPORT DWORD GUIAPI GetWindowExStyle(HWND hWnd)
Retrives 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:4475
MG_EXPORT BOOL GUIAPI IncludeWindowStyle(HWND hWnd, DWORD dwStyle)
Includes the specific style of a window.
HWND hwnd
Definition: window.h:3011
MSGHOOK hook
Definition: window.h:3702
MG_EXPORT LRESULT GUIAPI SendDlgItemMessage(HWND hDlg, LINT nIDDlgItem, UINT message, WPARAM wParam, LPARAM lParam)
Sends a message to the specified control in a dialog box.
void(* erase_background)(HWND hWnd, HDC hdc, const RECT *rect)
Definition: window.h:4871
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:8333
MG_EXPORT HWND GUIAPI GetNextDlgTabItem(HWND hDlg, HWND hCtl, BOOL bPrevious)
Retrieves the handle to the first control that has the WS_TABSTOP style that precedes (or follows) th...
GHANDLE HCURSOR
Handle to cursor.
Definition: common.h:417
MG_EXPORT BOOL GUIAPI IsWindowEnabled(HWND hWnd)
Determines 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:8166
DWORD dwStyle
Definition: window.h:4918
MG_EXPORT DWORD GUIAPI GetWindowAdditionalData2(HWND hWnd)
Retrives 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)
Sets the information of the specified window class.
#define NULL
A value indicates null pointer.
Definition: common.h:364
int we_metrics[WE_METRICS_NUMBER]
Definition: window.h:4886
MG_EXPORT 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.
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:7611
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)
Retrives the caption of a window.
MG_EXPORT BOOL GUIAPI IsTimerInstalled(HWND hWnd, LINT id)
Determines whether a timer is installed.
Definition: gdi.h:603
MG_EXPORT int GUIAPI WaitMainWindowClose(HWND hWnd, void **returnval)
Suspends execution of the calling thread which main window belongs to until the target thread termina...
unsigned char Uint8
A type definition for an 8-bit unsigned character.
Definition: common.h:154
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:707
MG_EXPORT BOOL GUIAPI RegisterWindowClass(PWNDCLASS pWndClass)
Registers a window class.
MG_EXPORT void GUIAPI SetAutoRepeatMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Sets 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)
Waits for a message from the message queue of a main window.
MG_EXPORT HMENU GUIAPI GetMenu(HWND hwnd)
Retrieves the handle to the menu assigned to the given main window.
MG_EXPORT int AddInnerRes(INNER_RES *inner_res, int count, BOOL copy)
Add some incore resource into the resource manager in order to call LoadResource to get those resourc...
UINT cbSize
Definition: window.h:8034
MG_EXPORT BOOL GUIAPI SetCaretBlinkTime(HWND hWnd, UINT uTime)
Sets 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)
Peeks a message from the message queue of a main window.
Definition: window.h:3175
HCURSOR hCursor
Definition: window.h:8172
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:3008
struct _MENUITEMINFO MENUITEMINFO
LFSCROLLBARINFO hscroll
Definition: window.h:4949
MG_EXPORT HWND GUIAPI GetParent(HWND hWnd)
Retrieves the handle to a child window&#39;s parent window.
MG_EXPORT BOOL GUIAPI IsWindow(HWND hWnd)
Determines 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 const BITMAP *GUIAPI GetSystemBitmapByHwnd(HWND hWnd, const char *id)
Retrives the system bitmap object by identifier.
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:8163
MG_EXPORT const BITMAP *GUIAPI GetSystemBitmap(HWND hWnd, const char *id)
Retrives the system bitmap object by identifier.
MG_EXPORT NOTIFPROC GUIAPI GetNotificationCallback(HWND hwnd)
Gets the notification callback procedure of a control.
MG_EXPORT DWORD GUIAPI SetWindowClassAdditionalData(HWND hWnd, DWORD newData)
Sets 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 HACCEL GUIAPI CopyAcceleratorTable(HACCEL hacc)
Copies the specified accelerator table.
MG_EXPORT BOOL GUIAPI GetCaretPos(HWND hWnd, PPOINT pPt)
Gets the caret position.
MG_EXPORT char *GUIAPI GetDlgItemText2(HWND hDlg, LINT id, int *lenPtr)
Retrieves the title or text associated with a control in a dialog box.
HICON we_icon[2][SYSICO_ITEM_NUMBER]
Definition: window.h:4895
WORD_HPTR WORD
A type definition for an unsigned integer (word).
Definition: common.h:536
struct _LFRDR_WINSTYLEINFO LFRDR_WINSTYLEINFO
MG_EXPORT BOOL GUIAPI HaveFreeTimer(void)
Determines whether there is any free timer slot in the system.
static BOOL GUIAPI GetMessage(PMSG pMsg, HWND hWnd)
Gets a message from the message queue of a main window.
Definition: window.h:3110
MG_EXPORT BOOL GUIAPI DestroyMainWindowIndirect(HWND hMainWin)
Destroys a main window created by CreateMainWindowIndirectParam.
DWORD dwExStyle
Definition: window.h:9996
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:9977
MG_EXPORT BOOL GUIAPI IsControl(HWND hWnd)
Determines whether a window is a control.
UINT_PTR WPARAM
A type definition for the first message paramter.
Definition: common.h:701
MG_EXPORT HICON GUIAPI GetWindowIcon(HWND hWnd)
Retrives the current icon of a window.
MG_EXPORT int GUIAPI GetWindowTextLength(HWND hWnd)
Retrieves the length of a window&#39;s text.
DWORD_PTR DWORD
A unsigned long type definition for pointer precision.
Definition: common.h:599
static int GUIAPI DialogBoxIndirectParam(PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC DlgProc, LPARAM lParam)
A simplified version of DialogBoxIndirectParamEx.
Definition: window.h:10149
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)
Sends a notification message to a window.
LONG_PTR LRESULT
Signed result of message processing.
Definition: common.h:578
DWORD dwAddData
Definition: window.h:8181
DWORD dwAddData
Definition: window.h:5805
MG_EXPORT void GUIAPI ScreenToClient(HWND hWnd, int *x, int *y)
Converts the screen coordinates of a point to client coordinates.
Definition: gdi.h:10373
struct _SCROLLINFO SCROLLINFO
MG_EXPORT PLOGFONT GUIAPI GetWindowFont(HWND hWnd)
Retrives the default font of a window.
MG_EXPORT HWND GUIAPI GetNextChild(HWND hWnd, HWND hChild)
Retrives the next control in a window.
MG_EXPORT BOOL GUIAPI GetScrollRange(HWND hWnd, int iSBar, int *pMinPos, int *pMaxPos)
Retrives the minimum and maximum position values for the specified scroll bar.
MG_EXPORT HWND GUIAPI GetNextDlgGroupItem(HWND hDlg, HWND hCtl, BOOL bPrevious)
Retrieves the handle to the first control in a group of controls that precedes (or follows) the speci...
#define WE_METRICS_NUMBER
The number of window element metric attributes.
Definition: window.h:4150
LINT id
Definition: window.h:4944
MG_EXPORT int GUIAPI IsMenu(HMENU hmnu)
Determines whether a handle is a menu handle.
MG_EXPORT int GUIAPI CheckMenuRadioItem(HMENU hmnu, LINT first, LINT last, LINT checkitem, UINT flag)
Checks a specified menu item and makes it a radio item.
LPARAM lParam
Definition: window.h:3017
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:4898
MG_EXPORT int GUIAPI GetIMETargetInfo(IME_TARGET_INFO *info)
Retrives 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)
Retrives the handle to the main window contains a window.
MG_EXPORT BOOL GUIAPI ShowCaretEx(HWND hWnd, BOOL ime)
Shows a caret.
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:3019
MG_EXPORT HWND GUIAPI GetNextHosted(HWND hHosting, HWND hHosted)
Retrives the next hosted main window of a main window.
MG_EXPORT gal_pixel GUIAPI SetWindowBkColor(HWND hWnd, gal_pixel new_bkcolor)
Sets 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:9962
#define FALSE
FALSE value, defined as 0 by MiniGUI.
Definition: common.h:346
MG_EXPORT int GUIAPI PostQuitMessage(HWND hWnd)
Puts a MSG_QUIT message into the message queue of a main window.
Definition: gdi.h:5764
gal_pixel iBkColor
Definition: window.h:4925
void(* draw_normal_menu_item)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:4874
const char * caption
Definition: window.h:9970
MG_EXPORT BOOL GUIAPI EndDialog(HWND hDlg, int endCode)
Destroys a modal dialog box, causing MiniGUI to end any processing for the dialog box...
HCURSOR hCursor
Definition: window.h:4931
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:659
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)
Sets the status of the current IME window.
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)
Retrives 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:4882
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:427
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:5790
MG_EXPORT HWND GUIAPI GetDlgDefPushButton(HWND hWnd)
Gets the default push button control in a window.
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:4144
MG_EXPORT const BITMAP *GUIAPI GetSystemBitmapEx(const char *rdr_name, const char *id)
Retrives the system bitmap object by identifier.
MG_EXPORT int GUIAPI GetMenuItemCount(HMENU hmnu)
Determines the number of items in a menu.
MG_EXPORT HWND GUIAPI GetCapture(void)
Retrives the handle to the window (if any) that has captured the mouse.
MG_EXPORT HWND GUIAPI SetCapture(HWND hWnd)
Sets 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:10008
MG_EXPORT WNDPROC GUIAPI GetWindowCallbackProc(HWND hWnd)
Retrives the callback procedure of a window.
WINDOW_ELEMENT_RENDERER * we_rdr
Definition: window.h:4952
MG_EXPORT BOOL GUIAPI GetUpdateRect(HWND hWnd, RECT *update_rect)
Retrives the bounding box of the update region of a window.
MG_EXPORT int GUIAPI CreateThreadForMainWindow(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *arg)
Create a thread for main window.
MG_EXPORT HICON GUIAPI GetSmallSystemIconEx(HWND hWnd, int iItem)
Retrives a small system icon by its identifier.
MG_EXPORT int GUIAPI IsDlgButtonChecked(HWND hDlg, LINT idButton)
Determines whether a button control has a check mark next to it or whether a three-state button contr...
MG_EXPORT HMENU GUIAPI GetPopupSubMenu(HMENU hpppmnu)
Retrieves the submenu of the specified popup menu.
MG_EXPORT HMENU GUIAPI CreateMenu(void)
Creates an empty menu.
UINT nPage
Definition: window.h:8053
MG_EXPORT NOTIFPROC GUIAPI SetNotificationCallback(HWND hwnd, NOTIFPROC notif_proc)
Sets a new notification callback procedure for a control.
MG_EXPORT void GUIAPI ReleaseCapture(void)
Releases the mouse capture from a window and restores normal mouse input processing.
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)
Retrieves 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:9968
GHANDLE HICON
Handle to icon.
Definition: common.h:422
UINT state
Definition: window.h:9305
MG_EXPORT BOOL GUIAPI SetDlgItemInt(HWND hDlg, LINT nIDDlgItem, UINT uValue, BOOL bSigned)
Sets 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)
Determines 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