MiniGUI API Reference (MiniGUI-Standalone)  v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
window.h
Go to the documentation of this file.
1 //
3 // IMPORTANT NOTICE
4 //
5 // The following open source license statement does not apply to any
6 // entity in the Exception List published by FMSoft.
7 //
8 // For more information, please visit:
9 //
10 // https://www.fmsoft.cn/exception-list
11 //
13 
57 /*
58  * $Id: window.h 13674 2010-12-06 06:45:01Z wanzheng $
59  *
60  * MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
61  * pSOS, ThreadX, NuCleus, OSE, and Win32.
62  */
63 
64 #ifndef _MGUI_WINDOW_H
65 #define _MGUI_WINDOW_H
66 
67 #include "common.h"
68 
69 #include <stddef.h>
70 #include <stdlib.h>
71 
72 #ifdef _MGHAVE_VIRTUAL_WINDOW
73 #include <pthread.h>
74 #include <semaphore.h>
75 #endif
76 
77 #ifdef HAVE_POLL
78 #include <poll.h>
79 #endif
80 
81 #ifdef __cplusplus
82 extern "C" {
83 #endif /* __cplusplus */
84 
90 /* Definitions of common messages. */
91 #define MSG_NULLMSG 0x0000
92 #define MSG_SYNCMSG 0x0000
93 
99 /* Group 1 from 0x0001 to 0x000F, the mouse messages. */
100 #define MSG_FIRSTMOUSEMSG 0x0001
101 
124 #define MSG_LBUTTONDOWN 0x0001
125 
145 #define MSG_LBUTTONUP 0x0002
146 
166 #define MSG_LBUTTONDBLCLK 0x0003
167 
187 #define MSG_MOUSEMOVE 0x0004
188 
211 #define MSG_RBUTTONDOWN 0x0005
212 
232 #define MSG_RBUTTONUP 0x0006
233 
253 #define MSG_RBUTTONDBLCLK 0x0007
254 
276 #define MSG_MBUTTONDOWN 0x0008
277 
299 #define MSG_MBUTTONUP 0x0009
300 
320 #define MSG_MBUTTONDBLCLK 0x000A
321 
322 #define MSG_NCMOUSEOFF 0x000A
323 
343 #define MSG_NCLBUTTONDOWN 0x000B
344 
364 #define MSG_NCLBUTTONUP 0x000C
365 
385 #define MSG_NCLBUTTONDBLCLK 0x000D
386 
406 #define MSG_NCMOUSEMOVE 0x000E
407 
427 #define MSG_NCRBUTTONDOWN 0x000F
428 
448 #define MSG_NCRBUTTONUP 0x0010
449 
469 #define MSG_NCRBUTTONDBLCLK 0x0011
470 
490 #define MSG_NCMBUTTONDOWN 0x0012
491 
511 #define MSG_NCMBUTTONUP 0x0013
512 
532 #define MSG_NCMBUTTONDBLCLK 0x0014
533 
534 #define MSG_LASTMOUSEMSG 0x0014
535 
543 /* Group 2 from 0x0015 to 0x001F, the key messages. */
544 #define MSG_FIRSTKEYMSG 0x0015
545 
568 #define MSG_KEYDOWN 0x0015
569 
596 #define MSG_CHAR 0x0016
597 
616 #define MSG_KEYUP 0x0017
617 
636 #define MSG_SYSKEYDOWN 0x0018
637 
656 #define MSG_SYSCHAR 0x0019
657 
676 #define MSG_SYSKEYUP 0x001A
677 
678 
679 /* keyboard longpress supported */
680 
694 #define MSG_KEYLONGPRESS 0x001B
695 
710 #define MSG_KEYALWAYSPRESS 0x001C
711 
737 #define MSG_KEYSYM 0x001D
738 
761 #define MSG_UTF8CHAR 0x001E
762 
769 #define DEF_LPRESS_TIME 200
770 
777 #define DEF_APRESS_TIME 1000
778 
783 #define DEF_INTERVAL_TIME 200
784 
785 extern DWORD __mg_key_longpress_time;
786 extern DWORD __mg_key_alwayspress_time;
787 extern DWORD __mg_interval_time;
788 
793 #define SetKeyLongPressTime(time) \
794  do { \
795  __mg_key_longpress_time = time; \
796  } while (0)
797 
802 #define SetKeyAlwaysPressTime(time) \
803  do { \
804  __mg_key_alwayspress_time = time; \
805  } while (0)
806 
811 #define SetIntervalTime(time) \
812  do { \
813  __mg_interval_time = time; \
814  } while (0)
815 
816 #define MSG_LASTKEYMSG 0x001F
817 
825 /* Group 3 from 0x0020 to 0x005F, User-machine Interaction messages. */
826 #define MSG_FIRSTPOSTMSG 0x0020
827 
852 #define MSG_SETCURSOR 0x0020
853 
854  #define HT_MASK 0xFF
855 
856  #define HT_UNKNOWN 0x00
857  #define HT_OUT 0x01
858  #define HT_MENUBAR 0x02
859  #define HT_TRANSPARENT 0x03
860 
861  #define HT_BORDER 0x04
862  #define HT_CLIENT 0x0C
863 
864  #define HT_NEEDCAPTURE 0x10
865  #define HT_ICON 0x14
866  #define HT_CLOSEBUTTON 0x15
867  #define HT_MAXBUTTON 0x16
868  #define HT_MINBUTTON 0x17
869  #define HT_HSCROLL 0x18
870  #define HT_VSCROLL 0x19
871 
872  #define HT_DRAGGABLE 0x20
873  #define HT_CAPTION 0x20
874 
875  /*indicate cursor at border */
876  #define HT_BORDER_MASK 0x28
877  #define HT_BORDER_TOP 0x28
878  #define HT_BORDER_BOTTOM 0x29
879  #define HT_BORDER_LEFT 0x2A
880  #define HT_BORDER_RIGHT 0x2B
881 
882  /*indicate cursor at border corner*/
883  #define HT_CORNER_MASK 0x2C
884  #define HT_CORNER_TL 0x2C
885  #define HT_CORNER_TR 0x2D
886  #define HT_CORNER_BL 0x2E
887  #define HT_CORNER_BR 0x2F
888 
889  /*new scrollbar hittest value
890  * can be AND'ed with HT_NEEDCAPTURE*/
891  #define HT_SB_MASK 0x50
892 
893  #define HT_SB_LEFTARROW 0x50
894  #define HT_SB_RIGHTARROW 0x51
895  #define HT_SB_LEFTSPACE 0x52
896  #define HT_SB_RIGHTSPACE 0x53
897  #define HT_SB_HTHUMB 0x54
898 
899  #define HT_SB_VMASK 0x58
900 
901  #define HT_SB_UPARROW 0x58
902  #define HT_SB_DOWNARROW 0x59
903  #define HT_SB_UPSPACE 0x5a
904  #define HT_SB_DOWNSPACE 0x5b
905  #define HT_SB_VTHUMB 0x5c
906 
907  #define HT_SB_UNKNOWN 0x5f
908 
909 /*user defined hittest code are 0x80 ~ 0x8F*/
910 #define HT_USER_MASK 0x80
911 
912 
918 #define MSG_NCHITTEST 0x0021
919 
926 #define MSG_HITTEST MSG_NCHITTEST
927 
932 #define MSG_CHANGESIZE 0x0022
933 
934 /* reserved */
935 #define MSG_QUERYNCRECT 0x0023
936 
941 #define MSG_QUERYCLIENTAREA 0x0024
942 
966 #define MSG_SIZECHANGING 0x0025
967 
990 #define MSG_SIZECHANGED 0x0026
991 
1008 #define MSG_CSIZECHANGED 0x0027
1009 
1020 #define MSG_SETFOCUS 0x0030
1021 
1032 #define MSG_KILLFOCUS 0x0031
1033 
1042 #define MSG_MOUSEACTIVE 0x0032
1043 
1052 #define MSG_ACTIVE 0x0033
1053 
1058 #define MSG_CHILDHIDDEN 0x0034
1059  #define RCTM_CLICK 1
1060  #define RCTM_KEY 2
1061  #define RCTM_MESSAGE 3
1062  #define RCTM_SHOWCTRL 4
1063 
1088 #define MSG_ACTIVEMENU 0x0040
1089 
1107 #define MSG_DEACTIVEMENU 0x0041
1108 
1119 #define SB_LINEUP 0x01a
1120 
1126 #define SB_LINEDOWN 0x02
1127 
1133 #define SB_LINELEFT 0x03
1134 
1140 #define SB_LINERIGHT 0x04
1141 
1147 #define SB_PAGEUP 0x05
1148 
1154 #define SB_PAGEDOWN 0x06
1155 
1161 #define SB_PAGELEFT 0x07
1162 
1168 #define SB_PAGERIGHT 0x08
1169 
1175 #define SB_THUMBPOSITION 0x09
1176 
1182 #define SB_THUMBTRACK 0x0A
1183 
1189 #define SB_TOP 0x0B
1190 
1196 #define SB_BOTTOM 0x0C
1197 
1203 #define SB_ENDSCROLL 0x0D
1204 
1235 #define MSG_HSCROLL 0x0042
1236 
1265 #define MSG_VSCROLL 0x0043
1266 
1279 #define MSG_NCSETCURSOR 0x0044
1280 
1296 #define MSG_MOUSEMOVEIN 0x0050
1297 
1303 #define MSG_WINDOWDROPPED 0x0051
1304 
1305 #define MSG_LASTPOSTMSG 0x005F
1306 
1314  /* Group 4 from 0x0060 to 0x007F, the creation messages. */
1315 #define MSG_FIRSTCREATEMSG 0x0060
1316 
1352 #define MSG_CREATE 0x0060
1353 
1382 #define MSG_NCCREATE 0x0061
1383 
1384 /*Not use*/
1385 #define MSG_INITPANES 0x0062
1386 #define MSG_DESTROYPANES 0x0063
1387 
1401 #define MSG_DESTROY 0x0064
1402 
1403 /* Not use */
1404 #define MSG_NCDESTROY 0x0065
1405 
1413 #define MSG_CLOSE 0x0066
1414 
1415 /* Not use */
1416 #define MSG_NCCALCSIZE 0x0067
1417 
1418 /*
1419  * Not implemented, this message is reserved for future use.
1420  *
1421  * \def MSG_MAXIMIZE
1422  * \brief Indicates the user has clicked the maximizing box on the caption.
1423  *
1424  * This message is sent to the window when the user has clicked the maximizing
1425  * box on the caption of the window.
1426  */
1427 #define MSG_MAXIMIZE 0x0068
1428 
1429 /*
1430  * Not implemented, this message is reserved for future use.
1431  *
1432  * \def MSG_MINIMIZE
1433  * \brief Indicates the user has clicked the minimizing box on the caption.
1434  *
1435  * This message is sent to the window when the user has clicked the
1436  * minimizing box on the caption of the window.
1437  */
1438 #define MSG_MINIMIZE 0x0069
1439 
1440 /*
1441  * Not implemented, this message is reserved for future use.
1442  *
1443  * \def MSG_HELP
1444  * \brief Indicates the user has clicked the help box on the caption.
1445  *
1446  * This message is sent to the window when the user has clicked the
1447  * help box on the caption of the window.
1448  */
1449 #define MSG_HELP 0x006A
1450 
1460 #define MSG_GESTURETEST 0x006B
1461 
1462 #define MSG_LASTCREATEMSG 0x006F
1463 
1492  /* Group 4 from 0x0070 to 0x009F, the extra input messages. */
1493 #define MSG_FIRSTEXTRAINPUTMSG 0x0070
1494 
1495 #define AXIS_SCROLL_INVALID 0
1496 #define AXIS_SCROLL_VERTICAL 1
1497 #define AXIS_SCROLL_HORIZONTAL 2
1498 
1499 #define AXIS_SOURCE_INVALID 0
1500 #define AXIS_SOURCE_WHEEL 1
1501 #define AXIS_SOURCE_FINGER 2
1502 #define AXIS_SOURCE_CONTINUOUS 3
1503 #define AXIS_SOURCE_WHEEL_TILT 4
1504 
1526 #define MSG_EXIN_AXIS 0x0070
1527 
1546 #define MSG_EXIN_BUTTONDOWN 0x0071
1547 
1566 #define MSG_EXIN_BUTTONUP 0x0072
1567 
1580 #define MSG_EXIN_TOUCH_DOWN 0x0073
1581 
1588 #define MSG_EXIN_TOUCH_UP 0x0074
1589 
1602 #define MSG_EXIN_TOUCH_MOTION 0x0075
1603 
1610 #define MSG_EXIN_TOUCH_CANCEL 0x0076
1611 
1630 #define MSG_EXIN_TOUCH_FRAME 0x0077
1631 
1632 #define SWITCH_INVALID 0
1633 #define SWITCH_LID 1
1634 #define SWITCH_TABLET_MODE 2
1635 
1636 #define SWITCH_STATE_INVALID 0
1637 #define SWITCH_STATE_ON 1
1638 #define SWITCH_STATE_OFF 2
1639 
1655 #define MSG_EXIN_SWITCH_TOGGLE 0x007A
1656 
1668 #define MSG_EXIN_GESTURE_SWIPE_BEGIN 0x0080
1669 
1685 #define MSG_EXIN_GESTURE_SWIPE_UPDATE 0x0081
1686 
1700 #define MSG_EXIN_GESTURE_SWIPE_END 0x0082
1701 
1718 #define MSG_EXIN_GESTURE_PINCH_BEGIN 0x0083
1719 
1741 #define MSG_EXIN_GESTURE_PINCH_UPDATE 0x0084
1742 
1761 #define MSG_EXIN_GESTURE_PINCH_END 0x0085
1762 
1775 #define MSG_EXIN_END_CHANGES 0x008F
1776 
1777 #define TABLET_TOOL_X 0
1778 #define TABLET_TOOL_Y 1
1779 #define TABLET_TOOL_PRESSURE 2
1780 #define TABLET_TOOL_DISTANCE 3
1781 #define TABLET_TOOL_TILT_X 4
1782 #define TABLET_TOOL_TILT_Y 5
1783 #define TABLET_TOOL_ROTATION 6
1784 #define TABLET_TOOL_SLIDER 7
1785 #define TABLET_TOOL_SIZE_MAJOR 8
1786 #define TABLET_TOOL_SIZE_MINOR 9
1787 #define TABLET_TOOL_WHEEL 10
1788 
1789 #define TABLET_TOOL_PROXIMITY_STATE_INVALID 0
1790 #define TABLET_TOOL_PROXIMITY_STATE_OUT 1
1791 #define TABLET_TOOL_PROXIMITY_STATE_IN 2
1792 
1793 #define TABLET_TOOL_TIP_INVALID 0
1794 #define TABLET_TOOL_TIP_UP 1
1795 #define TABLET_TOOL_TIP_DOWN 2
1796 
1797 #define TABLET_BUTTON_STATE_INVALID 0
1798 #define TABLET_BUTTON_STATE_RELEASED 1
1799 #define TABLET_BUTTON_STATE_PRESSED 2
1800 
1849 #define MSG_EXIN_TABLET_TOOL_AXIS 0x0090
1850 
1872 #define MSG_EXIN_TABLET_TOOL_PROXIMITY 0x0091
1873 
1895 #define MSG_EXIN_TABLET_TOOL_TIP 0x0092
1896 
1912 #define MSG_EXIN_TABLET_TOOL_BUTTON 0x0093
1913 
1931 #define MSG_EXIN_TABLET_PAD_BUTTON 0x0094
1932 
1933 #define TABLET_PAD_RING_SOURCE_UNKNOWN 0
1934 #define TABLET_PAD_RING_SOURCE_FINGER 1
1935 
1959 #define MSG_EXIN_TABLET_PAD_RING 0x0095
1960 
1961 #define TABLET_PAD_STRIP_SOURCE_UNKNOWN 0
1962 #define TABLET_PAD_STRIP_SOURCE_FINGER 1
1963 
1986 #define MSG_EXIN_TABLET_PAD_STRIP 0x0096
1987 
2001 #define MSG_EXIN_USER_BEGIN 0x009A
2002 
2016 #define MSG_EXIN_USER_UPDATE 0x009B
2017 
2031 #define MSG_EXIN_USER_END 0x009C
2032 
2033 #define MSG_LASTEXTRAINPUTMSG 0x009F
2034 
2042 /* Group 5 from 0x00A0 to 0x00CF, the paint messages. */
2043 #define MSG_FIRSTPAINTMSG 0x00A0
2044 
2069 #define MSG_SHOWWINDOW 0x00A0
2070 
2092 #define MSG_MOVEWINDOW 0x00A1
2093 
2112 #define MSG_ERASEBKGND 0x00B0 /* this is an async message */
2113 
2127 #define MSG_PAINT 0x00B1
2128 
2144 #define MSG_NCPAINT 0x00B2
2145 
2150 #define MSG_NCACTIVATE 0x00B3
2151 
2156 #define MSG_SYNCPAINT 0x00B4
2157 
2158 #define MSG_LASTPAINTMSG 0x00BF
2159 
2167 /* Group 6 from 0x00C0 to 0x00EF, the internal desktop messages. */
2168 #define MSG_FIRSTSESSIONMSG 0x00C0
2169 
2170 #define MSG_STARTSESSION 0x00C0
2171 #define MSG_QUERYENDSESSION 0x00C1
2172 #define MSG_ENDSESSION 0x00C2
2173 #define MSG_REINITSESSION 0x00C3
2174 
2175 /* Since 5.0.0 */
2176 #define MSG_REINITDESKOPS 0x00C4
2177 
2178 #define MSG_ERASEDESKTOP 0x00CE
2179 #define MSG_PAINTDESKTOP 0x00CF
2180 
2181 #define MSG_DT_MOUSEOFF 0x00D0
2182 
2200 #define MSG_DT_LBUTTONDOWN 0x00D1
2201 
2219 #define MSG_DT_LBUTTONUP 0x00D2
2220 
2238 #define MSG_DT_LBUTTONDBLCLK 0x00D3
2239 
2257 #define MSG_DT_MOUSEMOVE 0x00D4
2258 
2277 #define MSG_DT_RBUTTONDOWN 0x00D5
2278 
2296 #define MSG_DT_RBUTTONUP 0x00D6
2297 
2315 #define MSG_DT_RBUTTONDBLCLK 0x00D7
2316 
2335 #define MSG_DT_MBUTTONDOWN 0x00D8
2336 
2354 #define MSG_DT_MBUTTONUP 0x00D9
2355 
2373 #define MSG_DT_MBUTTONDBLCLK 0x00DA
2374 
2375 #define MSG_DT_KEYOFF 0x00CB
2376 
2394 #define MSG_DT_KEYDOWN 0x00E0
2395 
2396 #define MSG_DT_CHAR 0x00E1
2397 
2414 #define MSG_DT_KEYUP 0x00E2
2415 
2416 #define MSG_DT_SYSKEYDOWN 0x00E3
2417 #define MSG_DT_SYSCHAR 0x00E4
2418 #define MSG_DT_SYSKEYUP 0x00E5
2419 
2420 #define MSG_DT_KEYLONGPRESS 0x00E6
2421 #define MSG_DT_KEYALWAYSPRESS 0x00E7
2422 
2423 #define MSG_LASTSESSIONMSG 0x00EF
2424 
2432 /* Group 7 from 0x00F0 to 0x010F, Internal window management messages. */
2433 #define MSG_FIRSTWINDOWMSG 0x00F0
2434 
2435 #define MSG_ADDNEWMAINWIN 0x00F0
2436 #define MSG_REMOVEMAINWIN 0x00F1
2437 #define MSG_MOVETOTOPMOST 0x00F2
2438 #define MSG_SETACTIVEMAIN 0x00F3
2439 #define MSG_GETACTIVEMAIN 0x00F4
2440 #define MSG_SHOWMAINWIN 0x00F5
2441 #define MSG_HIDEMAINWIN 0x00F6
2442 #define MSG_MOVEMAINWIN 0x00F7
2443 #define MSG_SETCAPTURE 0x00F8
2444 #define MSG_GETCAPTURE 0x00F9
2445 
2446 #define MSG_ENDTRACKMENU 0x00FA
2447 #define MSG_TRACKPOPUPMENU 0x00FB
2448 #define MSG_CLOSEMENU 0x00FC
2449 #define MSG_SCROLLMAINWIN 0x00FD
2450 #define MSG_CARET_CREATE 0x00FE
2451 #define MSG_CARET_DESTROY 0x00FF
2452 
2453 #define MSG_ENABLEMAINWIN 0x0100
2454 #define MSG_ISENABLED 0x0101
2455 
2456 #define MSG_SETWINCURSOR 0x0102
2457 
2458 #define MSG_GETNEXTMAINWIN 0x0103
2459 
2460 /* Since 5.0.0 */
2461 #define MSG_SETALWAYSTOP 0x0104
2462 
2463 typedef struct _COMPOSITINGINFO {
2464  int type;
2465  DWORD arg;
2466 } COMPOSITINGINFO;
2467 
2468 /* Since 5.0.0 */
2469 #define MSG_SETCOMPOSITING 0x0105
2470 
2471 /* Since 5.0.0 */
2472 #define MSG_DUMPZORDER 0x0106
2473 
2474 /* Since 5.0.0 */
2475 #define MSG_SETAUTOREPEAT 0x0107
2476 
2477 /* Since 5.0.6 */
2478 #define MSG_SETGESTUREFLAGS 0x0108
2479 
2480 #define MSG_SHOWGLOBALCTRL 0x010A
2481 #define MSG_HIDEGLOBALCTRL 0x010B
2482 
2483 typedef struct _DRAGINFO {
2484  int location;
2485  int init_x, init_y;
2486 } DRAGINFO;
2487 
2488 /* client to server; wParam: hwnd, lParam: DRAGINFO. */
2489 #define MSG_STARTDRAGWIN 0x010C
2490 /* client to server; wParam: hwnd, lParam: 0L. */
2491 #define MSG_CANCELDRAGWIN 0x010D
2492 
2493 #define MSG_CHANGECAPTION 0x010E
2494 
2495 struct _RECT4MASK;
2496 typedef struct _WINMASKINFO {
2497  int nr_rcs;
2498  struct _RECT4MASK* rcs;
2499 } WINMASKINFO;
2500 
2501 /* Since 5.0.0 */
2502 #define MSG_SETWINDOWMASK 0x010F
2503 
2504 #define MSG_LASTWINDOWMSG 0x010F
2505 
2513 /* Group 8 from 0x0120 to 0x013F, the dialog and control messages. */
2514 #define MSG_FIRSTCONTROLMSG 0x0120
2515 
2547 #define MSG_COMMAND 0x0120
2548 
2553 #define MSG_SYSCOMMAND 0x0121
2554 
2559 #define MSG_GETDLGCODE 0x0122
2560 
2587 #define MSG_INITDIALOG 0x0123
2588 
2589 /*Reserved*/
2590 #define MSG_NEXTDLGCTRL 0x0124
2591 #define MSG_ENTERIDLE 0x0125
2592 
2597 #define MSG_DLG_GETDEFID 0x0126
2598 
2603 #define MSG_DLG_SETDEFID 0x0127
2604 
2605 /* #define MSG_DLG_REPOSITION 0x0128 */
2606 
2613 #define MSG_ISDIALOG 0x0128
2614 
2632 #define MSG_INITPAGE 0x0129
2633 
2654 #define MSG_SHOWPAGE 0x012A
2655 
2675 #define MSG_SHEETCMD 0x012B
2676 
2696 #define MSG_INITCONTAINER 0x012C
2697 
2726 #define MSG_SVCONTCMD 0x012D
2727 
2746 #define MSG_FREEZECTRL 0x012E
2747 
2766 #define MSG_FONTCHANGING 0x0130
2767 
2768 
2776 #define MSG_FONTCHANGED 0x0131
2777 
2797 #define MSG_GETTEXTLENGTH 0x0132
2798 
2822 #define MSG_GETTEXT 0x0133
2823 
2846 #define MSG_SETTEXT 0x0134
2847 
2861 #define MSG_ENABLE 0x0135
2862 
2886 #define MSG_NOTIFICATION 0x0136
2887 
2888 #define MSG_LASTCONTROLMSG 0x013F
2889 
2897 /* Group 9 from 0x0140 to 0x016F, the system messages. */
2898 #define MSG_FIRSTSYSTEMMSG 0x0140
2899 
2900 #define MSG_QUIT 0x0140
2901 
2909 #define MSG_IDLE 0x0142
2910 
2911 #define MSG_TIMEOUT 0x0143
2912 
2928 #define MSG_TIMER 0x0144
2929 
2930 #define MSG_CARETBLINK 0x0145
2931 
2932 #ifdef HAVE_SELECT
2933 
2963 #define MSG_FDEVENT 0x0146
2964 
2965 #endif /* defined HAVE_SELECT */
2966 
2967 #ifdef _MGRM_PROCESSES
2968 
2982 #define MSG_SRVNOTIFY 0x0147
2983 
2984 #define MSG_UPDATECLIWIN 0x0148
2985 
2986 /* Since 5.0.0; the server send this message to the client
2987  if the client moved to a new layer */
2988 #define MSG_LAYERCHANGED 0x0149
2989 
2990 #endif /* defined _MGRM_PROCESSES */
2991 
2992 /* Since 5.0.0: for managing message thread */
2993 #define MSG_MANAGE_MSGTHREAD 0x014A
2994  #define MSGTHREAD_SIGNIN 0x00
2995  #define MSGTHREAD_SIGNOUT 0x01
2996 
2997 /* Since 5.0.0: for calculating the default position */
2998 #define MSG_CALC_POSITION 0x014B
2999 
3000 /* Since 5.0.6: for waking up the client */
3001 #define MSG_WAKEUP_CLIENT 0x014C
3002 
3016 #define MSG_DOESNEEDIME 0x0150
3017 
3018 /* flag code. */
3019 #define IME_STATUS_REGISTERED 0x0000
3020 #define IME_STATUS_ENABLED 0x0001
3021 #define IME_STATUS_AUTOTRACK 0x0002
3022 #define IME_STATUS_LANGUAGE 0x0003
3023  #define IME_LANGUAGE_UNKNOWN 0x0000
3024  #define IME_LANGUAGE_LATIN 0x0001
3025  #define IME_LANGUAGE_ZHCN 0x0002
3026  #define IME_LANGUAGE_ZHTW 0x0003
3027 #define IME_STATUS_ENCODING 0x0004
3028  #define IME_ENCODING_LOCAL 0x0000
3029  #define IME_ENCODING_UTF8 0x0001
3030 #define IME_STATUS_VERSION 0x0005
3031 #define IME_STATUS_USER_MIN 0x0006
3032 #define IME_STATUS_USER_MAX 0x0020
3033 
3034 /* IME edit type */
3035 #define IME_WINDOW_TYPE_NOT_EDITABLE 0x0000
3036 #define IME_WINDOW_TYPE_EDITABLE 0x0001
3037 #define IME_WINDOW_TYPE_READONLY 0x0002
3038 #define IME_WINDOW_TYPE_PASSWORD 0x0003
3039 
3040 /*Internal use*/
3041 #define MSG_IME_REGISTER 0x0151
3042 #define MSG_IME_UNREGISTER 0x0152
3043 #define MSG_IME_OPEN 0x0153
3044 #define MSG_IME_CLOSE 0x0154
3045 #define MSG_IME_SETSTATUS 0x0156
3046 #define MSG_IME_GETSTATUS 0x0157
3047 #define MSG_IME_SETTARGET 0x0158
3048 #define MSG_IME_GETTARGET 0x0159
3049 #define MSG_IME_SETPOS 0x015A
3050 #define MSG_IME_GETPOS 0x015B
3051 
3052 /* new ime msg. */
3053 #define MSG_IME_SET_TARGET_INFO 0x015C
3054 #define MSG_IME_GET_TARGET_INFO 0x015D
3055 
3056 #define MSG_SHOWMENU 0x0160
3057 #define MSG_HIDEMENU 0x0161
3058 
3059 #define MSG_ADDTIMER 0x0162
3060 #define MSG_REMOVETIMER 0x0163
3061 #define MSG_RESETTIMER 0x0164
3062 
3063 #define MSG_WINDOWCHANGED 0x0165
3064 
3065 #define MSG_BROADCASTMSG 0x0166
3066 
3067 #define MSG_REGISTERWNDCLASS 0x0167
3068 #define MSG_UNREGISTERWNDCLASS 0x0168
3069 #define MSG_NEWCTRLINSTANCE 0x0169
3070 #define MSG_REMOVECTRLINSTANCE 0x016A
3071 #define MSG_GETCTRLCLASSINFO 0x016B
3072 #define MSG_CTRLCLASSDATAOP 0x016C
3073  #define CCDOP_GETCCI 0x01
3074  #define CCDOP_SETCCI 0x02
3075 
3076 #define MSG_REGISTERHOOKFUNC 0x016D
3077 #define MSG_REGISTERHOOKWIN 0x016E
3078 #define MSG_UNREGISTERHOOKWIN 0x016F
3079 
3080 #define MSG_LASTSYSTEMMSG 0x016F
3081 
3089 /* Group 10 from 0x0170 to 0x018F, the menu messages */
3090 #define MSG_FIRSTMENUMSG 0x0170
3091 
3092 /*Internal use*/
3093 #define MSG_INITMENU 0x0170
3094 #define MSG_INITMENUPOPUP 0x0171
3095 #define MSG_MENUSELECT 0x0172
3096 #define MSG_MENUCHAR 0x0173
3097 #define MSG_ENTERMENULOOP 0x0174
3098 #define MSG_EXITMENULOOP 0x0175
3099 #define MSG_CONTEXTMENU 0x0176
3100 #define MSG_NEXTMENU 0x0177
3101 
3102 #define MSG_LASTMENUMSG 0x018F
3103 
3111 #define MSG_FIRSTUSERMSG 0x0800
3112 
3113 
3121 #define MSG_USER 0x0800
3122 
3123 #define MSG_LASTUSERMSG 0xEFFF
3124 
3148 typedef struct _MSG
3149 {
3163 #ifdef _MGHAVE_VIRTUAL_WINDOW
3164  /* pointer to the sync MSG (internal use) */
3165  void* pSyncMsg;
3166 #endif
3167 } MSG;
3168 typedef MSG* PMSG;
3169 
3175 #define PM_NOREMOVE 0x0000
3176 
3182 #define PM_REMOVE 0x0001
3183 
3189 #define PM_NOYIELD 0x0002
3190 
3218 MG_EXPORT BOOL GUIAPI PeekMessageEx (PMSG pMsg, HWND hWnd,
3219  UINT nMsgFilterMin, UINT nMsgFilterMax,
3220  BOOL bWait, UINT uRemoveMsg);
3221 
3240 static inline BOOL GUIAPI GetMessage (PMSG pMsg, HWND hWnd)
3241 {
3242  return PeekMessageEx (pMsg, hWnd, 0, 0, TRUE, PM_REMOVE);
3243 }
3244 
3261 MG_EXPORT BOOL GUIAPI WaitMessage (PMSG pMsg, HWND hMainWnd);
3262 
3277 MG_EXPORT BOOL GUIAPI HavePendingMessage (HWND hMainWnd);
3278 
3305 static inline BOOL GUIAPI PeekMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
3306  UINT nMsgFilterMax, UINT uRemoveMsg)
3307 {
3308  return PeekMessageEx (pMsg, hWnd, nMsgFilterMin, nMsgFilterMax,
3309  FALSE, uRemoveMsg);
3310 }
3311 
3338 MG_EXPORT BOOL GUIAPI PeekPostMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
3339  UINT nMsgFilterMax, UINT uRemoveMsg);
3340 
3362 MG_EXPORT int GUIAPI PostMessage (HWND hWnd, UINT nMsg,
3363  WPARAM wParam, LPARAM lParam);
3364 
3393 MG_EXPORT LRESULT GUIAPI SendMessage (HWND hWnd, UINT nMsg,
3394  WPARAM wParam, LPARAM lParam);
3395 
3411 MG_EXPORT void GUIAPI SetAutoRepeatMessage (HWND hwnd, UINT msg,
3412  WPARAM wParam, LPARAM lParam);
3413 
3414 #ifdef _MGRM_PROCESSES
3415 
3416 #define CLIENTS_TOPMOST -1
3417 #define CLIENTS_ALL -2
3418 #define CLIENTS_EXCEPT_TOPMOST -3
3419 #define CLIENT_ACTIVE -4
3420 
3451 int GUIAPI Send2Client (const MSG* msg, int cli);
3452 
3472 BOOL GUIAPI Send2TopMostClients (UINT nMsg, WPARAM wParam, LPARAM lParam);
3473 
3494 BOOL GUIAPI Send2ActiveWindow (const MG_Layer* layer,
3495  UINT nMsg, WPARAM wParam, LPARAM lParam);
3496 
3497 #endif /* _MGRM_PROCESSES */
3498 
3499 #ifdef _MGHAVE_VIRTUAL_WINDOW
3500 
3522 MG_EXPORT LRESULT GUIAPI PostSyncMessage (HWND hWnd, UINT nMsg,
3523  WPARAM wParam, LPARAM lParam);
3524 
3547 MG_EXPORT LRESULT GUIAPI SendAsyncMessage (HWND hWnd, UINT nMsg,
3548  WPARAM wParam, LPARAM lParam);
3549 
3550 #else /* defined _MGHAVE_VIRTUAL_WINDOW */
3551 
3559 #define SendAsyncMessage SendMessage
3560 
3561 #endif /* not defined _MGHAVE_VIRTUAL_WINDOW */
3562 
3582 MG_EXPORT int GUIAPI SendNotifyMessage (HWND hWnd, UINT nMsg,
3583  WPARAM wParam, LPARAM lParam);
3584 
3604 MG_EXPORT int GUIAPI SendPriorNotifyMessage (HWND hWnd, UINT nMsg,
3605  WPARAM wParam, LPARAM lParam);
3606 
3633 MG_EXPORT int GUIAPI NotifyWindow (HWND hWnd, LINT id, int code,
3634  DWORD dwAddData);
3635 
3650 MG_EXPORT int GUIAPI BroadcastMessage (UINT nMsg, WPARAM wParam, LPARAM lParam);
3651 
3652 #ifdef _MGHAVE_VIRTUAL_WINDOW
3653 
3674 MG_EXPORT int GUIAPI BroadcastMessageInThisThread (UINT nMsg,
3675  WPARAM wParam, LPARAM lParam);
3676 
3677 #else /* defined _MGHAVE_VIRTUAL_WINDOW */
3678 
3679 #define BroadcastMessageInThisThread BroadcastMessage
3680 
3681 #endif /* not defined _MGHAVE_VIRTUAL_WINDOW */
3682 
3695 MG_EXPORT int GUIAPI PostQuitMessage (HWND hWnd);
3696 
3697 #define KBD_LAYOUT_DEFAULT "default"
3698 #define KBD_LAYOUT_FRPC "frpc"
3699 #define KBD_LAYOUT_FR "fr"
3700 #define KBD_LAYOUT_DE "de"
3701 #define KBD_LAYOUT_DELATIN1 "delatin1"
3702 #define KBD_LAYOUT_IT "it"
3703 #define KBD_LAYOUT_ES "es"
3704 #define KBD_LAYOUT_ESCP850 "escp850"
3705 #define KBD_LAYOUT_HEBREW "hebrew"
3706 #define KBD_LAYOUT_ARABIC "arabic"
3707 
3745 MG_EXPORT BOOL GUIAPI SetKeyboardLayout (const char* kbd_layout);
3746 
3747 #ifdef _MGCHARSET_UNICODE
3748 
3749 MG_EXPORT int GUIAPI ToUnicode (UINT keycode, const BYTE* kbd_state,
3750  wchar_t* wcs, int wcs_len, const char* kbd_layout);
3751 
3752 MG_EXPORT int GUIAPI ToAscii (UINT keycode, const BYTE* kbd_state,
3753  WORD* ch, const char* kbd_layout);
3754 
3755 #endif /* _MGCHARSET_UNICODE */
3756 
3777 MG_EXPORT BOOL GUIAPI TranslateMessage (PMSG pMsg);
3778 
3801 MG_EXPORT BOOL GUIAPI TranslateKeyMsgToChar (int message,
3802  WPARAM wParam, LPARAM lParam, WORD *ch);
3803 
3820 MG_EXPORT LRESULT GUIAPI DispatchMessage (PMSG pMsg);
3821 
3834 MG_EXPORT int GUIAPI ThrowAwayMessages (HWND pMainWnd);
3835 
3849 MG_EXPORT BOOL GUIAPI EmptyMessageQueue (HWND hWnd);
3850 
3851 #ifdef _MGHAVE_MSG_STRING
3852 
3867 MG_EXPORT const char* GUIAPI Message2Str (UINT message);
3868 
3885 MG_EXPORT void GUIAPI PrintMessage (FILE* fp, HWND hWnd,
3886  UINT nMsg, WPARAM wParam, LPARAM lParam);
3887 
3888 #endif /* defined _MGHAVE_MSG_STRING */
3889 
3892 #ifdef HAVE_SELECT
3893 
3924 #define MAX_NR_LISTEN_FD 4
3925 
3926 #ifdef WIN32
3927 #ifndef POLLIN
3928 #define POLLIN 0x001
3929 #endif
3930 
3931 #ifndef POLLOUT
3932 #define POLLOUT 0x004
3933 #endif
3934 
3935 #ifndef POLLERR
3936 #define POLLERR 0x008
3937 #endif
3938 
3939 #endif /* WIN32 */
3940 
3967 MG_EXPORT BOOL GUIAPI RegisterListenFD (int fd, int type,
3968  HWND hwnd, void* context);
3969 
3984 MG_EXPORT BOOL GUIAPI UnregisterListenFD (int fd);
3985 
3988 #endif /* defined HAVE_SELECT */
3989 
3995 #define HOOK_OP_MASK 0x00FF
3996 #define HOOK_GOON 0x0000
3997 #define HOOK_STOP 0x0001
3998 
3999 #define HOOK_EVENT_MASK 0xFF00
4000 #define HOOK_EVENT_KEY 0x0100
4001 #define HOOK_EVENT_MOUSE 0x0200
4002 #define HOOK_EVENT_EXTRA 0x0400
4003 
4004 
4026 typedef int (* MSGHOOK) (void* context, HWND dst_wnd,
4027  UINT msg, WPARAM wparam, LPARAM lparam);
4028 
4061 MG_EXPORT MSGHOOK GUIAPI RegisterEventHookFunc (int event_type,
4062  MSGHOOK hook, void* context);
4063 
4080 static inline MSGHOOK GUIAPI RegisterKeyMsgHook (void* context, MSGHOOK hook)
4081 {
4082  return RegisterEventHookFunc (HOOK_EVENT_KEY, hook, context);
4083 }
4084 
4101 static inline MSGHOOK GUIAPI RegisterMouseMsgHook (void* context, MSGHOOK hook)
4102 {
4103  return RegisterEventHookFunc (HOOK_EVENT_MOUSE, hook, context);
4104 }
4105 
4138 MG_EXPORT BOOL GUIAPI RegisterEventHookWindow (HWND hwnd, DWORD flags);
4139 
4155 MG_EXPORT BOOL GUIAPI UnregisterEventHookWindow (HWND hwnd);
4156 
4174 MG_EXPORT HWND GUIAPI RegisterKeyHookWindow (HWND hwnd, DWORD flag);
4175 
4193 MG_EXPORT HWND GUIAPI RegisterMouseHookWindow (HWND hwnd, DWORD flag);
4194 
4195 #ifndef _MGRM_THREADS
4196 
4213 typedef int (* SRVEVTHOOK) (PMSG pMsg);
4214 
4233 MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
4234 
4235 #endif /* not defined _MGRM_THREADS */
4236 
4248 #define WS_CTRLMASK 0x0000FFFFL
4249 
4254 #define WS_NONE 0x00000000L
4255 
4256 /* bits in this mask are only for main windows */
4257 #define WS_CAPTIONBAR_MASK 0xF0000000L
4258 
4264 #define WS_MINIMIZEBOX 0x80000000L
4265 
4271 #define WS_MAXIMIZEBOX 0x40000000L
4272 
4277 #define WS_CAPTION 0x20000000L
4278 
4283 #define WS_SYSMENU 0x10000000L
4284 
4285 /* bits in this mask are both for main windows and controls */
4286 #define WS_STATUS_MASK 0x0F000000L
4287 
4292 #define WS_VISIBLE 0x08000000L
4293 
4298 #define WS_DISABLED 0x04000000L
4299 
4304 #define WS_VSCROLL 0x02000000L
4305 
4310 #define WS_HSCROLL 0x01000000L
4311 
4312 /* bits in this mask are both for main window and controls */
4313 #define WS_BORDER_MASK 0x00F00000L
4314 
4320 #define WS_DLGFRAME 0x00800000L
4321 
4326 #define WS_THICKFRAME 0x00400000L
4327 
4332 #define WS_THINFRAME 0x00200000L
4333 
4338 #define WS_BORDER 0x00100000L
4339 
4340 /* bits in this mask are reuse for main windows and controls;
4341  bits have different meanings for main windows and controls.*/
4342 #define WS_MISC_MASK 0x000F0000L
4343 
4348 #define WS_CHILD 0x00080000L
4349 
4355 #define WS_GROUP 0x00040000L
4356 
4363 #define WS_TABSTOP 0x00020000L
4364 
4365 /* Main window states -- reserved for future use. */
4366 #define WS_MINIMIZE 0x00040000L
4367 #define WS_MAXIMIZE 0x00020000L
4368 
4375 #define WS_ALWAYSTOP 0x00010000L
4376 
4377 /* Obsolete styles, back-compatibility definitions. */
4378 #define WS_OVERLAPPED 0x00000000L
4379 #define WS_ABSSCRPOS 0x00000000L
4380 
4381 #define WS_MAINWIN_ONLY_MASK (WS_CAPTIONBAR_MASK | WS_ALWAYSTOP)
4382 #define WS_CONTROL_ONLY_MASK (WS_CTRLMASK)
4383 
4388 #define WS_EX_NONE 0x00000000L
4389 
4394 #define WS_EX_CONTROL_MASK 0x0000000FL
4395 
4449 #define WS_EX_WINTYPE_MASK 0x0000000FL
4450 
4464 #define WS_EX_WINTYPE_TOOLTIP 0x00000001L
4465 
4483 #define WS_EX_WINTYPE_GLOBAL 0x00000002L
4484 
4508 #define WS_EX_WINTYPE_SCREENLOCK 0x00000003L
4509 
4534 #define WS_EX_WINTYPE_DOCKER 0x00000004L
4535 
4551 #define WS_EX_WINTYPE_HIGHER 0x00000005L
4552 
4568 #define WS_EX_WINTYPE_NORMAL 0x00000006L
4569 
4594 #define WS_EX_WINTYPE_LAUNCHER 0x00000007L
4595 
4602 #define WS_EX_TROUNDCNS 0x00000010L
4603 
4608 #define WS_EX_BROUNDCNS 0x00000020L
4609 
4616 #define WS_EX_USEPRIVATECDC 0x00000040L
4617 
4622 #define WS_EX_NOTDRAGGABLE 0x00000080L
4623 #define WS_EX_DRAGGABLE 0x00000000L
4624 
4629 #define WS_EX_USEPARENTFONT 0x00000100L
4630 
4635 #define WS_EX_USEPARENTCURSOR 0x00000200L
4636 
4641 #define WS_EX_USEPARENTRDR 0x00000400L
4642 
4649 #define WS_EX_NOPARENTNOTIFY 0x00000800L
4650 
4657 #define WS_EX_AUTOSECONDARYDC 0x00001000L
4658 
4664 #define WS_EX_TRANSPARENT 0x00002000L
4665 
4682 #define WS_EX_TOPMOST 0x00004000L
4683 
4688 #define WS_EX_TOOLWINDOW 0x00008000L
4689 
4690 /* The group reserved for BIDI support */
4691 #define WS_EX_RIGHT 0x00010000L
4692 #define WS_EX_LEFT 0x00000000L
4693 #define WS_EX_RTLREADING 0x00020000L
4694 #define WS_EX_LTRREADING 0x00000000L
4695 
4700 #define WS_EX_LEFTSCROLLBAR 0x00040000L
4701 
4706 #define WS_EX_RIGHTSCROLLBAR 0x00000000L
4707 
4712 #define WS_EX_DLGHIDE 0x00100000L
4713 
4728 #define WS_EX_AUTOPOSITION 0x00200000L
4729 
4734 #define WS_EX_NOCLOSEBOX 0x00400000L
4735 
4740 #define WS_EX_CLIPCHILDREN 0x00800000L
4741 
4746 #define WS_EX_LFRDR_MASK 0x0F000000L
4747 
4753 #define WS_EX_LFRDR_CUSTOM1 0x01000000L
4754 
4761 #define WS_EX_LFRDR_CUSTOM2 0x02000000L
4762 
4769 #define WS_EX_LFRDR_CUSTOM3 0x04000000L
4770 
4777 #define WS_EX_LFRDR_CUSTOM4 0x08000000L
4778 
4779 /* Obsolete style, back-compatibility definitions. */
4780 #define WS_EX_IMECOMPOSE 0x00000000L
4781 
4788 #define WS_EX_INTERNAL_MASK 0xF0000000L
4789 
4806 #define WE_FONTS_NUMBER 4
4807 
4812 #define WE_METRICS_NUMBER 6
4813 
4818 #define WE_COLORS_NUMBER 14
4819 
4820 /* Window type mask */
4821 #define WE_ATTR_TYPE_MASK 0xF000
4822 #define WE_ATTR_TYPE_COLOR_MASK 0x0F00
4823 #define WE_ATTR_INDEX_MASK 0x00FF
4824 
4825 #define WE_ATTR_TYPE_FONT 0x1000
4826 #define WE_ATTR_TYPE_METRICS 0x2000
4827 
4828 #define WE_ATTR_TYPE_COLOR 0x3000
4829 #define WE_ATTR_TYPE_FGC 0x3000
4830 #define WE_ATTR_TYPE_BGCA 0x3100
4831 #define WE_ATTR_TYPE_BGCB 0x3200
4832 
4833 /* window element id */
4834 #define WE_CAPTION 0
4835 #define WE_MENU 1
4836 #define WE_MESSAGEBOX 2
4837 #define WE_TOOLTIP 3
4838 #define WE_WND_BORDER 4
4839 #define WE_SCROLLBAR 5
4840 #define WE_INACTIVE_CAPTION 6
4841 #define WE_WINDOW 7
4842 #define WE_THREED_BODY 8
4843 #define WE_SELECTED_ITEM 9
4844 #define WE_DISABLED_ITEM 10
4845 #define WE_HIGHLIGHT_ITEM 11
4846 #define WE_SIGNIFICANT_ITEM 12
4847 #define WE_DESKTOP 13
4848 
4849 /* window element attr id */
4850 
4851 /* Window caption */
4852 #define WE_FONT_CAPTION (WE_CAPTION | WE_ATTR_TYPE_FONT)
4853 #define WE_METRICS_CAPTION (WE_CAPTION | WE_ATTR_TYPE_METRICS)
4854 #define WE_FGC_ACTIVE_CAPTION (WE_CAPTION | WE_ATTR_TYPE_FGC)
4855 #define WE_BGCA_ACTIVE_CAPTION (WE_CAPTION | WE_ATTR_TYPE_BGCA)
4856 #define WE_BGCB_ACTIVE_CAPTION (WE_CAPTION | WE_ATTR_TYPE_BGCB)
4857 
4858 /* Menu */
4859 #define WE_FONT_MENU (WE_MENU | WE_ATTR_TYPE_FONT)
4860 #define WE_METRICS_MENU (WE_MENU | WE_ATTR_TYPE_METRICS)
4861 #define WE_FGC_MENU (WE_MENU | WE_ATTR_TYPE_FGC)
4862 #define WE_BGC_MENU (WE_MENU | WE_ATTR_TYPE_BGCA)
4863 
4864 /* Message box */
4865 #define WE_FONT_MESSAGEBOX (WE_MESSAGEBOX | WE_ATTR_TYPE_FONT)
4866 #define WE_FGC_MESSAGEBOX (WE_MESSAGEBOX | WE_ATTR_TYPE_FGC)
4867 
4868 /* Tool tips */
4869 #define WE_FONT_TOOLTIP (WE_TOOLTIP | WE_ATTR_TYPE_FONT)
4870 #define WE_FGC_TOOLTIP (WE_TOOLTIP | WE_ATTR_TYPE_FGC)
4871 #define WE_BGC_TOOLTIP (WE_TOOLTIP | WE_ATTR_TYPE_BGCA)
4872 
4873 /* Window border */
4874 #define WE_METRICS_WND_BORDER (WE_WND_BORDER | WE_ATTR_TYPE_METRICS)
4875 #define WE_FGC_ACTIVE_WND_BORDER (WE_WND_BORDER | WE_ATTR_TYPE_FGC)
4876 #define WE_FGC_INACTIVE_WND_BORDER (WE_WND_BORDER | WE_ATTR_TYPE_BGCA)
4877 
4878 /* Scroll bar */
4879 #define WE_METRICS_SCROLLBAR (WE_SCROLLBAR | WE_ATTR_TYPE_METRICS)
4880 
4881 /* Inactive caption */
4882 #define WE_FGC_INACTIVE_CAPTION (WE_INACTIVE_CAPTION | WE_ATTR_TYPE_FGC)
4883 #define WE_BGCA_INACTIVE_CAPTION (WE_INACTIVE_CAPTION | WE_ATTR_TYPE_BGCA)
4884 #define WE_BGCB_INACTIVE_CAPTION (WE_INACTIVE_CAPTION | WE_ATTR_TYPE_BGCB)
4885 
4886 /* Window */
4887 #define WE_FGC_WINDOW (WE_WINDOW | WE_ATTR_TYPE_FGC)
4888 #define WE_BGC_WINDOW (WE_WINDOW | WE_ATTR_TYPE_BGCA)
4889 
4890 /* 3d body */
4891 #define WE_FGC_THREED_BODY (WE_THREED_BODY | WE_ATTR_TYPE_FGC)
4892 #define WE_MAINC_THREED_BODY (WE_THREED_BODY | WE_ATTR_TYPE_BGCA)
4893 
4894 /* Selected items */
4895 #define WE_FGC_SELECTED_ITEM (WE_SELECTED_ITEM | WE_ATTR_TYPE_FGC)
4896 #define WE_BGC_SELECTED_ITEM (WE_SELECTED_ITEM | WE_ATTR_TYPE_BGCA)
4897 #define WE_BGC_SELECTED_LOSTFOCUS (WE_SELECTED_ITEM | WE_ATTR_TYPE_BGCB)
4898 
4899 /* Invalidate items */
4900 #define WE_FGC_DISABLED_ITEM (WE_DISABLED_ITEM | WE_ATTR_TYPE_FGC)
4901 #define WE_BGC_DISABLED_ITEM (WE_DISABLED_ITEM | WE_ATTR_TYPE_BGCA)
4902 
4903 /* Highlight items */
4904 #define WE_FGC_HIGHLIGHT_ITEM (WE_HIGHLIGHT_ITEM | WE_ATTR_TYPE_FGC)
4905 #define WE_BGC_HIGHLIGHT_ITEM (WE_HIGHLIGHT_ITEM | WE_ATTR_TYPE_BGCA)
4906 
4907 /* Significant items */
4908 #define WE_FGC_SIGNIFICANT_ITEM (WE_SIGNIFICANT_ITEM | WE_ATTR_TYPE_FGC)
4909 #define WE_BGC_SIGNIFICANT_ITEM (WE_SIGNIFICANT_ITEM | WE_ATTR_TYPE_BGCA)
4910 
4911 /* Desktop */
4912 #define WE_BGC_DESKTOP (WE_DESKTOP | WE_ATTR_TYPE_BGCA)
4913 
4914 #define WE_ATTR_TYPE_ICON 0x4000
4915 #define WE_ATTR_TYPE_ICON_MASK 0x0F00
4916 #define WE_ATTR_TYPE_SMALLICON 0x4000
4917 #define WE_ATTR_TYPE_LARGEICON 0x4100
4918 
4919 #define WE_LARGEICON_APPLICATION (WE_ATTR_TYPE_LARGEICON | 0x00)
4920 #define WE_LARGEICON_HAND (WE_ATTR_TYPE_LARGEICON | 0x01)
4921 #define WE_LARGEICON_QUESTION (WE_ATTR_TYPE_LARGEICON | 0x02)
4922 #define WE_LARGEICON_EXCLAMATION (WE_ATTR_TYPE_LARGEICON | 0x03)
4923 #define WE_LARGEICON_ASTERISK (WE_ATTR_TYPE_LARGEICON | 0x04)
4924 #define WE_LARGEICON_STOP WE_LARGEICON_HAND
4925 #define WE_LARGEICON_INFORMATION WE_LARGEICON_ASTERISK
4926 
4927 #define WE_SMALLICON_APPLICATION (WE_ATTR_TYPE_SMALLICON | 0x00)
4928 #define WE_SMALLICON_HAND (WE_ATTR_TYPE_SMALLICON | 0x01)
4929 #define WE_SMALLICON_QUESTION (WE_ATTR_TYPE_SMALLICON | 0x02)
4930 #define WE_SMALLICON_EXCLAMATION (WE_ATTR_TYPE_SMALLICON | 0x03)
4931 #define WE_SMALLICON_ASTERISK (WE_ATTR_TYPE_SMALLICON | 0x04)
4932 #define WE_SMALLICON_STOP WE_SMALLICON_HAND
4933 #define WE_SMALLICON_INFORMATION WE_SMALLICON_ASTERISK
4934 
4939 #define WE_ATTR_TYPE_RDR 0x5000
4940 
4941 #define WE_LFFLAT_NUMBER 1
4942 #ifdef _MGLF_RDR_FLAT
4943 
4944 #define WE_LFFLAT_TAB_NRMLCLR (WE_ATTR_TYPE_RDR | 0)
4945 #endif
4946 
4947 #define WE_LFSKIN_NUMBER 28
4948 #ifdef _MGLF_RDR_SKIN
4949 #define WE_LFSKIN_WND_BKGND (WE_ATTR_TYPE_RDR | 0)
4950 
4951 #define WE_LFSKIN_CAPTION (WE_ATTR_TYPE_RDR | 1)
4952 #define WE_LFSKIN_CAPTION_BTN (WE_ATTR_TYPE_RDR | 2)
4953 
4954 #define WE_LFSKIN_SCROLLBAR_VSHAFT (WE_ATTR_TYPE_RDR | 3)
4955 #define WE_LFSKIN_SCROLLBAR_VTHUMB (WE_ATTR_TYPE_RDR | 4)
4956 #define WE_LFSKIN_SCROLLBAR_HSHAFT (WE_ATTR_TYPE_RDR | 5)
4957 #define WE_LFSKIN_SCROLLBAR_HTHUMB (WE_ATTR_TYPE_RDR | 6)
4958 #define WE_LFSKIN_SCROLLBAR_ARROWS (WE_ATTR_TYPE_RDR | 7)
4959 
4960 #define WE_LFSKIN_BORDER_TOP (WE_ATTR_TYPE_RDR | 8)
4961 #define WE_LFSKIN_BORDER_BOTTOM (WE_ATTR_TYPE_RDR | 9)
4962 #define WE_LFSKIN_BORDER_LEFT (WE_ATTR_TYPE_RDR | 10)
4963 #define WE_LFSKIN_BORDER_RIGHT (WE_ATTR_TYPE_RDR | 11)
4964 
4965 #define WE_LFSKIN_ARROWS (WE_ATTR_TYPE_RDR | 12)
4966 #define WE_LFSKIN_ARROWS_SHELL (WE_ATTR_TYPE_RDR | 13)
4967 
4968 #define WE_LFSKIN_RADIOBUTTON (WE_ATTR_TYPE_RDR | 14)
4969 #define WE_LFSKIN_CHECKBUTTON (WE_ATTR_TYPE_RDR | 15)
4970 #define WE_LFSKIN_PUSHBUTTON (WE_ATTR_TYPE_RDR | 16)
4971 
4972 #define WE_LFSKIN_TREE (WE_ATTR_TYPE_RDR | 17)
4973 
4974 #define WE_LFSKIN_HEADER (WE_ATTR_TYPE_RDR | 18)
4975 #define WE_LFSKIN_TAB (WE_ATTR_TYPE_RDR | 19)
4976 
4977 #define WE_LFSKIN_PROGRESS_HCHUNK (WE_ATTR_TYPE_RDR | 20)
4978 #define WE_LFSKIN_PROGRESS_VCHUNK (WE_ATTR_TYPE_RDR | 21)
4979 #define WE_LFSKIN_PROGRESS_HTRACKBAR (WE_ATTR_TYPE_RDR | 22)
4980 #define WE_LFSKIN_PROGRESS_VTRACKBAR (WE_ATTR_TYPE_RDR | 23)
4981 
4982 #define WE_LFSKIN_TBSLIDER_H (WE_ATTR_TYPE_RDR | 24)
4983 #define WE_LFSKIN_TRACKBAR_VERT (WE_ATTR_TYPE_RDR | 25)
4984 #define WE_LFSKIN_TRACKBAR_HORZ (WE_ATTR_TYPE_RDR | 26)
4985 #define WE_LFSKIN_TBSLIDER_V (WE_ATTR_TYPE_RDR | 27)
4986 #endif
4987 
4993 
5014 typedef void (* NOTIFPROC) (HWND hwnd, LINT id, int nc, DWORD add_data);
5015 
5017 typedef struct _WINDOW_ELEMENT_ATTR {
5023 
5025 typedef struct _WINDOW_ELEMENT_RENDERER* PWERENDERER;
5026 
5027 #define SBS_NORMAL 0x00
5028 #define SBS_DISABLED 0x01
5029 #define SBS_HIDE 0x02
5030 
5034 typedef struct _LFSCROLLBARINFO {
5036  int minPos;
5038  int maxPos;
5040  int curPos;
5048  int barLen;
5050  int status;
5051 } LFSCROLLBARINFO;
5052 
5054 
5058 typedef struct _SCROLLBARDATA {
5060  int minPos;
5062  int maxPos;
5064  int curPos;
5072  int barLen;
5073  /* mouse position before tracking thumb.
5074  * it represents the distance from x mouse postion to barStart
5075  * for horizontal scrollbar.
5076  * it represents the distance from y mouse postion to barStart
5077  * for vertical scrollbar.
5078  */
5079  int track_pos;
5081  int status;
5082 } SCROLLBARDATA;
5083 
5084 typedef SCROLLBARDATA* PSCROLLBARDATA;
5085 
5087 #define SBS_DISABLED_LTUP 0x0100
5088 
5090 #define SBS_DISABLED_BTDN 0x0200
5091 
5093 #define SBS_HILITE_LTUP 0x0400
5094 
5096 #define SBS_HILITE_BTDN 0x0800
5097 
5099 #define SBS_HILITE_THUMB 0x0010
5100 
5102 #define SBS_PRESSED_LTUP 0x0020
5103 
5105 #define SBS_PRESSED_BTDN 0x0040
5106 
5108 #define SBS_PRESSED_THUMB 0x0080
5109 
5110 
5111 #define LFRDR_WINTYPE_UNKNOWN 0
5112 #define LFRDR_WINTYPE_DIALOG 1
5113 #define LFRDR_WINTYPE_MAINWIN 2
5114 #define LFRDR_WINTYPE_CONTROL 3
5115 
5119 typedef struct _LFRDR_WINSTYLEINFO
5120 {
5122  int dwStyle;
5123 
5132  int winType;
5134 
5140 typedef struct _LFRDR_TRACKBARINFO
5141 {
5142  int nMin;
5143  int nMax;
5144  int nPos;
5145  int nTickFreq;
5147 
5148 #define LFRDR_METRICS_MASK 0xFF00
5149 #define LFRDR_METRICS_BORDER 0x0100
5150 #define LFRDR_METRICS_CAPTION_H 0x0200
5151 #define LFRDR_METRICS_ICON_H 0x0300
5152 #define LFRDR_METRICS_ICON_W 0x0400
5153 #define LFRDR_METRICS_MENU_H 0x0500
5154 #define LFRDR_METRICS_VSCROLL_W 0x0600
5155 #define LFRDR_METRICS_HSCROLL_H 0x0700
5156 #define LFRDR_METRICS_MINWIN_WIDTH 0x0800
5157 #define LFRDR_METRICS_MINWIN_HEIGHT 0x0900
5158 
5159 #define LFRDR_SB_MINBARLEN 10
5160 
5165 #define LEN_RENDERER_NAME 15
5166 
5167 /* button status used by button and 3dbox. */
5168 #define LFRDR_BTN_STATUS_MASK 0x03
5169 #define LFRDR_BTN_STATUS_NORMAL 0x00
5170 #define LFRDR_BTN_STATUS_HILITE 0x01
5171 #define LFRDR_BTN_STATUS_PRESSED 0x02
5172 #define LFRDR_BTN_STATUS_DISABLED 0x03
5173 
5174 /* a flag used by radio button and check button. */
5175 #define LFRDR_BTN_STATUS_SELECTED 0x04
5176 
5177 /* a flag used by button on capton bar. */
5178 #define LFRDR_BTN_STATUS_INACTIVE 0x08
5179 
5180 /* thick or thin frame used by 3dbox. */
5181 #define LFRDR_3DBOX_THICKFRAME 0x20
5182 
5183 /* filled 3dbox */
5184 #define LFRDR_3DBOX_FILLED 0x40
5185 
5186 /*select status used by checkmark or radio.*/
5187 #define LFRDR_MARK_SELECTED_MASK 0x05
5188 #define LFRDR_MARK_ALL_SELECTED 0x01
5189 #define LFRDR_MARK_HALF_SELECTED 0x04
5190 
5191 /* a flag whether a checkmark or radio has a shell or not.*/
5192 #define LFRDR_MARK_HAVESHELL 0x02
5193 
5194 /*the direction of arrow.*/
5195 #define LFRDR_ARROW_DIRECT_MASK 0x0F00
5196 #define LFRDR_ARROW_LEFT 0x0000
5197 #define LFRDR_ARROW_RIGHT 0x0100
5198 #define LFRDR_ARROW_UP 0x0200
5199 #define LFRDR_ARROW_DOWN 0x0300
5200 
5201 /* hollow arrow or filled */
5202 #define LFRDR_ARROW_NOFILL 0x1000
5203 #define LFRDR_ARROW_HAVESHELL 0x2000
5204 
5205 /* minimum of menu margin */
5206 #define LFRDR_MENUITEMOFFY_MIN 4
5207 
5208 #define LFRDR_3DBOX_COLOR_LIGHTEST 0x01
5209 #define LFRDR_3DBOX_COLOR_DARKEST 0x02
5210 #define LFRDR_3DBOX_COLOR_LIGHTER 0x03
5211 #define LFRDR_3DBOX_COLOR_DARKER 0x04
5212 
5213 /* flag of propsheet tab */
5214 #define LFRDR_TAB_BOTTOM 0x0001
5215 #define LFRDR_TAB_ACTIVE 0x0010
5216 #define LFRDR_TAB_ICON 0x0100
5217 
5218 /* for fold icon*/
5219 #define LFRDR_TREE_WITHICON 0x08
5220 #define LFRDR_TREE_FOLD 0x01
5221 
5222 /* for connecting line*/
5223 #define LFRDR_TREE_CHILD 0x02
5224 #define LFRDR_TREE_NEXT 0x04
5225 
5226 #define SYSICO_ITEM_NUMBER 5
5227 
5231  const char name[LEN_RENDERER_NAME+1];
5232 
5237  int (*init) (PWERENDERER renderer);
5238 
5243  int (*deinit) (PWERENDERER renderer);
5244 
5259  DWORD (*calc_3dbox_color) (DWORD color, int flag);
5260 
5280  void (*draw_3dbox) (HDC hdc, const RECT* pRect, DWORD color, DWORD flag);
5281 
5282 
5293  void (*draw_radio) (HDC hdc, const RECT* pRect, DWORD color, int status);
5294 
5298  void (*draw_checkbox) (HDC hdc, const RECT* pRect, DWORD color,
5299  int status);
5300 
5304  void (*draw_checkmark) (HDC hdc, const RECT* pRect, DWORD color,
5305  int status);
5306 
5323  void (*draw_arrow) (HWND hWnd, HDC hdc, const RECT* pRect, DWORD color, int status);
5324 
5338  void (*draw_fold) (HWND hWnd, HDC hdc, const RECT* pRect, DWORD color,
5339  int status, int next);
5340 
5342  void (*draw_focus_frame) (HDC hdc, const RECT *pRect, DWORD color);
5343 
5345  void (*draw_normal_item) (HWND hWnd, HDC hdc, const RECT* pRect,
5346  DWORD color);
5347 
5349  void (*draw_hilite_item) (HWND hWnd, HDC hdc, const RECT* pRect,
5350  DWORD color);
5351 
5353  void (*draw_disabled_item) (HWND hWnd, HDC hdc, const RECT* pRect,
5354  DWORD color);
5355 
5357  void (*draw_significant_item) (HWND hWnd, HDC hdc, const RECT* pRect,
5358  DWORD color);
5359 
5373  void (*draw_push_button) (HWND hWnd, HDC hdc, const RECT* pRect,
5374  DWORD color1, DWORD color2, int status);
5375 
5392  void (*draw_radio_button) (HWND hWnd, HDC hdc, const RECT* pRect, int status);
5393 
5410  void (*draw_check_button) (HWND hWnd, HDC hdc, const RECT* pRect, int status);
5411 
5413  void (*draw_border) (HWND hWnd, HDC hdc, BOOL is_active);
5414 
5416  void (*draw_caption) (HWND hWnd, HDC hdc, BOOL is_active);
5417 
5431  void (*draw_caption_button) (HWND hwnd, HDC hdc, int ht_code, int state);
5432 
5447  void (*draw_scrollbar) (HWND hWnd, HDC hdc, int sb_pos);
5448 
5451  DWORD dwStyle, const RECT* rcClient, RECT* rcRuler,
5452  RECT* rcBar, RECT* rcBorder);
5453 
5455  void (*draw_trackbar) (HWND hWnd, HDC hdc, LFRDR_TRACKBARINFO *info);
5456 
5463  int (*calc_we_area) (HWND hWnd, int which, RECT* we_area);
5464 
5487  int (*calc_we_metrics) (HWND hWnd,
5488  LFRDR_WINSTYLEINFO* style_info, int which);
5489 
5495  int (*hit_test) (HWND hWnd, int x, int y);
5496 
5498  int (*on_click_hotspot) (HWND hWnd, int which);
5499 
5509  void (*draw_custom_hotspot) (HWND hWnd, HDC hdc, int ht_code, int state);
5510 
5517  void (*calc_thumb_area) (HWND hWnd, BOOL vertical,
5518  LFSCROLLBARINFO* sb_info);
5519 
5521  void (*disabled_text_out) (HWND hWnd, HDC hdc, const char* spText,
5522  PRECT rc, DWORD dt_fmt);
5523 
5534  void (*draw_tab) (HWND hWnd, HDC hdc, RECT *rect, char *title,
5535  DWORD color, int flag, HICON icon);
5536 
5538  void (*draw_progress) (HWND hWnd, HDC hdc,
5539  int nMax, int nMin, int nPos, BOOL fVertical);
5540 
5544  void (*draw_header) (HWND hWnd, HDC hdc, const RECT* pRect, DWORD color);
5545 
5550  DWORD (*on_get_rdr_attr) (struct _WINDOW_ELEMENT_RENDERER*, int we_attr_id);
5551 
5558  DWORD (*on_set_rdr_attr) (struct _WINDOW_ELEMENT_RENDERER*, int we_attr_id, DWORD we_attr, BOOL change);
5559 
5561  void (*erase_background) (HWND hWnd, HDC hdc, const RECT *rect);
5562 
5564  void (*draw_normal_menu_item) (HWND hWnd, HDC hdc, const RECT* pRect,
5565  DWORD color);
5566 
5568  void (*draw_hilite_menu_item) (HWND hWnd, HDC hdc, const RECT* pRect,
5569  DWORD color);
5570 
5572  void (*draw_disabled_menu_item) (HWND hWnd, HDC hdc, const RECT* pRect,
5573  DWORD color);
5574 
5577 
5580 
5583 
5585  HICON we_icon [2][SYSICO_ITEM_NUMBER];
5586 
5588  unsigned int refcount;
5589 
5591  const void* private_info;
5593 
5600 typedef struct _WINDOWINFO
5601 {
5602  unsigned char _padding1;
5603  unsigned char _padding2;
5604  unsigned short _padding3;
5605  void* _padding4;
5606 
5608  const char* spCaption;
5609 
5614 
5617 
5620 
5625 
5626  void* _padding5;
5627  void* _padding6;
5628  void* _padding7;
5629  void* _padding8;
5630  void* _padding9;
5631 
5633  int left, top;
5634  int right, bottom;
5635 
5637  int cl, ct;
5638  int cr, cb;
5639 
5644 
5649 
5652 
5665 
5670 
5673 } WINDOWINFO;
5674 
5686 static inline const WINDOWINFO* GUIAPI GetWindowInfo (HWND hWnd)
5687 {
5688  return (WINDOWINFO*)hWnd;
5689 }
5690 
5702 MG_EXPORT BOOL GUIAPI InitWindowElementAttrs (PWERENDERER rdr);
5703 
5796 MG_EXPORT DWORD GUIAPI GetWindowElementAttr (HWND hwnd, int we_attr_id);
5797 
5814 MG_EXPORT DWORD GUIAPI SetWindowElementAttr (HWND hwnd, int we_attr_id,
5815  DWORD we_attr);
5816 
5836 MG_EXPORT gal_pixel GUIAPI GetWindowElementPixelEx (HWND hwnd,
5837  HDC hdc, int we_attr_id);
5838 
5853 MG_EXPORT WINDOW_ELEMENT_RENDERER*
5854  GUIAPI GetWindowRendererFromName (const char* name);
5855 
5868 MG_EXPORT BOOL GUIAPI AddWindowElementRenderer (const char* name,
5869  const WINDOW_ELEMENT_RENDERER* we_rdr);
5870 
5881 MG_EXPORT BOOL GUIAPI RemoveWindowElementRenderer (const char* name);
5882 
5894 MG_EXPORT WINDOW_ELEMENT_RENDERER*
5895  GUIAPI GetDefaultWindowElementRenderer (void);
5896 
5908 MG_EXPORT const char* GUIAPI SetDefaultWindowElementRenderer (const char* name);
5909 
5928 MG_EXPORT BOOL GUIAPI SetWindowElementRenderer (HWND hWnd,
5929  const char* werdr_name, const WINDOW_ELEMENT_ATTR* we_attrs);
5930 
5943 MG_EXPORT BOOL InitRendererSystemIcon (const char* rdr_name,
5944  HICON *small_icon, HICON *large_icon);
5945 
5956 MG_EXPORT void TermRendererSystemIcon (HICON *small_icon,
5957  HICON *large_icon);
5958 
5979 MG_EXPORT BOOL GUIAPI RegisterResFromFile (HDC hdc, const char* file);
5980 
5981 
6000 MG_EXPORT BOOL GUIAPI RegisterResFromMem (HDC hdc, const char* file,
6001  const unsigned char* data, size_t data_size);
6002 
6016 MG_EXPORT BOOL GUIAPI RegisterResFromBitmap (const char* file, const BITMAP* bmp);
6017 
6030 MG_EXPORT const BITMAP* GUIAPI RetrieveRes (const char *file);
6031 
6045 MG_EXPORT void GUIAPI UnregisterRes (const char *file);
6046 
6065 MG_EXPORT BOOL GUIAPI RegisterSystemBitmap (HDC hdc, const char* rdr_name,
6066  const char* id);
6067 
6083 MG_EXPORT void GUIAPI UnregisterSystemBitmap (HDC hdc, const char* rdr_name,
6084  const char* id);
6085 
6086 /* define the key of resource */
6087 typedef DWORD RES_KEY;
6088 #define RES_KEY_INVALID 0
6089 
6090 /* define the incore res type */
6091 typedef struct _INNER_RES {
6092  RES_KEY key;
6093  const Uint8* data;
6094  size_t data_len;
6095 
6096  /* A special param recognized by the TYPE_OPS; normally is NULL.
6097  * If the data is a raw png, jpeg, bmp file content,
6098  * it should be the extention name of the filename:
6099  * INNER_RES res[]= { ... { ..., ... ,.., "png" } .. };
6100  * */
6101  const void* additional;
6102 } INNER_RES;
6103 
6106  RES_TYPE_INVALID = 0xFF,
6107 
6113 
6119 
6125 
6126 #ifdef _MGHAVE_CURSOR
6127 
6132 #endif
6133 
6140 
6141  /* NOT IMPLEMENT */
6142  RES_TYPE_TEXT,
6143  /* NOT IMPLEMENT */
6144  RES_TYPE_MENU,
6145  /* NOT IMPLEMENT */
6146  RES_TYPE_WINDOW,
6147 
6156 
6161 
6166 
6167  /*
6168  * The max valid value of resource type;
6169  * the user defined type must less this value.
6170  */
6171  RES_TYPE_USER_MAX = 0x7F
6172 };
6173 
6174 /* the return value of LoadResource with type RES_TYPE_MEM_RES */
6175 typedef struct _MEM_RES {
6176  Uint8 *data;
6177  size_t data_len;
6178 } MEM_RES;
6179 
6180 typedef struct _FONT_RES {
6181  LOGFONT logfont;
6182  RES_KEY key;
6183 } FONT_RES;
6184 
6185 /* the original source of resource
6186  * depend on the values, the res manager
6187  * would select corrent loader to
6188  * load resource form disk or mem
6189  */
6190 
6191 #define REF_SRC_NOTYPE 0x00
6192 
6193 /* indicate that the resource is stored in disk */
6194 #define REF_SRC_FILE 0x01
6195 
6196 /* indicate that the resource is stored in memory*/
6197 #define REF_SRC_INNER 0x02
6198 
6199 /* indicate that the resource is stored in shared memory*/
6200 #define REF_SRC_SHARED 0x03
6201 
6202 /* indicate that the resource is stored in outside( NOT SUPPORTED) */
6203 #define REF_SRC_OUTSIDE 0x04
6204 
6205 /* indicate that the resource is stored in a stream object (NOT SUPPORTED) */
6206 #define REF_SRC_STREAM 0x05
6207 
6208 /* indicate that the resource is create by MiniGUI */
6209 #define REF_SRC_LOGIC 0x06
6210 
6211 /* the RESOUCE type for loadding */
6212 typedef struct _RESOURCE {
6213  void* data; // store the pointer of cached resource
6214  union {
6215  void* src;
6216  INNER_RES* inner;
6217  char* file;
6218  } source; // indicate the stored format of resource
6219 } RESOURCE;
6220 
6221 /* The operations of one type of resource */
6222 typedef struct _RES_TYPE_OPS {
6223  /* To get a resource
6224  * return the buffered resource pointer
6225  * param res the in and out param of resource.
6226  * param src_type, one of REF_SRC_XXX
6227  * param usr_param
6228  * */
6229  void* (*get_res_data)(RESOURCE* res, int src_type, DWORD usr_param);
6230  /* To unload a buffered resource
6231  */
6232  void (*unload)(RESOURCE* res, int src_type);
6233 } RES_TYPE_OPS;
6234 
6235 /* Return value and error code of resource manager */
6236 enum emResReturn {
6237  RES_RET_OK = 0,
6238  RES_RET_INVALID_PARAM,
6239  RES_RET_NOT_EXIST_KEY, //RES_KEY is not exist
6240  RES_RET_LOAD_FILE_FAILED,
6241  RES_RET_LOAD_MEM_FAILED,
6242  RES_RET_UNKNOWN_TYPE,
6243  RES_RET_NOT_IMPLEMENTED,
6244  RES_RET_INUSED //the res or object is in used, cannot be unloaded
6245 };
6246 
6256 MG_EXPORT const char* GetResPath (void);
6257 
6271 MG_EXPORT int SetResPath (const char* path);
6272 
6286 MG_EXPORT int AddInnerRes (INNER_RES* inner_res, int count, BOOL copy);
6287 
6288 /*
6289  * NOT IMPLEMENT
6290  */
6291 MG_EXPORT int AddSharedRes (const char* shared_name);
6292 
6305 MG_EXPORT int RegisterResType (int type, RES_TYPE_OPS* ops);
6306 
6317 MG_EXPORT int UnregisterResType (int type);
6318 
6356 MG_EXPORT void* LoadResource (const char* res_name, int type, DWORD usr_param);
6357 
6371 MG_EXPORT void* GetResource (RES_KEY key);
6372 
6388 MG_EXPORT int AddResRef (RES_KEY key);
6389 
6401 MG_EXPORT int ReleaseRes (RES_KEY key);
6402 
6403 #define LoadMyBitmapFromRes(res_name, pal) \
6404  (MYBITMAP*)LoadResource(res_name, \
6405  RES_TYPE_MYBITMAP, (DWORD)(pal))
6406 
6407 #define GetMyBitmapFromRes(key) \
6408  (MYBITMAP*)GetResource(key)
6409 
6410 #define LoadBitmapFromRes(hdc, res_name) \
6411  (BITMAP*)LoadResource(res_name, RES_TYPE_IMAGE, (DWORD)hdc)
6412 
6413 #define GetBitmapFromRes(key) \
6414  (BITMAP*)GetResource(key)
6415 
6416 #define GetIconFromRes(key) \
6417  (HICON)GetResource(key)
6418 
6419 #ifndef _MGHAVE_CURSOR
6420 #define GetCursorFromRes(key) \
6421  (HCURSOR)GetResource(key)
6422 #endif
6423 
6424 #define GetEtcFromRes(key) \
6425  (GHANDLE)GetResource(key)
6426 
6427 #define LoadLogicFontFromRes(font_name) \
6428  (PLOGFONT)LoadResource(font_name, RES_TYPE_FONT, 0)
6429 
6430 #define GetLogicFontFromRes(font_name) \
6431  (PLOGFONT)GetResource(Str2Key(font_name))
6432 
6433 #define ReleaseLogicFont(font) \
6434  ReleaseRes(((FONT_RES*)(font))->key)
6435 
6436 #define ReleaseLogicFontByName(font_name) \
6437  ReleaseRes(Str2Key(font_name))
6438 
6450 MG_EXPORT RES_KEY Str2Key (const char* str);
6451 
6452 
6453 #ifdef __TARGET_MSTUDIO__
6454 
6463 MG_EXPORT int GUIAPI GetWindowZOrder(HWND hWnd);
6464 
6474 MG_EXPORT int GUIAPI SetWindowZOrder(HWND hWnd, int zorder);
6475 #endif /* defined __TARGET_MSTUDIO__ */
6476 
6484 #ifdef _MGHAVE_VIRTUAL_WINDOW
6485 
6627 MG_EXPORT int GUIAPI CreateThreadForMessaging (pthread_t* thread,
6628  pthread_attr_t* attr, void * (*start_routine)(void *), void* arg,
6629  BOOL joinable, size_t stack_size);
6630 
6643 MG_EXPORT BOOL GUIAPI GetThreadByWindow (HWND hWnd, pthread_t* thread);
6644 
6656 MG_EXPORT BOOL GUIAPI IsWindowInThisThread (HWND hWnd);
6657 
6677 MG_EXPORT BOOL GUIAPI VirtualWindowCleanup (HWND hVirtWnd);
6678 
6704 MG_EXPORT HWND GUIAPI CreateVirtualWindow (HWND hHosting, WNDPROC WndProc,
6705  const char* spCaption, LINT id, DWORD dwAddData);
6706 
6725 MG_EXPORT BOOL GUIAPI DestroyVirtualWindow (HWND hWnd);
6726 
6729 #endif /* defined _MGHAVE_VIRTUAL_WINDOW */
6730 
6736 extern MG_EXPORT HWND __mg_hwnd_desktop;
6737 
6742 #define HWND_DESKTOP __mg_hwnd_desktop
6743 
6748 #define HWND_NULL ((HWND)0)
6749 
6754 #define HWND_INVALID ((HWND)-1)
6755 
6756 #define HWND_OTHERPROC ((HWND)-1)
6757 
6761 typedef struct _MAINWINCREATE {
6764 
6767 
6769  const char* spCaption;
6770 
6773 
6776 
6779 
6782 
6785 
6787  int lx, ty, rx, by;
6788 
6793 
6796 
6799 } MAINWINCREATE;
6800 typedef MAINWINCREATE* PMAINWINCREATE;
6801 
6802 #ifdef _MGRM_THREADS
6803 
6821 static inline int GUIAPI CreateThreadForMainWindow (pthread_t* thread,
6822  pthread_attr_t* attr, void * (*start_routine)(void *), void* arg)
6823 {
6824  return CreateThreadForMessaging (thread, attr, start_routine, arg,
6825  TRUE, 16);
6826 }
6827 
6838 static inline pthread_t GUIAPI GetMainWinThread (HWND hMainWnd)
6839 {
6840 #ifdef WIN32
6841  pthread_t ret;
6842  memset (&ret, 0, sizeof (pthread_t));
6843 #else
6844  pthread_t ret = 0;
6845 #endif
6846 
6847  GetThreadByWindow (hMainWnd, &ret);
6848  return ret;
6849 }
6850 
6870 MG_EXPORT int GUIAPI WaitMainWindowClose (HWND hWnd, void** returnval);
6871 #endif /* defined _MGRM_THREADS */
6872 
6894 MG_EXPORT BOOL GUIAPI MainWindowCleanup (HWND hMainWnd);
6895 
6908 static inline BOOL MainWindowThreadCleanup (HWND hMainWnd)
6909 {
6910  return MainWindowCleanup (hMainWnd);
6911 }
6912 
6913 /* The flags for the surface pixel format */
6914 #define ST_PIXEL_MASK 0x00FF
6915 #define ST_PIXEL_DEFAULT 0x0000
6916 #define ST_PIXEL_ARGB4444 0x0001
6917 #define ST_PIXEL_ARGB1555 0x0002
6918 #define ST_PIXEL_ARGB8888 0x0003
6919 
6920 /* other flags for future use */
6921 
6922 /* for default surface flags */
6923 #define ST_DEFAULT (ST_PIXEL_DEFAULT)
6924 
6925 #define CT_SYSTEM_MASK 0X0000FF
6926 #define CT_OPAQUE 0x000000
6927 #define CT_COLORKEY 0x000001
6928 #define CT_ALPHACHANNEL 0x000002
6929 #define CT_LOGICALPIXEL 0x000003
6930 #define CT_ALPHAPIXEL 0x000004
6931 #define CT_BLURRED 0x000005
6932 #define CT_MAX_VALUE 0xFFFFFF
6933 
6990 MG_EXPORT HWND GUIAPI CreateMainWindowEx2 (PMAINWINCREATE create_info, LINT id,
6991  const char* werdr_name, const WINDOW_ELEMENT_ATTR* we_attrs,
6992  unsigned int surf_flag, DWORD bkgnd_color,
6993  int compos_type, DWORD ct_arg);
6994 
7028 static inline HWND GUIAPI CreateMainWindowEx (PMAINWINCREATE pCreateInfo,
7029  const char* werdr_name, const WINDOW_ELEMENT_ATTR* we_attrs,
7030  const char* window_name, const char* layer_name)
7031 {
7032  return CreateMainWindowEx2 (pCreateInfo, 0L, werdr_name, we_attrs,
7033  ST_DEFAULT, 0xFFFFFFFFUL, CT_OPAQUE, 0);
7034 }
7035 
7046 static inline HWND GUIAPI CreateMainWindow (PMAINWINCREATE pCreateInfo)
7047 {
7048  return CreateMainWindowEx (pCreateInfo, NULL, NULL, NULL, NULL);
7049 }
7050 
7069 MG_EXPORT BOOL GUIAPI DestroyMainWindow (HWND hWnd);
7070 
7071 typedef void (*CB_FREE_LOCAL_DATA) (DWORD local_data);
7072 
7099 MG_EXPORT BOOL GUIAPI SetWindowLocalData (HWND hwnd, const char* data_name,
7100  DWORD local_data, CB_FREE_LOCAL_DATA cb_free);
7101 
7122 MG_EXPORT BOOL GUIAPI RemoveWindowLocalData (HWND hwnd, const char* data_name);
7123 
7147 MG_EXPORT BOOL GUIAPI GetWindowLocalData (HWND hwnd, const char* data_name,
7148  DWORD *local_data, CB_FREE_LOCAL_DATA* cb_free);
7149 
7164 MG_EXPORT BOOL GUIAPI SetWindowMask (HWND hWnd, const MYBITMAP* mask);
7165 
7181 MG_EXPORT BOOL GUIAPI SetWindowMaskEx (HWND hWnd, HDC hdc, const BITMAP* mask);
7182 
7199 MG_EXPORT BOOL GUIAPI SetMainWindowAlwaysTop (HWND hWnd, BOOL fSet);
7200 
7201 #define GF_SWIPE_HORZ ZOF_GF_SWIPE_HORZ
7202 #define GF_SWIPE_VERT ZOF_GF_SWIPE_VERT
7203 
7232 MG_EXPORT BOOL GUIAPI SetMainWindowGestureFlags (HWND hWnd, DWORD dwFlags);
7233 
7234 #ifdef _MGSCHEMA_COMPOSITING
7235 
7287 MG_EXPORT BOOL GUIAPI SetMainWindowCompositing (HWND hWnd,
7288  int type, DWORD arg);
7289 
7290 #endif /* defined _MGSCHEMA_COMPOSITING */
7291 
7301 BOOL GUIAPI SetWindowRegion (HWND hWnd, const CLIPRGN* region);
7302 
7322 BOOL GUIAPI GetWindowRegion (HWND hWnd, CLIPRGN* region);
7323 
7324 LRESULT GUIAPI PreDefMainWinProc (HWND hWnd, UINT message,
7325  WPARAM wParam, LPARAM lParam);
7326 
7327 LRESULT GUIAPI PreDefDialogProc (HWND hWnd,
7328  UINT message, WPARAM wParam, LPARAM lParam);
7329 
7330 LRESULT GUIAPI PreDefControlProc (HWND hWnd, UINT message,
7331  WPARAM wParam, LPARAM lParam);
7332 
7333 #ifdef _MGHAVE_VIRTUAL_WINDOW
7334 LRESULT GUIAPI PreDefVirtualWinProc (HWND hWnd, UINT message,
7335  WPARAM wParam, LPARAM lParam);
7336 #endif
7337 
7355 MG_EXPORT LRESULT GUIAPI DefaultWindowProc (HWND hWnd, UINT message,
7356  WPARAM wParam, LPARAM lParam);
7357 
7363 #ifdef _MGHAVE_VIRTUAL_WINDOW
7364 extern MG_EXPORT WNDPROC __mg_def_proc[4];
7365 #else
7366 extern MG_EXPORT WNDPROC __mg_def_proc[3];
7367 #endif
7368 
7383 #define DefaultMainWinProc (__mg_def_proc[0])
7384 
7401 #define DefaultDialogProc (__mg_def_proc[1])
7402 
7416 #define DefaultControlProc (__mg_def_proc[2])
7417 
7418 #ifdef _MGHAVE_VIRTUAL_WINDOW
7419 
7432 #define DefaultVirtualWinProc (__mg_def_proc[3])
7433 #endif /* defined _MGHAVE_VIRTUAL_WINDOW */
7434 
7435 #ifdef _DEBUG
7436 MG_EXPORT void GUIAPI DumpWindow (FILE* fp, HWND hWnd);
7437 #endif /* _DEBUG */
7438 
7446 #define SW_HIDE 0x0000
7447 #define SW_SHOW 0x0010
7448 #define SW_SHOWNORMAL 0x0100
7449 
7465 MG_EXPORT void GUIAPI UpdateWindow (HWND hWnd, BOOL bErase);
7466 
7481 MG_EXPORT void GUIAPI UpdateInvalidClient (HWND hWnd, BOOL bErase);
7482 
7501 MG_EXPORT BOOL GUIAPI ShowWindow (HWND hWnd, int iCmdShow);
7502 
7519 MG_EXPORT BOOL GUIAPI EnableWindow (HWND hWnd, BOOL fEnable);
7520 
7535 MG_EXPORT BOOL GUIAPI IsWindowEnabled (HWND hWnd);
7536 
7557 MG_EXPORT BOOL GUIAPI GetClientRect(HWND hWnd, PRECT prc);
7558 
7571 MG_EXPORT gal_pixel GUIAPI DWORD2PixelByWindow (HWND hWnd, DWORD dwColor);
7572 
7588 MG_EXPORT gal_pixel GUIAPI GetWindowBkColor (HWND hWnd);
7589 
7608 MG_EXPORT gal_pixel GUIAPI SetWindowBkColor (HWND hWnd, gal_pixel new_bkcolor);
7609 
7622 MG_EXPORT PLOGFONT GUIAPI GetWindowFont (HWND hWnd);
7623 
7643 MG_EXPORT PLOGFONT GUIAPI SetWindowFont (HWND hWnd, PLOGFONT pLogFont);
7644 
7657 MG_EXPORT HCURSOR GUIAPI GetWindowCursor (HWND hWnd);
7658 
7672 MG_EXPORT HCURSOR GUIAPI SetWindowCursor (HWND hWnd, HCURSOR hNewCursor);
7673 
7686 MG_EXPORT HICON GUIAPI GetWindowIcon (HWND hWnd);
7687 
7705 MG_EXPORT HICON GUIAPI SetWindowIcon (HWND hWnd, HICON hIcon, BOOL bRedraw);
7706 
7718 MG_EXPORT DWORD GUIAPI GetWindowStyle (HWND hWnd);
7719 
7731 MG_EXPORT DWORD GUIAPI GetWindowExStyle (HWND hWnd);
7732 
7752 MG_EXPORT BOOL GUIAPI ExcludeWindowStyle (HWND hWnd, DWORD dwStyle);
7753 
7772 MG_EXPORT BOOL GUIAPI IncludeWindowStyle (HWND hWnd, DWORD dwStyle);
7773 
7792 MG_EXPORT BOOL GUIAPI ExcludeWindowExStyle (HWND hWnd, DWORD dwStyle);
7793 
7813 MG_EXPORT BOOL GUIAPI IncludeWindowExStyle (HWND hWnd, DWORD dwStyle);
7814 
7827 MG_EXPORT WNDPROC GUIAPI GetWindowCallbackProc (HWND hWnd);
7828 
7846 MG_EXPORT WNDPROC GUIAPI SetWindowCallbackProc (HWND hWnd, WNDPROC newProc);
7847 
7860 MG_EXPORT DWORD GUIAPI GetWindowAdditionalData (HWND hWnd);
7861 
7880 MG_EXPORT DWORD GUIAPI SetWindowAdditionalData (HWND hWnd, DWORD newData);
7881 
7894 MG_EXPORT DWORD GUIAPI GetWindowAdditionalData2 (HWND hWnd);
7895 
7913 MG_EXPORT DWORD GUIAPI SetWindowAdditionalData2 (HWND hWnd, DWORD newData);
7914 
7931 MG_EXPORT DWORD GUIAPI GetWindowClassAdditionalData (HWND hWnd);
7932 
7948 MG_EXPORT DWORD GUIAPI SetWindowClassAdditionalData (HWND hWnd, DWORD newData);
7949 
7962 MG_EXPORT const char* GUIAPI GetWindowCaption (HWND hWnd);
7963 
7977 MG_EXPORT BOOL GUIAPI SetWindowCaption (HWND hWnd, const char* spCaption);
7978 
7997 MG_EXPORT BOOL GUIAPI InvalidateRect (HWND hWnd,
7998  const RECT* prc, BOOL bEraseBkgnd);
7999 
8036 MG_EXPORT BOOL GUIAPI InvalidateRegion (HWND hWnd, const CLIPRGN* pRgn, BOOL bErase);
8037 
8063 MG_EXPORT BOOL GUIAPI ValidateRect (HWND hWnd, const RECT* rect);
8064 
8091 MG_EXPORT BOOL GUIAPI ValidateRegion (HWND hWnd, const CLIPRGN* pRgn);
8092 
8108 MG_EXPORT HDC GUIAPI BeginPaint(HWND hWnd);
8109 
8123 MG_EXPORT void GUIAPI EndPaint(HWND hWnd, HDC hdc);
8124 
8140 MG_EXPORT BOOL GUIAPI GetUpdateRect (HWND hWnd, RECT* update_rect);
8141 
8161 MG_EXPORT int GUIAPI GetUpdateRegion (HWND hWnd, PCLIPRGN pRgn);
8162 
8179 MG_EXPORT int GUIAPI ClientWidthToWindowWidthEx (DWORD dwStyle,
8180  int win_type, int cw);
8181 
8198 MG_EXPORT int GUIAPI ClientHeightToWindowHeightEx (DWORD dwStyle,
8199  int win_type, int ch, BOOL hasMenu);
8200 
8201 #define ClientWidthToWindowWidth(dwStyle, cw) \
8202  ClientWidthToWindowWidthEx (dwStyle, LFRDR_WINTYPE_MAINWIN, cw)
8203 
8204 #define ClientHeightToWindowHeight(dwStyle, ch, hasMenu) \
8205  ClientHeightToWindowHeightEx (dwStyle, LFRDR_WINTYPE_MAINWIN, ch, hasMenu)
8206 
8245 MG_EXPORT BOOL GUIAPI AdjustWindowRectEx (RECT* pRect, DWORD dwStyle,
8246  BOOL bMenu, DWORD dwExStyle);
8247 
8261 MG_EXPORT void GUIAPI ClientToScreen (HWND hWnd, int* x, int* y);
8262 
8276 MG_EXPORT void GUIAPI ScreenToClient (HWND hWnd, int* x, int* y);
8277 
8291 MG_EXPORT void GUIAPI ClientToWindow(HWND hWnd, int* x, int* y);
8292 
8306 MG_EXPORT void GUIAPI WindowToClient(HWND hWnd, int* x, int* y);
8307 
8308 
8322 MG_EXPORT void GUIAPI WindowToScreen (HWND hWnd, int* x, int* y);
8323 
8337 MG_EXPORT void GUIAPI ScreenToWindow (HWND hWnd, int* x, int* y);
8338 
8352 MG_EXPORT BOOL GUIAPI IsMainWindow (HWND hWnd);
8353 
8354 #ifdef _MGHAVE_VIRTUAL_WINDOW
8355 
8368 MG_EXPORT BOOL GUIAPI IsVirtualWindow (HWND hWnd);
8369 #endif /* defined _MGHAVE_VIRTUAL_WINDOW */
8370 
8383 MG_EXPORT BOOL GUIAPI IsControl (HWND hWnd);
8384 
8398 MG_EXPORT BOOL GUIAPI IsWindow (HWND hWnd);
8399 
8413 MG_EXPORT BOOL GUIAPI IsDialog (HWND hWnd);
8414 
8432 MG_EXPORT HWND GUIAPI GetParent (HWND hWnd);
8433 
8449 MG_EXPORT HWND GUIAPI GetMainWindowHandle (HWND hWnd);
8450 
8465 MG_EXPORT BOOL GUIAPI IsWindowVisible (HWND hWnd);
8466 
8484 MG_EXPORT BOOL GUIAPI GetWindowRect (HWND hWnd, PRECT prc);
8485 
8510 MG_EXPORT HWND GUIAPI GetNextChild (HWND hWnd, HWND hChild);
8511 
8529 MG_EXPORT HWND GUIAPI GetNextMainWindow (HWND hMainWnd);
8530 
8531 #define WIN_SEARCH_METHOD_MASK 0xFF00
8532 #define WIN_SEARCH_METHOD_BFS 0x0000
8533 #define WIN_SEARCH_METHOD_DFS 0x0100
8534 
8535 #define WIN_SEARCH_FILTER_MASK 0x00FF
8536 #define WIN_SEARCH_FILTER_MAIN 0x0001
8537 #define WIN_SEARCH_FILTER_VIRT 0x0002
8538 
8574 MG_EXPORT HWND GUIAPI GetHostedById (HWND hHosting,
8575  LINT lId, DWORD dwSearchFlags);
8576 
8589 MG_EXPORT LINT GUIAPI GetWindowId (HWND hWnd);
8590 
8604 MG_EXPORT LINT GUIAPI SetWindowId (HWND hWnd, LINT lNewId);
8605 
8625 MG_EXPORT HWND GUIAPI GetRootWindow (int* nrWins);
8626 
8650 MG_EXPORT HWND GUIAPI GetHosting (HWND hWnd);
8651 
8672 MG_EXPORT HWND GUIAPI GetFirstHosted (HWND hHosting);
8673 
8697 MG_EXPORT HWND GUIAPI GetNextHosted (HWND hHosting, HWND hHosted);
8698 
8713 MG_EXPORT int GUIAPI GetWindowTextLength (HWND hWnd);
8714 
8731 MG_EXPORT int GUIAPI GetWindowText (HWND hWnd, char* spString, int nMaxLen);
8732 
8748 MG_EXPORT BOOL GUIAPI SetWindowText (HWND hWnd, const char* spString);
8749 
8764 MG_EXPORT HWND GUIAPI GetFocusChild (HWND hParent);
8765 
8779 MG_EXPORT HWND GUIAPI SetNullFocus (HWND hParent);
8780 
8794 MG_EXPORT HWND GUIAPI SetFocusChild (HWND hWnd);
8795 
8800 #define SetFocus SetFocusChild
8801 
8806 #define GetFocus GetFocusChild
8807 
8819 MG_EXPORT HWND GUIAPI GetActiveWindow (void);
8820 
8834 MG_EXPORT HWND GUIAPI SetActiveWindow (HWND hMainWnd);
8835 
8840 #define GetForegroundWindow GetActiveWindow
8841 
8846 #define SetForegroundWindow SetActiveWindow
8847 
8862 MG_EXPORT HWND GUIAPI GetCapture(void);
8863 
8879 MG_EXPORT HWND GUIAPI SetCapture(HWND hWnd);
8880 
8892 MG_EXPORT void GUIAPI ReleaseCapture(void);
8893 
8906 MG_EXPORT HWND GUIAPI GetWindowUnderCursor (void);
8907 
8922 MG_EXPORT HWND GUIAPI WindowFromPointEx (POINT pt, BOOL bRecursion);
8923 
8924 #define WindowFromPoint(pt) WindowFromPointEx(pt, TRUE)
8925 
8926 #define CWP_ALL 0x0000
8927 #define CWP_SKIPINVISIBLE 0x0001
8928 #define CWP_SKIPDISABLED 0x0002
8929 #define CWP_SKIPTRANSPARENT 0x0004
8930 
8967 MG_EXPORT HWND GUIAPI ChildWindowFromPointEx (HWND hParent, POINT pt,
8968  UINT uFlags);
8969 
8981 static inline HWND GUIAPI ChildWindowFromPoint (HWND hParent, POINT pt)
8982 {
8983  return ChildWindowFromPointEx (hParent, pt, CWP_ALL);
8984 }
8985 
9007 MG_EXPORT BOOL GUIAPI MoveWindow (HWND hWnd, int x, int y, int w, int h,
9008  BOOL fPaint);
9009 
9010 #define SW_INVALIDATE 0x01
9011 #define SW_ERASE 0x02
9012 #define SW_SCROLLCHILDREN 0x04
9013 
9085 MG_EXPORT int GUIAPI ScrollWindowEx (HWND hWnd, int dx, int dy,
9086  const RECT *prcScroll, const RECT *prcClip,
9087  PCLIPRGN pRgnUpdate, PRECT prcUpdate, UINT flags);
9088 
9109 static inline void GUIAPI ScrollWindow (HWND hWnd, int dx, int dy,
9110  const RECT* prcScroll, const RECT* prcClip)
9111 {
9112  ScrollWindowEx (hWnd, dx, dy, prcScroll, prcClip,
9113  NULL, NULL, SW_ERASE | SW_INVALIDATE | SW_SCROLLCHILDREN);
9114 }
9115 
9116 #if 0
9117 /* deprecated. */
9118 #define GetWindowElementColor(iItem) \
9119  GetWindowElementPixelEx(HWND_NULL, (HDC)-1, iItem)
9120 
9121 /* deprecated. */
9122 #define GetWindowElementColorEx(hWnd, iItem) \
9123  GetWindowElementPixelEx(hWnd, (HDC)-1, iItem)
9124 #endif
9125 
9131 #define GetWindowElementPixel(hWnd, iItem) \
9132  GetWindowElementPixelEx(hWnd, HDC_INVALID, iItem)
9133 
9140 #define SYSBMP_RADIOBUTTON "radiobutton"
9141 #define SYSBMP_CHECKBUTTON "checkbutton"
9142 #define SYSBMP_BGPICTURE "bgpicture"
9143 #define SYSBMP_BGPICPOS "bgpicpos"
9144 
9145 /* Obsolete definitions; back-compatibility definitions. */
9146 #define SYSBMP_IMECTRLBTN "IMEctrlbtn"
9147 #define SYSBMP_LOGO "logo"
9148 
9179 MG_EXPORT const BITMAP* GUIAPI GetSystemBitmapEx2 (HDC hdc,
9180  const char* rdr_name, const char* id);
9181 
9203 static inline const BITMAP* GUIAPI GetSystemBitmapEx (const char* rdr_name,
9204  const char* id)
9205 {
9206  return GetSystemBitmapEx2 (HDC_SCREEN, rdr_name, id);
9207 }
9208 
9228 MG_EXPORT const BITMAP* GUIAPI GetSystemBitmap (HWND hWnd, const char* id);
9229 
9236 #define GetSystemBitmapByHwnd(hWnd, id) GetSystemBitmap ((hWnd), (id))
9237 
9257 MG_EXPORT void GUIAPI TermSystemBitmapEx (const char* id,
9258  const char* rdr_name, PBITMAP bmp);
9259 
9278 MG_EXPORT void GUIAPI TermSystemBitmap (HWND hWnd, const char* id, PBITMAP bmp);
9279 
9280 /*for backward compatibility */
9281 #define IDI_APPLICATION 0
9282 #define IDI_HAND 1
9283 #define IDI_STOP IDI_HAND
9284 #define IDI_QUESTION 2
9285 #define IDI_EXCLAMATION 3
9286 #define IDI_ASTERISK 4
9287 #define IDI_INFORMATION IDI_ASTERISK
9288 
9289 #define SYSICON_FT_DIR "dir"
9290 #define SYSICON_FT_FILE "file"
9291 
9292 #define SYSICON_TREEFOLD "treefold"
9293 #define SYSICON_TREEUNFOLD "treeunfold"
9294 
9312 MG_EXPORT HICON GUIAPI LoadSystemIconEx (HDC hdc,
9313  const char* rdr_name, const char* szItemName, int which);
9314 
9329 MG_EXPORT HICON GUIAPI LoadSystemIcon (const char* szItemName, int which);
9330 
9351 MG_EXPORT HICON GUIAPI GetLargeSystemIconEx (HWND hWnd, int iItem);
9352 
9373 MG_EXPORT HICON GUIAPI GetSmallSystemIconEx (HWND hWnd, int iItem);
9374 
9381 #define GetLargeSystemIcon(iItem) GetLargeSystemIconEx(HWND_NULL, iItem)
9382 
9389 #define GetSmallSystemIcon(iItem) GetSmallSystemIconEx(HWND_NULL, iItem)
9390 
9398 #define SB_HORZ 1
9399 #define SB_VERT 2
9400 
9419 MG_EXPORT BOOL GUIAPI EnableScrollBar (HWND hWnd, int iSBar, BOOL bEnable);
9420 
9442 MG_EXPORT BOOL GUIAPI GetScrollPos (HWND hWnd, int iSBar, int* pPos);
9443 
9468 MG_EXPORT BOOL GUIAPI GetScrollRange (HWND hWnd, int iSBar,
9469  int* pMinPos, int* pMaxPos);
9470 
9493 MG_EXPORT BOOL GUIAPI SetScrollPos (HWND hWnd, int iSBar, int iNewPos);
9494 
9519 MG_EXPORT BOOL GUIAPI SetScrollRange (HWND hWnd, int iSBar,
9520  int iMinPos, int iMaxPos);
9521 
9541 MG_EXPORT BOOL GUIAPI ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow);
9542 
9543 #define SIF_RANGE 0x0001
9544 #define SIF_PAGE 0x0002
9545 #define SIF_POS 0x0004
9546 #define SIF_DISABLENOSCROLL 0x0008
9547 #define SIF_TRACKPOS 0x0010
9548 #define SIF_ALL (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)
9549 
9551 #define SB_ARROW_LTUP 0x0001
9552 
9554 #define SB_ARROW_BTDN 0x0002
9555 
9557 #define SB_ARROW_BOTH (SB_ARROW_LTUP | SB_ARROW_BTDN)
9558 
9562 typedef struct _SCROLLINFO
9563 {
9580  int nMin;
9582  int nMax;
9586  int nPos;
9587 #if 0
9588  int nTrackPos;
9589 #endif
9591 
9615 MG_EXPORT BOOL GUIAPI SetScrollInfo (HWND hWnd, int iSBar,
9616  const SCROLLINFO* lpsi, BOOL fRedraw);
9617 
9640 MG_EXPORT BOOL GUIAPI GetScrollInfo (HWND hWnd, int iSBar, PSCROLLINFO lpsi);
9641 
9649 /* Class styles -- not supported so far */
9650 #define CS_VREDRAW 0x0001
9651 #define CS_HREDRAW 0x0002
9652 #define CS_KEYCVTWINDOW 0x0004
9653 #define CS_DBLCLKS 0x0008
9654 
9655 #define CS_OWNDC 0x0020
9656 #define CS_CLASSDC 0x0040
9657 #define CS_PARENTDC 0x0080
9658 
9659 #define CS_NOKEYCVT 0x0100
9660 #define CS_NOCLOSE 0x0200
9661 #define CS_SAVEBITS 0x0800
9662 
9663 #define CS_BYTEALIGNCLIENT 0x1000
9664 #define CS_BYTEALIGNWINDOW 0x2000
9665 #define CS_GLOBALCLASS 0x4000
9666 #define CS_IME 0x8000
9667 
9668 #define COP_STYLE 0x0001
9669 #define COP_HCURSOR 0x0002
9670 #define COP_BKCOLOR 0x0004
9671 #define COP_WINPROC 0x0008
9672 #define COP_ADDDATA 0x0010
9673 
9677 typedef struct _WNDCLASS {
9679  const char* spClassName;
9680 
9694 
9697 
9700 
9703 
9704 #ifndef _MGSCHEMA_COMPOSITING
9705 
9723 #else /* not defined _MGSCHEMA_COMPOSITING */
9724 
9734  DWORD dwBkColor;
9735 #endif /* defined _MGSCHEMA_COMPOSITING */
9736 
9739 
9742 } WNDCLASS;
9743 typedef WNDCLASS* PWNDCLASS;
9744 
9745 #define MAINWINCLASSNAME ("MAINWINDOW")
9746 #define VIRTWINCLASSNAME ("VIRTWINDOW")
9747 #define ROOTWINCLASSNAME ("ROOTWINDOW")
9748 
9767 MG_EXPORT BOOL GUIAPI RegisterWindowClass (PWNDCLASS pWndClass);
9768 
9782 MG_EXPORT BOOL GUIAPI UnregisterWindowClass (const char* szClassName);
9783 
9797 MG_EXPORT const char* GUIAPI GetClassName (HWND hWnd);
9798 
9814 MG_EXPORT BOOL GUIAPI GetWindowClassInfo (PWNDCLASS pWndClass);
9815 
9830 MG_EXPORT BOOL GUIAPI SetWindowClassInfo (const WNDCLASS* pWndClass);
9831 
9876 MG_EXPORT HWND GUIAPI CreateWindowEx2 (const char* spClassName,
9877  const char* spCaption, DWORD dwStyle, DWORD dwExStyle,
9878  LINT id, int x, int y, int w, int h, HWND hParentWnd,
9879  const char* werdr_name, const WINDOW_ELEMENT_ATTR* we_attrs,
9880  DWORD dwAddData);
9881 
9894 static inline HWND GUIAPI CreateWindowEx (const char* spClassName,
9895  const char* spCaption, DWORD dwStyle, DWORD dwExStyle,
9896  LINT id, int x, int y, int w, int h, HWND hParentWnd,
9897  DWORD dwAddData)
9898 {
9899  return CreateWindowEx2 (spClassName, spCaption, dwStyle, dwExStyle,
9900  id, x, y, w, h, hParentWnd, NULL, NULL, dwAddData);
9901 }
9902 
9915 MG_EXPORT BOOL GUIAPI DestroyWindow (HWND hWnd);
9916 
9952 MG_EXPORT NOTIFPROC GUIAPI SetNotificationCallback (HWND hwnd,
9953  NOTIFPROC notif_proc);
9954 
9968 MG_EXPORT NOTIFPROC GUIAPI GetNotificationCallback (HWND hwnd);
9969 
9977 static inline HWND GUIAPI CreateWindow (const char* spClassName,
9978  const char* spCaption, DWORD dwStyle,
9979  LINT id, int x, int y, int w, int h, HWND hParentWnd,
9980  DWORD dwAddData)
9981 {
9982  return CreateWindowEx2 (spClassName, spCaption, dwStyle, WS_EX_NONE,
9983  id, x, y, w, h, hParentWnd, NULL, NULL, dwAddData);
9984 }
9985 
9988 /******************************** Timer Support ******************************/
10011 typedef BOOL (* TIMERPROC)(HWND, LINT, DWORD);
10012 
10054 MG_EXPORT BOOL GUIAPI SetTimerEx (HWND hWnd, LINT id, DWORD speed,
10055  TIMERPROC timer_proc);
10056 
10063 #define SetTimer(hwnd, id, speed) \
10064  SetTimerEx(hwnd, id, speed, NULL)
10065 
10083 MG_EXPORT int GUIAPI KillTimer (HWND hWnd, LINT id);
10084 
10107 MG_EXPORT BOOL GUIAPI ResetTimerEx (HWND hWnd, LINT id, DWORD speed,
10108  TIMERPROC timer_proc);
10109 
10116 #define ResetTimer(hwnd, id, speed) \
10117  ResetTimerEx(hwnd, id, speed, (TIMERPROC)INV_PTR)
10118 
10136 MG_EXPORT BOOL GUIAPI IsTimerInstalled (HWND hWnd, LINT id);
10137 
10150 MG_EXPORT BOOL GUIAPI HaveFreeTimer (void);
10151 
10162 typedef struct _IME_TARGET_INFO
10163 {
10176 
10177  /* The position of the caret */
10178  POINT ptCaret;
10179 
10180  /* The rect of the edit box */
10181  RECT rcEditBox;
10182 } IME_TARGET_INFO;
10183 
10202 MG_EXPORT int GUIAPI RegisterIMEWindow (HWND hWnd);
10203 
10218 MG_EXPORT int GUIAPI UnregisterIMEWindow (HWND hWnd);
10219 
10263 MG_EXPORT int GUIAPI GetIMEStatus (int StatusCode);
10264 
10280 MG_EXPORT int GUIAPI SetIMEStatus (int StatusCode, int Value);
10281 
10295 MG_EXPORT int GUIAPI GetIMETargetInfo (IME_TARGET_INFO *info);
10296 
10312 MG_EXPORT int GUIAPI SetIMETargetInfo (const IME_TARGET_INFO *info);
10313 
10330 MG_EXPORT int GUIAPI GetIMEPos (POINT* pt);
10331 
10349 MG_EXPORT int GUIAPI SetIMEPos (const POINT* pt);
10350 
10369 MG_EXPORT HACCEL GUIAPI CopyAcceleratorTable (HACCEL hacc);
10370 
10384 MG_EXPORT int GUIAPI DeleteAccelerators (HACCEL hacc, int key, DWORD keymask);
10385 
10386 #define ACCEL_SHIFT KS_SHIFT
10387 #define ACCEL_ALT KS_ALT
10388 #define ACCEL_CTRL KS_CTRL
10389 
10418 MG_EXPORT int GUIAPI AddAccelerators (HACCEL hacc, int key,
10419  DWORD keymask, WPARAM wParam, LPARAM lParam);
10420 
10435 MG_EXPORT int GUIAPI DestroyAcceleratorTable (HACCEL hacc);
10436 
10448 MG_EXPORT HACCEL GUIAPI CreateAcceleratorTable (HWND hWnd);
10449 
10461 MG_EXPORT int GUIAPI TranslateAccelerator (HACCEL hAccel, PMSG pMsg);
10462 
10488 MG_EXPORT BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap,
10489  int nWidth, int nHeight);
10490 
10506 MG_EXPORT BOOL GUIAPI ChangeCaretSize (HWND hWnd, int newWidth, int newHeight);
10507 
10520 MG_EXPORT BOOL GUIAPI ActiveCaret (HWND hWnd);
10521 
10537 MG_EXPORT UINT GUIAPI GetCaretBlinkTime (HWND hWnd);
10538 
10555 MG_EXPORT BOOL GUIAPI SetCaretBlinkTime (HWND hWnd, UINT uTime);
10556 
10569 MG_EXPORT BOOL GUIAPI DestroyCaret (HWND hWnd);
10570 
10588 MG_EXPORT BOOL GUIAPI HideCaretEx (HWND hWnd, BOOL ime);
10589 
10604 static inline BOOL GUIAPI HideCaret (HWND hWnd)
10605 {
10606  return HideCaretEx (hWnd, TRUE);
10607 }
10608 
10626 MG_EXPORT BOOL GUIAPI ShowCaretEx (HWND hWnd, BOOL ime);
10627 
10642 static inline BOOL GUIAPI ShowCaret (HWND hWnd)
10643 {
10644  return ShowCaretEx (hWnd, TRUE);
10645 }
10646 
10663 MG_EXPORT BOOL GUIAPI SetCaretPos (HWND hWnd, int x, int y);
10664 
10679 MG_EXPORT BOOL GUIAPI GetCaretPos (HWND hWnd, PPOINT pPt);
10680 
10688 /* Menu flags */
10689 #define MF_INSERT 0x00000000L
10690 #define MF_CHANGE 0x00000080L
10691 #define MF_APPEND 0x00000100L
10692 #define MF_DELETE 0x00000200L
10693 #define MF_REMOVE 0x00001000L
10694 
10695 #define MF_BYCOMMAND 0x00000000L
10696 #define MF_BYPOSITION 0x00000400L
10697 
10698 #define MF_SEPARATOR 0x00000800L
10699 
10700 #define MF_ENABLED 0x00000000L
10701 #define MF_GRAYED 0x00000001L
10702 #define MF_DISABLED 0x00000002L
10703 
10704 #define MF_UNCHECKED 0x00000000L
10705 #define MF_CHECKED 0x00000008L
10706 #define MF_USECHECKBITMAPS 0x00000200L
10707 
10708 #define MF_STRING 0x00000000L
10709 #define MF_BITMAP 0x00000004L
10710 #define MF_OWNERDRAW 0x00000100L
10711 
10712 #define MF_POPUP 0x00000010L
10713 #define MF_MENUBARBREAK 0x00000020L
10714 #define MF_MENUBREAK 0x00000040L
10715 
10716 #define MF_UNHILITE 0x00000000L
10717 #define MF_HILITE 0x00000080L
10718 
10719 #define MF_DEFAULT 0x00001000L
10720 #define MF_SYSMENU 0x00002000L
10721 #define MF_HELP 0x00004000L
10722 #define MF_RIGHTJUSTIFY 0x00004000L
10723 
10724 #define MF_MOUSESELECT 0x00008000L
10725 #define MF_END 0x00000080L
10726 
10727 #define MFT_STRING MF_STRING /* 0x00000000L */
10728 #define MFT_BITMAP MF_BITMAP /* 0x00000004L */
10729 #define MFT_BMPSTRING 0x00010000L
10730 #define MFT_MENUBARBREAK MF_MENUBARBREAK /* 0x00000020L */
10731 #define MFT_MENUBREAK MF_MENUBREAK /* 0x00000040L */
10732 #define MFT_OWNERDRAW MF_OWNERDRAW /* 0x00000100L */
10733 #define MFT_RADIOCHECK 0x00000200L
10734 #define MFT_MARKCHECK 0x00000400L
10735 #define MFT_SEPARATOR MF_SEPARATOR /* 0x00000800L */
10736 
10737 #define MFT_RIGHTORDER 0x00002000L
10738 #define MFT_RIGHTJUSTIFY MF_RIGHTJUSTIFY
10739 
10740 #define MFS_GRAYED 0x00000003L
10741 #define MFS_DISABLED MFS_GRAYED
10742 #define MFS_CHECKED MF_CHECKED
10743 #define MFS_HILITE MF_HILITE
10744 #define MFS_ENABLED MF_ENABLED
10745 #define MFS_UNCHECKED MF_UNCHECKED
10746 #define MFS_UNHILITE MF_UNHILITE
10747 #define MFS_DEFAULT MF_DEFAULT
10748 
10749 /* System Menu Command Values */
10750  #define SC_SIZE 0xF000
10751  #define SC_MOVE 0xF010
10752  #define SC_MINIMIZE 0xF020
10753  #define SC_MAXIMIZE 0xF030
10754  #define SC_NEXTWINDOW 0xF040
10755  #define SC_PREVWINDOW 0xF050
10756  #define SC_CLOSE 0xF060
10757  #define SC_VSCROLL 0xF070
10758  #define SC_HSCROLL 0xF080
10759  #define SC_MOUSEMENU 0xF090
10760  #define SC_KEYMENU 0xF100
10761  #define SC_ARRANGE 0xF110
10762  #define SC_RESTORE 0xF120
10763  #define SC_TASKLIST 0xF130
10764  #define SC_SCREENSAVE 0xF140
10765  #define SC_HOTKEY 0xF150
10766 
10767  #define SC_DEFAULT 0xF160
10768  #define SC_MONITORPOWER 0xF170
10769  #define SC_CONTEXTHELP 0xF180
10770  #define SC_SEPARATOR 0xF00F
10771 
10772 /* MENUITEMINFO flags */
10773  #define MIIM_STATE 0x00000001
10774  #define MIIM_ID 0x00000002
10775  #define MIIM_SUBMENU 0x00000004
10776  #define MIIM_CHECKMARKS 0x00000008
10777  #define MIIM_TYPE 0x00000010
10778  #define MIIM_DATA 0x00000020
10779  #define MIIM_STRING 0x00000040
10780  #define MIIM_BITMAP 0x00000080
10781  #define MIIM_FTYPE 0x00000100
10782 
10783 
10784 /* Flags for TrackPopupMenu */
10785  #define TPM_LEFTBUTTON 0x0000L
10786  #define TPM_RIGHTBUTTON 0x0002L
10787  #define TPM_LEFTALIGN 0x0000L
10788  #define TPM_CENTERALIGN 0x0004L
10789  #define TPM_RIGHTALIGN 0x0008L
10790  #define TPM_TOPALIGN 0x0000L
10791  #define TPM_VCENTERALIGN 0x0010L
10792  #define TPM_BOTTOMALIGN 0x0020L
10793 
10794  #define TPM_HORIZONTAL 0x0000L /* Horz alignment matters more */
10795  #define TPM_VERTICAL 0x0040L /* Vert alignment matters more */
10796  #define TPM_NONOTIFY 0x0080L /* Don't send any notification msgs */
10797  #define TPM_RETURNCMD 0x0100L
10798 
10799  #define TPM_DESTROY 0x1000L /* Destroy menu after tracking */
10800  #define TPM_SYSCMD 0x2000L /* Send system command */
10801  #define TPM_DEFAULT 0x0000L /* Default tracking flag */
10802 
10803 /* return codes for MSG_MENUCHAR */
10804 #define MNC_IGNORE 0
10805 #define MNC_CLOSE 1
10806 #define MNC_EXECUTE 2
10807 #define MNC_SELECT 3
10808 
10812 typedef struct _MENUITEMINFO {
10813 
10831 
10859 
10874 
10879 
10882 
10885 
10888 
10891 
10894 
10900 } MENUITEMINFO;
10901 typedef MENUITEMINFO* PMENUITEMINFO;
10902 
10914 MG_EXPORT HMENU GUIAPI CreateMenu (void);
10915 
10930 MG_EXPORT HMENU GUIAPI CreatePopupMenu ( PMENUITEMINFO pmii);
10931 
10946 MG_EXPORT HMENU GUIAPI CreateSystemMenu (HWND hwnd, DWORD dwStyle);
10947 
10976 MG_EXPORT int GUIAPI InsertMenuItem (HMENU hmnu, LINT item,
10977  UINT flag, PMENUITEMINFO pmii);
10978 
11005 MG_EXPORT int GUIAPI RemoveMenu (HMENU hmnu, LINT item, UINT flag);
11006 
11032 MG_EXPORT int GUIAPI DeleteMenu (HMENU hmnu, LINT item, UINT flag);
11033 
11050 MG_EXPORT int GUIAPI DestroyMenu (HMENU hmnu);
11051 
11066 MG_EXPORT int GUIAPI IsMenu (HMENU hmnu);
11067 
11082 MG_EXPORT HMENU GUIAPI SetMenu (HWND hwnd, HMENU hmnu);
11083 
11096 MG_EXPORT HMENU GUIAPI GetMenu (HWND hwnd);
11097 
11110 MG_EXPORT void GUIAPI DrawMenuBar (HWND hwnd);
11111 
11126 MG_EXPORT int GUIAPI TrackMenuBar (HWND hwnd, int pos);
11127 
11165 MG_EXPORT int GUIAPI TrackPopupMenu (HMENU hmnu, UINT uFlags,
11166  int x, int y, HWND hwnd);
11167 
11185 MG_EXPORT HMENU GUIAPI GetMenuBarItemRect (HWND hwnd, int pos, RECT* prc);
11186 
11187 #define LFRDR_MENU_STATE_HILITE 0x01
11188 #define LFRDR_MENU_STATE_NORMAL 0x02
11189 #define LFRDR_MENU_STATE_DISABLED 0x04
11190 
11212 MG_EXPORT BOOL GUIAPI HiliteMenuBarItem (HWND hwnd, int pos, UINT flag);
11213 
11226 MG_EXPORT int GUIAPI GetMenuItemCount (HMENU hmnu);
11227 
11245 MG_EXPORT LINT GUIAPI GetMenuItemID (HMENU hmnu, int pos);
11246 
11272 MG_EXPORT int GUIAPI GetMenuItemInfo (HMENU hmnu, LINT item,
11273  UINT flag, PMENUITEMINFO pmii);
11274 
11275 /*Reserved*/
11276 int GUIAPI GetMenuItemRect (HWND hwnd, HMENU hmnu,
11277  LINT item, PRECT prc);
11278 
11291 MG_EXPORT HMENU GUIAPI GetPopupSubMenu (HMENU hpppmnu);
11292 
11305 MG_EXPORT HMENU GUIAPI StripPopupHead (HMENU hpppmnu);
11306 
11324 MG_EXPORT HMENU GUIAPI GetSubMenu (HMENU hmnu, int pos);
11325 
11343 MG_EXPORT HMENU GUIAPI GetSystemMenu (HWND hwnd, BOOL flag);
11344 
11366 MG_EXPORT UINT GUIAPI EnableMenuItem (HMENU hmnu, LINT item, UINT flag);
11367 
11394 MG_EXPORT int GUIAPI CheckMenuRadioItem (HMENU hmnu, LINT first, LINT last,
11395  LINT checkitem, UINT flag);
11396 
11422 MG_EXPORT int GUIAPI SetMenuItemBitmaps (HMENU hmnu, LINT item, UINT flag,
11423  PBITMAP hBmpUnchecked, PBITMAP hBmpChecked);
11424 
11448 MG_EXPORT int GUIAPI SetMenuItemInfo (HMENU hmnu, LINT item,
11449  UINT flag, PMENUITEMINFO pmii);
11450 
11458 /* Dialog codes */
11463 #define DLGC_WANTARROWS 0x0001
11464 
11468 #define DLGC_WANTTAB 0x0002
11469 
11473 #define DLGC_WANTALLKEYS 0x0004
11474 
11478 #define DLGC_WANTCHARS 0x0008
11479 
11484 #define DLGC_WANTENTER 0x0010
11485 
11489 #define DLGC_HASSETSEL 0x0080
11490 
11495 #define DLGC_DEFPUSHBUTTON 0x0100
11496 
11500 #define DLGC_PUSHBUTTON 0x0200
11501 
11505 #define DLGC_RADIOBUTTON 0x0400
11506 
11510 #define DLGC_3STATE 0x0800
11511 
11515 #define DLGC_STATIC 0x1000
11516 
11520 #define DLGC_BUTTON 0x2000
11521 
11525 typedef struct _CTRLDATA
11526 {
11528  const char* class_name;
11532  int x, y, w, h;
11538  const char* caption;
11543 
11545  const char* werdr_name;
11546 
11549 } CTRLDATA;
11550 typedef CTRLDATA* PCTRLDATA;
11551 
11559 typedef struct _DLGTEMPLATE
11560 {
11566  int x, y, w, h;
11568  const char* caption;
11579 } DLGTEMPLATE;
11580 typedef DLGTEMPLATE* PDLGTEMPLATE;
11581 
11613 MG_EXPORT HWND GUIAPI CreateMainWindowIndirectParamEx (PDLGTEMPLATE pDlgTemplate,
11614  HWND hOwner, WNDPROC WndProc, LPARAM lParam,
11615  const char* werdr_name, WINDOW_ELEMENT_ATTR* we_attrs,
11616  const char* window_name, const char* layer_name);
11617 
11630 static inline HWND GUIAPI CreateMainWindowIndirectParam (
11631  PDLGTEMPLATE pDlgTemplate, HWND hOwner,
11632  WNDPROC WndProc, LPARAM lParam)
11633 {
11634  return CreateMainWindowIndirectParamEx (pDlgTemplate, hOwner,
11635  WndProc, lParam, NULL, NULL, NULL, NULL);
11636 }
11637 
11649 static inline HWND GUIAPI CreateMainWindowIndirect (
11650  PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC WndProc)
11651 {
11652  return CreateMainWindowIndirectParam (pDlgTemplate, hOwner, WndProc, 0);
11653 }
11654 
11666 MG_EXPORT BOOL GUIAPI DestroyMainWindowIndirect (HWND hMainWin);
11667 
11701 MG_EXPORT int GUIAPI DialogBoxIndirectParamEx (PDLGTEMPLATE pDlgTemplate,
11702  HWND hOwner, WNDPROC DlgProc, LPARAM lParam,
11703  const char* werdr_name, WINDOW_ELEMENT_ATTR* we_attrs,
11704  const char* window_name, const char* layer_name);
11705 
11717 static inline int GUIAPI DialogBoxIndirectParam (PDLGTEMPLATE pDlgTemplate,
11718  HWND hOwner, WNDPROC DlgProc, LPARAM lParam)
11719 {
11720  return DialogBoxIndirectParamEx (pDlgTemplate, hOwner, DlgProc, lParam,
11721  NULL, NULL, NULL, NULL);
11722 }
11723 
11741 MG_EXPORT BOOL GUIAPI EndDialog (HWND hDlg, int endCode);
11742 
11753 MG_EXPORT void GUIAPI DestroyAllControls (HWND hWnd);
11754 
11766 MG_EXPORT HWND GUIAPI GetDlgDefPushButton (HWND hWnd);
11767 
11782 MG_EXPORT LINT GUIAPI GetDlgCtrlID (HWND hwndCtl);
11783 
11798 MG_EXPORT HWND GUIAPI GetDlgItem (HWND hDlg, LINT nIDDlgItem);
11799 
11832 MG_EXPORT UINT GUIAPI GetDlgItemInt (HWND hDlg, LINT nIDDlgItem,
11833  BOOL *lpTranslated, BOOL bSigned);
11834 
11857 MG_EXPORT int GUIAPI GetDlgItemText (HWND hDlg, LINT nIDDlgItem,
11858  char* lpString, int nMaxCount);
11859 
11880 MG_EXPORT char* GUIAPI GetDlgItemText2 (HWND hDlg, LINT id, int* lenPtr);
11881 
11901 MG_EXPORT HWND GUIAPI GetNextDlgGroupItem (HWND hDlg,
11902  HWND hCtl, BOOL bPrevious);
11903 
11922 MG_EXPORT HWND GUIAPI GetNextDlgTabItem (HWND hDlg, HWND hCtl, BOOL bPrevious);
11923 
11945 MG_EXPORT LRESULT GUIAPI SendDlgItemMessage (HWND hDlg, LINT nIDDlgItem,
11946  UINT message, WPARAM wParam, LPARAM lParam);
11947 
11970 MG_EXPORT BOOL GUIAPI SetDlgItemInt (HWND hDlg, LINT nIDDlgItem,
11971  UINT uValue, BOOL bSigned);
11972 
11992 MG_EXPORT BOOL GUIAPI SetDlgItemText (HWND hDlg, LINT nIDDlgItem,
11993  const char* lpString);
11994 
11995 #ifdef _MGCTRL_BUTTON
11996 
12021 MG_EXPORT void GUIAPI CheckDlgButton (HWND hDlg, LINT nIDDlgItem, int nCheck);
12022 
12044 MG_EXPORT void GUIAPI CheckRadioButton (HWND hDlg,
12045  LINT idFirstButton, LINT idLastButton, LINT idCheckButton);
12046 
12074 MG_EXPORT int GUIAPI IsDlgButtonChecked (HWND hDlg, LINT idButton);
12075 #endif
12076 
12084 #if defined(_MGCTRL_STATIC) && defined (_MGCTRL_BUTTON)
12085 
12086 /* Standard control IDs */
12087 #define IDC_STATIC 0
12088 #define IDOK 1
12089 #define IDCANCEL 2
12090 #define IDABORT 3
12091 #define IDRETRY 4
12092 #define IDIGNORE 5
12093 #define IDYES 6
12094 #define IDNO 7
12095 
12096 #define MINID_RESERVED 0xF001
12097 #define MAXID_RESERVED 0xFFFF
12098 
12099 #define MB_OK 0x00000000
12100 #define MB_OKCANCEL 0x00000001
12101 #define MB_YESNO 0x00000002
12102 #define MB_RETRYCANCEL 0x00000003
12103 #define MB_ABORTRETRYIGNORE 0x00000004
12104 #define MB_YESNOCANCEL 0x00000005
12105 #define MB_CANCELASBACK 0x00000008 /* customized style */
12106 #define MB_TYPEMASK 0x00000007
12107 
12108 #define MB_ICONHAND 0x00000010
12109 #define MB_ICONQUESTION 0x00000020
12110 #define MB_ICONEXCLAMATION 0x00000030
12111 #define MB_ICONASTERISK 0x00000040
12112 #define MB_ICONMASK 0x000000F0
12113 
12114 #define MB_ICONINFORMATION MB_ICONASTERISK
12115 #define MB_ICONSTOP MB_ICONHAND
12116 
12117 #define MB_DEFBUTTON1 0x00000000
12118 #define MB_DEFBUTTON2 0x00000100
12119 #define MB_DEFBUTTON3 0x00000200
12120 #define MB_DEFMASK 0x00000F00
12121 
12122 /* #define MB_APPLMODAL 0x00000000 */
12123 /* #define MB_SYSTEMMODAL 0x00001000 */
12124 /* #define MB_TASKMODAL 0x00002000 */
12125 
12126 #define MB_NOFOCUS 0x00008000
12127 
12128 #define MB_ALIGNCENTER 0x00000000
12129 #define MB_ALIGNTOPLEFT 0x00010000
12130 #define MB_ALIGNBTMLEFT 0x00020000
12131 #define MB_ALIGNTOPRIGHT 0x00030000
12132 #define MB_ALIGNBTMRIGHT 0x00040000
12133 #define MB_ALIGNMASK 0x00070000
12134 
12135 #define MB_BASEDONPARENT 0x00080000 /* default is desktop. */
12136 
12239 MG_EXPORT int GUIAPI MessageBox (HWND hParentWnd, const char* pszText,
12240  const char* pszCaption, DWORD dwStyle);
12241 
12242 #endif /* _MGCTRL_STATIC && _MGCTRL_BUTTON */
12243 
12254 MG_EXPORT void GUIAPI MessageBeep (DWORD dwBeep);
12255 
12260 #ifdef __cplusplus
12261 }
12262 #endif /* __cplusplus */
12263 
12264 #endif /* _MGUI_WINDOW_H */
12265 
_WNDCLASS
Definition: window.h:9677
PostMessage
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.
LFRDR_TRACKBARINFO
struct _LFRDR_TRACKBARINFO LFRDR_TRACKBARINFO
StripPopupHead
MG_EXPORT HMENU GUIAPI StripPopupHead(HMENU hpppmnu)
Strips the title of the popup menu.
_WINDOWINFO::spCaption
const char * spCaption
Definition: window.h:5608
GetPopupSubMenu
MG_EXPORT HMENU GUIAPI GetPopupSubMenu(HMENU hpppmnu)
Retrieve the submenu of the specified popup menu.
CreateMenu
MG_EXPORT HMENU GUIAPI CreateMenu(void)
Creates an empty menu.
InsertMenuItem
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.
RegisterSystemBitmap
MG_EXPORT BOOL GUIAPI RegisterSystemBitmap(HDC hdc, const char *rdr_name, const char *id)
Register a device-dependent bitmap from id to BITMAP cache.
DestroyMainWindow
MG_EXPORT BOOL GUIAPI DestroyMainWindow(HWND hWnd)
Destroys a main window.
GetRootWindow
MG_EXPORT HWND GUIAPI GetRootWindow(int *nrWins)
Retrieve the root window of the current thread.
_POINT
Definition: common.h:966
GetScrollPos
MG_EXPORT BOOL GUIAPI GetScrollPos(HWND hWnd, int iSBar, int *pPos)
Retrieve the current position of the scroll box (thumb) in the specified scroll bar.
_MENUITEMINFO::itemdata
DWORD itemdata
Definition: window.h:10890
ClientWidthToWindowWidthEx
MG_EXPORT int GUIAPI ClientWidthToWindowWidthEx(DWORD dwStyle, int win_type, int cw)
Calculates main window width from the width of the client area.
GetUpdateRegion
MG_EXPORT int GUIAPI GetUpdateRegion(HWND hWnd, PCLIPRGN pRgn)
Copy the update region of a window to a region.
CreateMainWindowIndirect
static HWND GUIAPI CreateMainWindowIndirect(PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC WndProc)
A simplified version of CreateMainWindowIndirectParam.
Definition: window.h:11649
WE_COLORS_NUMBER
#define WE_COLORS_NUMBER
The number of window element color attributes.
Definition: window.h:4818
_MSG::hwnd
HWND hwnd
Definition: window.h:3151
CheckRadioButton
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...
TranslateMessage
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.
EndPaint
MG_EXPORT void GUIAPI EndPaint(HWND hWnd, HDC hdc)
Marks the end of painting in a window.
ChildWindowFromPointEx
MG_EXPORT HWND GUIAPI ChildWindowFromPointEx(HWND hParent, POINT pt, UINT uFlags)
Retrieve a handle to the child window that contains the speicified point and meets the certain criter...
NULL
#define NULL
A value indicates null pointer.
Definition: common.h:369
_WINDOW_ELEMENT_RENDERER::on_set_rdr_attr
DWORD(* on_set_rdr_attr)(struct _WINDOW_ELEMENT_RENDERER *, int we_attr_id, DWORD we_attr, BOOL change)
Definition: window.h:5558
SetActiveWindow
MG_EXPORT HWND GUIAPI SetActiveWindow(HWND hMainWnd)
Set a main window to be the active main window.
_WINDOWINFO::we_rdr
WINDOW_ELEMENT_RENDERER * we_rdr
Definition: window.h:5672
CreateMainWindow
static HWND GUIAPI CreateMainWindow(PMAINWINCREATE pCreateInfo)
A simplified version of CreateMainWindowEx.
Definition: window.h:7046
AddResRef
MG_EXPORT int AddResRef(RES_KEY key)
Increase the reference count of a buffered resource.
SCROLLBARDATA
struct _SCROLLBARDATA SCROLLBARDATA
_IME_TARGET_INFO
Definition: window.h:10162
RemoveWindowElementRenderer
MG_EXPORT BOOL GUIAPI RemoveWindowElementRenderer(const char *name)
Remove a window renderer from MiniGUI.
SetDlgItemInt
MG_EXPORT BOOL GUIAPI SetDlgItemInt(HWND hDlg, LINT nIDDlgItem, UINT uValue, BOOL bSigned)
Set the text of a control in a dialog box to the string representation of a specified integer value.
_MAINWINCREATE::MainWindowProc
LRESULT(* MainWindowProc)(HWND, UINT, WPARAM, LPARAM)
Definition: window.h:6784
GetWindowAdditionalData
MG_EXPORT DWORD GUIAPI GetWindowAdditionalData(HWND hWnd)
Retrieve the first additional data of a window.
_MSG::lParam
LPARAM lParam
Definition: window.h:3159
GetIMEStatus
MG_EXPORT int GUIAPI GetIMEStatus(int StatusCode)
Retrieve status of the current IME window.
GetSmallSystemIconEx
MG_EXPORT HICON GUIAPI GetSmallSystemIconEx(HWND hWnd, int iItem)
Retrieve a small system icon by its identifier.
SetTimerEx
MG_EXPORT BOOL GUIAPI SetTimerEx(HWND hWnd, LINT id, DWORD speed, TIMERPROC timer_proc)
Creates a timer with the specified timeout value.
WindowToScreen
MG_EXPORT void GUIAPI WindowToScreen(HWND hWnd, int *x, int *y)
Converts the window coordinates of a point to screen coordinates.
IME_TARGET_INFO
struct _IME_TARGET_INFO IME_TARGET_INFO
DWORD
DWORD_PTR DWORD
A unsigned long type definition for pointer precision.
Definition: common.h:604
_MENUITEMINFO::type
UINT type
Definition: window.h:10858
EndDialog
MG_EXPORT BOOL GUIAPI EndDialog(HWND hDlg, int endCode)
Destroys a modal dialog box, causing MiniGUI to end any processing for the dialog box.
RegisterEventHookWindow
MG_EXPORT BOOL GUIAPI RegisterEventHookWindow(HWND hwnd, DWORD flags)
Register an input event message hook window.
_LFRDR_TRACKBARINFO
Definition: window.h:5140
_WNDCLASS::iBkColor
gal_pixel iBkColor
Definition: window.h:9722
PeekMessageEx
MG_EXPORT BOOL GUIAPI PeekMessageEx(PMSG pMsg, HWND hWnd, UINT nMsgFilterMin, UINT nMsgFilterMax, BOOL bWait, UINT uRemoveMsg)
Peek a message from the message queue of a main window.
_CTRLDATA::we_attrs
const WINDOW_ELEMENT_ATTR * we_attrs
Definition: window.h:11548
GetNextMainWindow
MG_EXPORT HWND GUIAPI GetNextMainWindow(HWND hMainWnd)
Retrieve the next main window in the system according to the zorder.
EnableWindow
MG_EXPORT BOOL GUIAPI EnableWindow(HWND hWnd, BOOL fEnable)
Enables of disables a window.
HWND
GHANDLE HWND
Handle to main window or control.
Definition: common.h:407
WNDPROC
LRESULT(* WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Type of the window callback procedure.
Definition: window.h:4992
PeekPostMessage
MG_EXPORT BOOL GUIAPI PeekPostMessage(PMSG pMsg, HWND hWnd, UINT nMsgFilterMin, UINT nMsgFilterMax, UINT uRemoveMsg)
Peek a post message from the message queue of a main window.
_WINDOWINFO::iBkColor
gal_pixel iBkColor
Definition: window.h:5651
SetCapture
MG_EXPORT HWND GUIAPI SetCapture(HWND hWnd)
Set the mouse capture to the specified window.
HDC
GHANDLE HDC
Handle to device context.
Definition: common.h:412
DeleteAccelerators
MG_EXPORT int GUIAPI DeleteAccelerators(HACCEL hacc, int key, DWORD keymask)
Deletes an accelerator from the accelerator table.
_WINDOWINFO::vscroll
LFSCROLLBARINFO vscroll
Definition: window.h:5667
_WINDOW_ELEMENT_RENDERER::draw_checkmark
void(* draw_checkmark)(HDC hdc, const RECT *pRect, DWORD color, int status)
Definition: window.h:5304
_MSG::wParam
WPARAM wParam
Definition: window.h:3156
LoadSystemIconEx
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.
RegisterMouseHookWindow
MG_EXPORT HWND GUIAPI RegisterMouseHookWindow(HWND hwnd, DWORD flag)
Registers a mouse message hook window.
_WNDCLASS::WinProc
LRESULT(* WinProc)(HWND, UINT, WPARAM, LPARAM)
Definition: window.h:9738
DLGTEMPLATE
struct _DLGTEMPLATE DLGTEMPLATE
__mg_def_proc
MG_EXPORT WNDPROC __mg_def_proc[4]
The default window callback procedure array.
_WINDOW_ELEMENT_RENDERER::draw_normal_menu_item
void(* draw_normal_menu_item)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:5564
_WINDOW_ELEMENT_RENDERER::on_click_hotspot
int(* on_click_hotspot)(HWND hWnd, int which)
Definition: window.h:5498
DWORD2PixelByWindow
MG_EXPORT gal_pixel GUIAPI DWORD2PixelByWindow(HWND hWnd, DWORD dwColor)
Convert a DWORD color to gal_pixel for a window.
SetFocusChild
MG_EXPORT HWND GUIAPI SetFocusChild(HWND hWnd)
Set the active child of a window.
MainWindowThreadCleanup
static BOOL MainWindowThreadCleanup(HWND hMainWnd)
Cleanup the main window.
Definition: window.h:6908
_LFRDR_WINSTYLEINFO
Definition: window.h:5119
RES_TYPE_MYBITMAP
@ RES_TYPE_MYBITMAP
Definition: window.h:6118
SetScrollPos
MG_EXPORT BOOL GUIAPI SetScrollPos(HWND hWnd, int iSBar, int iNewPos)
Set the position of the scroll box (thumb) of the specified scroll bar.
SetWindowIcon
MG_EXPORT HICON GUIAPI SetWindowIcon(HWND hWnd, HICON hIcon, BOOL bRedraw)
Set the current icon of a window.
_MAINWINCREATE
Definition: window.h:6761
SetCaretBlinkTime
MG_EXPORT BOOL GUIAPI SetCaretBlinkTime(HWND hWnd, UINT uTime)
Set the caret blink time to the specified number of milliseconds.
_SCROLLINFO::nMin
int nMin
Definition: window.h:9580
_WINDOW_ELEMENT_RENDERER::init
int(* init)(PWERENDERER renderer)
Definition: window.h:5237
GetLargeSystemIconEx
MG_EXPORT HICON GUIAPI GetLargeSystemIconEx(HWND hWnd, int iItem)
Retrieve a large system icon by its identifier in default renderer.
WNDCLASS
struct _WNDCLASS WNDCLASS
_LOGFONT
Definition: gdi.h:6478
_CTRLDATA::id
LINT id
Definition: window.h:11536
WINDOWINFO
struct _WINDOWINFO WINDOWINFO
SetWindowElementAttr
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.
GetWindowElementPixelEx
MG_EXPORT gal_pixel GUIAPI GetWindowElementPixelEx(HWND hwnd, HDC hdc, int we_attr_id)
Get the pixel value of a window element.
UnregisterEventHookWindow
MG_EXPORT BOOL GUIAPI UnregisterEventHookWindow(HWND hwnd)
Unregister an input event message hook window.
_SCROLLBARDATA::barLen
int barLen
Definition: window.h:5072
SetIMETargetInfo
MG_EXPORT int GUIAPI SetIMETargetInfo(const IME_TARGET_INFO *info)
Set the target info of the current IME window.
SendAsyncMessage
MG_EXPORT LRESULT GUIAPI SendAsyncMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Send an asynchronical message to a window.
GetSystemMenu
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...
TermRendererSystemIcon
MG_EXPORT void TermRendererSystemIcon(HICON *small_icon, HICON *large_icon)
Release large and small system icon resources.
_WINDOWINFO::dwAddData2
DWORD dwAddData2
Definition: window.h:5624
_SCROLLBARDATA::pageStep
int pageStep
Definition: window.h:5066
_WINDOWINFO::idx_znode
int idx_znode
Definition: window.h:5648
GetSubMenu
MG_EXPORT HMENU GUIAPI GetSubMenu(HMENU hmnu, int pos)
Retrieve the handle to the submenu activated by the specified menu item.
GetActiveWindow
MG_EXPORT HWND GUIAPI GetActiveWindow(void)
Retrieve the main window handle of the active main window.
ClientToWindow
MG_EXPORT void GUIAPI ClientToWindow(HWND hWnd, int *x, int *y)
Converts the client coordinates to the window coordinates.
_WNDCLASS::spClassName
const char * spClassName
Definition: window.h:9679
SRVEVTHOOK
int(* SRVEVTHOOK)(PMSG pMsg)
The type of the event hook.
Definition: window.h:4213
TranslateAccelerator
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.
RES_TYPE_ETC
@ RES_TYPE_ETC
Definition: window.h:6139
RegisterResType
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...
WPARAM
UINT_PTR WPARAM
A type definition for the first message paramter.
Definition: common.h:706
_WINDOWINFO::cl
int cl
Definition: window.h:5637
RES_TYPE_USER
@ RES_TYPE_USER
Definition: window.h:6165
_WINDOW_ELEMENT_RENDERER::draw_fold
void(* draw_fold)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color, int status, int next)
Definition: window.h:5338
_WINDOW_ELEMENT_RENDERER::draw_custom_hotspot
void(* draw_custom_hotspot)(HWND hWnd, HDC hdc, int ht_code, int state)
Definition: window.h:5509
SetResPath
MG_EXPORT int SetResPath(const char *path)
Set user's resource path into the search paths of resource manager.
_WINDOWINFO::hscroll
LFSCROLLBARINFO hscroll
Definition: window.h:5669
SetWindowCallbackProc
MG_EXPORT WNDPROC GUIAPI SetWindowCallbackProc(HWND hWnd, WNDPROC newProc)
Set the callback procedure of a window.
LRESULT
LONG_PTR LRESULT
Signed result of message processing.
Definition: common.h:583
_WINDOWINFO::hCursor
HCURSOR hCursor
Definition: window.h:5658
_LFSCROLLBARINFO::arrowLen
int arrowLen
Definition: window.h:5044
UINT
unsigned int UINT
A type definition for unsigned integer.
Definition: common.h:664
BYTE
unsigned char BYTE
A type definition for an 8-bit unsigned character (byte).
Definition: common.h:460
SetMenuItemBitmaps
MG_EXPORT int GUIAPI SetMenuItemBitmaps(HMENU hmnu, LINT item, UINT flag, PBITMAP hBmpUnchecked, PBITMAP hBmpChecked)
Associates the specified bitmap with a menu item.
GetWindowRegion
BOOL GUIAPI GetWindowRegion(HWND hWnd, CLIPRGN *region)
The function obtains a copy of the window region of a window.
UpdateInvalidClient
MG_EXPORT void GUIAPI UpdateInvalidClient(HWND hWnd, BOOL bErase)
Updates the invalid client areas in a window.
HaveFreeTimer
MG_EXPORT BOOL GUIAPI HaveFreeTimer(void)
Determine whether there is any free timer slot in the current thread.
GetDefaultWindowElementRenderer
MG_EXPORT WINDOW_ELEMENT_RENDERER *GUIAPI GetDefaultWindowElementRenderer(void)
Get the default window renderer.
GetCaretPos
MG_EXPORT BOOL GUIAPI GetCaretPos(HWND hWnd, PPOINT pPt)
Get the caret position.
MENUITEMINFO
struct _MENUITEMINFO MENUITEMINFO
GetMenu
MG_EXPORT HMENU GUIAPI GetMenu(HWND hwnd)
Retrieve the handle to the menu assigned to the given main window.
GetWindowElementAttr
MG_EXPORT DWORD GUIAPI GetWindowElementAttr(HWND hwnd, int we_attr_id)
Get a window element data.
RES_TYPE_FONT
@ RES_TYPE_FONT
Definition: window.h:6160
GetWindowInfo
static const WINDOWINFO *GUIAPI GetWindowInfo(HWND hWnd)
Get the handle of window information.
Definition: window.h:5686
_CTRLDATA
Definition: window.h:11525
LINT
LONG_PTR LINT
Signed integer which has pointer precision.
Definition: common.h:577
_WINDOW_ELEMENT_RENDERER::hit_test
int(* hit_test)(HWND hWnd, int x, int y)
Definition: window.h:5495
_RECT
Definition: common.h:936
RegisterEventHookFunc
MG_EXPORT MSGHOOK GUIAPI RegisterEventHookFunc(int event_type, MSGHOOK hook, void *context)
Registers an input event message hook function.
GetMenuItemInfo
MG_EXPORT int GUIAPI GetMenuItemInfo(HMENU hmnu, LINT item, UINT flag, PMENUITEMINFO pmii)
Retrieve information about a menu item.
SetWindowCursor
MG_EXPORT HCURSOR GUIAPI SetWindowCursor(HWND hWnd, HCURSOR hNewCursor)
Set the current cursor of a window.
SCROLLINFO
struct _SCROLLINFO SCROLLINFO
AddWindowElementRenderer
MG_EXPORT BOOL GUIAPI AddWindowElementRenderer(const char *name, const WINDOW_ELEMENT_RENDERER *we_rdr)
Add a window element renderer to the system.
ScrollWindowEx
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's client area.
_CTRLDATA::dwExStyle
DWORD dwExStyle
Definition: window.h:11542
SetScrollRange
MG_EXPORT BOOL GUIAPI SetScrollRange(HWND hWnd, int iSBar, int iMinPos, int iMaxPos)
Set the minimum and maximum position values for the specified scroll bar.
_WINDOW_ELEMENT_RENDERER::calc_3dbox_color
DWORD(* calc_3dbox_color)(DWORD color, int flag)
Definition: window.h:5259
SetWindowFont
MG_EXPORT PLOGFONT GUIAPI SetWindowFont(HWND hWnd, PLOGFONT pLogFont)
Set the default font of a window.
UpdateWindow
MG_EXPORT void GUIAPI UpdateWindow(HWND hWnd, BOOL bErase)
Updates a window.
_SCROLLINFO::nPage
UINT nPage
Definition: window.h:9584
DeleteMenu
MG_EXPORT int GUIAPI DeleteMenu(HMENU hmnu, LINT item, UINT flag)
Deletes an item from the specified menu.
ExcludeWindowExStyle
MG_EXPORT BOOL GUIAPI ExcludeWindowExStyle(HWND hWnd, DWORD dwStyle)
Removes the specific extended style of a window.
_DLGTEMPLATE::dwExStyle
DWORD dwExStyle
Definition: window.h:11564
_WINDOW_ELEMENT_RENDERER::we_fonts
PLOGFONT we_fonts[WE_FONTS_NUMBER]
Definition: window.h:5582
RegisterResFromMem
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.
GetDlgDefPushButton
MG_EXPORT HWND GUIAPI GetDlgDefPushButton(HWND hWnd)
Get the default push button control in a window.
HMENU
GHANDLE HMENU
Handle to menu.
Definition: common.h:432
SetWindowClassInfo
MG_EXPORT BOOL GUIAPI SetWindowClassInfo(const WNDCLASS *pWndClass)
Set the information of the specified window class.
_CTRLDATA::dwAddData
DWORD dwAddData
Definition: window.h:11540
_LFSCROLLBARINFO::curPos
int curPos
Definition: window.h:5040
DestroyAllControls
MG_EXPORT void GUIAPI DestroyAllControls(HWND hWnd)
Destroys all controls in a window.
EmptyMessageQueue
MG_EXPORT BOOL GUIAPI EmptyMessageQueue(HWND hWnd)
Empty a message queue.
_WINDOW_ELEMENT_RENDERER::draw_hilite_item
void(* draw_hilite_item)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:5349
NotifyWindow
MG_EXPORT int GUIAPI NotifyWindow(HWND hWnd, LINT id, int code, DWORD dwAddData)
Send a notification message to a window.
GetClassName
const MG_EXPORT char *GUIAPI GetClassName(HWND hWnd)
Retrieve the name of the class to which the specified window belongs.
FALSE
#define FALSE
FALSE value, defined as 0 by MiniGUI.
Definition: common.h:351
_LFRDR_WINSTYLEINFO::winType
int winType
Definition: window.h:5132
InitWindowElementAttrs
MG_EXPORT BOOL GUIAPI InitWindowElementAttrs(PWERENDERER rdr)
Str2Key
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...
GetWindowText
MG_EXPORT int GUIAPI GetWindowText(HWND hWnd, char *spString, int nMaxLen)
Copies the text of a window's into a buffer.
DestroyVirtualWindow
MG_EXPORT BOOL GUIAPI DestroyVirtualWindow(HWND hWnd)
Destroy a virtual window.
GetThreadByWindow
MG_EXPORT BOOL GUIAPI GetThreadByWindow(HWND hWnd, pthread_t *thread)
Get the thread identifier which a window belongs to.
_WINDOW_ELEMENT_RENDERER::draw_header
void(* draw_header)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:5544
TrackPopupMenu
MG_EXPORT int GUIAPI TrackPopupMenu(HMENU hmnu, UINT uFlags, int x, int y, HWND hwnd)
Displays and tracks a popup menu.
_WINDOWINFO::hSysMenu
HMENU hSysMenu
Definition: window.h:5662
ScreenToWindow
MG_EXPORT void GUIAPI ScreenToWindow(HWND hWnd, int *x, int *y)
Converts the screen coordinates of a point to window coordinates.
_MAINWINCREATE::dwAddData
DWORD dwAddData
Definition: window.h:6795
SetNullFocus
MG_EXPORT HWND GUIAPI SetNullFocus(HWND hParent)
Cancels the current active child and set the focus child to be null.
GetWindowCursor
MG_EXPORT HCURSOR GUIAPI GetWindowCursor(HWND hWnd)
Retrieve the current cursor of a window.
WindowToClient
MG_EXPORT void GUIAPI WindowToClient(HWND hWnd, int *x, int *y)
Converts the window coordinates to client coordinates.
ShowCaretEx
MG_EXPORT BOOL GUIAPI ShowCaretEx(HWND hWnd, BOOL ime)
Shows a caret.
_MSG
Definition: window.h:3148
_SCROLLBARDATA::minPos
int minPos
Definition: window.h:5060
GetScrollInfo
MG_EXPORT BOOL GUIAPI GetScrollInfo(HWND hWnd, int iSBar, PSCROLLINFO lpsi)
Retrieve the parameters of a scroll bar.
BroadcastMessageInThisThread
MG_EXPORT int GUIAPI BroadcastMessageInThisThread(UINT nMsg, WPARAM wParam, LPARAM lParam)
Broadcast a message to all main/virtual windows in the current thread.
GetResPath
const MG_EXPORT char * GetResPath(void)
Get the currrent user's resource path.
SetKeyboardLayout
MG_EXPORT BOOL GUIAPI SetKeyboardLayout(const char *kbd_layout)
Set a new keyboard layout.
HICON
GHANDLE HICON
Handle to icon.
Definition: common.h:427
SetWindowText
MG_EXPORT BOOL GUIAPI SetWindowText(HWND hWnd, const char *spString)
Set the text of a window.
_WINDOW_ELEMENT_RENDERER::calc_we_metrics
int(* calc_we_metrics)(HWND hWnd, LFRDR_WINSTYLEINFO *style_info, int which)
Definition: window.h:5487
_WINDOW_ELEMENT_RENDERER::on_get_rdr_attr
DWORD(* on_get_rdr_attr)(struct _WINDOW_ELEMENT_RENDERER *, int we_attr_id)
Definition: window.h:5550
GetWindowUnderCursor
MG_EXPORT HWND GUIAPI GetWindowUnderCursor(void)
Retrieve the handle to the window (if any) which is just beneath the mouse cursor.
GetNextDlgGroupItem
MG_EXPORT HWND GUIAPI GetNextDlgGroupItem(HWND hDlg, HWND hCtl, BOOL bPrevious)
Retrieve the handle to the first control in a group of controls that precedes (or follows) the specif...
WE_METRICS_NUMBER
#define WE_METRICS_NUMBER
The number of window element metric attributes.
Definition: window.h:4812
DestroyWindow
MG_EXPORT BOOL GUIAPI DestroyWindow(HWND hWnd)
Destroys a specified control.
IsWindowVisible
MG_EXPORT BOOL GUIAPI IsWindowVisible(HWND hWnd)
Retrieve the visibility state of the specified window.
CreateMainWindowIndirectParamEx
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,...
LoadResource
MG_EXPORT void * LoadResource(const char *res_name, int type, DWORD usr_param)
Load a resource from disk or memory.
_WINDOWINFO::id
LINT id
Definition: window.h:5613
GetWindowStyle
MG_EXPORT DWORD GUIAPI GetWindowStyle(HWND hWnd)
Retrieve the style of a window.
_WINDOWINFO::hIcon
HICON hIcon
Definition: window.h:5660
_MAINWINCREATE::lx
int lx
Definition: window.h:6787
_MSG::time
DWORD time
Definition: window.h:3162
_MAINWINCREATE::hIcon
HICON hIcon
Definition: window.h:6778
ClientHeightToWindowHeightEx
MG_EXPORT int GUIAPI ClientHeightToWindowHeightEx(DWORD dwStyle, int win_type, int ch, BOOL hasMenu)
Calculates window height from the height of the client area.
_WINDOWINFO
Definition: window.h:5600
GetDlgItem
MG_EXPORT HWND GUIAPI GetDlgItem(HWND hDlg, LINT nIDDlgItem)
Retrieve the handle to a control in a dialog box.
Uint8
unsigned char Uint8
A type definition for an 8-bit unsigned character.
Definition: common.h:157
HACCEL
GHANDLE HACCEL
Handle to accelarator.
Definition: common.h:437
GetWindowClassAdditionalData
MG_EXPORT DWORD GUIAPI GetWindowClassAdditionalData(HWND hWnd)
Retrieve the additional data of a control class.
RegisterKeyMsgHook
static MSGHOOK GUIAPI RegisterKeyMsgHook(void *context, MSGHOOK hook)
Register a key message hook function.
Definition: window.h:4080
_LFRDR_WINSTYLEINFO::dwStyle
int dwStyle
Definition: window.h:5122
_SCROLLINFO::cbSize
UINT cbSize
Definition: window.h:9565
WaitMessage
MG_EXPORT BOOL GUIAPI WaitMessage(PMSG pMsg, HWND hMainWnd)
Wait for a message from the message queue of a main window.
IsMenu
MG_EXPORT int GUIAPI IsMenu(HMENU hmnu)
Determine whether a handle is a menu handle.
_WINDOW_ELEMENT_RENDERER::deinit
int(* deinit)(PWERENDERER renderer)
Definition: window.h:5243
GetClientRect
MG_EXPORT BOOL GUIAPI GetClientRect(HWND hWnd, PRECT prc)
Retrieve the client rectangle of a window.
_MAINWINCREATE::hCursor
HCURSOR hCursor
Definition: window.h:6775
_WINDOW_ELEMENT_RENDERER
Definition: window.h:5229
SetWindowMaskEx
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")'s Mask Rect with BITMA...
_MENUITEMINFO::id
LINT id
Definition: window.h:10878
GetSystemBitmapEx2
const MG_EXPORT BITMAP *GUIAPI GetSystemBitmapEx2(HDC hdc, const char *rdr_name, const char *id)
Retrieve the system bitmap object by identifier.
_WINDOW_ELEMENT_RENDERER::draw_3dbox
void(* draw_3dbox)(HDC hdc, const RECT *pRect, DWORD color, DWORD flag)
Definition: window.h:5280
BOOL
int BOOL
A type definition for boolean value.
Definition: common.h:343
_WINDOWINFO::NotifProc
NOTIFPROC NotifProc
Definition: window.h:5619
_MENUITEMINFO::checkedbmp
PBITMAP checkedbmp
Definition: window.h:10887
SetScrollInfo
MG_EXPORT BOOL GUIAPI SetScrollInfo(HWND hWnd, int iSBar, const SCROLLINFO *lpsi, BOOL fRedraw)
Set the parameters of a scroll bar.
GetWindowRendererFromName
MG_EXPORT WINDOW_ELEMENT_RENDERER *GUIAPI GetWindowRendererFromName(const char *name)
Get window renderer from name.
_WINDOW_ELEMENT_RENDERER::draw_tab
void(* draw_tab)(HWND hWnd, HDC hdc, RECT *rect, char *title, DWORD color, int flag, HICON icon)
Definition: window.h:5534
_WINDOWINFO::WinProc
WNDPROC WinProc
Definition: window.h:5616
PM_REMOVE
#define PM_REMOVE
Definition: window.h:3182
ActiveCaret
MG_EXPORT BOOL GUIAPI ActiveCaret(HWND hWnd)
Activates the caret owned by a window.
RES_TYPE_IMAGE
@ RES_TYPE_IMAGE
Definition: window.h:6112
ChangeCaretSize
MG_EXPORT BOOL GUIAPI ChangeCaretSize(HWND hWnd, int newWidth, int newHeight)
Changes the size of the caret.
_DLGTEMPLATE::dwAddData
DWORD dwAddData
Definition: window.h:11578
_MENUITEMINFO::uncheckedbmp
PBITMAP uncheckedbmp
Definition: window.h:10884
_WINDOW_ELEMENT_RENDERER::draw_trackbar
void(* draw_trackbar)(HWND hWnd, HDC hdc, LFRDR_TRACKBARINFO *info)
Definition: window.h:5455
IsWindowEnabled
MG_EXPORT BOOL GUIAPI IsWindowEnabled(HWND hWnd)
Determine whether the specified window is enabled for mouse and keyboard input.
_LFSCROLLBARINFO
Definition: window.h:5034
RES_TYPE_MEM_RES
@ RES_TYPE_MEM_RES
Definition: window.h:6155
_WINDOW_ELEMENT_RENDERER::calc_we_area
int(* calc_we_area)(HWND hWnd, int which, RECT *we_area)
Definition: window.h:5463
SetWindowAdditionalData
MG_EXPORT DWORD GUIAPI SetWindowAdditionalData(HWND hWnd, DWORD newData)
Set the first additional data of a window.
emResType
emResType
Definition: window.h:6105
_WINDOW_ELEMENT_RENDERER::name
const char name[LEN_RENDERER_NAME+1]
Definition: window.h:5231
UnregisterSystemBitmap
MG_EXPORT void GUIAPI UnregisterSystemBitmap(HDC hdc, const char *rdr_name, const char *id)
Unregister a BITMAP object from the system BITMAP cache.
GetWindowCaption
const MG_EXPORT char *GUIAPI GetWindowCaption(HWND hWnd)
Retrieve the caption of a window.
_MENUITEMINFO::mask
UINT mask
Definition: window.h:10830
DestroyAcceleratorTable
MG_EXPORT int GUIAPI DestroyAcceleratorTable(HACCEL hacc)
Destroys an accelerator table.
_MENUITEMINFO::hsubmenu
HMENU hsubmenu
Definition: window.h:10881
NOTIFPROC
void(* NOTIFPROC)(HWND hwnd, LINT id, int nc, DWORD add_data)
Type of the notification callback procedure.
Definition: window.h:5014
_WINDOW_ELEMENT_RENDERER::draw_radio_button
void(* draw_radio_button)(HWND hWnd, HDC hdc, const RECT *pRect, int status)
Definition: window.h:5392
DialogBoxIndirectParam
static int GUIAPI DialogBoxIndirectParam(PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC DlgProc, LPARAM lParam)
A simplified version of DialogBoxIndirectParamEx.
Definition: window.h:11717
GetResource
MG_EXPORT void * GetResource(RES_KEY key)
Retrieve and return a buffered resource by the key.
_DLGTEMPLATE::controls
PCTRLDATA controls
Definition: window.h:11576
HavePendingMessage
MG_EXPORT BOOL GUIAPI HavePendingMessage(HWND hMainWnd)
Check if there is any pending message in the message queue of a main window.
WindowFromPointEx
MG_EXPORT HWND GUIAPI WindowFromPointEx(POINT pt, BOOL bRecursion)
Retrieve a handle to the window that contains the specified point.
RegisterMouseMsgHook
static MSGHOOK GUIAPI RegisterMouseMsgHook(void *context, MSGHOOK hook)
Register a mouse message hook function.
Definition: window.h:4101
DestroyCaret
MG_EXPORT BOOL GUIAPI DestroyCaret(HWND hWnd)
Destroys a caret.
TranslateKeyMsgToChar
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.
_SCROLLBARDATA
Definition: window.h:5058
GetWindowBkColor
MG_EXPORT gal_pixel GUIAPI GetWindowBkColor(HWND hWnd)
Returns the current background color of a window.
PostQuitMessage
MG_EXPORT int GUIAPI PostQuitMessage(HWND hWnd)
Puts a MSG_QUIT message into the message queue of a main window.
ChildWindowFromPoint
static HWND GUIAPI ChildWindowFromPoint(HWND hParent, POINT pt)
Retrieve a handle to the child window that contains the speicified point.
Definition: window.h:8981
SetAutoRepeatMessage
MG_EXPORT void GUIAPI SetAutoRepeatMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Set the auto-repeat message.
ResetTimerEx
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.
_SCROLLBARDATA::arrowLen
int arrowLen
Definition: window.h:5068
_WINDOW_ELEMENT_RENDERER::draw_caption_button
void(* draw_caption_button)(HWND hwnd, HDC hdc, int ht_code, int state)
Definition: window.h:5431
_MAINWINCREATE::spCaption
const char * spCaption
Definition: window.h:6769
ClientToScreen
MG_EXPORT void GUIAPI ClientToScreen(HWND hWnd, int *x, int *y)
Converts the client coordinates of a point to screen coordinates.
_SCROLLINFO
Definition: window.h:9562
GetFirstHosted
MG_EXPORT HWND GUIAPI GetFirstHosted(HWND hHosting)
Retrieve the first hosted window of a main window or a virtual window.
_WNDCLASS::dwStyle
DWORD dwStyle
Definition: window.h:9696
_WINDOWINFO::dwStyle
DWORD dwStyle
Definition: window.h:5641
ExcludeWindowStyle
MG_EXPORT BOOL GUIAPI ExcludeWindowStyle(HWND hWnd, DWORD dwStyle)
Removes the specific style of a window.
SetDefaultWindowElementRenderer
const MG_EXPORT char *GUIAPI SetDefaultWindowElementRenderer(const char *name)
Set a window element renderer as the default system renderer.
IncludeWindowExStyle
MG_EXPORT BOOL GUIAPI IncludeWindowExStyle(HWND hWnd, DWORD dwStyle)
Includes the specific extended style of a window.
GetParent
MG_EXPORT HWND GUIAPI GetParent(HWND hWnd)
Retrieve the handle to a child window's parent window.
SendDlgItemMessage
MG_EXPORT LRESULT GUIAPI SendDlgItemMessage(HWND hDlg, LINT nIDDlgItem, UINT message, WPARAM wParam, LPARAM lParam)
Send a message to the specified control in a dialog box.
_WINDOWINFO::hAccel
HACCEL hAccel
Definition: window.h:5656
_WINDOW_ELEMENT_RENDERER::we_colors
DWORD we_colors[WE_COLORS_NUMBER][3]
Definition: window.h:5579
_MSG::message
UINT message
Definition: window.h:3153
_WINDOW_ELEMENT_RENDERER::erase_background
void(* erase_background)(HWND hWnd, HDC hdc, const RECT *rect)
Definition: window.h:5561
CTRLDATA
struct _CTRLDATA CTRLDATA
ValidateRegion
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...
CreateMainWindowEx2
MG_EXPORT HWND GUIAPI CreateMainWindowEx2(PMAINWINCREATE create_info, LINT id, const char *werdr_name, const WINDOW_ELEMENT_ATTR *we_attrs, unsigned int surf_flag, DWORD bkgnd_color, int compos_type, DWORD ct_arg)
Creates a main window with specified compositing type and identifier.
_MAINWINCREATE::hMenu
HMENU hMenu
Definition: window.h:6772
_MENUITEMINFO::typedata
DWORD typedata
Definition: window.h:10893
SetMenuItemInfo
MG_EXPORT int GUIAPI SetMenuItemInfo(HMENU hmnu, LINT item, UINT flag, PMENUITEMINFO pmii)
Changes information about a menu item.
GetIMEPos
MG_EXPORT int GUIAPI GetIMEPos(POINT *pt)
Retrieve the position of the current IME window.
SetServerEventHook
MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook(SRVEVTHOOK SrvEvtHook)
Set an event hook in the server of MiniGUI-Processes.
IsVirtualWindow
MG_EXPORT BOOL GUIAPI IsVirtualWindow(HWND hWnd)
Determine whether a window is a virtual window.
_LFSCROLLBARINFO::minPos
int minPos
Definition: window.h:5036
GetMenuItemCount
MG_EXPORT int GUIAPI GetMenuItemCount(HMENU hmnu)
Determine the number of items in a menu.
GetWindowRect
MG_EXPORT BOOL GUIAPI GetWindowRect(HWND hWnd, PRECT prc)
Retrieve the dimensions of the bounding rectangle of a window.
HideCaret
static BOOL GUIAPI HideCaret(HWND hWnd)
Hides a caret.
Definition: window.h:10604
_SCROLLBARDATA::barStart
int barStart
Definition: window.h:5070
_WINDOWINFO::left
int left
Definition: window.h:5633
_DLGTEMPLATE::caption
const char * caption
Definition: window.h:11568
_WINDOW_ELEMENT_RENDERER::draw_push_button
void(* draw_push_button)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color1, DWORD color2, int status)
Definition: window.h:5373
_CTRLDATA::class_name
const char * class_name
Definition: window.h:11528
IsControl
MG_EXPORT BOOL GUIAPI IsControl(HWND hWnd)
Determine whether a window is a control.
GetWindowTextLength
MG_EXPORT int GUIAPI GetWindowTextLength(HWND hWnd)
Retrieve the length of a window's text.
_WNDCLASS::hCursor
HCURSOR hCursor
Definition: window.h:9702
_WNDCLASS::dwAddData
DWORD dwAddData
Definition: window.h:9741
_CTRLDATA::werdr_name
const char * werdr_name
Definition: window.h:11545
GetCaretBlinkTime
MG_EXPORT UINT GUIAPI GetCaretBlinkTime(HWND hWnd)
Returns the elapsed time, in milliseconds, required to invert the caret's pixels.
_SCROLLINFO::fMask
UINT fMask
Definition: window.h:9578
GetWindowId
MG_EXPORT LINT GUIAPI GetWindowId(HWND hWnd)
Get the identifier of a window.
IncludeWindowStyle
MG_EXPORT BOOL GUIAPI IncludeWindowStyle(HWND hWnd, DWORD dwStyle)
Includes the specific style of a window.
HiliteMenuBarItem
MG_EXPORT BOOL GUIAPI HiliteMenuBarItem(HWND hwnd, int pos, UINT flag)
Draws the specified menubar item with 3D effect.
GetDlgItemText
MG_EXPORT int GUIAPI GetDlgItemText(HWND hDlg, LINT nIDDlgItem, char *lpString, int nMaxCount)
Retrieve the title or text associated with a control in a dialog box.
_DLGTEMPLATE::hMenu
HMENU hMenu
Definition: window.h:11572
RetrieveRes
const MG_EXPORT BITMAP *GUIAPI RetrieveRes(const char *file)
Get a BITMAP object from cache according to the specified resource file name.
UnregisterIMEWindow
MG_EXPORT int GUIAPI UnregisterIMEWindow(HWND hWnd)
Unregisters an IME window.
GetNextChild
MG_EXPORT HWND GUIAPI GetNextChild(HWND hWnd, HWND hChild)
Retrieve the next control in a window.
GetMenuItemID
MG_EXPORT LINT GUIAPI GetMenuItemID(HMENU hmnu, int pos)
Retrieve the menu item identifier of a menu item at specified position in a menu.
AdjustWindowRectEx
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...
GetWindowAdditionalData2
MG_EXPORT DWORD GUIAPI GetWindowAdditionalData2(HWND hWnd)
Retrieve the second additional data of a window.
GetWindowFont
MG_EXPORT PLOGFONT GUIAPI GetWindowFont(HWND hWnd)
Retrieve the default font of a window.
GetNextDlgTabItem
MG_EXPORT HWND GUIAPI GetNextDlgTabItem(HWND hDlg, HWND hCtl, BOOL bPrevious)
Retrieve the handle to the first control that has the WS_TABSTOP style that precedes (or follows) the...
KillTimer
MG_EXPORT int GUIAPI KillTimer(HWND hWnd, LINT id)
Destroys a timer.
_MENUITEMINFO::state
UINT state
Definition: window.h:10873
MAINWINCREATE
struct _MAINWINCREATE MAINWINCREATE
MessageBeep
MG_EXPORT void GUIAPI MessageBeep(DWORD dwBeep)
Makes a sound of beep.
_WINDOWINFO::hMenu
HMENU hMenu
Definition: window.h:5654
_MAINWINCREATE::dwReserved
DWORD dwReserved
Definition: window.h:6798
WINDOW_ELEMENT_RENDERER
struct _WINDOW_ELEMENT_RENDERER WINDOW_ELEMENT_RENDERER
_WINDOW_ELEMENT_RENDERER::draw_checkbox
void(* draw_checkbox)(HDC hdc, const RECT *pRect, DWORD color, int status)
Definition: window.h:5298
SetWindowCaption
MG_EXPORT BOOL GUIAPI SetWindowCaption(HWND hWnd, const char *spCaption)
Set the caption of a window.
_WINDOW_ELEMENT_RENDERER::draw_normal_item
void(* draw_normal_item)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:5345
ScrollWindow
static void GUIAPI ScrollWindow(HWND hWnd, int dx, int dy, const RECT *prcScroll, const RECT *prcClip)
Scrolls the content of a window's client area.
Definition: window.h:9109
_DLGTEMPLATE
Definition: window.h:11559
_WNDCLASS::dwExStyle
DWORD dwExStyle
Definition: window.h:9699
_WINDOW_ELEMENT_RENDERER::draw_border
void(* draw_border)(HWND hWnd, HDC hdc, BOOL is_active)
Definition: window.h:5413
SetWindowClassAdditionalData
MG_EXPORT DWORD GUIAPI SetWindowClassAdditionalData(HWND hWnd, DWORD newData)
Set the additional data of a control class.
_WNDCLASS::opMask
DWORD opMask
Definition: window.h:9693
RemoveWindowLocalData
MG_EXPORT BOOL GUIAPI RemoveWindowLocalData(HWND hwnd, const char *data_name)
Remove the local data bound with a name for a window.
MSG
struct _MSG MSG
_WINDOW_ELEMENT_RENDERER::draw_check_button
void(* draw_check_button)(HWND hWnd, HDC hdc, const RECT *pRect, int status)
Definition: window.h:5410
SetWindowBkColor
MG_EXPORT gal_pixel GUIAPI SetWindowBkColor(HWND hWnd, gal_pixel new_bkcolor)
Set the background color of a window.
ReleaseRes
MG_EXPORT int ReleaseRes(RES_KEY key)
Release the buffered resource. It will decrease the reference count of the resource....
GetDlgItemText2
MG_EXPORT char *GUIAPI GetDlgItemText2(HWND hDlg, LINT id, int *lenPtr)
Retrieve the title or text associated with a control in a dialog box.
_LFSCROLLBARINFO::barStart
int barStart
Definition: window.h:5046
_WINDOW_ELEMENT_RENDERER::calc_thumb_area
void(* calc_thumb_area)(HWND hWnd, BOOL vertical, LFSCROLLBARINFO *sb_info)
Definition: window.h:5517
SetMenu
MG_EXPORT HMENU GUIAPI SetMenu(HWND hwnd, HMENU hmnu)
Assigns a new menu to the specified main window.
MainWindowCleanup
MG_EXPORT BOOL GUIAPI MainWindowCleanup(HWND hMainWnd)
Cleans up system resource associated with a main window.
VirtualWindowCleanup
MG_EXPORT BOOL GUIAPI VirtualWindowCleanup(HWND hVirtWnd)
Cleanup the system resource associated with a virtual window.
UnregisterRes
MG_EXPORT void GUIAPI UnregisterRes(const char *file)
Unregister the BITMAP object from cache according to the specified resource file name.
_SCROLLBARDATA::curPos
int curPos
Definition: window.h:5064
_SCROLLINFO::nMax
int nMax
Definition: window.h:9582
GetHosting
MG_EXPORT HWND GUIAPI GetHosting(HWND hWnd)
Retrieve the hosting window of a main window or a virtual window.
CreateAcceleratorTable
MG_EXPORT HACCEL GUIAPI CreateAcceleratorTable(HWND hWnd)
Creates an empty accelerator table.
DestroyMainWindowIndirect
MG_EXPORT BOOL GUIAPI DestroyMainWindowIndirect(HWND hMainWin)
Destroys a main window created by CreateMainWindowIndirectParam.
GetWindowExStyle
MG_EXPORT DWORD GUIAPI GetWindowExStyle(HWND hWnd)
Retrieve the extended style of a window.
_WINDOW_ELEMENT_RENDERER::draw_radio
void(* draw_radio)(HDC hdc, const RECT *pRect, DWORD color, int status)
Definition: window.h:5293
common.h
This file includes macro definitions and typedefs that commonly used by MiniGUI.
SendNotifyMessage
MG_EXPORT int GUIAPI SendNotifyMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Send a notification message to a window.
PeekMessage
static BOOL GUIAPI PeekMessage(PMSG pMsg, HWND hWnd, UINT nMsgFilterMin, UINT nMsgFilterMax, UINT uRemoveMsg)
Peek a message from the message queue of a main window.
Definition: window.h:3305
CreatePopupMenu
MG_EXPORT HMENU GUIAPI CreatePopupMenu(PMENUITEMINFO pmii)
Creates a drop-down menu or submenu.
ShowWindow
MG_EXPORT BOOL GUIAPI ShowWindow(HWND hWnd, int iCmdShow)
Shows or hides a window.
_LFSCROLLBARINFO::pageStep
int pageStep
Definition: window.h:5042
_MENUITEMINFO
Definition: window.h:10812
_MAINWINCREATE::iBkColor
gal_pixel iBkColor
Definition: window.h:6792
_WINDOW_ELEMENT_RENDERER::draw_arrow
void(* draw_arrow)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color, int status)
Definition: window.h:5323
LEN_RENDERER_NAME
#define LEN_RENDERER_NAME
The maximum length of a renderer name.
Definition: window.h:5165
DialogBoxIndirectParamEx
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.
_WINDOW_ELEMENT_RENDERER::draw_disabled_item
void(* draw_disabled_item)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:5353
PostSyncMessage
MG_EXPORT LRESULT GUIAPI PostSyncMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Post a synchronical message to a window which is in different thread.
_WINDOW_ELEMENT_ATTR
Definition: window.h:5017
InitRendererSystemIcon
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.
_SCROLLBARDATA::maxPos
int maxPos
Definition: window.h:5062
SetWindowElementRenderer
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.
GetIMETargetInfo
MG_EXPORT int GUIAPI GetIMETargetInfo(IME_TARGET_INFO *info)
Retrieve the target info of the current IME window.
_DLGTEMPLATE::x
int x
Definition: window.h:11566
CreateMainWindowEx
static HWND GUIAPI CreateMainWindowEx(PMAINWINCREATE pCreateInfo, const char *werdr_name, const WINDOW_ELEMENT_ATTR *we_attrs, const char *window_name, const char *layer_name)
Creates a main window.
Definition: window.h:7028
CreateMainWindowIndirectParam
static HWND GUIAPI CreateMainWindowIndirectParam(PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC WndProc, LPARAM lParam)
A simplified version of CreateMainWindowIndirectParamEx.
Definition: window.h:11630
RegisterWindowClass
MG_EXPORT BOOL GUIAPI RegisterWindowClass(PWNDCLASS pWndClass)
Registers a window class.
_MAINWINCREATE::hHosting
HWND hHosting
Definition: window.h:6781
_LFSCROLLBARINFO::maxPos
int maxPos
Definition: window.h:5038
TermSystemBitmapEx
MG_EXPORT void GUIAPI TermSystemBitmapEx(const char *id, const char *rdr_name, PBITMAP bmp)
Release the system bitmap object by identifier.
IsWindowInThisThread
MG_EXPORT BOOL GUIAPI IsWindowInThisThread(HWND hWnd)
Determine whether a window was created in this thread.
_CLIPRGN
Definition: gdi.h:780
SetWindowId
MG_EXPORT LINT GUIAPI SetWindowId(HWND hWnd, LINT lNewId)
Set the identifier of a window.
GetNotificationCallback
MG_EXPORT NOTIFPROC GUIAPI GetNotificationCallback(HWND hwnd)
Get the notification callback procedure of a control.
_MENUITEMINFO::cch
UINT cch
Definition: window.h:10899
InvalidateRect
MG_EXPORT BOOL GUIAPI InvalidateRect(HWND hWnd, const RECT *prc, BOOL bEraseBkgnd)
Makes a rectangle region in the client area of a window invalid.
_WINDOW_ELEMENT_RENDERER::draw_significant_item
void(* draw_significant_item)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:5357
DestroyMenu
MG_EXPORT int GUIAPI DestroyMenu(HMENU hmnu)
Destroys the specified menu and frees any memory that the menu occupies.
UnregisterResType
MG_EXPORT int UnregisterResType(int type)
Unregister a user-defined resource type.
LoadSystemIcon
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....
_DLGTEMPLATE::controlnr
int controlnr
Definition: window.h:11574
_SCROLLINFO::nPos
int nPos
Definition: window.h:9586
_WINDOWINFO::dwAddData
DWORD dwAddData
Definition: window.h:5622
LFRDR_WINSTYLEINFO
struct _LFRDR_WINSTYLEINFO LFRDR_WINSTYLEINFO
_LFSCROLLBARINFO::barLen
int barLen
Definition: window.h:5048
ShowScrollBar
MG_EXPORT BOOL GUIAPI ShowScrollBar(HWND hWnd, int iSBar, BOOL bShow)
Shows or hides the specified scroll bar.
LFSCROLLBARINFO
struct _LFSCROLLBARINFO LFSCROLLBARINFO
_WINDOW_ELEMENT_RENDERER::disabled_text_out
void(* disabled_text_out)(HWND hWnd, HDC hdc, const char *spText, PRECT rc, DWORD dt_fmt)
Definition: window.h:5521
_MYBITMAP
Definition: gdi.h:11024
ShowCaret
static BOOL GUIAPI ShowCaret(HWND hWnd)
Shows a caret.
Definition: window.h:10642
SetIMEStatus
MG_EXPORT int GUIAPI SetIMEStatus(int StatusCode, int Value)
Set the status of the current IME window.
MSGHOOK
int(* MSGHOOK)(void *context, HWND dst_wnd, UINT msg, WPARAM wparam, LPARAM lparam)
Type of message hook function.
Definition: window.h:4026
ReleaseCapture
MG_EXPORT void GUIAPI ReleaseCapture(void)
Releases the mouse capture from a window and restores normal mouse input processing.
EnableMenuItem
MG_EXPORT UINT GUIAPI EnableMenuItem(HMENU hmnu, LINT item, UINT flag)
Enables, disables, or grays the specified menu item.
TermSystemBitmap
MG_EXPORT void GUIAPI TermSystemBitmap(HWND hWnd, const char *id, PBITMAP bmp)
Release the system bitmap object by identifier.
CreateSystemMenu
MG_EXPORT HMENU GUIAPI CreateSystemMenu(HWND hwnd, DWORD dwStyle)
Creates a system menu.
_MAINWINCREATE::dwStyle
DWORD dwStyle
Definition: window.h:6763
SetWindowMask
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")'s Mask Rect with MYBIT...
_WINDOW_ELEMENT_RENDERER::refcount
unsigned int refcount
Definition: window.h:5588
RemoveMenu
MG_EXPORT int GUIAPI RemoveMenu(HMENU hmnu, LINT item, UINT flag)
Deletes a menu item or detaches a submenu from the specified menu.
_WINDOW_ELEMENT_ATTR::we_attr
DWORD we_attr
Definition: window.h:5021
CheckMenuRadioItem
MG_EXPORT int GUIAPI CheckMenuRadioItem(HMENU hmnu, LINT first, LINT last, LINT checkitem, UINT flag)
Check a specified menu item and makes it a radio item.
SetNotificationCallback
MG_EXPORT NOTIFPROC GUIAPI SetNotificationCallback(HWND hwnd, NOTIFPROC notif_proc)
Set a new notification callback procedure for a window.
IsWindow
MG_EXPORT BOOL GUIAPI IsWindow(HWND hWnd)
Determine whether a window handle identifies an existing window.
_DLGTEMPLATE::dwStyle
DWORD dwStyle
Definition: window.h:11562
GetDlgCtrlID
MG_EXPORT LINT GUIAPI GetDlgCtrlID(HWND hwndCtl)
Get the integer identifier of a control.
_WINDOW_ELEMENT_RENDERER::draw_hilite_menu_item
void(* draw_hilite_menu_item)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:5568
CheckDlgButton
MG_EXPORT void GUIAPI CheckDlgButton(HWND hDlg, LINT nIDDlgItem, int nCheck)
Changes the check status of a button control.
GetMainWindowHandle
MG_EXPORT HWND GUIAPI GetMainWindowHandle(HWND hWnd)
Retrieve the handle to the main window contains a window.
WE_FONTS_NUMBER
#define WE_FONTS_NUMBER
The number of window element font attributes.
Definition: window.h:4806
SetWindowRegion
BOOL GUIAPI SetWindowRegion(HWND hWnd, const CLIPRGN *region)
Set window's Mask Rect with CLIPRGN data.
_WINDOW_ELEMENT_RENDERER::draw_progress
void(* draw_progress)(HWND hWnd, HDC hdc, int nMax, int nMin, int nPos, BOOL fVertical)
Definition: window.h:5538
CopyAcceleratorTable
MG_EXPORT HACCEL GUIAPI CopyAcceleratorTable(HACCEL hacc)
Copies the specified accelerator table.
RegisterResFromFile
MG_EXPORT BOOL GUIAPI RegisterResFromFile(HDC hdc, const char *file)
Register a device-dependent bitmap from a file.
BroadcastMessage
MG_EXPORT int GUIAPI BroadcastMessage(UINT nMsg, WPARAM wParam, LPARAM lParam)
Broadcast a message to all main windows on the desktop.
CreateCaret
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.
RES_TYPE_ICON
@ RES_TYPE_ICON
Definition: window.h:6124
_MAINWINCREATE::dwExStyle
DWORD dwExStyle
Definition: window.h:6766
ValidateRect
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 ...
CreateWindowEx
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:9894
GetCapture
MG_EXPORT HWND GUIAPI GetCapture(void)
Retrieve the handle to the window (if any) that has captured the mouse.
_WINDOW_ELEMENT_RENDERER::draw_disabled_menu_item
void(* draw_disabled_menu_item)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:5572
TRUE
#define TRUE
TRUE value, defined as 1 by MiniGUI.
Definition: common.h:358
IsMainWindow
MG_EXPORT BOOL GUIAPI IsMainWindow(HWND hWnd)
Determine whether a window is a main window.
SetMainWindowAlwaysTop
MG_EXPORT BOOL GUIAPI SetMainWindowAlwaysTop(HWND hWnd, BOOL fSet)
Set or cancel a main window being always top.
RegisterIMEWindow
MG_EXPORT int GUIAPI RegisterIMEWindow(HWND hWnd)
Registers an IME window.
_CTRLDATA::dwStyle
DWORD dwStyle
Definition: window.h:11530
_WINDOW_ELEMENT_RENDERER::draw_scrollbar
void(* draw_scrollbar)(HWND hWnd, HDC hdc, int sb_pos)
Definition: window.h:5447
DrawMenuBar
MG_EXPORT void GUIAPI DrawMenuBar(HWND hwnd)
Redraws the menu bar of the specified main window.
RegisterResFromBitmap
MG_EXPORT BOOL GUIAPI RegisterResFromBitmap(const char *file, const BITMAP *bmp)
Register a device-dependent bitmap to bitmap cache.
RES_TYPE_CURSOR
@ RES_TYPE_CURSOR
Definition: window.h:6131
TrackMenuBar
MG_EXPORT int GUIAPI TrackMenuBar(HWND hwnd, int pos)
Displays the specified submenu.
GetWindowCallbackProc
MG_EXPORT WNDPROC GUIAPI GetWindowCallbackProc(HWND hWnd)
Retrieve the callback procedure of a window.
LPARAM
UINT_PTR LPARAM
A type definition for the second message paramter.
Definition: common.h:712
IsDlgButtonChecked
MG_EXPORT int GUIAPI IsDlgButtonChecked(HWND hDlg, LINT idButton)
Determine whether a button control has a check mark next to it or whether a three-state button contro...
TIMERPROC
BOOL(* TIMERPROC)(HWND, LINT, DWORD)
Type of the timer callback procedure.
Definition: window.h:10011
GetUpdateRect
MG_EXPORT BOOL GUIAPI GetUpdateRect(HWND hWnd, RECT *update_rect)
Retrieve the bounding box of the update region of a window.
GetMessage
static BOOL GUIAPI GetMessage(PMSG pMsg, HWND hWnd)
Get a message from the message queue of a main window.
Definition: window.h:3240
WINDOW_ELEMENT_ATTR
struct _WINDOW_ELEMENT_ATTR WINDOW_ELEMENT_ATTR
GetFocusChild
MG_EXPORT HWND GUIAPI GetFocusChild(HWND hParent)
Retrieve the handle to the window's active child that has the keyboard focus.
UnregisterWindowClass
MG_EXPORT BOOL GUIAPI UnregisterWindowClass(const char *szClassName)
Undoes the effect of RegisterWindowClass.
GetWindowIcon
MG_EXPORT HICON GUIAPI GetWindowIcon(HWND hWnd)
Retrieve the current icon of a window.
_CTRLDATA::caption
const char * caption
Definition: window.h:11538
AddAccelerators
MG_EXPORT int GUIAPI AddAccelerators(HACCEL hacc, int key, DWORD keymask, WPARAM wParam, LPARAM lParam)
Adds an accelerator to the accelerator table.
CreateVirtualWindow
MG_EXPORT HWND GUIAPI CreateVirtualWindow(HWND hHosting, WNDPROC WndProc, const char *spCaption, LINT id, DWORD dwAddData)
Create a virtual window.
_BITMAP
Definition: gdi.h:11088
_LFSCROLLBARINFO::status
int status
Definition: window.h:5050
gal_pixel
Uint32 gal_pixel
Data type of pixel value.
Definition: common.h:1106
_IME_TARGET_INFO::iEditBoxType
int iEditBoxType
Definition: window.h:10175
_WINDOWINFO::pLogFont
PLOGFONT pLogFont
Definition: window.h:5664
_SCROLLBARDATA::status
int status
Definition: window.h:5081
MoveWindow
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.
GetSystemBitmapEx
static const BITMAP *GUIAPI GetSystemBitmapEx(const char *rdr_name, const char *id)
Retrieve the system bitmap object by identifier.
Definition: window.h:9203
RegisterKeyHookWindow
MG_EXPORT HWND GUIAPI RegisterKeyHookWindow(HWND hwnd, DWORD flag)
Register a key message hook window.
_WINDOW_ELEMENT_RENDERER::we_metrics
int we_metrics[WE_METRICS_NUMBER]
Definition: window.h:5576
WS_EX_NONE
#define WS_EX_NONE
No any extended window style.
Definition: window.h:4388
ScreenToClient
MG_EXPORT void GUIAPI ScreenToClient(HWND hWnd, int *x, int *y)
Converts the screen coordinates of a point to client coordinates.
SetCaretPos
MG_EXPORT BOOL GUIAPI SetCaretPos(HWND hWnd, int x, int y)
Moves the caret to a new position.
HCURSOR
GHANDLE HCURSOR
Handle to cursor.
Definition: common.h:422
IsTimerInstalled
MG_EXPORT BOOL GUIAPI IsTimerInstalled(HWND hWnd, LINT id)
Determine whether a timer is installed.
HDC_SCREEN
#define HDC_SCREEN
Handle to the device context of the whole screen or the fake screen when MiniGUI is running under Min...
Definition: gdi.h:1358
GetHostedById
MG_EXPORT HWND GUIAPI GetHostedById(HWND hHosting, LINT lId, DWORD dwSearchFlags)
Retrieve a hosted main window or virtual window by identifier.
_WINDOW_ELEMENT_RENDERER::draw_caption
void(* draw_caption)(HWND hWnd, HDC hdc, BOOL is_active)
Definition: window.h:5416
DispatchMessage
MG_EXPORT LRESULT GUIAPI DispatchMessage(PMSG pMsg)
Dispatches a message to the window's callback procedure.
GetScrollRange
MG_EXPORT BOOL GUIAPI GetScrollRange(HWND hWnd, int iSBar, int *pMinPos, int *pMaxPos)
Retrieve the minimum and maximum position values for the specified scroll bar.
SendMessage
MG_EXPORT LRESULT GUIAPI SendMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Send a message to a window and wait for the handling result.
IsDialog
MG_EXPORT BOOL GUIAPI IsDialog(HWND hWnd)
Determine whether a window handle identifies a dialog window.
_DLGTEMPLATE::hIcon
HICON hIcon
Definition: window.h:11570
_WINDOWINFO::dwExStyle
DWORD dwExStyle
Definition: window.h:5643
GetDlgItemInt
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.
CreateWindowEx2
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.
_WINDOW_ELEMENT_RENDERER::private_info
const void * private_info
Definition: window.h:5591
SetWindowAdditionalData2
MG_EXPORT DWORD GUIAPI SetWindowAdditionalData2(HWND hWnd, DWORD newData)
Set the second additional data of a window.
SendPriorNotifyMessage
MG_EXPORT int GUIAPI SendPriorNotifyMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Send a prior notification message to a window.
GetSystemBitmap
const MG_EXPORT BITMAP *GUIAPI GetSystemBitmap(HWND hWnd, const char *id)
Retrieve the system bitmap object by identifier.
GetNextHosted
MG_EXPORT HWND GUIAPI GetNextHosted(HWND hHosting, HWND hHosted)
Retrieve the next hosted window of a main window or a virtual window.
_WINDOW_ELEMENT_RENDERER::draw_focus_frame
void(* draw_focus_frame)(HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:5342
_WINDOW_ELEMENT_ATTR::we_attr_id
int we_attr_id
Definition: window.h:5019
MessageBox
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.
InvalidateRegion
MG_EXPORT BOOL GUIAPI InvalidateRegion(HWND hWnd, const CLIPRGN *pRgn, BOOL bErase)
Invalidates the client area within the specified region.
EnableScrollBar
MG_EXPORT BOOL GUIAPI EnableScrollBar(HWND hWnd, int iSBar, BOOL bEnable)
Enables or disables one scroll bar arrows.
DefaultWindowProc
MG_EXPORT LRESULT GUIAPI DefaultWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
The default window callback procedure.
_WINDOW_ELEMENT_RENDERER::calc_trackbar_rect
void(* calc_trackbar_rect)(HWND hWnd, LFRDR_TRACKBARINFO *info, DWORD dwStyle, const RECT *rcClient, RECT *rcRuler, RECT *rcBar, RECT *rcBorder)
Definition: window.h:5450
_WINDOW_ELEMENT_RENDERER::we_icon
HICON we_icon[2][SYSICO_ITEM_NUMBER]
Definition: window.h:5585
SetWindowLocalData
MG_EXPORT BOOL GUIAPI SetWindowLocalData(HWND hwnd, const char *data_name, DWORD local_data, CB_FREE_LOCAL_DATA cb_free)
Set the local data bound with a name for a window.
SetMainWindowGestureFlags
MG_EXPORT BOOL GUIAPI SetMainWindowGestureFlags(HWND hWnd, DWORD dwFlags)
Set the gesture flags of a main window.
BeginPaint
MG_EXPORT HDC GUIAPI BeginPaint(HWND hWnd)
Prepares a window for painting.
GetMenuBarItemRect
MG_EXPORT HMENU GUIAPI GetMenuBarItemRect(HWND hwnd, int pos, RECT *prc)
Retrieve the rect of a menu bar item.
ThrowAwayMessages
MG_EXPORT int GUIAPI ThrowAwayMessages(HWND pMainWnd)
Removes all messages in the message queue associated with a window.
_CTRLDATA::x
int x
Definition: window.h:11532
WORD
WORD_HPTR WORD
A type definition for an unsigned integer (word).
Definition: common.h:541
GetWindowClassInfo
MG_EXPORT BOOL GUIAPI GetWindowClassInfo(PWNDCLASS pWndClass)
Retrieve the information of the specified window class.