MiniGUI API Reference (MiniGUI-Standalone)  v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
window.h
Go to the documentation of this file.
1 
45 /*
46  * $Id: window.h 13674 2010-12-06 06:45:01Z wanzheng $
47  *
48  * MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
49  * pSOS, ThreadX, NuCleus, OSE, and Win32.
50  */
51 
52 #ifndef _MGUI_WINDOW_H
53 #define _MGUI_WINDOW_H
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif /* __cplusplus */
58 
64 /* Definitions of common messages. */
65 #define MSG_NULLMSG 0x0000
66 #define MSG_SYNCMSG 0x0000
67 
73 /* Group 1 from 0x0001 to 0x000F, the mouse messages. */
74 #define MSG_FIRSTMOUSEMSG 0x0001
75 
98 #define MSG_LBUTTONDOWN 0x0001
99 
119 #define MSG_LBUTTONUP 0x0002
120 
140 #define MSG_LBUTTONDBLCLK 0x0003
141 
161 #define MSG_MOUSEMOVE 0x0004
162 
185 #define MSG_RBUTTONDOWN 0x0005
186 
206 #define MSG_RBUTTONUP 0x0006
207 
227 #define MSG_RBUTTONDBLCLK 0x0007
228 
229 #define MSG_NCMOUSEOFF 0x0007
230 
250 #define MSG_NCLBUTTONDOWN 0x0008
251 
271 #define MSG_NCLBUTTONUP 0x0009
272 
292 #define MSG_NCLBUTTONDBLCLK 0x000A
293 
313 #define MSG_NCMOUSEMOVE 0x000B
314 
334 #define MSG_NCRBUTTONDOWN 0x000C
335 
355 #define MSG_NCRBUTTONUP 0x000D
356 
376 #define MSG_NCRBUTTONDBLCLK 0x000E
377 
378 #define MSG_LASTMOUSEMSG 0x000F
379 
387 /* Group 2 from 0x0010 to 0x001F, the key messages. */
388 #define MSG_FIRSTKEYMSG 0x0010
389 
412 #define MSG_KEYDOWN 0x0010
413 
440 #define MSG_CHAR 0x0011
441 
460 #define MSG_KEYUP 0x0012
461 
480 #define MSG_SYSKEYDOWN 0x0013
481 
500 #define MSG_SYSCHAR 0x0014
501 
520 #define MSG_SYSKEYUP 0x0015
521 
522 
523 /* keyboard longpress supported */
524 
532 #define MSG_KEYLONGPRESS 0x0016
533 
541 #define MSG_KEYALWAYSPRESS 0x0017
542 
568 #define MSG_KEYSYM 0x0018
569 
592 #define MSG_UTF8CHAR 0x0019
593 
600 #define DEF_LPRESS_TIME 500
601 
608 #define DEF_APRESS_TIME 1000
609 
614 #define DEF_INTERVAL_TIME 200
615 
616 extern DWORD __mg_key_longpress_time;
617 extern DWORD __mg_key_alwayspress_time;
618 extern DWORD __mg_interval_time;
619 
624 #define SetKeyLongPressTime(time) \
625  do { \
626  __mg_key_longpress_time = time; \
627  } while (0)
628 
633 #define SetKeyAlwaysPressTime(time) \
634  do { \
635  __mg_key_alwayspress_time = time; \
636  } while (0)
637 
642 #define SetIntervalTime(time) \
643  do { \
644  __mg_interval_time = time; \
645  } while (0)
646 
647 #define MSG_LASTKEYMSG 0x001F
648 
656 /* Group 3 from 0x0020 to 0x005F, User-machine Interaction messages. */
657 #define MSG_FIRSTPOSTMSG 0x0020
658 
683 #define MSG_SETCURSOR 0x0020
684 
685  #define HT_MASK 0xFF
686 
687  #define HT_UNKNOWN 0x00
688  #define HT_OUT 0x01
689  #define HT_MENUBAR 0x02
690  #define HT_TRANSPARENT 0x03
691 
692  #define HT_BORDER 0x04
693  #define HT_CLIENT 0x0C
694 
695  #define HT_NEEDCAPTURE 0x10
696  #define HT_ICON 0x14
697  #define HT_CLOSEBUTTON 0x15
698  #define HT_MAXBUTTON 0x16
699  #define HT_MINBUTTON 0x17
700  #define HT_HSCROLL 0x18
701  #define HT_VSCROLL 0x19
702 
703  #define HT_DRAGGABLE 0x20
704  #define HT_CAPTION 0x20
705 
706  /*indicate cursor at border */
707  #define HT_BORDER_MASK 0x28
708  #define HT_BORDER_TOP 0x28
709  #define HT_BORDER_BOTTOM 0x29
710  #define HT_BORDER_LEFT 0x2A
711  #define HT_BORDER_RIGHT 0x2B
712 
713  /*indicate cursor at border corner*/
714  #define HT_CORNER_MASK 0x2C
715  #define HT_CORNER_TL 0x2C
716  #define HT_CORNER_TR 0x2D
717  #define HT_CORNER_BL 0x2E
718  #define HT_CORNER_BR 0x2F
719 
720  /*new scrollbar hittest value
721  * can be AND'ed with HT_NEEDCAPTURE*/
722  #define HT_SB_MASK 0x50
723 
724  #define HT_SB_LEFTARROW 0x50
725  #define HT_SB_RIGHTARROW 0x51
726  #define HT_SB_LEFTSPACE 0x52
727  #define HT_SB_RIGHTSPACE 0x53
728  #define HT_SB_HTHUMB 0x54
729 
730  #define HT_SB_VMASK 0x58
731 
732  #define HT_SB_UPARROW 0x58
733  #define HT_SB_DOWNARROW 0x59
734  #define HT_SB_UPSPACE 0x5a
735  #define HT_SB_DOWNSPACE 0x5b
736  #define HT_SB_VTHUMB 0x5c
737 
738  #define HT_SB_UNKNOWN 0x5f
739 
740 /*user defined hittest code are 0x80 ~ 0x8F*/
741 #define HT_USER_MASK 0x80
742 
743 
749 #define MSG_NCHITTEST 0x0021
750 
757 #define MSG_HITTEST MSG_NCHITTEST
758 
763 #define MSG_CHANGESIZE 0x0022
764 
765 /* reserved */
766 #define MSG_QUERYNCRECT 0x0023
767 
772 #define MSG_QUERYCLIENTAREA 0x0024
773 
797 #define MSG_SIZECHANGING 0x0025
798 
821 #define MSG_SIZECHANGED 0x0026
822 
839 #define MSG_CSIZECHANGED 0x0027
840 
851 #define MSG_SETFOCUS 0x0030
852 
863 #define MSG_KILLFOCUS 0x0031
864 
873 #define MSG_MOUSEACTIVE 0x0032
874 
883 #define MSG_ACTIVE 0x0033
884 
889 #define MSG_CHILDHIDDEN 0x0034
890  #define RCTM_CLICK 1
891  #define RCTM_KEY 2
892  #define RCTM_MESSAGE 3
893  #define RCTM_SHOWCTRL 4
894 
919 #define MSG_ACTIVEMENU 0x0040
920 
938 #define MSG_DEACTIVEMENU 0x0041
939 
940 /* Scroll bar notifying code */
951 #define SB_LINEUP 0x01a
952 
958 #define SB_LINEDOWN 0x02
959 
965 #define SB_LINELEFT 0x03
966 
972 #define SB_LINERIGHT 0x04
973 
979 #define SB_PAGEUP 0x05
980 
986 #define SB_PAGEDOWN 0x06
987 
993 #define SB_PAGELEFT 0x07
994 
1000 #define SB_PAGERIGHT 0x08
1001 
1007 #define SB_THUMBPOSITION 0x09
1008 
1014 #define SB_THUMBTRACK 0x0A
1015 
1021 #define SB_TOP 0x0B
1022 
1028 #define SB_BOTTOM 0x0C
1029 
1035 #define SB_ENDSCROLL 0x0D
1036 
1067 #define MSG_HSCROLL 0x0042
1068 
1097 #define MSG_VSCROLL 0x0043
1098 
1111 #define MSG_NCSETCURSOR 0x0044
1112 
1128 #define MSG_MOUSEMOVEIN 0x0050
1129 
1135 #define MSG_WINDOWDROPPED 0x0051
1136 
1137 #define MSG_LASTPOSTMSG 0x005F
1138 
1146  /* Group 4 from 0x0060 to 0x009F, the creation messages. */
1147 #define MSG_FIRSTCREATEMSG 0x0060
1148 
1176 #define MSG_CREATE 0x0060
1177 
1206 #define MSG_NCCREATE 0x0061
1207 
1208 /*Not use*/
1209 #define MSG_INITPANES 0x0062
1210 #define MSG_DESTROYPANES 0x0063
1211 
1225 #define MSG_DESTROY 0x0064
1226 
1227 /* Not use */
1228 #define MSG_NCDESTROY 0x0065
1229 
1237 #define MSG_CLOSE 0x0066
1238 
1239 /* Not use */
1240 #define MSG_NCCALCSIZE 0x0067
1241 
1242 /*
1243  * Not implemented, this message is reserved for future use.
1244  *
1245  * \def MSG_MAXIMIZE
1246  * \brief Indicates the user has clicked the maximizing box on the caption.
1247  *
1248  * This message is sent to the window when the user has clicked the maximizing
1249  * box on the caption of the window.
1250  */
1251 #define MSG_MAXIMIZE 0x0068
1252 
1253 /*
1254  * Not implemented, this message is reserved for future use.
1255  *
1256  * \def MSG_MINIMIZE
1257  * \brief Indicates the user has clicked the minimizing box on the caption.
1258  *
1259  * This message is sent to the window when the user has clicked the
1260  * minimizing box on the caption of the window.
1261  */
1262 #define MSG_MINIMIZE 0x0069
1263 
1264 /*
1265  * Not implemented, this message is reserved for future use.
1266  *
1267  * \def MSG_HELP
1268  * \brief Indicates the user has clicked the help box on the caption.
1269  *
1270  * This message is sent to the window when the user has clicked the
1271  * help box on the caption of the window.
1272  */
1273 #define MSG_HELP 0x006A
1274 
1275 #define MSG_LASTCREATEMSG 0x009F
1276 
1284 /* Group 5 from 0x00A0 to 0x00CF, the paint messages. */
1285 #define MSG_FIRSTPAINTMSG 0x00A0
1286 
1311 #define MSG_SHOWWINDOW 0x00A0
1312 
1331 #define MSG_ERASEBKGND 0x00B0 /* this is an async message */
1332 
1346 #define MSG_PAINT 0x00B1
1347 
1363 #define MSG_NCPAINT 0x00B2
1364 
1369 #define MSG_NCACTIVATE 0x00B3
1370 
1375 #define MSG_SYNCPAINT 0x00B4
1376 
1377 #define MSG_LASTPAINTMSG 0x00CF
1378 
1386 /* Group 6 from 0x00D0 to 0x00EF, the internal desktop messages. */
1387 #define MSG_FIRSTSESSIONMSG 0x00D0
1388 
1389 #define MSG_STARTSESSION 0x00D0
1390 #define MSG_QUERYENDSESSION 0x00D1
1391 #define MSG_ENDSESSION 0x00D2
1392 #define MSG_REINITSESSION 0x00D3
1393 
1394 #define MSG_ERASEDESKTOP 0x00DE
1395 #define MSG_PAINTDESKTOP 0x00DF
1396 
1397 #define MSG_DT_MOUSEOFF 0x00E0
1398 
1416 #define MSG_DT_LBUTTONDOWN 0x00E1
1417 
1435 #define MSG_DT_LBUTTONUP 0x00E2
1436 
1454 #define MSG_DT_LBUTTONDBLCLK 0x00E3
1455 
1473 #define MSG_DT_MOUSEMOVE 0x00E4
1474 
1493 #define MSG_DT_RBUTTONDOWN 0x00E5
1494 
1512 #define MSG_DT_RBUTTONUP 0x00E6
1513 
1531 #define MSG_DT_RBUTTONDBLCLK 0x00E7
1532 
1533 #define MSG_DT_KEYOFF 0x00D8
1534 
1552 #define MSG_DT_KEYDOWN 0x00E8
1553 
1570 #define MSG_DT_KEYUP 0x00EA
1571 
1572 #define MSG_DT_SYSKEYDOWN 0x00EB
1573 #define MSG_DT_SYSKEYUP 0x00ED
1574 
1575 #define MSG_DT_SYSCHAR 0x00EC
1576 #define MSG_DT_CHAR 0x00E9
1577 
1578 #define MSG_DT_KEYLONGPRESS 0x00EE
1579 #define MSG_DT_KEYALWAYSPRESS 0x00EF
1580 
1581 #define MSG_LASTSESSIONMSG 0x00EF
1582 
1590 /* Group 7 from 0x00F0 to 0x010F, Internal window management messages. */
1591 #define MSG_FIRSTWINDOWMSG 0x00F0
1592 
1593 #define MSG_ADDNEWMAINWIN 0x00F0
1594 #define MSG_REMOVEMAINWIN 0x00F1
1595 #define MSG_MOVETOTOPMOST 0x00F2
1596 #define MSG_SETACTIVEMAIN 0x00F3
1597 #define MSG_GETACTIVEMAIN 0x00F4
1598 #define MSG_SHOWMAINWIN 0x00F5
1599 #define MSG_HIDEMAINWIN 0x00F6
1600 #define MSG_MOVEMAINWIN 0x00F7
1601 #define MSG_SETCAPTURE 0x00F8
1602 #define MSG_GETCAPTURE 0x00F9
1603 
1604 #define MSG_ENDTRACKMENU 0x00FA
1605 #define MSG_TRACKPOPUPMENU 0x00FB
1606 #define MSG_CLOSEMENU 0x00FC
1607 #define MSG_SCROLLMAINWIN 0x00FD
1608 #define MSG_CARET_CREATE 0x00FE
1609 #define MSG_CARET_DESTROY 0x00FF
1610 
1611 #define MSG_ENABLEMAINWIN 0x0100
1612 #define MSG_ISENABLED 0x0101
1613 
1614 #define MSG_SETWINCURSOR 0x0102
1615 
1616 #define MSG_GETNEXTMAINWIN 0x0103
1617 
1618 #define MSG_SHOWGLOBALCTRL 0x010A
1619 #define MSG_HIDEGLOBALCTRL 0x010B
1620 
1621 typedef struct _DRAGINFO {
1622  int location;
1623  int init_x, init_y;
1624 } DRAGINFO;
1625 
1626 /* client to server; wParam: hwnd, lParam: DRAGINFO. */
1627 #define MSG_STARTDRAGWIN 0x010C
1628 /* client to server; wParam: hwnd, lParam: 0L. */
1629 #define MSG_CANCELDRAGWIN 0x010D
1630 
1631 #define MSG_CHANGECAPTION 0x010E
1632 
1633 #define MSG_LASTWINDOWMSG 0x010F
1634 
1642 /* Group 8 from 0x0120 to 0x013F, the dialog and control messages. */
1643 #define MSG_FIRSTCONTROLMSG 0x0120
1644 
1674 #define MSG_COMMAND 0x0120
1675 
1680 #define MSG_SYSCOMMAND 0x0121
1681 
1686 #define MSG_GETDLGCODE 0x0122
1687 
1714 #define MSG_INITDIALOG 0x0123
1715 
1716 /*Reserved*/
1717 #define MSG_NEXTDLGCTRL 0x0124
1718 #define MSG_ENTERIDLE 0x0125
1719 
1724 #define MSG_DLG_GETDEFID 0x0126
1725 
1730 #define MSG_DLG_SETDEFID 0x0127
1731 
1732 /* #define MSG_DLG_REPOSITION 0x0128 */
1733 
1740 #define MSG_ISDIALOG 0x0128
1741 
1759 #define MSG_INITPAGE 0x0129
1760 
1781 #define MSG_SHOWPAGE 0x012A
1782 
1802 #define MSG_SHEETCMD 0x012B
1803 
1823 #define MSG_INITCONTAINER 0x012C
1824 
1853 #define MSG_SVCONTCMD 0x012D
1854 
1873 #define MSG_FREEZECTRL 0x012E
1874 
1893 #define MSG_FONTCHANGING 0x0130
1894 
1895 
1903 #define MSG_FONTCHANGED 0x0131
1904 
1922 #define MSG_GETTEXTLENGTH 0x0132
1923 
1946 #define MSG_GETTEXT 0x0133
1947 
1968 #define MSG_SETTEXT 0x0134
1969 
1983 #define MSG_ENABLE 0x0135
1984 
1985 #define MSG_LASTCONTROLMSG 0x013F
1986 
1994 /* Group 9 from 0x0140 to 0x016F, the system messages. */
1995 #define MSG_FIRSTSYSTEMMSG 0x0140
1996 
1997 #define MSG_QUIT 0x0140
1998 
2006 #define MSG_IDLE 0x0142
2007 
2008 #define MSG_TIMEOUT 0x0143
2009 
2025 #define MSG_TIMER 0x0144
2026 
2027 #define MSG_CARETBLINK 0x0145
2028 
2029 #ifndef _MGRM_THREADS
2030 
2058 #define MSG_FDEVENT 0x0146
2059 
2073 #define MSG_SRVNOTIFY 0x0147
2074 
2075 #ifdef _MGRM_PROCESSES
2076  #define MSG_UPDATECLIWIN 0x0148
2077 #endif
2078 
2079 #endif /* !_MGRM_THREADS */
2080 
2094 #define MSG_DOESNEEDIME 0x0150
2095 
2096 /* flag code. */
2097 #define IME_STATUS_REGISTERED 0x0000
2098 #define IME_STATUS_ENABLED 0x0001
2099 #define IME_STATUS_AUTOTRACK 0x0002
2100 #define IME_STATUS_LANGUAGE 0x0003
2101  #define IME_LANGUAGE_UNKNOWN 0x0000
2102  #define IME_LANGUAGE_LATIN 0x0001
2103  #define IME_LANGUAGE_ZHCN 0x0002
2104  #define IME_LANGUAGE_ZHTW 0x0003
2105 #define IME_STATUS_ENCODING 0x0004
2106  #define IME_ENCODING_LOCAL 0x0000
2107  #define IME_ENCODING_UTF8 0x0001
2108 #define IME_STATUS_VERSION 0x0005
2109 #define IME_STATUS_USER_MIN 0x0006
2110 #define IME_STATUS_USER_MAX 0x0020
2111 
2112 /* IME edit type */
2113 #define IME_WINDOW_TYPE_NOT_EDITABLE 0x0000
2114 #define IME_WINDOW_TYPE_EDITABLE 0x0001
2115 #define IME_WINDOW_TYPE_READONLY 0x0002
2116 #define IME_WINDOW_TYPE_PASSWORD 0x0003
2117 
2118 /*Internal use*/
2119 #define MSG_IME_REGISTER 0x0151
2120 #define MSG_IME_UNREGISTER 0x0152
2121 #define MSG_IME_OPEN 0x0153
2122 #define MSG_IME_CLOSE 0x0154
2123 #define MSG_IME_SETSTATUS 0x0156
2124 #define MSG_IME_GETSTATUS 0x0157
2125 #define MSG_IME_SETTARGET 0x0158
2126 #define MSG_IME_GETTARGET 0x0159
2127 #define MSG_IME_SETPOS 0x015A
2128 #define MSG_IME_GETPOS 0x015B
2129 
2130 /* new ime msg. */
2131 #define MSG_IME_SET_TARGET_INFO 0x015C
2132 #define MSG_IME_GET_TARGET_INFO 0x015D
2133 
2134 #define MSG_SHOWMENU 0x0160
2135 #define MSG_HIDEMENU 0x0161
2136 
2137 #define MSG_ADDTIMER 0x0162
2138 #define MSG_REMOVETIMER 0x0163
2139 #define MSG_RESETTIMER 0x0164
2140 
2141 #define MSG_WINDOWCHANGED 0x0165
2142 
2143 #define MSG_BROADCASTMSG 0x0166
2144 
2145 #define MSG_REGISTERWNDCLASS 0x0167
2146 #define MSG_UNREGISTERWNDCLASS 0x0168
2147 #define MSG_NEWCTRLINSTANCE 0x0169
2148 #define MSG_REMOVECTRLINSTANCE 0x016A
2149 #define MSG_GETCTRLCLASSINFO 0x016B
2150 #define MSG_CTRLCLASSDATAOP 0x016C
2151  #define CCDOP_GETCCI 0x01
2152  #define CCDOP_SETCCI 0x02
2153 
2154 #define MSG_REGISTERKEYHOOK 0x016D
2155 #define MSG_REGISTERMOUSEHOOK 0x016E
2156 
2157 #define MSG_LASTSYSTEMMSG 0x016F
2158 
2166 /* Group 10 from 0x0170 to 0x018F, the menu messages */
2167 #define MSG_FIRSTMENUMSG 0x0170
2168 
2169 /*Internal use*/
2170 #define MSG_INITMENU 0x0170
2171 #define MSG_INITMENUPOPUP 0x0171
2172 #define MSG_MENUSELECT 0x0172
2173 #define MSG_MENUCHAR 0x0173
2174 #define MSG_ENTERMENULOOP 0x0174
2175 #define MSG_EXITMENULOOP 0x0175
2176 #define MSG_CONTEXTMENU 0x0176
2177 #define MSG_NEXTMENU 0x0177
2178 
2179 #define MSG_LASTMENUMSG 0x018F
2180 
2188 #define MSG_FIRSTUSERMSG 0x0800
2189 
2190 
2198 #define MSG_USER 0x0800
2199 
2200 #define MSG_LASTUSERMSG 0xEFFF
2201 
2225 typedef struct _MSG
2226 {
2237 #ifdef _MGRM_THREADS
2238 
2239  void* pAdd;
2240 #endif
2241 } MSG;
2242 typedef MSG* PMSG;
2243 
2244 #define QS_NOTIFYMSG 0x10000000
2245 #ifdef _MGRM_THREADS
2246  #define QS_SYNCMSG 0x20000000
2247 #else
2248  #define QS_DESKTIMER 0x20000000
2249 #endif
2250 #define QS_POSTMSG 0x40000000
2251 #define QS_QUIT 0x80000000
2252 #define QS_INPUT 0x01000000
2253 #define QS_PAINT 0x02000000
2254 #define QS_TIMER 0x0000FFFF
2255 #define QS_EMPTY 0x00000000
2256 
2262 #define PM_NOREMOVE 0x0000
2263 
2269 #define PM_REMOVE 0x0001
2270 
2276 #define PM_NOYIELD 0x0002
2277 
2305 MG_EXPORT BOOL GUIAPI PeekMessageEx (PMSG pMsg, HWND hWnd,
2306  UINT nMsgFilterMin, UINT nMsgFilterMax,
2307  BOOL bWait, UINT uRemoveMsg);
2308 
2327 static inline BOOL GUIAPI GetMessage (PMSG pMsg, HWND hWnd)
2328 {
2329  return PeekMessageEx (pMsg, hWnd, 0, 0, TRUE, PM_REMOVE);
2330 }
2331 
2348 MG_EXPORT BOOL GUIAPI WaitMessage (PMSG pMsg, HWND hMainWnd);
2349 
2364 MG_EXPORT BOOL GUIAPI HavePendingMessage (HWND hMainWnd);
2365 
2392 static inline BOOL GUIAPI PeekMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
2393  UINT nMsgFilterMax, UINT uRemoveMsg)
2394 {
2395  return PeekMessageEx (pMsg, hWnd, nMsgFilterMin, nMsgFilterMax,
2396  FALSE, uRemoveMsg);
2397 }
2398 
2425 MG_EXPORT BOOL GUIAPI PeekPostMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
2426  UINT nMsgFilterMax, UINT uRemoveMsg);
2427 
2449 MG_EXPORT int GUIAPI PostMessage (HWND hWnd, UINT nMsg,
2450  WPARAM wParam, LPARAM lParam);
2451 
2467 MG_EXPORT LRESULT GUIAPI SendMessage (HWND hWnd, UINT nMsg,
2468  WPARAM wParam, LPARAM lParam);
2469 
2485 MG_EXPORT void GUIAPI SetAutoRepeatMessage (HWND hwnd, UINT msg,
2486  WPARAM wParam, LPARAM lParam);
2487 
2488 #ifndef _MGRM_THREADS
2489 
2496 #define SendAsyncMessage SendMessage
2497 
2498 #ifdef _MGRM_PROCESSES
2499 
2500 #define CLIENTS_TOPMOST -1
2501 #define CLIENTS_ALL -2
2502 #define CLIENTS_EXCEPT_TOPMOST -3
2503 #define CLIENT_ACTIVE -4
2504 
2535 int GUIAPI Send2Client (const MSG* msg, int cli);
2536 
2556 BOOL GUIAPI Send2TopMostClients (UINT nMsg, WPARAM wParam, LPARAM lParam);
2557 
2578 BOOL GUIAPI Send2ActiveWindow (const MG_Layer* layer,
2579  UINT nMsg, WPARAM wParam, LPARAM lParam);
2580 
2581 #endif /* _MGRM_PROCESSES */
2582 
2583 #else /* !_MGRM_THREADS */
2584 
2605 MG_EXPORT LRESULT GUIAPI PostSyncMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
2606 
2627 MG_EXPORT LRESULT GUIAPI SendAsyncMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
2628 #endif
2629 
2648 MG_EXPORT int GUIAPI SendNotifyMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
2649 
2664 MG_EXPORT int GUIAPI BroadcastMessage (UINT nMsg, WPARAM wParam, LPARAM lParam);
2665 
2678 MG_EXPORT int GUIAPI PostQuitMessage (HWND hWnd);
2679 
2680 #define KBD_LAYOUT_DEFAULT "default"
2681 #define KBD_LAYOUT_FRPC "frpc"
2682 #define KBD_LAYOUT_FR "fr"
2683 #define KBD_LAYOUT_DE "de"
2684 #define KBD_LAYOUT_DELATIN1 "delatin1"
2685 #define KBD_LAYOUT_IT "it"
2686 #define KBD_LAYOUT_ES "es"
2687 #define KBD_LAYOUT_ESCP850 "escp850"
2688 #define KBD_LAYOUT_HEBREW "hebrew"
2689 #define KBD_LAYOUT_ARABIC "arabic"
2690 
2728 MG_EXPORT BOOL GUIAPI SetKeyboardLayout (const char* kbd_layout);
2729 
2730 #ifdef _MGCHARSET_UNICODE
2731 
2732 #include <stddef.h>
2733 #include <stdlib.h>
2734 
2735 MG_EXPORT int GUIAPI ToUnicode (UINT keycode, const BYTE* kbd_state,
2736  wchar_t* wcs, int wcs_len, const char* kbd_layout);
2737 
2738 MG_EXPORT int GUIAPI ToAscii (UINT keycode, const BYTE* kbd_state,
2739  WORD* ch, const char* kbd_layout);
2740 
2741 #endif /* _MGCHARSET_UNICODE */
2742 
2763 MG_EXPORT BOOL GUIAPI TranslateMessage (PMSG pMsg);
2764 
2787 MG_EXPORT BOOL GUIAPI TranslateKeyMsgToChar (int message,
2788  WPARAM wParam, LPARAM lParam, WORD *ch);
2789 
2806 MG_EXPORT LRESULT GUIAPI DispatchMessage (PMSG pMsg);
2807 
2820 MG_EXPORT int GUIAPI ThrowAwayMessages (HWND pMainWnd);
2821 
2822 #ifndef _MGRM_THREADS
2823 
2838 MG_EXPORT BOOL GUIAPI EmptyMessageQueue (HWND hWnd);
2839 
2840 #endif
2841 
2842 #ifdef _MGHAVE_MSG_STRING
2843 
2858 MG_EXPORT const char* GUIAPI Message2Str (UINT message);
2859 
2876 MG_EXPORT void GUIAPI PrintMessage (FILE* fp, HWND hWnd,
2877  UINT nMsg, WPARAM wParam, LPARAM lParam);
2878 
2879 #endif
2880 
2892 #define HOOK_GOON 0
2893 
2898 #define HOOK_STOP 1
2899 
2900 #ifndef _MGRM_PROCESSES
2901 
2908 typedef int (* MSGHOOK)(void* context, HWND dst_wnd,
2909  UINT msg, WPARAM wparam, LPARAM lparam);
2910 
2914 typedef struct _HOOKINFO
2915 {
2917  void* context;
2920 } HOOKINFO;
2921 
2938 MG_EXPORT MSGHOOK GUIAPI RegisterKeyMsgHook (void* context, MSGHOOK hook);
2939 
2956 MG_EXPORT MSGHOOK GUIAPI RegisterMouseMsgHook (void* context, MSGHOOK hook);
2957 
2958 #endif /* !_MGRM_PROCESSES */
2959 
2960 #ifndef _MGRM_THREADS
2961 
2975 typedef int (* SRVEVTHOOK) (PMSG pMsg);
2976 
2990 MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
2991 
2992 #ifdef _MGRM_PROCESSES
2993 
3015 MG_EXPORT HWND GUIAPI RegisterKeyHookWindow (HWND hwnd, DWORD flag);
3016 
3038 MG_EXPORT HWND GUIAPI RegisterMouseHookWindow (HWND hwnd, DWORD flag);
3039 
3040 #endif /* _MGRM_PROCESSES */
3041 #endif /* !_MGRM_THREADS */
3042 
3043 
3055 #define WS_CTRLMASK 0x0000FFFFL
3056 
3061 #define WS_NONE 0x00000000L
3062 
3067 #define WS_CHILD 0x40000000L
3068 
3073 #define WS_CAPTION 0x20000000L
3074 
3079 #define WS_SYSMENU 0x10000000L
3080 
3085 #define WS_VISIBLE 0x08000000L
3086 
3091 #define WS_DISABLED 0x04000000L
3092 
3093 /* Main window states -- reserved for future use. */
3094 #define WS_MINIMIZE 0x02000000L
3095 #define WS_MAXIMIZE 0x01000000L
3096 
3102 #define WS_DLGFRAME 0x00800000L
3103 
3108 #define WS_BORDER 0x00400000L
3109 
3114 #define WS_THICKFRAME 0x00200000L
3115 
3120 #define WS_THINFRAME 0x00100000L
3121 
3126 #define WS_VSCROLL 0x00080000L
3127 
3132 #define WS_HSCROLL 0x00040000L
3133 
3139 #define WS_GROUP 0x00020000L
3140 
3147 #define WS_TABSTOP 0x00010000L
3148 
3149 /*
3150  * Not implemented, reserved for future use.
3151  *
3152  * \def WS_MINIMIZEBOX
3153  * \brief Creates a window with minimizing box on caption.
3154  * \note This style is valid only for main window.
3155  */
3156 #define WS_MINIMIZEBOX 0x00020000L
3157 
3158 /*
3159  * Not implemented, reserved for future use.
3160  *
3161  * \def WS_MAXIMIZEBOX
3162  * \brief Creates a window with maximizing box on caption.
3163  * \note This style is valid only for main window.
3164  */
3165 #define WS_MAXIMIZEBOX 0x00010000L
3166 
3167 /* Obsolete styles, back-compatibility definitions. */
3168 #define WS_OVERLAPPED 0x00000000L
3169 #define WS_ABSSCRPOS 0x00000000L
3170 
3175 #define WS_EX_CONTROL_MASK 0x0000000FL
3176 
3181 #define WS_EX_INTERNAL_MASK 0xF0000000L
3182 
3187 #define WS_EX_NONE 0x00000000L
3188 
3193 #define WS_EX_TROUNDCNS 0x00000010L
3194 
3199 #define WS_EX_BROUNDCNS 0x00000020L
3200 
3207 #define WS_EX_USEPRIVATECDC 0x00000040L
3208 
3213 #define WS_EX_NOTDRAGGABLE 0x00000080L
3214 #define WS_EX_DRAGGABLE 0x00000000L
3215 
3220 #define WS_EX_USEPARENTFONT 0x00000100L
3221 
3226 #define WS_EX_USEPARENTCURSOR 0x00000200L
3227 
3232 #define WS_EX_USEPARENTRDR 0x00000400L
3233 
3240 #define WS_EX_NOPARENTNOTIFY 0x00000800L
3241 
3248 #define WS_EX_AUTOSECONDARYDC 0x00001000L
3249 
3255 #define WS_EX_TRANSPARENT 0x00002000L
3256 
3261 #define WS_EX_TOPMOST 0x00004000L
3262 
3267 #define WS_EX_TOOLWINDOW 0x00008000L
3268 
3269 /* The group reserved for BIDI support */
3270 #define WS_EX_RIGHT 0x00010000L
3271 #define WS_EX_LEFT 0x00000000L
3272 #define WS_EX_RTLREADING 0x00020000L
3273 #define WS_EX_LTRREADING 0x00000000L
3274 
3279 #define WS_EX_LEFTSCROLLBAR 0x00040000L
3280 
3285 #define WS_EX_RIGHTSCROLLBAR 0x00000000L
3286 
3291 #define WS_EX_DLGHIDE 0x00100000L
3292 
3297 #define WS_EX_NOCLOSEBOX 0x00400000L
3298 
3303 #define WS_EX_CLIPCHILDREN 0x00800000L
3304 
3309 #define WS_EX_LFRDR_MASK 0x0F000000L
3310 
3316 #define WS_EX_LFRDR_CUSTOM1 0x01000000L
3317 
3324 #define WS_EX_LFRDR_CUSTOM2 0x02000000L
3325 
3332 #define WS_EX_LFRDR_CUSTOM3 0x04000000L
3333 
3340 #define WS_EX_LFRDR_CUSTOM4 0x08000000L
3341 
3342 /* Obsolete style, back-compatibility definitions. */
3343 #define WS_EX_IMECOMPOSE 0x00000000L
3344 
3361 #define WE_FONTS_NUMBER 4
3362 
3367 #define WE_METRICS_NUMBER 6
3368 
3373 #define WE_COLORS_NUMBER 14
3374 
3375 /* Window type mask */
3376 #define WE_ATTR_TYPE_MASK 0xF000
3377 #define WE_ATTR_TYPE_COLOR_MASK 0x0F00
3378 #define WE_ATTR_INDEX_MASK 0x00FF
3379 
3380 #define WE_ATTR_TYPE_FONT 0x1000
3381 #define WE_ATTR_TYPE_METRICS 0x2000
3382 
3383 #define WE_ATTR_TYPE_COLOR 0x3000
3384 #define WE_ATTR_TYPE_FGC 0x3000
3385 #define WE_ATTR_TYPE_BGCA 0x3100
3386 #define WE_ATTR_TYPE_BGCB 0x3200
3387 
3388 /* window element id */
3389 #define WE_CAPTION 0
3390 #define WE_MENU 1
3391 #define WE_MESSAGEBOX 2
3392 #define WE_TOOLTIP 3
3393 #define WE_WND_BORDER 4
3394 #define WE_SCROLLBAR 5
3395 #define WE_INACTIVE_CAPTION 6
3396 #define WE_WINDOW 7
3397 #define WE_THREED_BODY 8
3398 #define WE_SELECTED_ITEM 9
3399 #define WE_DISABLED_ITEM 10
3400 #define WE_HIGHLIGHT_ITEM 11
3401 #define WE_SIGNIFICANT_ITEM 12
3402 #define WE_DESKTOP 13
3403 
3404 /* window element attr id */
3405 
3406 /* Window caption */
3407 #define WE_FONT_CAPTION (WE_CAPTION | WE_ATTR_TYPE_FONT)
3408 #define WE_METRICS_CAPTION (WE_CAPTION | WE_ATTR_TYPE_METRICS)
3409 #define WE_FGC_ACTIVE_CAPTION (WE_CAPTION | WE_ATTR_TYPE_FGC)
3410 #define WE_BGCA_ACTIVE_CAPTION (WE_CAPTION | WE_ATTR_TYPE_BGCA)
3411 #define WE_BGCB_ACTIVE_CAPTION (WE_CAPTION | WE_ATTR_TYPE_BGCB)
3412 
3413 /* Menu */
3414 #define WE_FONT_MENU (WE_MENU | WE_ATTR_TYPE_FONT)
3415 #define WE_METRICS_MENU (WE_MENU | WE_ATTR_TYPE_METRICS)
3416 #define WE_FGC_MENU (WE_MENU | WE_ATTR_TYPE_FGC)
3417 #define WE_BGC_MENU (WE_MENU | WE_ATTR_TYPE_BGCA)
3418 
3419 /* Message box */
3420 #define WE_FONT_MESSAGEBOX (WE_MESSAGEBOX | WE_ATTR_TYPE_FONT)
3421 #define WE_FGC_MESSAGEBOX (WE_MESSAGEBOX | WE_ATTR_TYPE_FGC)
3422 
3423 /* Tool tips */
3424 #define WE_FONT_TOOLTIP (WE_TOOLTIP | WE_ATTR_TYPE_FONT)
3425 #define WE_FGC_TOOLTIP (WE_TOOLTIP | WE_ATTR_TYPE_FGC)
3426 #define WE_BGC_TOOLTIP (WE_TOOLTIP | WE_ATTR_TYPE_BGCA)
3427 
3428 /* Window border */
3429 #define WE_METRICS_WND_BORDER (WE_WND_BORDER | WE_ATTR_TYPE_METRICS)
3430 #define WE_FGC_ACTIVE_WND_BORDER (WE_WND_BORDER | WE_ATTR_TYPE_FGC)
3431 #define WE_FGC_INACTIVE_WND_BORDER (WE_WND_BORDER | WE_ATTR_TYPE_BGCA)
3432 
3433 /* Scroll bar */
3434 #define WE_METRICS_SCROLLBAR (WE_SCROLLBAR | WE_ATTR_TYPE_METRICS)
3435 
3436 /* Inactive caption */
3437 #define WE_FGC_INACTIVE_CAPTION (WE_INACTIVE_CAPTION | WE_ATTR_TYPE_FGC)
3438 #define WE_BGCA_INACTIVE_CAPTION (WE_INACTIVE_CAPTION | WE_ATTR_TYPE_BGCA)
3439 #define WE_BGCB_INACTIVE_CAPTION (WE_INACTIVE_CAPTION | WE_ATTR_TYPE_BGCB)
3440 
3441 /* Window */
3442 #define WE_FGC_WINDOW (WE_WINDOW | WE_ATTR_TYPE_FGC)
3443 #define WE_BGC_WINDOW (WE_WINDOW | WE_ATTR_TYPE_BGCA)
3444 
3445 /* 3d body */
3446 #define WE_FGC_THREED_BODY (WE_THREED_BODY | WE_ATTR_TYPE_FGC)
3447 #define WE_MAINC_THREED_BODY (WE_THREED_BODY | WE_ATTR_TYPE_BGCA)
3448 
3449 /* Selected items */
3450 #define WE_FGC_SELECTED_ITEM (WE_SELECTED_ITEM | WE_ATTR_TYPE_FGC)
3451 #define WE_BGC_SELECTED_ITEM (WE_SELECTED_ITEM | WE_ATTR_TYPE_BGCA)
3452 #define WE_BGC_SELECTED_LOSTFOCUS (WE_SELECTED_ITEM | WE_ATTR_TYPE_BGCB)
3453 
3454 /* Invalidate items */
3455 #define WE_FGC_DISABLED_ITEM (WE_DISABLED_ITEM | WE_ATTR_TYPE_FGC)
3456 #define WE_BGC_DISABLED_ITEM (WE_DISABLED_ITEM | WE_ATTR_TYPE_BGCA)
3457 
3458 /* Highlight items */
3459 #define WE_FGC_HIGHLIGHT_ITEM (WE_HIGHLIGHT_ITEM | WE_ATTR_TYPE_FGC)
3460 #define WE_BGC_HIGHLIGHT_ITEM (WE_HIGHLIGHT_ITEM | WE_ATTR_TYPE_BGCA)
3461 
3462 /* Significant items */
3463 #define WE_FGC_SIGNIFICANT_ITEM (WE_SIGNIFICANT_ITEM | WE_ATTR_TYPE_FGC)
3464 #define WE_BGC_SIGNIFICANT_ITEM (WE_SIGNIFICANT_ITEM | WE_ATTR_TYPE_BGCA)
3465 
3466 /* Desktop */
3467 #define WE_BGC_DESKTOP (WE_DESKTOP | WE_ATTR_TYPE_BGCA)
3468 
3469 #define WE_ATTR_TYPE_ICON 0x4000
3470 #define WE_ATTR_TYPE_ICON_MASK 0x0F00
3471 #define WE_ATTR_TYPE_SMALLICON 0x4000
3472 #define WE_ATTR_TYPE_LARGEICON 0x4100
3473 
3474 #define WE_LARGEICON_APPLICATION (WE_ATTR_TYPE_LARGEICON | 0x00)
3475 #define WE_LARGEICON_HAND (WE_ATTR_TYPE_LARGEICON | 0x01)
3476 #define WE_LARGEICON_QUESTION (WE_ATTR_TYPE_LARGEICON | 0x02)
3477 #define WE_LARGEICON_EXCLAMATION (WE_ATTR_TYPE_LARGEICON | 0x03)
3478 #define WE_LARGEICON_ASTERISK (WE_ATTR_TYPE_LARGEICON | 0x04)
3479 #define WE_LARGEICON_STOP WE_LARGEICON_HAND
3480 #define WE_LARGEICON_INFORMATION WE_LARGEICON_ASTERISK
3481 
3482 #define WE_SMALLICON_APPLICATION (WE_ATTR_TYPE_SMALLICON | 0x00)
3483 #define WE_SMALLICON_HAND (WE_ATTR_TYPE_SMALLICON | 0x01)
3484 #define WE_SMALLICON_QUESTION (WE_ATTR_TYPE_SMALLICON | 0x02)
3485 #define WE_SMALLICON_EXCLAMATION (WE_ATTR_TYPE_SMALLICON | 0x03)
3486 #define WE_SMALLICON_ASTERISK (WE_ATTR_TYPE_SMALLICON | 0x04)
3487 #define WE_SMALLICON_STOP WE_SMALLICON_HAND
3488 #define WE_SMALLICON_INFORMATION WE_SMALLICON_ASTERISK
3489 
3494 #define WE_ATTR_TYPE_RDR 0x5000
3495 
3496 #define WE_LFFLAT_NUMBER 1
3497 #ifdef _MGLF_RDR_FLAT
3498 
3499 #define WE_LFFLAT_TAB_NRMLCLR (WE_ATTR_TYPE_RDR | 0)
3500 #endif
3501 
3502 #define WE_LFSKIN_NUMBER 28
3503 #ifdef _MGLF_RDR_SKIN
3504 #define WE_LFSKIN_WND_BKGND (WE_ATTR_TYPE_RDR | 0)
3505 
3506 #define WE_LFSKIN_CAPTION (WE_ATTR_TYPE_RDR | 1)
3507 #define WE_LFSKIN_CAPTION_BTN (WE_ATTR_TYPE_RDR | 2)
3508 
3509 #define WE_LFSKIN_SCROLLBAR_VSHAFT (WE_ATTR_TYPE_RDR | 3)
3510 #define WE_LFSKIN_SCROLLBAR_VTHUMB (WE_ATTR_TYPE_RDR | 4)
3511 #define WE_LFSKIN_SCROLLBAR_HSHAFT (WE_ATTR_TYPE_RDR | 5)
3512 #define WE_LFSKIN_SCROLLBAR_HTHUMB (WE_ATTR_TYPE_RDR | 6)
3513 #define WE_LFSKIN_SCROLLBAR_ARROWS (WE_ATTR_TYPE_RDR | 7)
3514 
3515 #define WE_LFSKIN_BORDER_TOP (WE_ATTR_TYPE_RDR | 8)
3516 #define WE_LFSKIN_BORDER_BOTTOM (WE_ATTR_TYPE_RDR | 9)
3517 #define WE_LFSKIN_BORDER_LEFT (WE_ATTR_TYPE_RDR | 10)
3518 #define WE_LFSKIN_BORDER_RIGHT (WE_ATTR_TYPE_RDR | 11)
3519 
3520 #define WE_LFSKIN_ARROWS (WE_ATTR_TYPE_RDR | 12)
3521 #define WE_LFSKIN_ARROWS_SHELL (WE_ATTR_TYPE_RDR | 13)
3522 
3523 #define WE_LFSKIN_RADIOBUTTON (WE_ATTR_TYPE_RDR | 14)
3524 #define WE_LFSKIN_CHECKBUTTON (WE_ATTR_TYPE_RDR | 15)
3525 #define WE_LFSKIN_PUSHBUTTON (WE_ATTR_TYPE_RDR | 16)
3526 
3527 #define WE_LFSKIN_TREE (WE_ATTR_TYPE_RDR | 17)
3528 
3529 #define WE_LFSKIN_HEADER (WE_ATTR_TYPE_RDR | 18)
3530 #define WE_LFSKIN_TAB (WE_ATTR_TYPE_RDR | 19)
3531 
3532 #define WE_LFSKIN_PROGRESS_HCHUNK (WE_ATTR_TYPE_RDR | 20)
3533 #define WE_LFSKIN_PROGRESS_VCHUNK (WE_ATTR_TYPE_RDR | 21)
3534 #define WE_LFSKIN_PROGRESS_HTRACKBAR (WE_ATTR_TYPE_RDR | 22)
3535 #define WE_LFSKIN_PROGRESS_VTRACKBAR (WE_ATTR_TYPE_RDR | 23)
3536 
3537 #define WE_LFSKIN_TBSLIDER_H (WE_ATTR_TYPE_RDR | 24)
3538 #define WE_LFSKIN_TRACKBAR_VERT (WE_ATTR_TYPE_RDR | 25)
3539 #define WE_LFSKIN_TRACKBAR_HORZ (WE_ATTR_TYPE_RDR | 26)
3540 #define WE_LFSKIN_TBSLIDER_V (WE_ATTR_TYPE_RDR | 27)
3541 #endif
3542 
3544 typedef struct _WINDOW_ELEMENT_ATTR {
3550 
3552 typedef struct _WINDOW_ELEMENT_RENDERER* PWERENDERER;
3553 
3554 #define SBS_NORMAL 0x00
3555 #define SBS_DISABLED 0x01
3556 #define SBS_HIDE 0x02
3557 
3561 typedef struct _LFSCROLLBARINFO {
3563  int minPos;
3565  int maxPos;
3567  int curPos;
3569  int pageStep;
3571  int arrowLen;
3573  int barStart;
3575  int barLen;
3577  int status;
3578 } LFSCROLLBARINFO;
3579 
3581 
3585 typedef struct _SCROLLBARDATA {
3587  int minPos;
3589  int maxPos;
3591  int curPos;
3599  int barLen;
3600  /* mouse position before tracking thumb.
3601  * it represents the distance from x mouse postion to barStart
3602  * for horizontal scrollbar.
3603  * it represents the distance from y mouse postion to barStart
3604  * for vertical scrollbar.
3605  */
3606  int track_pos;
3608  int status;
3609 } SCROLLBARDATA;
3610 
3611 typedef SCROLLBARDATA* PSCROLLBARDATA;
3612 
3614 #define SBS_DISABLED_LTUP 0x0100
3615 
3617 #define SBS_DISABLED_BTDN 0x0200
3618 
3620 #define SBS_HILITE_LTUP 0x0400
3621 
3623 #define SBS_HILITE_BTDN 0x0800
3624 
3626 #define SBS_HILITE_THUMB 0x0010
3627 
3629 #define SBS_PRESSED_LTUP 0x0020
3630 
3632 #define SBS_PRESSED_BTDN 0x0040
3633 
3635 #define SBS_PRESSED_THUMB 0x0080
3636 
3637 
3638 #define LFRDR_WINTYPE_UNKNOWN 0
3639 #define LFRDR_WINTYPE_DIALOG 1
3640 #define LFRDR_WINTYPE_MAINWIN 2
3641 #define LFRDR_WINTYPE_CONTROL 3
3642 
3646 typedef struct _LFRDR_WINSTYLEINFO
3647 {
3649  int dwStyle;
3650 
3659  int winType;
3661 
3667 typedef struct _LFRDR_TRACKBARINFO
3668 {
3669  int nMin;
3670  int nMax;
3671  int nPos;
3672  int nTickFreq;
3674 
3675 #define LFRDR_METRICS_MASK 0xFF00
3676 #define LFRDR_METRICS_BORDER 0x0100
3677 #define LFRDR_METRICS_CAPTION_H 0x0200
3678 #define LFRDR_METRICS_ICON_H 0x0300
3679 #define LFRDR_METRICS_ICON_W 0x0400
3680 #define LFRDR_METRICS_MENU_H 0x0500
3681 #define LFRDR_METRICS_VSCROLL_W 0x0600
3682 #define LFRDR_METRICS_HSCROLL_H 0x0700
3683 #define LFRDR_METRICS_MINWIN_WIDTH 0x0800
3684 #define LFRDR_METRICS_MINWIN_HEIGHT 0x0900
3685 
3686 #define LFRDR_SB_MINBARLEN 10
3687 
3692 #define LEN_RENDERER_NAME 15
3693 
3694 /* button status used by button and 3dbox. */
3695 #define LFRDR_BTN_STATUS_MASK 0x03
3696 #define LFRDR_BTN_STATUS_NORMAL 0x00
3697 #define LFRDR_BTN_STATUS_HILITE 0x01
3698 #define LFRDR_BTN_STATUS_PRESSED 0x02
3699 #define LFRDR_BTN_STATUS_DISABLED 0x03
3700 
3701 /* a flag used by radio button and check button. */
3702 #define LFRDR_BTN_STATUS_SELECTED 0x04
3703 
3704 /* a flag used by button on capton bar. */
3705 #define LFRDR_BTN_STATUS_INACTIVE 0x08
3706 
3707 /* thick or thin frame used by 3dbox. */
3708 #define LFRDR_3DBOX_THICKFRAME 0x20
3709 
3710 /* filled 3dbox */
3711 #define LFRDR_3DBOX_FILLED 0x40
3712 
3713 /*select status used by checkmark or radio.*/
3714 #define LFRDR_MARK_SELECTED_MASK 0x05
3715 #define LFRDR_MARK_ALL_SELECTED 0x01
3716 #define LFRDR_MARK_HALF_SELECTED 0x04
3717 
3718 /* a flag whether a checkmark or radio has a shell or not.*/
3719 #define LFRDR_MARK_HAVESHELL 0x02
3720 
3721 /*the direction of arrow.*/
3722 #define LFRDR_ARROW_DIRECT_MASK 0x0F00
3723 #define LFRDR_ARROW_LEFT 0x0000
3724 #define LFRDR_ARROW_RIGHT 0x0100
3725 #define LFRDR_ARROW_UP 0x0200
3726 #define LFRDR_ARROW_DOWN 0x0300
3727 
3728 /* hollow arrow or filled */
3729 #define LFRDR_ARROW_NOFILL 0x1000
3730 #define LFRDR_ARROW_HAVESHELL 0x2000
3731 
3732 /* minimum of menu margin */
3733 #define LFRDR_MENUITEMOFFY_MIN 4
3734 
3735 #define LFRDR_3DBOX_COLOR_LIGHTEST 0x01
3736 #define LFRDR_3DBOX_COLOR_DARKEST 0x02
3737 #define LFRDR_3DBOX_COLOR_LIGHTER 0x03
3738 #define LFRDR_3DBOX_COLOR_DARKER 0x04
3739 
3740 /* flag of propsheet tab */
3741 #define LFRDR_TAB_BOTTOM 0x0001
3742 #define LFRDR_TAB_ACTIVE 0x0010
3743 #define LFRDR_TAB_ICON 0x0100
3744 
3745 /* for fold icon*/
3746 #define LFRDR_TREE_WITHICON 0x08
3747 #define LFRDR_TREE_FOLD 0x01
3748 
3749 /* for connecting line*/
3750 #define LFRDR_TREE_CHILD 0x02
3751 #define LFRDR_TREE_NEXT 0x04
3752 
3753 #define SYSICO_ITEM_NUMBER 5
3754 
3758  const char name[LEN_RENDERER_NAME+1];
3759 
3764  int (*init) (PWERENDERER renderer);
3765 
3770  int (*deinit) (PWERENDERER renderer);
3771 
3786  DWORD (*calc_3dbox_color) (DWORD color, int flag);
3787 
3807  void (*draw_3dbox) (HDC hdc, const RECT* pRect, DWORD color, DWORD flag);
3808 
3809 
3820  void (*draw_radio) (HDC hdc, const RECT* pRect, DWORD color, int status);
3821 
3825  void (*draw_checkbox) (HDC hdc, const RECT* pRect, DWORD color,
3826  int status);
3827 
3831  void (*draw_checkmark) (HDC hdc, const RECT* pRect, DWORD color,
3832  int status);
3833 
3850  void (*draw_arrow) (HWND hWnd, HDC hdc, const RECT* pRect, DWORD color, int status);
3851 
3865  void (*draw_fold) (HWND hWnd, HDC hdc, const RECT* pRect, DWORD color,
3866  int status, int next);
3867 
3869  void (*draw_focus_frame) (HDC hdc, const RECT *pRect, DWORD color);
3870 
3872  void (*draw_normal_item) (HWND hWnd, HDC hdc, const RECT* pRect,
3873  DWORD color);
3874 
3876  void (*draw_hilite_item) (HWND hWnd, HDC hdc, const RECT* pRect,
3877  DWORD color);
3878 
3880  void (*draw_disabled_item) (HWND hWnd, HDC hdc, const RECT* pRect,
3881  DWORD color);
3882 
3884  void (*draw_significant_item) (HWND hWnd, HDC hdc, const RECT* pRect,
3885  DWORD color);
3886 
3900  void (*draw_push_button) (HWND hWnd, HDC hdc, const RECT* pRect,
3901  DWORD color1, DWORD color2, int status);
3902 
3919  void (*draw_radio_button) (HWND hWnd, HDC hdc, const RECT* pRect, int status);
3920 
3937  void (*draw_check_button) (HWND hWnd, HDC hdc, const RECT* pRect, int status);
3938 
3940  void (*draw_border) (HWND hWnd, HDC hdc, BOOL is_active);
3941 
3943  void (*draw_caption) (HWND hWnd, HDC hdc, BOOL is_active);
3944 
3958  void (*draw_caption_button) (HWND hwnd, HDC hdc, int ht_code, int state);
3959 
3974  void (*draw_scrollbar) (HWND hWnd, HDC hdc, int sb_pos);
3975 
3977  void (*calc_trackbar_rect) (HWND hWnd, LFRDR_TRACKBARINFO *info,
3978  DWORD dwStyle, const RECT* rcClient, RECT* rcRuler,
3979  RECT* rcBar, RECT* rcBorder);
3980 
3982  void (*draw_trackbar) (HWND hWnd, HDC hdc, LFRDR_TRACKBARINFO *info);
3983 
3990  int (*calc_we_area) (HWND hWnd, int which, RECT* we_area);
3991 
4014  int (*calc_we_metrics) (HWND hWnd,
4015  LFRDR_WINSTYLEINFO* style_info, int which);
4016 
4022  int (*hit_test) (HWND hWnd, int x, int y);
4023 
4025  int (*on_click_hotspot) (HWND hWnd, int which);
4026 
4036  void (*draw_custom_hotspot) (HWND hWnd, HDC hdc, int ht_code, int state);
4037 
4044  void (*calc_thumb_area) (HWND hWnd, BOOL vertical,
4045  LFSCROLLBARINFO* sb_info);
4046 
4048  void (*disabled_text_out) (HWND hWnd, HDC hdc, const char* spText,
4049  PRECT rc, DWORD dt_fmt);
4050 
4061  void (*draw_tab) (HWND hWnd, HDC hdc, RECT *rect, char *title,
4062  DWORD color, int flag, HICON icon);
4063 
4065  void (*draw_progress) (HWND hWnd, HDC hdc,
4066  int nMax, int nMin, int nPos, BOOL fVertical);
4067 
4071  void (*draw_header) (HWND hWnd, HDC hdc, const RECT* pRect, DWORD color);
4072 
4077  DWORD (*on_get_rdr_attr) (struct _WINDOW_ELEMENT_RENDERER*, int we_attr_id);
4078 
4085  DWORD (*on_set_rdr_attr) (struct _WINDOW_ELEMENT_RENDERER*, int we_attr_id, DWORD we_attr, BOOL change);
4086 
4088  void (*erase_background) (HWND hWnd, HDC hdc, const RECT *rect);
4089 
4091  void (*draw_normal_menu_item) (HWND hWnd, HDC hdc, const RECT* pRect,
4092  DWORD color);
4093 
4095  void (*draw_hilite_menu_item) (HWND hWnd, HDC hdc, const RECT* pRect,
4096  DWORD color);
4097 
4099  void (*draw_disabled_menu_item) (HWND hWnd, HDC hdc, const RECT* pRect,
4100  DWORD color);
4101 
4104 
4107 
4110 
4112  HICON we_icon [2][SYSICO_ITEM_NUMBER];
4113 
4115  unsigned int refcount;
4116 
4118  const void* private_info;
4120 
4124 typedef struct _WINDOWINFO
4125 {
4127  int left, top;
4128  int right, bottom;
4129 
4131  int cl, ct;
4132  int cr, cb;
4133 
4138 
4155 
4157  char* spCaption;
4162 
4167 
4170 } WINDOWINFO;
4171 
4183 static inline const WINDOWINFO* GUIAPI GetWindowInfo (HWND hWnd)
4184 {
4185  return (WINDOWINFO*)hWnd;
4186 }
4187 
4199 MG_EXPORT BOOL GUIAPI InitWindowElementAttrs (PWERENDERER rdr);
4200 
4293 MG_EXPORT DWORD GUIAPI GetWindowElementAttr (HWND hwnd, int we_attr_id);
4294 
4311 MG_EXPORT DWORD GUIAPI SetWindowElementAttr (HWND hwnd, int we_attr_id,
4312  DWORD we_attr);
4313 
4333 MG_EXPORT gal_pixel GUIAPI GetWindowElementPixelEx (HWND hwnd,
4334  HDC hdc, int we_attr_id);
4335 
4350 MG_EXPORT WINDOW_ELEMENT_RENDERER*
4351  GUIAPI GetWindowRendererFromName (const char* name);
4352 
4365 MG_EXPORT BOOL GUIAPI AddWindowElementRenderer (const char* name,
4366  const WINDOW_ELEMENT_RENDERER* we_rdr);
4367 
4378 MG_EXPORT BOOL GUIAPI RemoveWindowElementRenderer (const char* name);
4379 
4391 MG_EXPORT WINDOW_ELEMENT_RENDERER*
4392  GUIAPI GetDefaultWindowElementRenderer (void);
4393 
4405 MG_EXPORT const char* GUIAPI SetDefaultWindowElementRenderer (const char* name);
4406 
4425 MG_EXPORT BOOL GUIAPI SetWindowElementRenderer (HWND hWnd,
4426  const char* werdr_name, const WINDOW_ELEMENT_ATTR* we_attrs);
4427 
4440 MG_EXPORT BOOL InitRendererSystemIcon (const char* rdr_name,
4441  HICON *small_icon, HICON *large_icon);
4442 
4453 MG_EXPORT void TermRendererSystemIcon (HICON *small_icon,
4454  HICON *large_icon);
4455 
4476 MG_EXPORT BOOL GUIAPI RegisterResFromFile (HDC hdc, const char* file);
4477 
4478 
4497 MG_EXPORT BOOL GUIAPI RegisterResFromMem (HDC hdc, const char* file,
4498  const unsigned char* data, size_t data_size);
4499 
4513 MG_EXPORT BOOL GUIAPI RegisterResFromBitmap (const char* file, const BITMAP* bmp);
4514 
4527 MG_EXPORT const BITMAP* GUIAPI RetrieveRes (const char *file);
4528 
4542 MG_EXPORT void GUIAPI UnregisterRes (const char *file);
4543 
4560 MG_EXPORT BOOL GUIAPI RegisterSystemBitmap (HDC hdc, const char* rdr_name,
4561  const char* id);
4562 
4577 MG_EXPORT void GUIAPI UnregisterSystemBitmap (HDC hdc, const char* rdr_name,
4578  const char* id);
4579 
4580 /* define the key of resource */
4581 typedef unsigned long RES_KEY;
4582 #define RES_KEY_INVALID 0
4583 
4584 /* define the incore res type */
4585 typedef struct _INNER_RES {
4586  RES_KEY key;
4587  Uint8* data;
4588  int data_len;
4589 
4590  /* special param recognized by the TYPE_OPS
4591  * normal is null.
4592  * is the data is a mem of raw png, jpeg, bmp
4593  * and so on, it should be the extention name
4594  * of the filename. eg.
4595  * INNER_RES res[]= { ... { ..., ... ,.., "png" } .. };
4596  * */
4597  void* additional;
4598 } INNER_RES;
4599 
4600 /* the type of resource */
4601 enum emResType{
4602  RES_TYPE_INVALID = 0xFF,
4603 
4604  /* All kinds of image supported by MiniGUI
4605  * such as png, jpeg, bmp and so on
4606  * This type will make LoadResource return a
4607  * PBITMAP pointer
4608  */
4609  RES_TYPE_IMAGE = 0,
4610 
4611  /* All kinds of image supported by MiniGUI
4612  * This Type will make LoadResource return a MYBITMAP* pointer
4613  */
4614  RES_TYPE_MYBITMAP,
4615 
4616  /* the icon file and mem
4617  * it only make LoadResource load or get the FIRST
4618  * icon, and return HICON
4619  */
4620  RES_TYPE_ICON,
4621 
4622 #ifdef _MGHAVE_CURSOR
4623  /* the cursor file or data
4624  * Make LoadResource return HCURSOR
4625  */
4626  RES_TYPE_CURSOR,
4627 #endif
4628 
4629  /* the config file or data support by minigui
4630  * make LoadResource return GHANDLE
4631  * it should be accessed by GetValueFromEtc and GetIntValueFromEtc
4632  */
4633  RES_TYPE_ETC,
4634 
4635  /* NOT IMPLEMENT */
4636  RES_TYPE_TEXT,
4637  /* NOT IMPLEMENT */
4638  RES_TYPE_MENU,
4639  /* NOT IMPLEMENT */
4640 
4641  RES_TYPE_WINDOW,
4642  /* Make the LoadResource return the
4643  * raw data of INNER_RES, it's a pointer
4644  * of MEM_RES
4645  * only support incore Resource,
4646  * if the resource is stored in disk, LoadResource will return NULL
4647  */
4648  RES_TYPE_MEM_RES,
4649 
4650  RES_TYPE_FONT,
4651 
4652  /* the beginning of user defined type
4653  */
4654  RES_TYPE_USER,
4655 
4656  /* the max valid value of type
4657  * used defined type must less this value
4658  */
4659  RES_TYPE_USER_MAX = 0x7F
4660 };
4661 
4662 /* the return value of LoadResource with type RES_TYPE_MEM_RES */
4663 typedef struct _MEM_RES {
4664  Uint8 *data;
4665  int data_len;
4666 } MEM_RES;
4667 
4668 typedef struct _FONT_RES {
4669  LOGFONT logfont;
4670  RES_KEY key;
4671 } FONT_RES;
4672 
4673 /* the original source of resource
4674  * depend on the values, the res manager
4675  * would select corrent loader to
4676  * load resource form disk or mem
4677  */
4678 
4679 #define REF_SRC_NOTYPE 0x00
4680 
4681 /* indicate that the resource is stored in disk */
4682 #define REF_SRC_FILE 0x01
4683 
4684 /* indicate that the resource is stored in memory*/
4685 #define REF_SRC_INNER 0x02
4686 
4687 /* indicate that the resource is stored in shared memory*/
4688 #define REF_SRC_SHARED 0x03
4689 
4690 /* indicate that the resource is stored in outside( NOT SUPPORTED) */
4691 #define REF_SRC_OUTSIDE 0x04
4692 
4693 /* indicate that the resource is stored in a stream object (NOT SUPPORTED) */
4694 #define REF_SRC_STREAM 0x05
4695 
4696 /* indicate that the resource is create by MiniGUI */
4697 #define REF_SRC_LOGIC 0x06
4698 
4699 /* the RESOUCE type for loadding */
4700 typedef struct _RESOURCE {
4701  void* data; // store the pointer of cached resource
4702  union {
4703  void* src;
4704  INNER_RES* inner;
4705  char* file;
4706  } source; // indicate the stored format of resource
4707 } RESOURCE;
4708 
4709 /* The operations of one type of resource */
4710 typedef struct _RES_TYPE_OPS {
4711  /* To get a resource
4712  * return the buffered resource pointer
4713  * param res the in and out param of resource.
4714  * param src_type, one of REF_SRC_XXX
4715  * param usr_param
4716  * */
4717  void* (*get_res_data)(RESOURCE* res, int src_type, DWORD usr_param);
4718  /* To unload a buffered resource
4719  */
4720  void (*unload)(RESOURCE* res, int src_type);
4721 } RES_TYPE_OPS;
4722 
4723 /* Return value and error code of resource manager */
4724 enum emResReturn {
4725  RES_RET_OK = 0,
4726  RES_RET_INVALID_PARAM,
4727  RES_RET_NOT_EXIST_KEY, //RES_KEY is not exist
4728  RES_RET_LOAD_FILE_FAILED,
4729  RES_RET_LOAD_MEM_FAILED,
4730  RES_RET_UNKNOWN_TYPE,
4731  RES_RET_NOT_IMPLEMENTED,
4732  RES_RET_INUSED //the res or object is in used, cannot be unloaded
4733 };
4734 
4744 MG_EXPORT const char* GetResPath (void);
4745 
4759 MG_EXPORT int SetResPath (const char* path);
4760 
4774 MG_EXPORT int AddInnerRes (INNER_RES* inner_res, int count, BOOL copy);
4775 
4776 /*
4777  * NOT IMPLEMENT
4778  */
4779 MG_EXPORT int AddSharedRes (const char* shared_name);
4780 
4793 MG_EXPORT int RegisterResType (int type, RES_TYPE_OPS* ops);
4794 
4805 MG_EXPORT int UnregisterResType (int type);
4806 
4844 MG_EXPORT void* LoadResource (const char* res_name, int type, DWORD usr_param);
4845 
4859 MG_EXPORT void* GetResource (RES_KEY key);
4860 
4876 MG_EXPORT int AddResRef (RES_KEY key);
4877 
4889 MG_EXPORT int ReleaseRes (RES_KEY key);
4890 
4891 #define LoadBitmapFromRes(hdc, res_name) \
4892  (PBITMAP)LoadResource(res_name, RES_TYPE_IMAGE, (DWORD)hdc)
4893 
4894 #define GetBitmapFromRes(key) (BITMAP*)GetResource(key)
4895 
4896 #define GetIconFromRes(key) (HICON)GetResource(key)
4897 
4898 #ifndef _MGHAVE_CURSOR
4899 #define GetCursorFromRes(key) (HCURSOR)GetResource(key)
4900 #endif
4901 
4902 #define GetEtcFromRes(key) (GHANDLE)GetResource(key)
4903 
4904 #define LoadLogicFontFromRes(font_name) (PLOGFONT)LoadResource(font_name, RES_TYPE_FONT, 0)
4905 #define GetLogicFontFromRes(font_name) (PLOGFONT)GetResource(Str2Key(font_name))
4906 #define ReleaseLogicFont(font) ReleaseRes(((FONT_RES*)(font))->key)
4907 #define ReleaseLogicFontByName(font_name) ReleaseRes(Str2Key(font_name))
4908 
4920 MG_EXPORT RES_KEY Str2Key (const char* str);
4921 
4922 
4923 #ifdef __TARGET_MSTUDIO__
4924 
4933 MG_EXPORT int GUIAPI GetWindowZOrder(HWND hWnd);
4934 
4944 MG_EXPORT int GUIAPI SetWindowZOrder(HWND hWnd, int zorder);
4945 
4946 #endif
4947 
4965 
4966 extern MG_EXPORT HWND __mg_hwnd_desktop;
4967 
4972 #define HWND_DESKTOP __mg_hwnd_desktop
4973 
4978 #define HWND_NULL ((HWND)0)
4979 
4984 #define HWND_INVALID ((HWND)-1)
4985 
4986 #define HWND_OTHERPROC ((HWND)-1)
4987 
4991 typedef struct _MAINWINCREATE
4992 {
4995 
4998 
5000  const char* spCaption;
5001 
5004 
5007 
5010 
5012  HWND hHosting;
5013 
5015  LRESULT (*MainWindowProc)(HWND, UINT, WPARAM, LPARAM);
5016 
5018  int lx, ty, rx, by;
5019 
5022 
5025 
5028 }MAINWINCREATE;
5029 typedef MAINWINCREATE* PMAINWINCREATE;
5030 
5031 #ifdef _MGRM_THREADS
5032 
5043 MG_EXPORT int GUIAPI CreateThreadForMainWindow(pthread_t* thread,
5044  pthread_attr_t* attr,
5045  void * (*start_routine)(void *),
5046  void * arg);
5047 
5054 MG_EXPORT pthread_t GUIAPI GetMainWinThread(HWND hMainWnd);
5055 
5065 MG_EXPORT int GUIAPI WaitMainWindowClose(HWND hWnd, void** returnval);
5066 #endif
5067 
5083 MG_EXPORT void GUIAPI MainWindowThreadCleanup(HWND hMainWnd);
5084 
5091 #define MainWindowCleanup(hwnd) MainWindowThreadCleanup(hwnd)
5092 
5118 MG_EXPORT HWND GUIAPI CreateMainWindowEx (PMAINWINCREATE pCreateInfo,
5119  const char* werdr_name, const WINDOW_ELEMENT_ATTR* we_attrs,
5120  const char* window_name, const char* layer_name);
5121 
5132 static inline HWND GUIAPI CreateMainWindow (PMAINWINCREATE pCreateInfo)
5133 {
5134  return CreateMainWindowEx (pCreateInfo, NULL, NULL, NULL, NULL);
5135 }
5136 
5155 MG_EXPORT BOOL GUIAPI DestroyMainWindow (HWND hWnd);
5156 
5172 MG_EXPORT BOOL GUIAPI SetWindowMask (HWND hWnd, const MYBITMAP* mask);
5173 
5190 MG_EXPORT BOOL GUIAPI SetWindowMaskEx (HWND hWnd, HDC hdc, const BITMAP* mask);
5191 
5201 BOOL GUIAPI SetWindowRegion (HWND hWnd, const CLIPRGN* region);
5202 
5222 BOOL GUIAPI GetWindowRegion (HWND hWnd, CLIPRGN* region);
5223 
5224 LRESULT GUIAPI PreDefMainWinProc (HWND hWnd, UINT message,
5225  WPARAM wParam, LPARAM lParam);
5226 
5227 LRESULT GUIAPI PreDefDialogProc (HWND hWnd,
5228  UINT message, WPARAM wParam, LPARAM lParam);
5229 
5230 LRESULT GUIAPI PreDefControlProc (HWND hWnd, UINT message,
5231  WPARAM wParam, LPARAM lParam);
5232 
5250 MG_EXPORT LRESULT GUIAPI DefaultWindowProc (HWND hWnd, UINT message,
5251  WPARAM wParam, LPARAM lParam);
5252 
5258 extern MG_EXPORT WNDPROC __mg_def_proc[3];
5259 
5274 #define DefaultMainWinProc (__mg_def_proc[0])
5275 
5292 #define DefaultDialogProc (__mg_def_proc[1])
5293 
5307 #define DefaultControlProc (__mg_def_proc[2])
5308 
5309 #ifdef _DEBUG
5310 MG_EXPORT void GUIAPI DumpWindow (FILE* fp, HWND hWnd);
5311 #endif /* _DEBUG */
5312 
5320 #define SW_HIDE 0x0000
5321 #define SW_SHOW 0x0010
5322 #define SW_SHOWNORMAL 0x0100
5323 
5339 MG_EXPORT void GUIAPI UpdateWindow (HWND hWnd, BOOL bErase);
5340 
5359 MG_EXPORT BOOL GUIAPI ShowWindow (HWND hWnd, int iCmdShow);
5360 
5377 MG_EXPORT BOOL GUIAPI EnableWindow (HWND hWnd, BOOL fEnable);
5378 
5393 MG_EXPORT BOOL GUIAPI IsWindowEnabled (HWND hWnd);
5394 
5415 MG_EXPORT BOOL GUIAPI GetClientRect(HWND hWnd, PRECT prc);
5416 
5432 MG_EXPORT gal_pixel GUIAPI GetWindowBkColor (HWND hWnd);
5433 
5452 MG_EXPORT gal_pixel GUIAPI SetWindowBkColor (HWND hWnd, gal_pixel new_bkcolor);
5453 
5466 MG_EXPORT PLOGFONT GUIAPI GetWindowFont (HWND hWnd);
5467 
5487 MG_EXPORT PLOGFONT GUIAPI SetWindowFont (HWND hWnd, PLOGFONT pLogFont);
5488 
5501 MG_EXPORT HCURSOR GUIAPI GetWindowCursor (HWND hWnd);
5502 
5516 MG_EXPORT HCURSOR GUIAPI SetWindowCursor (HWND hWnd, HCURSOR hNewCursor);
5517 
5530 MG_EXPORT HICON GUIAPI GetWindowIcon (HWND hWnd);
5531 
5549 MG_EXPORT HICON GUIAPI SetWindowIcon (HWND hWnd, HICON hIcon, BOOL bRedraw);
5550 
5562 MG_EXPORT DWORD GUIAPI GetWindowStyle (HWND hWnd);
5563 
5575 MG_EXPORT DWORD GUIAPI GetWindowExStyle (HWND hWnd);
5576 
5590 MG_EXPORT BOOL GUIAPI ExcludeWindowStyle (HWND hWnd, DWORD dwStyle);
5591 
5605 MG_EXPORT BOOL GUIAPI IncludeWindowStyle (HWND hWnd, DWORD dwStyle);
5606 
5620 MG_EXPORT BOOL GUIAPI ExcludeWindowExStyle (HWND hWnd, DWORD dwStyle);
5621 
5635 MG_EXPORT BOOL GUIAPI IncludeWindowExStyle (HWND hWnd, DWORD dwStyle);
5636 
5649 MG_EXPORT WNDPROC GUIAPI GetWindowCallbackProc (HWND hWnd);
5650 
5668 MG_EXPORT WNDPROC GUIAPI SetWindowCallbackProc (HWND hWnd, WNDPROC newProc);
5669 
5682 MG_EXPORT DWORD GUIAPI GetWindowAdditionalData (HWND hWnd);
5683 
5702 MG_EXPORT DWORD GUIAPI SetWindowAdditionalData (HWND hWnd, DWORD newData);
5703 
5716 MG_EXPORT DWORD GUIAPI GetWindowAdditionalData2 (HWND hWnd);
5717 
5735 MG_EXPORT DWORD GUIAPI SetWindowAdditionalData2 (HWND hWnd, DWORD newData);
5736 
5753 MG_EXPORT DWORD GUIAPI GetWindowClassAdditionalData (HWND hWnd);
5754 
5770 MG_EXPORT DWORD GUIAPI SetWindowClassAdditionalData (HWND hWnd, DWORD newData);
5771 
5784 MG_EXPORT const char* GUIAPI GetWindowCaption (HWND hWnd);
5785 
5799 MG_EXPORT BOOL GUIAPI SetWindowCaption (HWND hWnd, const char* spCaption);
5800 
5819 MG_EXPORT BOOL GUIAPI InvalidateRect (HWND hWnd,
5820  const RECT* prc, BOOL bEraseBkgnd);
5821 
5858 MG_EXPORT BOOL GUIAPI InvalidateRegion (HWND hWnd, const CLIPRGN* pRgn, BOOL bErase);
5859 
5885 MG_EXPORT BOOL GUIAPI ValidateRect (HWND hWnd, const RECT* rect);
5886 
5913 MG_EXPORT BOOL GUIAPI ValidateRegion (HWND hWnd, const CLIPRGN* pRgn);
5914 
5930 MG_EXPORT HDC GUIAPI BeginPaint(HWND hWnd);
5931 
5945 MG_EXPORT void GUIAPI EndPaint(HWND hWnd, HDC hdc);
5946 
5962 MG_EXPORT BOOL GUIAPI GetUpdateRect (HWND hWnd, RECT* update_rect);
5963 
5983 MG_EXPORT int GUIAPI GetUpdateRegion (HWND hWnd, PCLIPRGN pRgn);
5984 
6001 MG_EXPORT int GUIAPI ClientWidthToWindowWidthEx (DWORD dwStyle,
6002  int win_type, int cw);
6003 
6020 MG_EXPORT int GUIAPI ClientHeightToWindowHeightEx (DWORD dwStyle,
6021  int win_type, int ch, BOOL hasMenu);
6022 
6023 #define ClientWidthToWindowWidth(dwStyle, cw) \
6024  ClientWidthToWindowWidthEx (dwStyle, LFRDR_WINTYPE_MAINWIN, cw)
6025 
6026 #define ClientHeightToWindowHeight(dwStyle, ch, hasMenu) \
6027  ClientHeightToWindowHeightEx (dwStyle, LFRDR_WINTYPE_MAINWIN, ch, hasMenu)
6028 
6067 MG_EXPORT BOOL GUIAPI AdjustWindowRectEx (RECT* pRect, DWORD dwStyle,
6068  BOOL bMenu, DWORD dwExStyle);
6069 
6083 MG_EXPORT void GUIAPI ClientToScreen (HWND hWnd, int* x, int* y);
6084 
6098 MG_EXPORT void GUIAPI ScreenToClient (HWND hWnd, int* x, int* y);
6099 
6113 MG_EXPORT void GUIAPI ClientToWindow(HWND hWnd, int* x, int* y);
6114 
6128 MG_EXPORT void GUIAPI WindowToClient(HWND hWnd, int* x, int* y);
6129 
6130 
6144 MG_EXPORT void GUIAPI WindowToScreen (HWND hWnd, int* x, int* y);
6145 
6159 MG_EXPORT void GUIAPI ScreenToWindow (HWND hWnd, int* x, int* y);
6160 
6174 MG_EXPORT BOOL GUIAPI IsMainWindow (HWND hWnd);
6175 
6188 MG_EXPORT BOOL GUIAPI IsControl (HWND hWnd);
6189 
6203 MG_EXPORT BOOL GUIAPI IsWindow (HWND hWnd);
6204 
6218 MG_EXPORT BOOL GUIAPI IsDialog (HWND hWnd);
6219 
6237 MG_EXPORT HWND GUIAPI GetParent (HWND hWnd);
6238 
6254 MG_EXPORT HWND GUIAPI GetMainWindowHandle (HWND hWnd);
6255 
6270 MG_EXPORT BOOL GUIAPI IsWindowVisible (HWND hWnd);
6271 
6289 MG_EXPORT BOOL GUIAPI GetWindowRect (HWND hWnd, PRECT prc);
6290 
6315 MG_EXPORT HWND GUIAPI GetNextChild (HWND hWnd, HWND hChild);
6316 
6334 MG_EXPORT HWND GUIAPI GetNextMainWindow (HWND hMainWnd);
6335 
6355 MG_EXPORT HWND GUIAPI GetHosting (HWND hMainWnd);
6356 
6376 MG_EXPORT HWND GUIAPI GetFirstHosted (HWND hHosting);
6377 
6402 MG_EXPORT HWND GUIAPI GetNextHosted (HWND hHosting, HWND hHosted);
6403 
6418 MG_EXPORT int GUIAPI GetWindowTextLength (HWND hWnd);
6419 
6436 MG_EXPORT int GUIAPI GetWindowText (HWND hWnd, char* spString, int nMaxLen);
6437 
6453 MG_EXPORT BOOL GUIAPI SetWindowText (HWND hWnd, const char* spString);
6454 
6469 MG_EXPORT HWND GUIAPI GetFocusChild (HWND hParent);
6470 
6484 MG_EXPORT HWND GUIAPI SetNullFocus (HWND hParent);
6485 
6499 MG_EXPORT HWND GUIAPI SetFocusChild (HWND hWnd);
6500 
6505 #define SetFocus SetFocusChild
6506 
6511 #define GetFocus GetFocusChild
6512 
6524 MG_EXPORT HWND GUIAPI GetActiveWindow (void);
6525 
6539 MG_EXPORT HWND GUIAPI SetActiveWindow (HWND hMainWnd);
6540 
6545 #define GetForegroundWindow GetActiveWindow
6546 
6551 #define SetForegroundWindow SetActiveWindow
6552 
6567 MG_EXPORT HWND GUIAPI GetCapture(void);
6568 
6584 MG_EXPORT HWND GUIAPI SetCapture(HWND hWnd);
6585 
6597 MG_EXPORT void GUIAPI ReleaseCapture(void);
6598 
6611 MG_EXPORT HWND GUIAPI GetWindowUnderCursor (void);
6612 
6627 MG_EXPORT HWND GUIAPI WindowFromPointEx (POINT pt, BOOL bRecursion);
6628 
6629 #define WindowFromPoint(pt) WindowFromPointEx(pt, TRUE)
6630 
6631 #define CWP_ALL 0x0000
6632 #define CWP_SKIPINVISIBLE 0x0001
6633 #define CWP_SKIPDISABLED 0x0002
6634 #define CWP_SKIPTRANSPARENT 0x0004
6635 
6672 MG_EXPORT HWND GUIAPI ChildWindowFromPointEx (HWND hParent, POINT pt,
6673  UINT uFlags);
6674 
6686 static inline HWND GUIAPI ChildWindowFromPoint (HWND hParent, POINT pt)
6687 {
6688  return ChildWindowFromPointEx (hParent, pt, CWP_ALL);
6689 }
6690 
6712 MG_EXPORT BOOL GUIAPI MoveWindow (HWND hWnd, int x, int y, int w, int h,
6713  BOOL fPaint);
6714 
6715 #define SW_INVALIDATE 0x01
6716 #define SW_ERASE 0x02
6717 #define SW_SCROLLCHILDREN 0x04
6718 
6790 MG_EXPORT int GUIAPI ScrollWindowEx (HWND hWnd, int dx, int dy,
6791  const RECT *prcScroll, const RECT *prcClip,
6792  PCLIPRGN pRgnUpdate, PRECT prcUpdate, UINT flags);
6793 
6814 static inline void GUIAPI ScrollWindow (HWND hWnd, int dx, int dy,
6815  const RECT* prcScroll, const RECT* prcClip)
6816 {
6817  ScrollWindowEx (hWnd, dx, dy, prcScroll, prcClip,
6818  NULL, NULL, SW_ERASE | SW_INVALIDATE | SW_SCROLLCHILDREN);
6819 }
6820 
6825 #define GetWindowElementColor(iItem) \
6826  GetWindowElementPixelEx(HWND_NULL, (HDC)-1, iItem)
6827 
6828 #define GetWindowElementColorEx(hWnd, iItem) \
6829  GetWindowElementPixelEx(hWnd, (HDC)-1, iItem)
6830 
6831 #define GetWindowElementPixel(hWnd, iItem) \
6832  GetWindowElementPixelEx(hWnd, (HDC)-1, iItem)
6833 
6840 #define SYSBMP_RADIOBUTTON "radiobutton"
6841 #define SYSBMP_CHECKBUTTON "checkbutton"
6842 #define SYSBMP_BGPICTURE "bgpicture"
6843 #define SYSBMP_BGPICPOS "bgpicpos"
6844 
6845 /* Obsolete definitions; back-compatibility definitions. */
6846 #define SYSBMP_IMECTRLBTN "IMEctrlbtn"
6847 #define SYSBMP_LOGO "logo"
6848 
6867 MG_EXPORT const BITMAP* GUIAPI GetSystemBitmapEx (const char* rdr_name,
6868  const char* id);
6869 
6888 MG_EXPORT const BITMAP* GUIAPI GetSystemBitmapByHwnd (HWND hWnd, const char* id);
6889 
6908 MG_EXPORT const BITMAP* GUIAPI GetSystemBitmap (HWND hWnd, const char* id);
6909 
6929 MG_EXPORT void GUIAPI TermSystemBitmapEx (const char* id,
6930  const char* rdr_name, PBITMAP bmp);
6931 
6950 MG_EXPORT void GUIAPI TermSystemBitmap (HWND hWnd, const char* id, PBITMAP bmp);
6951 
6952 /*for backward compatibility */
6953 #define IDI_APPLICATION 0
6954 #define IDI_HAND 1
6955 #define IDI_STOP IDI_HAND
6956 #define IDI_QUESTION 2
6957 #define IDI_EXCLAMATION 3
6958 #define IDI_ASTERISK 4
6959 #define IDI_INFORMATION IDI_ASTERISK
6960 
6961 #define SYSICON_FT_DIR "dir"
6962 #define SYSICON_FT_FILE "file"
6963 
6964 #define SYSICON_TREEFOLD "treefold"
6965 #define SYSICON_TREEUNFOLD "treeunfold"
6966 
6984 MG_EXPORT HICON GUIAPI LoadSystemIconEx (HDC hdc,
6985  const char* rdr_name, const char* szItemName, int which);
6986 
7001 MG_EXPORT HICON GUIAPI LoadSystemIcon (const char* szItemName, int which);
7002 
7023 MG_EXPORT HICON GUIAPI GetLargeSystemIconEx (HWND hWnd, int iItem);
7024 
7045 MG_EXPORT HICON GUIAPI GetSmallSystemIconEx (HWND hWnd, int iItem);
7046 
7053 #define GetLargeSystemIcon(iItem) GetLargeSystemIconEx(HWND_NULL, iItem)
7054 
7061 #define GetSmallSystemIcon(iItem) GetSmallSystemIconEx(HWND_NULL, iItem)
7062 
7070 #define SB_HORZ 1
7071 #define SB_VERT 2
7072 
7091 MG_EXPORT BOOL GUIAPI EnableScrollBar (HWND hWnd, int iSBar, BOOL bEnable);
7092 
7114 MG_EXPORT BOOL GUIAPI GetScrollPos (HWND hWnd, int iSBar, int* pPos);
7115 
7140 MG_EXPORT BOOL GUIAPI GetScrollRange (HWND hWnd, int iSBar,
7141  int* pMinPos, int* pMaxPos);
7142 
7165 MG_EXPORT BOOL GUIAPI SetScrollPos (HWND hWnd, int iSBar, int iNewPos);
7166 
7191 MG_EXPORT BOOL GUIAPI SetScrollRange (HWND hWnd, int iSBar,
7192  int iMinPos, int iMaxPos);
7193 
7213 MG_EXPORT BOOL GUIAPI ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow);
7214 
7215 #define SIF_RANGE 0x0001
7216 #define SIF_PAGE 0x0002
7217 #define SIF_POS 0x0004
7218 #define SIF_DISABLENOSCROLL 0x0008
7219 #define SIF_TRACKPOS 0x0010
7220 #define SIF_ALL (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)
7221 
7223 #define SB_ARROW_LTUP 0x0001
7224 
7226 #define SB_ARROW_BTDN 0x0002
7227 
7229 #define SB_ARROW_BOTH (SB_ARROW_LTUP | SB_ARROW_BTDN)
7230 
7234 typedef struct _SCROLLINFO
7235 {
7237  UINT cbSize;
7250  UINT fMask;
7252  int nMin;
7254  int nMax;
7256  UINT nPage;
7258  int nPos;
7259 #if 0
7260  int nTrackPos;
7261 #endif
7263 
7287 MG_EXPORT BOOL GUIAPI SetScrollInfo (HWND hWnd, int iSBar,
7288  const SCROLLINFO* lpsi, BOOL fRedraw);
7289 
7312 MG_EXPORT BOOL GUIAPI GetScrollInfo (HWND hWnd, int iSBar, PSCROLLINFO lpsi);
7313 
7321 /* Class styles -- not supported so far */
7322 #define CS_VREDRAW 0x0001
7323 #define CS_HREDRAW 0x0002
7324 #define CS_KEYCVTWINDOW 0x0004
7325 #define CS_DBLCLKS 0x0008
7326 
7327 #define CS_OWNDC 0x0020
7328 #define CS_CLASSDC 0x0040
7329 #define CS_PARENTDC 0x0080
7330 
7331 #define CS_NOKEYCVT 0x0100
7332 #define CS_NOCLOSE 0x0200
7333 #define CS_SAVEBITS 0x0800
7334 
7335 #define CS_BYTEALIGNCLIENT 0x1000
7336 #define CS_BYTEALIGNWINDOW 0x2000
7337 #define CS_GLOBALCLASS 0x4000
7338 #define CS_IME 0x8000
7339 
7340 #define COP_STYLE 0x0001
7341 #define COP_HCURSOR 0x0002
7342 #define COP_BKCOLOR 0x0004
7343 #define COP_WINPROC 0x0008
7344 #define COP_ADDDATA 0x0010
7345 
7349 typedef struct _WNDCLASS
7350 {
7352  const char* spClassName;
7353 
7367 
7370 
7373 
7376 
7379 
7381  LRESULT (*WinProc) (HWND, UINT, WPARAM, LPARAM);
7382 
7385 } WNDCLASS;
7386 typedef WNDCLASS* PWNDCLASS;
7387 
7388 #define MAINWINCLASSNAME ("MAINWINDOW")
7389 #define ROOTWINCLASSNAME ("ROOTWINDOW")
7390 
7409 MG_EXPORT BOOL GUIAPI RegisterWindowClass (PWNDCLASS pWndClass);
7410 
7424 MG_EXPORT BOOL GUIAPI UnregisterWindowClass (const char* szClassName);
7425 
7439 MG_EXPORT const char* GUIAPI GetClassName (HWND hWnd);
7440 
7456 MG_EXPORT BOOL GUIAPI GetWindowClassInfo (PWNDCLASS pWndClass);
7457 
7472 MG_EXPORT BOOL GUIAPI SetWindowClassInfo (const WNDCLASS* pWndClass);
7473 
7518 MG_EXPORT HWND GUIAPI CreateWindowEx2 (const char* spClassName,
7519  const char* spCaption, DWORD dwStyle, DWORD dwExStyle,
7520  LINT id, int x, int y, int w, int h, HWND hParentWnd,
7521  const char* werdr_name, const WINDOW_ELEMENT_ATTR* we_attrs,
7522  DWORD dwAddData);
7523 
7536 static inline HWND GUIAPI CreateWindowEx (const char* spClassName,
7537  const char* spCaption, DWORD dwStyle, DWORD dwExStyle,
7538  LINT id, int x, int y, int w, int h, HWND hParentWnd,
7539  DWORD dwAddData)
7540 {
7541  return CreateWindowEx2 (spClassName, spCaption, dwStyle, dwExStyle,
7542  id, x, y, w, h, hParentWnd, NULL, NULL, dwAddData);
7543 }
7544 
7557 MG_EXPORT BOOL GUIAPI DestroyWindow (HWND hWnd);
7558 
7572 typedef void (* NOTIFPROC) (HWND hwnd, LINT id, int nc, DWORD add_data);
7573 
7600 MG_EXPORT NOTIFPROC GUIAPI SetNotificationCallback (HWND hwnd,
7601  NOTIFPROC notif_proc);
7602 
7616 MG_EXPORT NOTIFPROC GUIAPI GetNotificationCallback (HWND hwnd);
7617 
7624 #define CreateWindow(class_name, caption, style, \
7625  id, x, y, w, h, parent, add_data) \
7626  CreateWindowEx(class_name, caption, style, 0, \
7627  id, x, y, w, h, parent, add_data)
7628 
7631 /******************************** Timer Support ******************************/
7652 typedef BOOL (* TIMERPROC)(HWND, LINT, DWORD);
7653 
7690 MG_EXPORT BOOL GUIAPI SetTimerEx (HWND hWnd, LINT id, DWORD speed,
7691  TIMERPROC timer_proc);
7692 
7699 #define SetTimer(hwnd, id, speed) \
7700  SetTimerEx(hwnd, id, speed, NULL)
7701 
7719 MG_EXPORT int GUIAPI KillTimer (HWND hWnd, LINT id);
7720 
7743 MG_EXPORT BOOL GUIAPI ResetTimerEx (HWND hWnd, LINT id, DWORD speed,
7744  TIMERPROC timer_proc);
7745 
7752 #define ResetTimer(hwnd, id, speed) \
7753  ResetTimerEx(hwnd, id, speed, (TIMERPROC)INV_PTR)
7754 
7768 MG_EXPORT DWORD GUIAPI GetTickCount (void);
7769 
7787 MG_EXPORT BOOL GUIAPI IsTimerInstalled (HWND hWnd, LINT id);
7788 
7800 MG_EXPORT BOOL GUIAPI HaveFreeTimer (void);
7801 
7812 typedef struct _IME_TARGET_INFO
7813 {
7826 
7827  /* The position of the caret */
7828  POINT ptCaret;
7829 
7830  /* The rect of the edit box */
7831  RECT rcEditBox;
7832 } IME_TARGET_INFO;
7833 
7852 MG_EXPORT int GUIAPI RegisterIMEWindow (HWND hWnd);
7853 
7868 MG_EXPORT int GUIAPI UnregisterIMEWindow (HWND hWnd);
7869 
7913 MG_EXPORT int GUIAPI GetIMEStatus (int StatusCode);
7914 
7930 MG_EXPORT int GUIAPI SetIMEStatus (int StatusCode, int Value);
7931 
7945 MG_EXPORT int GUIAPI GetIMETargetInfo (IME_TARGET_INFO *info);
7946 
7962 MG_EXPORT int GUIAPI SetIMETargetInfo (const IME_TARGET_INFO *info);
7963 
7980 MG_EXPORT int GUIAPI GetIMEPos (POINT* pt);
7981 
7999 MG_EXPORT int GUIAPI SetIMEPos (const POINT* pt);
8000 
8019 MG_EXPORT HACCEL GUIAPI CopyAcceleratorTable (HACCEL hacc);
8020 
8034 MG_EXPORT int GUIAPI DeleteAccelerators (HACCEL hacc, int key, DWORD keymask);
8035 
8036 #define ACCEL_SHIFT KS_SHIFT
8037 #define ACCEL_ALT KS_ALT
8038 #define ACCEL_CTRL KS_CTRL
8039 
8068 MG_EXPORT int GUIAPI AddAccelerators (HACCEL hacc, int key,
8069  DWORD keymask, WPARAM wParam, LPARAM lParam);
8070 
8085 MG_EXPORT int GUIAPI DestroyAcceleratorTable (HACCEL hacc);
8086 
8098 MG_EXPORT HACCEL GUIAPI CreateAcceleratorTable (HWND hWnd);
8099 
8111 MG_EXPORT int GUIAPI TranslateAccelerator (HACCEL hAccel, PMSG pMsg);
8112 
8138 MG_EXPORT BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap,
8139  int nWidth, int nHeight);
8140 
8156 MG_EXPORT BOOL GUIAPI ChangeCaretSize (HWND hWnd, int newWidth, int newHeight);
8157 
8170 MG_EXPORT BOOL GUIAPI ActiveCaret (HWND hWnd);
8171 
8187 MG_EXPORT UINT GUIAPI GetCaretBlinkTime (HWND hWnd);
8188 
8205 MG_EXPORT BOOL GUIAPI SetCaretBlinkTime (HWND hWnd, UINT uTime);
8206 
8219 MG_EXPORT BOOL GUIAPI DestroyCaret (HWND hWnd);
8220 
8238 MG_EXPORT BOOL GUIAPI HideCaretEx (HWND hWnd, BOOL ime);
8239 
8254 static inline BOOL GUIAPI HideCaret (HWND hWnd)
8255 {
8256  return HideCaretEx (hWnd, TRUE);
8257 }
8258 
8276 MG_EXPORT BOOL GUIAPI ShowCaretEx (HWND hWnd, BOOL ime);
8277 
8292 static inline BOOL GUIAPI ShowCaret (HWND hWnd)
8293 {
8294  return ShowCaretEx (hWnd, TRUE);
8295 }
8296 
8313 MG_EXPORT BOOL GUIAPI SetCaretPos (HWND hWnd, int x, int y);
8314 
8329 MG_EXPORT BOOL GUIAPI GetCaretPos (HWND hWnd, PPOINT pPt);
8330 
8338 /* Menu flags */
8339 #define MF_INSERT 0x00000000L
8340 #define MF_CHANGE 0x00000080L
8341 #define MF_APPEND 0x00000100L
8342 #define MF_DELETE 0x00000200L
8343 #define MF_REMOVE 0x00001000L
8344 
8345 #define MF_BYCOMMAND 0x00000000L
8346 #define MF_BYPOSITION 0x00000400L
8347 
8348 #define MF_SEPARATOR 0x00000800L
8349 
8350 #define MF_ENABLED 0x00000000L
8351 #define MF_GRAYED 0x00000001L
8352 #define MF_DISABLED 0x00000002L
8353 
8354 #define MF_UNCHECKED 0x00000000L
8355 #define MF_CHECKED 0x00000008L
8356 #define MF_USECHECKBITMAPS 0x00000200L
8357 
8358 #define MF_STRING 0x00000000L
8359 #define MF_BITMAP 0x00000004L
8360 #define MF_OWNERDRAW 0x00000100L
8361 
8362 #define MF_POPUP 0x00000010L
8363 #define MF_MENUBARBREAK 0x00000020L
8364 #define MF_MENUBREAK 0x00000040L
8365 
8366 #define MF_UNHILITE 0x00000000L
8367 #define MF_HILITE 0x00000080L
8368 
8369 #define MF_DEFAULT 0x00001000L
8370 #define MF_SYSMENU 0x00002000L
8371 #define MF_HELP 0x00004000L
8372 #define MF_RIGHTJUSTIFY 0x00004000L
8373 
8374 #define MF_MOUSESELECT 0x00008000L
8375 #define MF_END 0x00000080L
8376 
8377 #define MFT_STRING MF_STRING /* 0x00000000L */
8378 #define MFT_BITMAP MF_BITMAP /* 0x00000004L */
8379 #define MFT_BMPSTRING 0x00010000L
8380 #define MFT_MENUBARBREAK MF_MENUBARBREAK /* 0x00000020L */
8381 #define MFT_MENUBREAK MF_MENUBREAK /* 0x00000040L */
8382 #define MFT_OWNERDRAW MF_OWNERDRAW /* 0x00000100L */
8383 #define MFT_RADIOCHECK 0x00000200L
8384 #define MFT_MARKCHECK 0x00000400L
8385 #define MFT_SEPARATOR MF_SEPARATOR /* 0x00000800L */
8386 
8387 #define MFT_RIGHTORDER 0x00002000L
8388 #define MFT_RIGHTJUSTIFY MF_RIGHTJUSTIFY
8389 
8390 #define MFS_GRAYED 0x00000003L
8391 #define MFS_DISABLED MFS_GRAYED
8392 #define MFS_CHECKED MF_CHECKED
8393 #define MFS_HILITE MF_HILITE
8394 #define MFS_ENABLED MF_ENABLED
8395 #define MFS_UNCHECKED MF_UNCHECKED
8396 #define MFS_UNHILITE MF_UNHILITE
8397 #define MFS_DEFAULT MF_DEFAULT
8398 
8399 /* System Menu Command Values */
8400  #define SC_SIZE 0xF000
8401  #define SC_MOVE 0xF010
8402  #define SC_MINIMIZE 0xF020
8403  #define SC_MAXIMIZE 0xF030
8404  #define SC_NEXTWINDOW 0xF040
8405  #define SC_PREVWINDOW 0xF050
8406  #define SC_CLOSE 0xF060
8407  #define SC_VSCROLL 0xF070
8408  #define SC_HSCROLL 0xF080
8409  #define SC_MOUSEMENU 0xF090
8410  #define SC_KEYMENU 0xF100
8411  #define SC_ARRANGE 0xF110
8412  #define SC_RESTORE 0xF120
8413  #define SC_TASKLIST 0xF130
8414  #define SC_SCREENSAVE 0xF140
8415  #define SC_HOTKEY 0xF150
8416 
8417  #define SC_DEFAULT 0xF160
8418  #define SC_MONITORPOWER 0xF170
8419  #define SC_CONTEXTHELP 0xF180
8420  #define SC_SEPARATOR 0xF00F
8421 
8422 /* MENUITEMINFO flags */
8423  #define MIIM_STATE 0x00000001
8424  #define MIIM_ID 0x00000002
8425  #define MIIM_SUBMENU 0x00000004
8426  #define MIIM_CHECKMARKS 0x00000008
8427  #define MIIM_TYPE 0x00000010
8428  #define MIIM_DATA 0x00000020
8429  #define MIIM_STRING 0x00000040
8430  #define MIIM_BITMAP 0x00000080
8431  #define MIIM_FTYPE 0x00000100
8432 
8433 
8434 /* Flags for TrackPopupMenu */
8435  #define TPM_LEFTBUTTON 0x0000L
8436  #define TPM_RIGHTBUTTON 0x0002L
8437  #define TPM_LEFTALIGN 0x0000L
8438  #define TPM_CENTERALIGN 0x0004L
8439  #define TPM_RIGHTALIGN 0x0008L
8440  #define TPM_TOPALIGN 0x0000L
8441  #define TPM_VCENTERALIGN 0x0010L
8442  #define TPM_BOTTOMALIGN 0x0020L
8443 
8444  #define TPM_HORIZONTAL 0x0000L /* Horz alignment matters more */
8445  #define TPM_VERTICAL 0x0040L /* Vert alignment matters more */
8446  #define TPM_NONOTIFY 0x0080L /* Don't send any notification msgs */
8447  #define TPM_RETURNCMD 0x0100L
8448 
8449  #define TPM_DESTROY 0x1000L /* Destroy menu after tracking */
8450  #define TPM_SYSCMD 0x2000L /* Send system command */
8451  #define TPM_DEFAULT 0x0000L /* Default tracking flag */
8452 
8453 /* return codes for MSG_MENUCHAR */
8454 #define MNC_IGNORE 0
8455 #define MNC_CLOSE 1
8456 #define MNC_EXECUTE 2
8457 #define MNC_SELECT 3
8458 
8462 typedef struct _MENUITEMINFO {
8463 
8480  UINT mask;
8481 
8508  UINT type;
8509 
8523  UINT state;
8524 
8528  LINT id;
8529 
8532 
8535 
8538 
8541 
8544 
8549  UINT cch;
8550 } MENUITEMINFO;
8551 typedef MENUITEMINFO* PMENUITEMINFO;
8552 
8564 MG_EXPORT HMENU GUIAPI CreateMenu (void);
8565 
8580 MG_EXPORT HMENU GUIAPI CreatePopupMenu ( PMENUITEMINFO pmii);
8581 
8596 MG_EXPORT HMENU GUIAPI CreateSystemMenu (HWND hwnd, DWORD dwStyle);
8597 
8626 MG_EXPORT int GUIAPI InsertMenuItem (HMENU hmnu, LINT item,
8627  UINT flag, PMENUITEMINFO pmii);
8628 
8655 MG_EXPORT int GUIAPI RemoveMenu (HMENU hmnu, LINT item, UINT flag);
8656 
8682 MG_EXPORT int GUIAPI DeleteMenu (HMENU hmnu, LINT item, UINT flag);
8683 
8700 MG_EXPORT int GUIAPI DestroyMenu (HMENU hmnu);
8701 
8716 MG_EXPORT int GUIAPI IsMenu (HMENU hmnu);
8717 
8732 MG_EXPORT HMENU GUIAPI SetMenu (HWND hwnd, HMENU hmnu);
8733 
8746 MG_EXPORT HMENU GUIAPI GetMenu (HWND hwnd);
8747 
8760 MG_EXPORT void GUIAPI DrawMenuBar (HWND hwnd);
8761 
8776 MG_EXPORT int GUIAPI TrackMenuBar (HWND hwnd, int pos);
8777 
8815 MG_EXPORT int GUIAPI TrackPopupMenu (HMENU hmnu, UINT uFlags,
8816  int x, int y, HWND hwnd);
8817 
8835 MG_EXPORT HMENU GUIAPI GetMenuBarItemRect (HWND hwnd, int pos, RECT* prc);
8836 
8837 #define LFRDR_MENU_STATE_HILITE 0x01
8838 #define LFRDR_MENU_STATE_NORMAL 0x02
8839 #define LFRDR_MENU_STATE_DISABLED 0x04
8840 
8862 MG_EXPORT BOOL GUIAPI HiliteMenuBarItem (HWND hwnd, int pos, UINT flag);
8863 
8876 MG_EXPORT int GUIAPI GetMenuItemCount (HMENU hmnu);
8877 
8895 MG_EXPORT LINT GUIAPI GetMenuItemID (HMENU hmnu, int pos);
8896 
8922 MG_EXPORT int GUIAPI GetMenuItemInfo (HMENU hmnu, LINT item,
8923  UINT flag, PMENUITEMINFO pmii);
8924 
8925 /*Reserved*/
8926 int GUIAPI GetMenuItemRect (HWND hwnd, HMENU hmnu,
8927  LINT item, PRECT prc);
8928 
8941 MG_EXPORT HMENU GUIAPI GetPopupSubMenu (HMENU hpppmnu);
8942 
8955 MG_EXPORT HMENU GUIAPI StripPopupHead (HMENU hpppmnu);
8956 
8974 MG_EXPORT HMENU GUIAPI GetSubMenu (HMENU hmnu, int pos);
8975 
8993 MG_EXPORT HMENU GUIAPI GetSystemMenu (HWND hwnd, BOOL flag);
8994 
9016 MG_EXPORT UINT GUIAPI EnableMenuItem (HMENU hmnu, LINT item, UINT flag);
9017 
9044 MG_EXPORT int GUIAPI CheckMenuRadioItem (HMENU hmnu, LINT first, LINT last,
9045  LINT checkitem, UINT flag);
9046 
9072 MG_EXPORT int GUIAPI SetMenuItemBitmaps (HMENU hmnu, LINT item, UINT flag,
9073  PBITMAP hBmpUnchecked, PBITMAP hBmpChecked);
9074 
9098 MG_EXPORT int GUIAPI SetMenuItemInfo (HMENU hmnu, LINT item,
9099  UINT flag, PMENUITEMINFO pmii);
9100 
9108 /* Dialog codes */
9113 #define DLGC_WANTARROWS 0x0001
9114 
9118 #define DLGC_WANTTAB 0x0002
9119 
9123 #define DLGC_WANTALLKEYS 0x0004
9124 
9128 #define DLGC_WANTCHARS 0x0008
9129 
9134 #define DLGC_WANTENTER 0x0010
9135 
9139 #define DLGC_HASSETSEL 0x0080
9140 
9145 #define DLGC_DEFPUSHBUTTON 0x0100
9146 
9150 #define DLGC_PUSHBUTTON 0x0200
9151 
9155 #define DLGC_RADIOBUTTON 0x0400
9156 
9160 #define DLGC_3STATE 0x0800
9161 
9165 #define DLGC_STATIC 0x1000
9166 
9170 #define DLGC_BUTTON 0x2000
9171 
9175 typedef struct _CTRLDATA
9176 {
9178  const char* class_name;
9182  int x, y, w, h;
9186  LINT id;
9188  const char* caption;
9193 
9195  const char* werdr_name;
9196 
9199 } CTRLDATA;
9200 typedef CTRLDATA* PCTRLDATA;
9201 
9209 typedef struct _DLGTEMPLATE
9210 {
9216  int x, y, w, h;
9218  const char* caption;
9226  PCTRLDATA controls;
9229 } DLGTEMPLATE;
9230 typedef DLGTEMPLATE* PDLGTEMPLATE;
9231 
9263 MG_EXPORT HWND GUIAPI CreateMainWindowIndirectParamEx (PDLGTEMPLATE pDlgTemplate,
9264  HWND hOwner, WNDPROC WndProc, LPARAM lParam,
9265  const char* werdr_name, WINDOW_ELEMENT_ATTR* we_attrs,
9266  const char* window_name, const char* layer_name);
9267 
9280 static inline HWND GUIAPI CreateMainWindowIndirectParam (
9281  PDLGTEMPLATE pDlgTemplate, HWND hOwner,
9282  WNDPROC WndProc, LPARAM lParam)
9283 {
9284  return CreateMainWindowIndirectParamEx (pDlgTemplate, hOwner,
9285  WndProc, lParam, NULL, NULL, NULL, NULL);
9286 }
9287 
9299 static inline HWND GUIAPI CreateMainWindowIndirect (
9300  PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC WndProc)
9301 {
9302  return CreateMainWindowIndirectParam (pDlgTemplate, hOwner, WndProc, 0);
9303 }
9304 
9316 MG_EXPORT BOOL GUIAPI DestroyMainWindowIndirect (HWND hMainWin);
9317 
9351 MG_EXPORT int GUIAPI DialogBoxIndirectParamEx (PDLGTEMPLATE pDlgTemplate,
9352  HWND hOwner, WNDPROC DlgProc, LPARAM lParam,
9353  const char* werdr_name, WINDOW_ELEMENT_ATTR* we_attrs,
9354  const char* window_name, const char* layer_name);
9355 
9367 static inline int GUIAPI DialogBoxIndirectParam (PDLGTEMPLATE pDlgTemplate,
9368  HWND hOwner, WNDPROC DlgProc, LPARAM lParam)
9369 {
9370  return DialogBoxIndirectParamEx (pDlgTemplate, hOwner, DlgProc, lParam,
9371  NULL, NULL, NULL, NULL);
9372 }
9373 
9391 MG_EXPORT BOOL GUIAPI EndDialog (HWND hDlg, int endCode);
9392 
9403 MG_EXPORT void GUIAPI DestroyAllControls (HWND hWnd);
9404 
9416 MG_EXPORT HWND GUIAPI GetDlgDefPushButton (HWND hWnd);
9417 
9432 MG_EXPORT LINT GUIAPI GetDlgCtrlID (HWND hwndCtl);
9433 
9448 MG_EXPORT HWND GUIAPI GetDlgItem (HWND hDlg, LINT nIDDlgItem);
9449 
9482 MG_EXPORT UINT GUIAPI GetDlgItemInt (HWND hDlg, LINT nIDDlgItem,
9483  BOOL *lpTranslated, BOOL bSigned);
9484 
9507 MG_EXPORT int GUIAPI GetDlgItemText (HWND hDlg, LINT nIDDlgItem,
9508  char* lpString, int nMaxCount);
9509 
9530 MG_EXPORT char* GUIAPI GetDlgItemText2 (HWND hDlg, LINT id, int* lenPtr);
9531 
9551 MG_EXPORT HWND GUIAPI GetNextDlgGroupItem (HWND hDlg,
9552  HWND hCtl, BOOL bPrevious);
9553 
9572 MG_EXPORT HWND GUIAPI GetNextDlgTabItem (HWND hDlg, HWND hCtl, BOOL bPrevious);
9573 
9595 MG_EXPORT LRESULT GUIAPI SendDlgItemMessage (HWND hDlg, LINT nIDDlgItem,
9596  UINT message, WPARAM wParam, LPARAM lParam);
9597 
9620 MG_EXPORT BOOL GUIAPI SetDlgItemInt (HWND hDlg, LINT nIDDlgItem,
9621  UINT uValue, BOOL bSigned);
9622 
9642 MG_EXPORT BOOL GUIAPI SetDlgItemText (HWND hDlg, LINT nIDDlgItem,
9643  const char* lpString);
9644 
9645 #ifdef _MGCTRL_BUTTON
9646 
9671 MG_EXPORT void GUIAPI CheckDlgButton (HWND hDlg, LINT nIDDlgItem, int nCheck);
9672 
9694 MG_EXPORT void GUIAPI CheckRadioButton (HWND hDlg,
9695  LINT idFirstButton, LINT idLastButton, LINT idCheckButton);
9696 
9724 MG_EXPORT int GUIAPI IsDlgButtonChecked (HWND hDlg, LINT idButton);
9725 #endif
9726 
9734 #if defined(_MGCTRL_STATIC) && defined (_MGCTRL_BUTTON)
9735 
9736 /* Standard control IDs */
9737 #define IDC_STATIC 0
9738 #define IDOK 1
9739 #define IDCANCEL 2
9740 #define IDABORT 3
9741 #define IDRETRY 4
9742 #define IDIGNORE 5
9743 #define IDYES 6
9744 #define IDNO 7
9745 
9746 #define MINID_RESERVED 0xF001
9747 #define MAXID_RESERVED 0xFFFF
9748 
9749 #define MB_OK 0x00000000
9750 #define MB_OKCANCEL 0x00000001
9751 #define MB_YESNO 0x00000002
9752 #define MB_RETRYCANCEL 0x00000003
9753 #define MB_ABORTRETRYIGNORE 0x00000004
9754 #define MB_YESNOCANCEL 0x00000005
9755 #define MB_CANCELASBACK 0x00000008 /* customized style */
9756 #define MB_TYPEMASK 0x00000007
9757 
9758 #define MB_ICONHAND 0x00000010
9759 #define MB_ICONQUESTION 0x00000020
9760 #define MB_ICONEXCLAMATION 0x00000030
9761 #define MB_ICONASTERISK 0x00000040
9762 #define MB_ICONMASK 0x000000F0
9763 
9764 #define MB_ICONINFORMATION MB_ICONASTERISK
9765 #define MB_ICONSTOP MB_ICONHAND
9766 
9767 #define MB_DEFBUTTON1 0x00000000
9768 #define MB_DEFBUTTON2 0x00000100
9769 #define MB_DEFBUTTON3 0x00000200
9770 #define MB_DEFMASK 0x00000F00
9771 
9772 /* #define MB_APPLMODAL 0x00000000 */
9773 /* #define MB_SYSTEMMODAL 0x00001000 */
9774 /* #define MB_TASKMODAL 0x00002000 */
9775 
9776 #define MB_NOFOCUS 0x00008000
9777 
9778 #define MB_ALIGNCENTER 0x00000000
9779 #define MB_ALIGNTOPLEFT 0x00010000
9780 #define MB_ALIGNBTMLEFT 0x00020000
9781 #define MB_ALIGNTOPRIGHT 0x00030000
9782 #define MB_ALIGNBTMRIGHT 0x00040000
9783 #define MB_ALIGNMASK 0x00070000
9784 
9785 #define MB_BASEDONPARENT 0x00080000 /* default is desktop. */
9786 
9889 MG_EXPORT int GUIAPI MessageBox (HWND hParentWnd, const char* pszText,
9890  const char* pszCaption, DWORD dwStyle);
9891 
9892 #endif /* _MGCTRL_STATIC && _MGCTRL_BUTTON */
9893 
9904 MG_EXPORT void GUIAPI MessageBeep (DWORD dwBeep);
9905 
9910 #ifdef __cplusplus
9911 }
9912 #endif /* __cplusplus */
9913 
9914 #endif /* _MGUI_WINDOW_H */
9915 
GHANDLE HACCEL
Handle to accelarator.
Definition: common.h:388
const char * caption
Definition: window.h:9218
HMENU hMenu
Definition: window.h:9222
MG_EXPORT int UnregisterResType(int type)
Unregister a user-defined resource type.
MG_EXPORT DWORD GUIAPI GetWindowElementAttr(HWND hwnd, int we_attr_id)
Get a window element data.
#define SendAsyncMessage
Is an alias of SendMessage for MiniGUI-Processes and MiniGUI-Standalone.
Definition: window.h:2496
MG_EXPORT int GUIAPI BroadcastMessage(UINT nMsg, WPARAM wParam, LPARAM lParam)
Broadcasts a message to all main window on the desktop.
MG_EXPORT LINT GUIAPI GetDlgCtrlID(HWND hwndCtl)
Gets the integer identifier of a control.
MG_EXPORT BOOL GUIAPI IsMainWindow(HWND hWnd)
Determines whether a window is a main window.
const char * spCaption
Definition: window.h:5000
MG_EXPORT HMENU GUIAPI GetMenuBarItemRect(HWND hwnd, int pos, RECT *prc)
Retrieves the rect of a menu bar item.
void * context
Definition: window.h:2917
MG_EXPORT int RegisterResType(int type, RES_TYPE_OPS *ops)
Register a new user-defined type into resource manager, so that the LoadResource can load the special...
HCURSOR hCursor
Definition: window.h:5006
MG_EXPORT void GUIAPI UnregisterRes(const char *file)
Unregister the BITMAP object from cache according to the specified resource file name.
#define PM_REMOVE
Definition: window.h:2269
MG_EXPORT HWND GUIAPI GetFocusChild(HWND hParent)
Retrieves the handle to the window&#39;s active child that has the keyboard focus.
MG_EXPORT void TermRendererSystemIcon(HICON *small_icon, HICON *large_icon)
Release large and small system icon resources.
DWORD typedata
Definition: window.h:8543
MG_EXPORT HMENU GUIAPI StripPopupHead(HMENU hpppmnu)
Strips the title of the popup menu.
WPARAM wParam
Definition: window.h:2232
MG_EXPORT BOOL GUIAPI GetScrollPos(HWND hWnd, int iSBar, int *pPos)
Retrieves the current position of the scroll box (thumb) in the specified scroll bar.
MG_EXPORT WINDOW_ELEMENT_RENDERER *GUIAPI GetDefaultWindowElementRenderer(void)
Get the default window renderer.
struct _DLGTEMPLATE DLGTEMPLATE
Definition: common.h:874
struct _LFRDR_TRACKBARINFO LFRDR_TRACKBARINFO
int BOOL
A type definition for boolean value.
Definition: common.h:294
MG_EXPORT void GUIAPI CheckRadioButton(HWND hDlg, LINT idFirstButton, LINT idLastButton, LINT idCheckButton)
Adds a check mark to (checks) a specified radio button in a group and removes a check mark from (clea...
MG_EXPORT int GUIAPI TranslateAccelerator(HACCEL hAccel, PMSG pMsg)
Translates an accelerator key message to MSG_COMMAND messge and sends it to the window procedure...
MG_EXPORT HICON GUIAPI SetWindowIcon(HWND hWnd, HICON hIcon, BOOL bRedraw)
Sets the current icon of a window.
static BOOL GUIAPI HideCaret(HWND hWnd)
Hides a caret.
Definition: window.h:8254
MG_EXPORT int GUIAPI GetUpdateRegion(HWND hWnd, PCLIPRGN pRgn)
Copy the update region of a window to a region.
int nPos
Definition: window.h:7258
gal_pixel iBkColor
Definition: window.h:5021
unsigned char BYTE
A type definition for an 8-bit unsigned character (byte).
Definition: common.h:411
MG_EXPORT LRESULT GUIAPI SendMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Sends a message to a window.
MG_EXPORT BOOL GUIAPI SetScrollPos(HWND hWnd, int iSBar, int iNewPos)
Sets the position of the scroll box (thumb) of the specified scroll bar.
MG_EXPORT gal_pixel GUIAPI GetWindowElementPixelEx(HWND hwnd, HDC hdc, int we_attr_id)
Get a window element gal_pixel color.
gal_pixel iFgColor
Definition: window.h:4140
MG_EXPORT DWORD GUIAPI SetWindowAdditionalData2(HWND hWnd, DWORD newData)
Sets the second additional data of a window.
MG_EXPORT int GUIAPI GetIMEStatus(int StatusCode)
Retrives status of the current IME window.
MG_EXPORT DWORD GUIAPI GetWindowAdditionalData(HWND hWnd)
Retrives the first additional data of a window.
MG_EXPORT UINT GUIAPI GetCaretBlinkTime(HWND hWnd)
Returns the elapsed time, in milliseconds, required to invert the caret&#39;s pixels. ...
PBITMAP uncheckedbmp
Definition: window.h:8534
MG_EXPORT int GUIAPI SetIMETargetInfo(const IME_TARGET_INFO *info)
Sets the target info of the current IME window.
MG_EXPORT HWND GUIAPI GetNextMainWindow(HWND hMainWnd)
Retrives the next main window in the system according to the zorder.
MG_EXPORT int GUIAPI KillTimer(HWND hWnd, LINT id)
Destroys a timer.
HICON hIcon
Definition: window.h:9220
LRESULT(* WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Type of the window callback procedure.
Definition: window.h:4964
MG_EXPORT HWND GUIAPI GetActiveWindow(void)
Retrieves the main window handle to the active main window.
int x
Definition: window.h:9182
DWORD dwAddData
Definition: window.h:9228
MG_EXPORT void GUIAPI MainWindowThreadCleanup(HWND hMainWnd)
Cleans up system resource associated with a main window.
MG_EXPORT LRESULT GUIAPI DefaultWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
The default window callback procedure.
DWORD dwAddData
Definition: window.h:9190
MG_EXPORT const char *GUIAPI GetClassName(HWND hWnd)
Retrieves the name of the class to which the specified window belongs.
struct _HOOKINFO HOOKINFO
MG_EXPORT int GUIAPI PostMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Posts a message into the message queue of a window and returns immediatly.
MG_EXPORT void GUIAPI WindowToClient(HWND hWnd, int *x, int *y)
Converts the window coordinates to client coordinates.
MG_EXPORT int GUIAPI SetMenuItemBitmaps(HMENU hmnu, LINT item, UINT flag, PBITMAP hBmpUnchecked, PBITMAP hBmpChecked)
Associates the specified bitmap with a menu item.
HMENU hsubmenu
Definition: window.h:8531
struct _SCROLLBARDATA SCROLLBARDATA
MG_EXPORT BOOL GUIAPI CreateCaret(HWND hWnd, PBITMAP pBitmap, int nWidth, int nHeight)
Creates a new shape for the system caret and assigns ownership of the caret to the specified window...
MG_EXPORT BOOL GUIAPI DestroyMainWindow(HWND hWnd)
Destroys a main window.
int nMax
Definition: window.h:7254
MG_EXPORT HMENU GUIAPI GetSubMenu(HMENU hmnu, int pos)
Retrieves the handle to the submenu activated by the specified menu item.
HMENU hMenu
Definition: window.h:5003
MG_EXPORT WINDOW_ELEMENT_RENDERER *GUIAPI GetWindowRendererFromName(const char *name)
Get window renderer from name.
DWORD(* on_set_rdr_attr)(struct _WINDOW_ELEMENT_RENDERER *, int we_attr_id, DWORD we_attr, BOOL change)
Definition: window.h:4085
MG_EXPORT HWND GUIAPI GetHosting(HWND hMainWnd)
Retrives the hosting main window of a main window.
MG_EXPORT BOOL InitRendererSystemIcon(const char *rdr_name, HICON *small_icon, HICON *large_icon)
Initialize large and small system icons in the specified renderer rdr_name.
MG_EXPORT int GUIAPI ClientHeightToWindowHeightEx(DWORD dwStyle, int win_type, int ch, BOOL hasMenu)
Calculates window height from the height of the client area.
MG_EXPORT int GUIAPI GetMenuItemInfo(HMENU hmnu, LINT item, UINT flag, PMENUITEMINFO pmii)
Retrieves information about a menu item.
MG_EXPORT HICON GUIAPI GetLargeSystemIconEx(HWND hWnd, int iItem)
Retrives a large system icon by its identifier in default renderer.
MG_EXPORT WNDPROC __mg_def_proc[3]
The default window callback procedure array.
MG_EXPORT HWND GUIAPI SetActiveWindow(HWND hMainWnd)
Sets a main window to be the active main window.
MG_EXPORT PLOGFONT GUIAPI SetWindowFont(HWND hWnd, PLOGFONT pLogFont)
Sets the default font of a window.
MG_EXPORT BOOL GUIAPI HiliteMenuBarItem(HWND hwnd, int pos, UINT flag)
Draws the specified menubar item with 3D effect.
static HWND GUIAPI CreateMainWindow(PMAINWINCREATE pCreateInfo)
A simplified version of CreateMainWindowEx.
Definition: window.h:5132
MG_EXPORT void * LoadResource(const char *res_name, int type, DWORD usr_param)
Load a resource from disk or memory.
HMENU hSysMenu
Definition: window.h:4152
MG_EXPORT int GUIAPI DeleteMenu(HMENU hmnu, LINT item, UINT flag)
Deletes an item from the specified menu.
MG_EXPORT void GUIAPI WindowToScreen(HWND hWnd, int *x, int *y)
Converts the window coordinates of a point to screen coordinates.
MG_EXPORT HWND GUIAPI CreateWindowEx2(const char *spClassName, const char *spCaption, DWORD dwStyle, DWORD dwExStyle, LINT id, int x, int y, int w, int h, HWND hParentWnd, const char *werdr_name, const WINDOW_ELEMENT_ATTR *we_attrs, DWORD dwAddData)
Creates a child window with extended style, renderer and attributes table.
const WINDOW_ELEMENT_ATTR * we_attrs
Definition: window.h:9198
MG_EXPORT void GUIAPI DestroyAllControls(HWND hWnd)
Destroys all controls in a window.
MG_EXPORT BOOL GUIAPI EnableWindow(HWND hWnd, BOOL fEnable)
Enables of disables a window.
MG_EXPORT BOOL GUIAPI SetWindowMaskEx(HWND hWnd, HDC hdc, const BITMAP *mask)
Set window (a main window, or a child window which is also known as "control")&#39;s Mask Rect with BITMA...
int nMin
Definition: window.h:7252
Definition: common.h:843
gal_pixel iBkColor
Definition: window.h:7378
MG_EXPORT BOOL GUIAPI PeekPostMessage(PMSG pMsg, HWND hWnd, UINT nMsgFilterMin, UINT nMsgFilterMax, UINT uRemoveMsg)
Peeks a post message from the message queue of a main window.
const char * spClassName
Definition: window.h:7352
MG_EXPORT HMENU GUIAPI CreateSystemMenu(HWND hwnd, DWORD dwStyle)
Creates a system menu.
static HWND GUIAPI CreateMainWindowIndirect(PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC WndProc)
A simplified version of CreateMainWindowIndirectParam.
Definition: window.h:9299
MG_EXPORT int GUIAPI ThrowAwayMessages(HWND pMainWnd)
Removes all messages in the message queue associated with a window.
#define WE_COLORS_NUMBER
The number of window element color attributes.
Definition: window.h:3373
MG_EXPORT HCURSOR GUIAPI GetWindowCursor(HWND hWnd)
Retrives the current cursor of a window.
Uint32 gal_pixel
Data type of pixel value.
Definition: common.h:1014
MG_EXPORT int GUIAPI RemoveMenu(HMENU hmnu, LINT item, UINT flag)
Deletes a menu item or detaches a submenu from the specified menu.
MG_EXPORT HWND GUIAPI SetNullFocus(HWND hParent)
Cancels the current active child and set the focus child to be null.
HICON hIcon
Definition: window.h:4150
MG_EXPORT HICON GUIAPI LoadSystemIconEx(HDC hdc, const char *rdr_name, const char *szItemName, int which)
Loads an icon from information defined in MiniGUI.cfg.
MG_EXPORT int GUIAPI GetDlgItemText(HWND hDlg, LINT nIDDlgItem, char *lpString, int nMaxCount)
Retrieves the title or text associated with a control in a dialog box.
PBITMAP checkedbmp
Definition: window.h:8537
MG_EXPORT HWND GUIAPI SetFocusChild(HWND hWnd)
Sets the active child of a window.
MG_EXPORT BOOL GUIAPI GetScrollInfo(HWND hWnd, int iSBar, PSCROLLINFO lpsi)
Retrieves the parameters of a scroll bar.
MG_EXPORT BOOL GUIAPI SetWindowText(HWND hWnd, const char *spString)
Sets the text of a window.
MG_EXPORT HWND GUIAPI GetWindowUnderCursor(void)
Retrives the handle to the window (if any) which is just beneath the mouse cursor.
void(* draw_hilite_menu_item)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:4095
struct _MSG MSG
struct _MAINWINCREATE MAINWINCREATE
DWORD dwReserved
Definition: window.h:5027
HACCEL hAccel
Definition: window.h:4146
HWND hHosting
Definition: window.h:5012
MG_EXPORT const char * GetResPath(void)
Get the currrent user&#39;s resource path.
MG_EXPORT int SetResPath(const char *path)
Set user&#39;s resource path into the search paths of resource manager.
MG_EXPORT int GUIAPI ScrollWindowEx(HWND hWnd, int dx, int dy, const RECT *prcScroll, const RECT *prcClip, PCLIPRGN pRgnUpdate, PRECT prcUpdate, UINT flags)
Scrolls the content of a window&#39;s client area.
MG_EXPORT MSGHOOK GUIAPI RegisterKeyMsgHook(void *context, MSGHOOK hook)
Registers a key message hook.
MG_EXPORT HCURSOR GUIAPI SetWindowCursor(HWND hWnd, HCURSOR hNewCursor)
Sets the current cursor of a window.
static BOOL GUIAPI ShowCaret(HWND hWnd)
Shows a caret.
Definition: window.h:8292
int(* SRVEVTHOOK)(PMSG pMsg)
The type of the event hook.
Definition: window.h:2975
MG_EXPORT BOOL GUIAPI GetClientRect(HWND hWnd, PRECT prc)
Retrives the client rectangle of a window.
MG_EXPORT DWORD GUIAPI GetWindowClassAdditionalData(HWND hWnd)
Retrives the additional data of a control class.
MG_EXPORT BOOL GUIAPI GetWindowClassInfo(PWNDCLASS pWndClass)
Retrieves the information of the specified window class.
UINT message
Definition: window.h:2230
UINT fMask
Definition: window.h:7250
MG_EXPORT BOOL GUIAPI TranslateKeyMsgToChar(int message, WPARAM wParam, LPARAM lParam, WORD *ch)
Translates a key down and key up message to a corresponding character.
const void * private_info
Definition: window.h:4118
DWORD dwStyle
Definition: window.h:9212
MG_EXPORT BOOL GUIAPI PeekMessageEx(PMSG pMsg, HWND hWnd, UINT nMsgFilterMin, UINT nMsgFilterMax, BOOL bWait, UINT uRemoveMsg)
Peeks a message from the message queue of a main window.
DWORD dwExStyle
Definition: window.h:4997
MG_EXPORT HWND GUIAPI GetFirstHosted(HWND hHosting)
Retrives the first hosted main window of a main window.
MG_EXPORT void GUIAPI ClientToWindow(HWND hWnd, int *x, int *y)
Converts the client coordinates to the window coordinates.
LFSCROLLBARINFO vscroll
Definition: window.h:4164
MG_EXPORT BOOL GUIAPI SetScrollInfo(HWND hWnd, int iSBar, const SCROLLINFO *lpsi, BOOL fRedraw)
Sets the parameters of a scroll bar.
MG_EXPORT int GUIAPI GetWindowText(HWND hWnd, char *spString, int nMaxLen)
Copies the text of a window&#39;s into a buffer.
MG_EXPORT MSGHOOK GUIAPI RegisterMouseMsgHook(void *context, MSGHOOK hook)
Registers a mouse message hook.
GHANDLE HDC
Handle to device context.
Definition: common.h:363
MG_EXPORT void GUIAPI ScreenToWindow(HWND hWnd, int *x, int *y)
Converts the screen coordinates of a point to window coordinates.
MG_EXPORT WNDPROC GUIAPI SetWindowCallbackProc(HWND hWnd, WNDPROC newProc)
Sets the callback procedure of a window.
void(* NOTIFPROC)(HWND hwnd, LINT id, int nc, DWORD add_data)
Type of the notification callback procedure.
Definition: window.h:7572
MG_EXPORT void GUIAPI UnregisterSystemBitmap(HDC hdc, const char *rdr_name, const char *id)
Unregister a BITMAP object from BITMAP cache.
MG_EXPORT int GUIAPI InsertMenuItem(HMENU hmnu, LINT item, UINT flag, PMENUITEMINFO pmii)
Inserts a new menu item at the specified position in a menu.
DWORD itemdata
Definition: window.h:8540
MG_EXPORT BOOL GUIAPI SetKeyboardLayout(const char *kbd_layout)
Sets a new keyboard layout.
int left
Definition: window.h:4127
MG_EXPORT BOOL GUIAPI SetWindowElementRenderer(HWND hWnd, const char *werdr_name, const WINDOW_ELEMENT_ATTR *we_attrs)
Set a window element renderer and window element attributes for window specified by hwnd...
MG_EXPORT BOOL GUIAPI IsWindowVisible(HWND hWnd)
Retrieves the visibility state of the specified window.
MG_EXPORT BOOL GUIAPI DestroyWindow(HWND hWnd)
Destroys a specified control.
MG_EXPORT UINT GUIAPI GetDlgItemInt(HWND hDlg, LINT nIDDlgItem, BOOL *lpTranslated, BOOL bSigned)
Translates the text of a control in a dialog box into an integer value.
BOOL(* TIMERPROC)(HWND, LINT, DWORD)
Type of the timer callback procedure.
Definition: window.h:7652
MG_EXPORT BOOL GUIAPI UnregisterWindowClass(const char *szClassName)
Undoes the effect of RegisterWindowClass.
MG_EXPORT BOOL GUIAPI SetScrollRange(HWND hWnd, int iSBar, int iMinPos, int iMaxPos)
Sets the minimum and maximum position values for the specified scroll bar.
char * spCaption
Definition: window.h:4157
int controlnr
Definition: window.h:9224
MG_EXPORT BOOL GUIAPI ExcludeWindowExStyle(HWND hWnd, DWORD dwStyle)
Removes the specific extended style of a window.
DWORD dwExStyle
Definition: window.h:9192
#define TRUE
TRUE value, defined as 1 by MiniGUI.
Definition: common.h:309
MG_EXPORT void GUIAPI UpdateWindow(HWND hWnd, BOOL bErase)
Updates a window.
HMENU hMenu
Definition: window.h:4144
MG_EXPORT BOOL GUIAPI EmptyMessageQueue(HWND hWnd)
Empties a message queue.
MG_EXPORT DWORD GUIAPI GetTickCount(void)
Retrieves the tick counts that have elapsed since MiniGUI was started.
MG_EXPORT void * GetResource(RES_KEY key)
Retrive and return a buffered resource by the key.
DWORD we_colors[WE_COLORS_NUMBER][3]
Definition: window.h:4106
MG_EXPORT BOOL GUIAPI SetCaretPos(HWND hWnd, int x, int y)
Moves the caret to a new position.
MG_EXPORT int ReleaseRes(RES_KEY key)
Release the buffered resource. It will decrease the reference count of the resource. If the reference count is less then 0, the resource will be released.
DWORD dwExStyle
Definition: window.h:4137
MG_EXPORT int GUIAPI DestroyMenu(HMENU hmnu)
Destroys the specified menu and frees any memory that the menu occupies.
MG_EXPORT HICON GUIAPI LoadSystemIcon(const char *szItemName, int which)
Uses default renderer and HDC_SCREEN to load an icon from information defined in MiniGUI.cfg.
static const WINDOWINFO *GUIAPI GetWindowInfo(HWND hWnd)
Get the handle of window information.
Definition: window.h:4183
GHANDLE HWND
Handle to main window or control.
Definition: common.h:358
MG_EXPORT void GUIAPI TermSystemBitmap(HWND hWnd, const char *id, PBITMAP bmp)
Release the system bitmap object by identifier.
MG_EXPORT DWORD GUIAPI SetWindowAdditionalData(HWND hWnd, DWORD newData)
Sets the first additional data of a window.
MG_EXPORT BOOL GUIAPI SetWindowCaption(HWND hWnd, const char *spCaption)
Sets the caption of a window.
MG_EXPORT BOOL GUIAPI AdjustWindowRectEx(RECT *pRect, DWORD dwStyle, BOOL bMenu, DWORD dwExStyle)
Calculates the required size of the window rectangle based on the desired size of the client rectangl...
MG_EXPORT BOOL GUIAPI ValidateRegion(HWND hWnd, const CLIPRGN *pRgn)
Validates the client area within a region by removing the region from the current update region of th...
MG_EXPORT int GUIAPI DestroyAcceleratorTable(HACCEL hacc)
Destroys an accelerator table.
DWORD dwStyle
Definition: window.h:4994
MG_EXPORT const char *GUIAPI SetDefaultWindowElementRenderer(const char *name)
Set a window element renderer as the default system renderer.
MG_EXPORT DWORD GUIAPI GetWindowStyle(HWND hWnd)
Retrives the style of a window.
MG_EXPORT BOOL GUIAPI HavePendingMessage(HWND hMainWnd)
Checks if there is any pending message in the message queue of a main window.
MG_EXPORT BOOL GUIAPI GetWindowRect(HWND hWnd, PRECT prc)
Retrives the dimensions of the bounding rectangle of a window.
MG_EXPORT HWND GUIAPI WindowFromPointEx(POINT pt, BOOL bRecursion)
Retrieves a handle to the window that contains the specified point.
DWORD dwExStyle
Definition: window.h:7372
MG_EXPORT int GUIAPI GetIMEPos(POINT *pt)
Retrives the position of the current IME window.
PLOGFONT we_fonts[WE_FONTS_NUMBER]
Definition: window.h:4109
MG_EXPORT int GUIAPI MessageBox(HWND hParentWnd, const char *pszText, const char *pszCaption, DWORD dwStyle)
Displays a message box within one, two, or three push buttons.
const char * class_name
Definition: window.h:9178
MG_EXPORT BOOL GUIAPI RegisterSystemBitmap(HDC hdc, const char *rdr_name, const char *id)
Register a device-dependent bitmap from id to BITMAP cache.
MG_EXPORT int GUIAPI TrackMenuBar(HWND hwnd, int pos)
Displays the specified submenu.
MG_EXPORT const BITMAP *GUIAPI RetrieveRes(const char *file)
Get a BITMAP object from cache according to the specified resource file name.
int(* MSGHOOK)(void *context, HWND dst_wnd, UINT msg, WPARAM wparam, LPARAM lparam)
Type of message hook function.
Definition: window.h:2908
MG_EXPORT HMENU GUIAPI GetSystemMenu(HWND hwnd, BOOL flag)
Allows the application to access the window menu (also known as the system menu) for copying and modi...
struct _WINDOWINFO WINDOWINFO
MG_EXPORT HWND GUIAPI GetDlgItem(HWND hDlg, LINT nIDDlgItem)
Retrives the handle to a control in a dialog box.
MG_EXPORT BOOL GUIAPI InitWindowElementAttrs(PWERENDERER rdr)
static HWND GUIAPI ChildWindowFromPoint(HWND hParent, POINT pt)
Retrives a handle to the child window that contains the speicified point.
Definition: window.h:6686
static HWND GUIAPI CreateMainWindowIndirectParam(PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC WndProc, LPARAM lParam)
A simplified version of CreateMainWindowIndirectParamEx.
Definition: window.h:9280
MG_EXPORT BOOL GUIAPI SetTimerEx(HWND hWnd, LINT id, DWORD speed, TIMERPROC timer_proc)
Creates a timer with the specified timeout value.
LONG_PTR LINT
Signed integer which has pointer precision.
Definition: common.h:528
struct _LFSCROLLBARINFO LFSCROLLBARINFO
PLOGFONT pLogFont
Definition: window.h:4154
MG_EXPORT DWORD GUIAPI GetWindowExStyle(HWND hWnd)
Retrives the extended style of a window.
MG_EXPORT int GUIAPI DialogBoxIndirectParamEx(PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC DlgProc, LPARAM lParam, const char *werdr_name, WINDOW_ELEMENT_ATTR *we_attrs, const char *window_name, const char *layer_name)
Creates a modal dialog box from a dialog box template in memory and other information.
#define LEN_RENDERER_NAME
The maximum length of a renderer name.
Definition: window.h:3692
MG_EXPORT BOOL GUIAPI IncludeWindowStyle(HWND hWnd, DWORD dwStyle)
Includes the specific style of a window.
HWND hwnd
Definition: window.h:2228
MSGHOOK hook
Definition: window.h:2919
MG_EXPORT LRESULT GUIAPI SendDlgItemMessage(HWND hDlg, LINT nIDDlgItem, UINT message, WPARAM wParam, LPARAM lParam)
Sends a message to the specified control in a dialog box.
void(* erase_background)(HWND hWnd, HDC hdc, const RECT *rect)
Definition: window.h:4088
MG_EXPORT BOOL GUIAPI ExcludeWindowStyle(HWND hWnd, DWORD dwStyle)
Removes the specific style of a window.
static HWND GUIAPI CreateWindowEx(const char *spClassName, const char *spCaption, DWORD dwStyle, DWORD dwExStyle, LINT id, int x, int y, int w, int h, HWND hParentWnd, DWORD dwAddData)
A shortcut version of CreateWindowEx2.
Definition: window.h:7536
MG_EXPORT HWND GUIAPI GetNextDlgTabItem(HWND hDlg, HWND hCtl, BOOL bPrevious)
Retrieves the handle to the first control that has the WS_TABSTOP style that precedes (or follows) th...
GHANDLE HCURSOR
Handle to cursor.
Definition: common.h:373
MG_EXPORT BOOL GUIAPI IsWindowEnabled(HWND hWnd)
Determines whether the specified window is enabled for mouse and keyboard input.
MG_EXPORT BOOL GUIAPI IncludeWindowExStyle(HWND hWnd, DWORD dwStyle)
Includes the specific extended style of a window.
DWORD dwStyle
Definition: window.h:7369
DWORD dwStyle
Definition: window.h:4135
MG_EXPORT DWORD GUIAPI GetWindowAdditionalData2(HWND hWnd)
Retrives the second additional data of a window.
BOOL GUIAPI GetWindowRegion(HWND hWnd, CLIPRGN *region)
The function obtains a copy of the window region of a window.
MG_EXPORT BOOL GUIAPI SetWindowClassInfo(const WNDCLASS *pWndClass)
Sets the information of the specified window class.
#define NULL
A value indicates null pointer.
Definition: common.h:320
int we_metrics[WE_METRICS_NUMBER]
Definition: window.h:4103
MG_EXPORT HWND GUIAPI CreateMainWindowEx(PMAINWINCREATE pCreateInfo, const char *werdr_name, const WINDOW_ELEMENT_ATTR *we_attrs, const char *window_name, const char *layer_name)
Creates a main window.
static void GUIAPI ScrollWindow(HWND hWnd, int dx, int dy, const RECT *prcScroll, const RECT *prcClip)
Scrolls the content of a window&#39;s client area.
Definition: window.h:6814
BOOL GUIAPI SetWindowRegion(HWND hWnd, const CLIPRGN *region)
Set window&#39;s Mask Rect with CLIPRGN data.
MG_EXPORT const char *GUIAPI GetWindowCaption(HWND hWnd)
Retrives the caption of a window.
MG_EXPORT BOOL GUIAPI IsTimerInstalled(HWND hWnd, LINT id)
Determines whether a timer is installed.
Definition: gdi.h:591
unsigned char Uint8
A type definition for an 8-bit unsigned character.
Definition: common.h:142
MG_EXPORT int GUIAPI AddAccelerators(HACCEL hacc, int key, DWORD keymask, WPARAM wParam, LPARAM lParam)
Adds an accelerator to the accelerator table.
UINT_PTR LPARAM
A type definition for the second message paramter.
Definition: common.h:642
MG_EXPORT BOOL GUIAPI RegisterWindowClass(PWNDCLASS pWndClass)
Registers a window class.
MG_EXPORT void GUIAPI SetAutoRepeatMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Sets the auto-repeat message.
MG_EXPORT gal_pixel GUIAPI GetWindowBkColor(HWND hWnd)
Returns the current background color of a window.
MG_EXPORT BOOL GUIAPI WaitMessage(PMSG pMsg, HWND hMainWnd)
Waits for a message from the message queue of a main window.
MG_EXPORT HMENU GUIAPI GetMenu(HWND hwnd)
Retrieves the handle to the menu assigned to the given main window.
MG_EXPORT int AddInnerRes(INNER_RES *inner_res, int count, BOOL copy)
Add some incore resource into the resource manager in order to call LoadResource to get those resourc...
UINT cbSize
Definition: window.h:7237
MG_EXPORT BOOL GUIAPI SetCaretBlinkTime(HWND hWnd, UINT uTime)
Sets the caret blink time to the specified number of milliseconds.
MG_EXPORT void GUIAPI ClientToScreen(HWND hWnd, int *x, int *y)
Converts the client coordinates of a point to screen coordinates.
static BOOL GUIAPI PeekMessage(PMSG pMsg, HWND hWnd, UINT nMsgFilterMin, UINT nMsgFilterMax, UINT uRemoveMsg)
Peeks a message from the message queue of a main window.
Definition: window.h:2392
HCURSOR hCursor
Definition: window.h:7375
MG_EXPORT BOOL GUIAPI TranslateMessage(PMSG pMsg)
Translates key down and key up messages to MSG_CHAR message and post it into the message queue...
MG_EXPORT int GUIAPI UnregisterIMEWindow(HWND hWnd)
Unregisters an IME window.
Definition: window.h:2225
struct _MENUITEMINFO MENUITEMINFO
LFSCROLLBARINFO hscroll
Definition: window.h:4166
MG_EXPORT HWND GUIAPI GetParent(HWND hWnd)
Retrieves the handle to a child window&#39;s parent window.
MG_EXPORT BOOL GUIAPI IsWindow(HWND hWnd)
Determines whether a window handle identifies an existing window.
MG_EXPORT HMENU GUIAPI SetMenu(HWND hwnd, HMENU hmnu)
Assigns a new menu to the specified main window.
MG_EXPORT const BITMAP *GUIAPI GetSystemBitmapByHwnd(HWND hWnd, const char *id)
Retrives the system bitmap object by identifier.
MG_EXPORT void GUIAPI MessageBeep(DWORD dwBeep)
Makes a sound of beep.
MG_EXPORT BOOL GUIAPI RemoveWindowElementRenderer(const char *name)
Remove a window renderer from MiniGUI.
DWORD opMask
Definition: window.h:7366
MG_EXPORT const BITMAP *GUIAPI GetSystemBitmap(HWND hWnd, const char *id)
Retrives the system bitmap object by identifier.
MG_EXPORT NOTIFPROC GUIAPI GetNotificationCallback(HWND hwnd)
Gets the notification callback procedure of a control.
MG_EXPORT DWORD GUIAPI SetWindowClassAdditionalData(HWND hWnd, DWORD newData)
Sets the additional data of a control class.
MG_EXPORT BOOL GUIAPI ValidateRect(HWND hWnd, const RECT *rect)
Validates the client area within a rectangle by removing the rectangle from the update region of the ...
MG_EXPORT HACCEL GUIAPI CopyAcceleratorTable(HACCEL hacc)
Copies the specified accelerator table.
MG_EXPORT BOOL GUIAPI GetCaretPos(HWND hWnd, PPOINT pPt)
Gets the caret position.
MG_EXPORT char *GUIAPI GetDlgItemText2(HWND hDlg, LINT id, int *lenPtr)
Retrieves the title or text associated with a control in a dialog box.
HICON we_icon[2][SYSICO_ITEM_NUMBER]
Definition: window.h:4112
WORD_HPTR WORD
A type definition for an unsigned integer (word).
Definition: common.h:492
struct _LFRDR_WINSTYLEINFO LFRDR_WINSTYLEINFO
MG_EXPORT BOOL GUIAPI HaveFreeTimer(void)
Determines whether there is any free timer slot in the system.
static BOOL GUIAPI GetMessage(PMSG pMsg, HWND hWnd)
Gets a message from the message queue of a main window.
Definition: window.h:2327
MG_EXPORT BOOL GUIAPI DestroyMainWindowIndirect(HWND hMainWin)
Destroys a main window created by CreateMainWindowIndirectParam.
DWORD dwExStyle
Definition: window.h:9214
MG_EXPORT BOOL GUIAPI InvalidateRect(HWND hWnd, const RECT *prc, BOOL bEraseBkgnd)
Makes a rectangle region in the client area of a window invalid.
const char * werdr_name
Definition: window.h:9195
MG_EXPORT BOOL GUIAPI IsControl(HWND hWnd)
Determines whether a window is a control.
UINT_PTR WPARAM
A type definition for the first message paramter.
Definition: common.h:636
MG_EXPORT HICON GUIAPI GetWindowIcon(HWND hWnd)
Retrives the current icon of a window.
MG_EXPORT int GUIAPI GetWindowTextLength(HWND hWnd)
Retrieves the length of a window&#39;s text.
DWORD_PTR DWORD
A unsigned long type definition for pointer precision.
Definition: common.h:555
static int GUIAPI DialogBoxIndirectParam(PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC DlgProc, LPARAM lParam)
A simplified version of DialogBoxIndirectParamEx.
Definition: window.h:9367
MG_EXPORT HMENU GUIAPI CreatePopupMenu(PMENUITEMINFO pmii)
Creates a drop-down menu or submenu.
MG_EXPORT int GUIAPI SendNotifyMessage(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
Sends a notification message to a window.
LONG_PTR LRESULT
Signed result of message processing.
Definition: common.h:534
DWORD dwAddData
Definition: window.h:7384
DWORD dwAddData
Definition: window.h:5024
MG_EXPORT void GUIAPI ScreenToClient(HWND hWnd, int *x, int *y)
Converts the screen coordinates of a point to client coordinates.
Definition: gdi.h:7382
struct _SCROLLINFO SCROLLINFO
MG_EXPORT PLOGFONT GUIAPI GetWindowFont(HWND hWnd)
Retrives the default font of a window.
MG_EXPORT HWND GUIAPI GetNextChild(HWND hWnd, HWND hChild)
Retrives the next control in a window.
MG_EXPORT BOOL GUIAPI GetScrollRange(HWND hWnd, int iSBar, int *pMinPos, int *pMaxPos)
Retrives the minimum and maximum position values for the specified scroll bar.
MG_EXPORT HWND GUIAPI GetNextDlgGroupItem(HWND hDlg, HWND hCtl, BOOL bPrevious)
Retrieves the handle to the first control in a group of controls that precedes (or follows) the speci...
#define WE_METRICS_NUMBER
The number of window element metric attributes.
Definition: window.h:3367
LINT id
Definition: window.h:4161
MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook(SRVEVTHOOK SrvEvtHook)
Sets an event hook in the server of MiniGUI-Processes.
MG_EXPORT int GUIAPI IsMenu(HMENU hmnu)
Determines whether a handle is a menu handle.
MG_EXPORT int GUIAPI CheckMenuRadioItem(HMENU hmnu, LINT first, LINT last, LINT checkitem, UINT flag)
Checks a specified menu item and makes it a radio item.
LPARAM lParam
Definition: window.h:2234
MG_EXPORT HWND GUIAPI CreateMainWindowIndirectParamEx(PDLGTEMPLATE pDlgTemplate, HWND hOwner, WNDPROC WndProc, LPARAM lParam, const char *werdr_name, WINDOW_ELEMENT_ATTR *we_attrs, const char *window_name, const char *layer_name)
Uses a dialog template and other information to create a modeless main window and controls in it...
MG_EXPORT void GUIAPI CheckDlgButton(HWND hDlg, LINT nIDDlgItem, int nCheck)
Changes the check status of a button control.
MG_EXPORT LRESULT GUIAPI DispatchMessage(PMSG pMsg)
Dispatches a message to the window&#39;s callback procedure.
unsigned int refcount
Definition: window.h:4115
MG_EXPORT int GUIAPI GetIMETargetInfo(IME_TARGET_INFO *info)
Retrives the target info of the current IME window.
struct _WINDOW_ELEMENT_ATTR WINDOW_ELEMENT_ATTR
MG_EXPORT BOOL GUIAPI ResetTimerEx(HWND hWnd, LINT id, DWORD speed, TIMERPROC timer_proc)
Adjusts a timer with a different timeout value or different timer callback procedure.
MG_EXPORT HWND GUIAPI GetMainWindowHandle(HWND hWnd)
Retrives the handle to the main window contains a window.
MG_EXPORT BOOL GUIAPI ShowCaretEx(HWND hWnd, BOOL ime)
Shows a caret.
MG_EXPORT BOOL GUIAPI EnableScrollBar(HWND hWnd, int iSBar, BOOL bEnable)
Enables or disables one scroll bar arrows.
MG_EXPORT void GUIAPI TermSystemBitmapEx(const char *id, const char *rdr_name, PBITMAP bmp)
Release the system bitmap object by identifier.
MG_EXPORT RES_KEY Str2Key(const char *str)
Translate a string to an unsigned long (RES_KEY), which is used to find a resource in the resource ma...
struct _CTRLDATA CTRLDATA
DWORD time
Definition: window.h:2236
MG_EXPORT HWND GUIAPI GetNextHosted(HWND hHosting, HWND hHosted)
Retrives the next hosted main window of a main window.
MG_EXPORT gal_pixel GUIAPI SetWindowBkColor(HWND hWnd, gal_pixel new_bkcolor)
Sets the background color of a window.
MG_EXPORT HDC GUIAPI BeginPaint(HWND hWnd)
Prepares a window for painting.
MG_EXPORT int GUIAPI RegisterIMEWindow(HWND hWnd)
Registers an IME window.
DWORD dwStyle
Definition: window.h:9180
#define FALSE
FALSE value, defined as 0 by MiniGUI.
Definition: common.h:302
MG_EXPORT int GUIAPI PostQuitMessage(HWND hWnd)
Puts a MSG_QUIT message into the message queue of a main window.
Definition: gdi.h:5697
gal_pixel iBkColor
Definition: window.h:4142
void(* draw_normal_menu_item)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:4091
const char * caption
Definition: window.h:9188
MG_EXPORT BOOL GUIAPI EndDialog(HWND hDlg, int endCode)
Destroys a modal dialog box, causing MiniGUI to end any processing for the dialog box...
HCURSOR hCursor
Definition: window.h:4148
MG_EXPORT BOOL GUIAPI RegisterResFromMem(HDC hdc, const char *file, const unsigned char *data, size_t data_size)
Register a device-dependent bitmap to bitmap cache from memory.
unsigned int UINT
A type definition for unsigned integer.
Definition: common.h:594
struct _IME_TARGET_INFO IME_TARGET_INFO
MG_EXPORT BOOL GUIAPI ShowWindow(HWND hWnd, int iCmdShow)
Shows or hides a window.
MG_EXPORT BOOL GUIAPI MoveWindow(HWND hWnd, int x, int y, int w, int h, BOOL fPaint)
Changes the position and dimensions of a window.
MG_EXPORT int GUIAPI SetIMEStatus(int StatusCode, int Value)
Sets the status of the current IME window.
struct _WINDOW_ELEMENT_RENDERER WINDOW_ELEMENT_RENDERER
MG_EXPORT void GUIAPI EndPaint(HWND hWnd, HDC hdc)
Marks the end of painting in a window.
MG_EXPORT BOOL GUIAPI ShowScrollBar(HWND hWnd, int iSBar, BOOL bShow)
Shows or hides the specified scroll bar.
MG_EXPORT UINT GUIAPI EnableMenuItem(HMENU hmnu, LINT item, UINT flag)
Enables, disables, or grays the specified menu item.
MG_EXPORT HWND GUIAPI ChildWindowFromPointEx(HWND hParent, POINT pt, UINT uFlags)
Retrives a handle to the child window that contains the speicified point and meets the certain criter...
void(* draw_disabled_menu_item)(HWND hWnd, HDC hdc, const RECT *pRect, DWORD color)
Definition: window.h:4099
MG_EXPORT int GUIAPI TrackPopupMenu(HMENU hmnu, UINT uFlags, int x, int y, HWND hwnd)
Displays and tracks a popup menu.
GHANDLE HMENU
Handle to menu.
Definition: common.h:383
MG_EXPORT BOOL GUIAPI ActiveCaret(HWND hWnd)
Activates the caret owned by a window.
MG_EXPORT BOOL GUIAPI ChangeCaretSize(HWND hWnd, int newWidth, int newHeight)
Changes the size of the caret.
MG_EXPORT BOOL GUIAPI AddWindowElementRenderer(const char *name, const WINDOW_ELEMENT_RENDERER *we_rdr)
Add a window element renderer to the system.
MG_EXPORT BOOL GUIAPI RegisterResFromBitmap(const char *file, const BITMAP *bmp)
Register a device-dependent bitmap to bitmap cache.
MG_EXPORT int AddResRef(RES_KEY key)
Increase the reference count of a buffered resource.
MG_EXPORT DWORD GUIAPI SetWindowElementAttr(HWND hwnd, int we_attr_id, DWORD we_attr)
Set a new window element data specified by we_attr_id.
HICON hIcon
Definition: window.h:5009
MG_EXPORT HWND GUIAPI GetDlgDefPushButton(HWND hWnd)
Gets the default push button control in a window.
MG_EXPORT BOOL GUIAPI InvalidateRegion(HWND hWnd, const CLIPRGN *pRgn, BOOL bErase)
Invalidates the client area within the specified region.
MG_EXPORT BOOL GUIAPI RegisterResFromFile(HDC hdc, const char *file)
Register a device-dependent bitmap from a file.
MG_EXPORT int GUIAPI SetMenuItemInfo(HMENU hmnu, LINT item, UINT flag, PMENUITEMINFO pmii)
Changes information about a menu item.
#define WE_FONTS_NUMBER
The number of window element font attributes.
Definition: window.h:3361
MG_EXPORT const BITMAP *GUIAPI GetSystemBitmapEx(const char *rdr_name, const char *id)
Retrives the system bitmap object by identifier.
MG_EXPORT int GUIAPI GetMenuItemCount(HMENU hmnu)
Determines the number of items in a menu.
MG_EXPORT HWND GUIAPI GetCapture(void)
Retrives the handle to the window (if any) that has captured the mouse.
MG_EXPORT HWND GUIAPI SetCapture(HWND hWnd)
Sets the mouse capture to the specified window.
MG_EXPORT void GUIAPI DrawMenuBar(HWND hwnd)
Redraws the menu bar of the specified main window.
PCTRLDATA controls
Definition: window.h:9226
MG_EXPORT WNDPROC GUIAPI GetWindowCallbackProc(HWND hWnd)
Retrives the callback procedure of a window.
WINDOW_ELEMENT_RENDERER * we_rdr
Definition: window.h:4169
MG_EXPORT BOOL GUIAPI GetUpdateRect(HWND hWnd, RECT *update_rect)
Retrives the bounding box of the update region of a window.
MG_EXPORT HICON GUIAPI GetSmallSystemIconEx(HWND hWnd, int iItem)
Retrives a small system icon by its identifier.
MG_EXPORT int GUIAPI IsDlgButtonChecked(HWND hDlg, LINT idButton)
Determines whether a button control has a check mark next to it or whether a three-state button contr...
MG_EXPORT HMENU GUIAPI GetPopupSubMenu(HMENU hpppmnu)
Retrieves the submenu of the specified popup menu.
MG_EXPORT HMENU GUIAPI CreateMenu(void)
Creates an empty menu.
UINT nPage
Definition: window.h:7256
MG_EXPORT NOTIFPROC GUIAPI SetNotificationCallback(HWND hwnd, NOTIFPROC notif_proc)
Sets a new notification callback procedure for a control.
MG_EXPORT void GUIAPI ReleaseCapture(void)
Releases the mouse capture from a window and restores normal mouse input processing.
MG_EXPORT int GUIAPI ClientWidthToWindowWidthEx(DWORD dwStyle, int win_type, int cw)
Calculates main window width from the width of the client area.
MG_EXPORT BOOL GUIAPI DestroyCaret(HWND hWnd)
Destroys a caret.
MG_EXPORT LINT GUIAPI GetMenuItemID(HMENU hmnu, int pos)
Retrieves the menu item identifier of a menu item at specified position in a menu.
MG_EXPORT int GUIAPI DeleteAccelerators(HACCEL hacc, int key, DWORD keymask)
Deletes an accelerator from the accelerator table.
MG_EXPORT HACCEL GUIAPI CreateAcceleratorTable(HWND hWnd)
Creates an empty accelerator table.
LINT id
Definition: window.h:9186
GHANDLE HICON
Handle to icon.
Definition: common.h:378
UINT state
Definition: window.h:8523
MG_EXPORT BOOL GUIAPI SetDlgItemInt(HWND hDlg, LINT nIDDlgItem, UINT uValue, BOOL bSigned)
Sets the text of a control in a dialog box to the string representation of a specified integer value...
MG_EXPORT BOOL GUIAPI IsDialog(HWND hWnd)
Determines whether a window handle identifies a dialog window.
MG_EXPORT BOOL GUIAPI SetWindowMask(HWND hWnd, const MYBITMAP *mask)
Set window (a main window, or a child window which is also known as "control")&#39;s Mask Rect with MYBIT...
struct _WNDCLASS WNDCLASS