Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

window.h

Go to the documentation of this file.
00001 
00021 /* 
00022  * $Id: window.h,v 1.188 2006/06/24 04:08:15 xwyan Exp $
00023  *
00024  *             MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks, 
00025  *                     pSOS, ThreadX, NuCleus, OSE, and Win32.
00026  *
00027  *             Copyright (C) 2002-2006 Feynman Software.
00028  *             Copyright (C) 1998-2002 Wei Yongming.
00029  */
00030 
00031 #ifndef _MGUI_WINDOW_H
00032 #define _MGUI_WINDOW_H
00033 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif  /* __cplusplus */
00037 
00044 #define MSG_NULLMSG         0x0000
00045 #define MSG_SYNCMSG         0x0000
00046 
00052 /* Group 1 from 0x0001 to 0x000F, the mouse messages. */
00053 #define MSG_FIRSTMOUSEMSG   0x0001
00054 
00077 #define MSG_LBUTTONDOWN     0x0001
00078 
00098 #define MSG_LBUTTONUP       0x0002
00099 
00119 #define MSG_LBUTTONDBLCLK   0x0003
00120 
00140 #define MSG_MOUSEMOVE       0x0004
00141 
00164 #define MSG_RBUTTONDOWN     0x0005
00165 
00185 #define MSG_RBUTTONUP       0x0006
00186 
00206 #define MSG_RBUTTONDBLCLK   0x0007
00207 
00208 #define MSG_NCMOUSEOFF      0x0007
00209 
00229 #define MSG_NCLBUTTONDOWN   0x0008
00230 
00250 #define MSG_NCLBUTTONUP     0x0009
00251 
00271 #define MSG_NCLBUTTONDBLCLK 0x000A
00272 
00292 #define MSG_NCMOUSEMOVE     0x000B
00293 
00313 #define MSG_NCRBUTTONDOWN   0x000C
00314 
00334 #define MSG_NCRBUTTONUP     0x000D
00335 
00355 #define MSG_NCRBUTTONDBLCLK 0x000E
00356 
00357 #define MSG_LASTMOUSEMSG    0x000F
00358 
00366 /* Group 2 from 0x0010 to 0x001F, the key messages. */
00367 #define MSG_FIRSTKEYMSG     0x0010
00368 
00391 #define MSG_KEYDOWN         0x0010
00392 
00411 #define MSG_CHAR            0x0011
00412 
00431 #define MSG_KEYUP           0x0012
00432 
00451 #define MSG_SYSKEYDOWN      0x0013
00452 
00471 #define MSG_SYSCHAR         0x0014
00472 
00491 #define MSG_SYSKEYUP        0x0015
00492 
00518 #define MSG_KEYSYM  0x0016
00519 
00520 /* keyboard longpress supported */
00521 
00529 #define MSG_KEYLONGPRESS    0x0017
00530 
00538 #define MSG_KEYALWAYSPRESS  0x0018
00539 
00546 #define DEF_LPRESS_TIME     500
00547 
00554 #define DEF_APRESS_TIME     1000
00555 
00560 #define DEF_INTERVAL_TIME   200
00561 
00562 extern unsigned int __mg_key_longpress_time;
00563 extern unsigned int __mg_key_alwayspress_time;
00564 extern unsigned int __mg_interval_time;
00565 
00570 #define SetKeyLongPressTime(time)       \
00571     do {                                \
00572         __mg_key_longpress_time = time; \
00573     } while (0)
00574 
00579 #define SetKeyAlwaysPressTime(time)     \
00580     do {                                \
00581         __mg_key_alwayspress_time = time; \
00582     } while (0)
00583 
00588 #define SetIntervalTime(time)           \
00589     do {                                \
00590         __mg_interval_time = time;      \
00591     } while (0)
00592 
00593 #define MSG_LASTKEYMSG      0x001F
00594 
00602 /* Group 3 from 0x0020 to 0x005F, the post mouse/key event messages. */
00603 #define MSG_FIRSTPOSTMSG    0x0020
00604 
00629 #define MSG_SETCURSOR       0x0020
00630 
00631     #define HT_UNKNOWN          0x00
00632     #define HT_OUT              0x01
00633     #define HT_MENUBAR          0x02
00634     #define HT_TRANSPARENT      0x03
00635     #define HT_BORDER           0x04
00636     #define HT_CLIENT           0x0C
00637 
00638     #define HT_NEEDCAPTURE      0x10
00639     #define HT_ICON             0x14
00640     #define HT_CLOSEBUTTON      0x15
00641     #define HT_MAXBUTTON        0x16
00642     #define HT_MINBUTTON        0x17
00643     #define HT_HSCROLL          0x18
00644     #define HT_VSCROLL          0x19
00645     
00646     #define HT_DRAGGABLE        0x20
00647     #define HT_CAPTION          0x21
00648     #define HT_BORDER_TOP       0x23
00649     #define HT_BORDER_BOTTOM    0x24
00650     #define HT_BORDER_LEFT      0x25
00651     #define HT_BORDER_RIGHT     0x26
00652     #define HT_CORNER_TL        0x27
00653     #define HT_CORNER_TR        0x28
00654     #define HT_CORNER_BL        0x29
00655     #define HT_CORNER_BR        0x2A
00656 
00657     #define SBPOS_LEFTARROW     0x81
00658     #define SBPOS_RIGHTARROW    0x82
00659     #define SBPOS_LEFTSPACE     0x83
00660     #define SBPOS_RIGHTSPACE    0x84
00661     #define SBPOS_UPARROW       0x85
00662     #define SBPOS_DOWNARROW     0x86
00663     #define SBPOS_UPSPACE       0x87
00664     #define SBPOS_DOWNSPACE     0x88
00665     #define SBPOS_THUMB         0x89
00666     #define SBPOS_UNKNOWN       0x80
00667     #define SBPOS_MASK          0x80
00668 
00674 #define MSG_NCHITTEST       0x0021      
00675 
00682 #define MSG_HITTEST         MSG_NCHITTEST
00683 
00688 #define MSG_CHANGESIZE      0x0022
00689 
00690 /*reserved*/
00691 #define MSG_QUERYNCRECT     0x0023
00692 
00697 #define MSG_QUERYCLIENTAREA 0x0024
00698 
00722 #define MSG_SIZECHANGING    0x0025
00723 
00746 #define MSG_SIZECHANGED     0x0026
00747 
00764 #define MSG_CSIZECHANGED     0x0027
00765 
00773 #define MSG_SETFOCUS        0x0030
00774 
00782 #define MSG_KILLFOCUS       0x0031
00783 
00792 #define MSG_MOUSEACTIVE     0x0032
00793 
00801 #define MSG_ACTIVE          0x0033
00802 
00807 #define MSG_CHILDHIDDEN     0x0034
00808     #define RCTM_CLICK          1
00809     #define RCTM_KEY            2
00810     #define RCTM_MESSAGE        3
00811     #define RCTM_SHOWCTRL       4
00812 
00837 #define MSG_ACTIVEMENU      0x0040
00838 
00856 #define MSG_DEACTIVEMENU    0x0041
00857 
00858 /* Scroll bar notifying code */
00859 #define SB_LINEUP           0x01
00860 #define SB_LINEDOWN         0x02
00861 #define SB_LINELEFT         0x03
00862 #define SB_LINERIGHT        0x04
00863 #define SB_PAGEUP           0x05
00864 #define SB_PAGEDOWN         0x06
00865 #define SB_PAGELEFT         0x07
00866 #define SB_PAGERIGHT        0x08
00867 #define SB_THUMBPOSITION    0x09
00868 #define SB_THUMBTRACK       0x0A
00869 #define SB_ENDSCROLL        0x0B
00870     
00899 #define MSG_HSCROLL         0x0042
00900 
00929 #define MSG_VSCROLL         0x0043
00930 
00943 #define MSG_NCSETCURSOR     0x0044
00944 
00960 #define MSG_MOUSEMOVEIN     0x0050
00961 
00967 #define MSG_WINDOWDROPPED   0x0051
00968 
00969 #define MSG_LASTPOSTMSG     0x005F
00970 
00978     /* Group 4 from 0x0060 to 0x009F, the creation messages. */
00979 #define MSG_FIRSTCREATEMSG  0x0060
00980 
01008 #define MSG_CREATE          0x0060
01009 
01038 #define MSG_NCCREATE        0x0061
01039 
01040 /*Not use*/
01041 #define MSG_INITPANES       0x0062
01042 #define MSG_DESTROYPANES    0x0063
01043 
01057 #define MSG_DESTROY         0x0064
01058 
01059 /*Not use*/
01060 #define MSG_NCDESTROY       0x0065
01061 
01069 #define MSG_CLOSE           0x0066
01070 
01071 /*Not use*/
01072 #define MSG_NCCALCSIZE      0x0067
01073 
01081 #define MSG_MAXIMIZE            0x0068
01082 
01090 #define MSG_MINIMIZE            0x0069
01091 
01092 #define MSG_LASTCREATEMSG   0x009F
01093 
01101 /* Group 5 from 0x00A0 to 0x00CF, the paint messages. */
01102 #define MSG_FIRSTPAINTMSG   0x00A0
01103 
01128 #define MSG_SHOWWINDOW      0x00A0 
01129 
01146 #define MSG_ERASEBKGND      0x00B0      /* this is an async message. */
01147 
01161 #define MSG_PAINT           0x00B1
01162 
01167 #define MSG_NCPAINT         0x00B2
01168 
01173 #define MSG_NCACTIVATE      0x00B3
01174 
01178 #define MSG_SYNCPAINT       0x00B4
01179 
01180 #define MSG_LASTPAINTMSG    0x00CF
01181 
01189 /* Group 6 from 0x00D0 to 0x00EF, the internal desktop messages. */
01190 #define MSG_FIRSTSESSIONMSG 0x00D0
01191 
01192 #define MSG_STARTSESSION    0x00D0
01193 #define MSG_QUERYENDSESSION 0x00D1
01194 #define MSG_ENDSESSION      0x00D2
01195 #define MSG_REINITSESSION   0x00D3
01196 
01197 #define MSG_ERASEDESKTOP    0x00E0
01198 #define MSG_PAINTDESKTOP    0x00E1
01199 
01200 #define MSG_DT_MOUSEOFF     0x00E1
01201 #define MSG_DT_LBUTTONDOWN  0x00E2
01202 #define MSG_DT_LBUTTONUP    0x00E3
01203 #define MSG_DT_LBUTTONDBLCLK    0x00E4
01204 #define MSG_DT_MOUSEMOVE    0x00E5
01205 #define MSG_DT_RBUTTONDOWN  0x00E6
01206 #define MSG_DT_RBUTTONUP    0x00E7
01207 #define MSG_DT_RBUTTONDBLCLK    0x00E8
01208 
01209 #define MSG_DT_KEYOFF       0x00DA 
01210 #define MSG_DT_KEYDOWN      0x00EA
01211 #define MSG_DT_CHAR         0x00EB
01212 #define MSG_DT_KEYUP        0x00EC
01213 #define MSG_DT_SYSKEYDOWN   0x00ED
01214 #define MSG_DT_SYSCHAR      0x00EE
01215 #define MSG_DT_SYSKEYUP     0x00EF
01216 
01217 #define MSG_LASTSESSIONMSG  0x00EF
01218 
01226 /* Group 7 from 0x00F0 to 0x010F, Internal window management messages. */
01227 #define MSG_FIRSTWINDOWMSG  0x00F0
01228 
01229 #define MSG_ADDNEWMAINWIN   0x00F0
01230 #define MSG_REMOVEMAINWIN   0x00F1
01231 #define MSG_MOVETOTOPMOST   0x00F2 
01232 #define MSG_SETACTIVEMAIN   0x00F3
01233 #define MSG_GETACTIVEMAIN   0x00F4
01234 #define MSG_SHOWMAINWIN     0x00F5
01235 #define MSG_HIDEMAINWIN     0x00F6
01236 #define MSG_MOVEMAINWIN     0x00F7
01237 #define MSG_SETCAPTURE      0x00F8
01238 #define MSG_GETCAPTURE      0x00F9
01239 
01240 #define MSG_ENDTRACKMENU    0x00FA
01241 #define MSG_TRACKPOPUPMENU  0x00FB
01242 #define MSG_CLOSEMENU       0x00FC
01243 #define MSG_SCROLLMAINWIN   0x00FD
01244 #define MSG_CARET_CREATE    0x00FE
01245 #define MSG_CARET_DESTROY   0x00FF
01246 
01247 #define MSG_ENABLEMAINWIN   0x0100
01248 #define MSG_ISENABLED       0x0101
01249 
01250 #define MSG_SETWINCURSOR    0x0102
01251 
01252 #define MSG_GETNEXTMAINWIN  0x0103
01253 
01254 #define MSG_SHOWGLOBALCTRL  0x010A
01255 #define MSG_HIDEGLOBALCTRL  0x010B
01256 
01257 typedef struct _DRAGINFO {
01258     int     location;
01259     int     init_x, init_y;
01260 } DRAGINFO;
01261 
01262 /* client to server; wParam: hwnd, lParam: DRAGINFO. */
01263 #define MSG_STARTDRAGWIN    0x010C
01264 /* client to server; wParam: hwnd, lParam: 0L. */
01265 #define MSG_CANCELDRAGWIN   0x010D
01266 
01267 #define MSG_CHANGECAPTION   0x010E
01268 
01269 #define MSG_LASTWINDOWMSG   0x010F
01270 
01278 /* Group 8 from 0x0120 to 0x013F, the dialog and control messages. */
01279 #define MSG_FIRSTCONTROLMSG 0x0120
01280 
01302 #define MSG_COMMAND         0x0120
01303 
01308 #define MSG_SYSCOMMAND      0x0121
01309 
01314 #define MSG_GETDLGCODE      0x0122
01315 
01342 #define MSG_INITDIALOG      0x0123
01343 
01344 /*Reserved*/
01345 #define MSG_NEXTDLGCTRL     0x0124
01346 #define MSG_ENTERIDLE       0x0125
01347 
01352 #define MSG_DLG_GETDEFID    0x0126
01353 
01358 #define MSG_DLG_SETDEFID    0x0127
01359 
01360 /* #define MSG_DLG_REPOSITION  0x0128 */
01361 
01368 #define MSG_ISDIALOG        0x0128
01369 
01387 #define MSG_INITPAGE        0x0129
01388 
01409 #define MSG_SHOWPAGE        0x012A
01410 
01430 #define MSG_SHEETCMD        0x012B
01431 
01451 #define MSG_INITCONTAINER   0x012C
01452 
01481 #define MSG_SVCONTCMD       0x012D
01482 
01501 #define MSG_FREEZECTRL      0x012E
01502 
01521 #define MSG_FONTCHANGING    0x0130
01522 
01523 
01531 #define MSG_FONTCHANGED     0x0131
01532 
01550 #define MSG_GETTEXTLENGTH   0x0132
01551 
01574 #define MSG_GETTEXT         0x0133
01575 
01596 #define MSG_SETTEXT         0x0134
01597 
01611 #define MSG_ENABLE          0x0135
01612 
01613 #define MSG_LASTCONTROLMSG  0x013F
01614 
01622 /* Group 9 from 0x0140 to 0x016F, the system messages. */
01623 #define MSG_FIRSTSYSTEMMSG  0x0140
01624 
01625 #define MSG_QUIT            0x0140
01626 
01634 #define MSG_IDLE            0x0142
01635 
01636 #define MSG_TIMEOUT         0x0143
01637 
01651 #define MSG_TIMER           0x0144
01652 
01653 #define MSG_CARETBLINK      0x0145
01654 
01655 #ifdef _LITE_VERSION
01656 
01684 #define MSG_FDEVENT         0x0146
01685 
01699 #define MSG_SRVNOTIFY       0x0147
01700 
01701 #ifndef _STAND_ALONE
01702     #define MSG_UPDATECLIWIN    0x0148
01703 #endif
01704 
01705 #endif /* _LITE_VERSION */
01706 
01720 #define MSG_DOESNEEDIME     0x0150
01721 
01722 /*Internal use*/
01723 #define MSG_IME_REGISTER    0x0151
01724 #define MSG_IME_UNREGISTER  0x0152
01725 #define MSG_IME_OPEN        0x0153
01726 #define MSG_IME_CLOSE       0x0154
01727 #define MSG_IME_SETSTATUS   0x0156
01728 #define MSG_IME_GETSTATUS   0x0157
01729     #define IS_ENABLE       1
01730     #define IS_FULLCHAR     2
01731     #define IS_FULLPUNC     3
01732     #define IS_METHOD       4
01733 #define MSG_IME_SETTARGET   0x0158
01734 #define MSG_IME_GETTARGET   0x0159
01735 
01736 #define MSG_SHOWMENU        0x0160
01737 #define MSG_HIDEMENU        0x0161
01738 
01739 #define MSG_ADDTIMER        0x0162
01740 #define MSG_REMOVETIMER     0x0163
01741 #define MSG_RESETTIMER      0x0164
01742 
01743 #define MSG_WINDOWCHANGED   0x0165
01744 
01745 #define MSG_BROADCASTMSG    0x0166
01746 
01747 #define MSG_REGISTERWNDCLASS    0x0167
01748 #define MSG_UNREGISTERWNDCLASS  0x0168
01749 #define MSG_NEWCTRLINSTANCE     0x0169
01750 #define MSG_REMOVECTRLINSTANCE  0x016A
01751 #define MSG_GETCTRLCLASSINFO    0x016B
01752 #define MSG_CTRLCLASSDATAOP     0x016C
01753     #define CCDOP_GETCCI        0x01
01754     #define CCDOP_SETCCI        0x02
01755 
01756 #define MSG_REGISTERKEYHOOK     0x016D
01757 #define MSG_REGISTERMOUSEHOOK   0x016E
01758 
01759 #define MSG_LASTSYSTEMMSG   0x016F
01760 
01768 /* Group 10 from 0x0170 to 0x018F, the menu messages */
01769 #define MSG_FIRSTMENUMSG    0x0170
01770 
01771 /*Internal use*/
01772 #define MSG_INITMENU        0x0170
01773 #define MSG_INITMENUPOPUP   0x0171
01774 #define MSG_MENUSELECT      0x0172
01775 #define MSG_MENUCHAR        0x0173
01776 #define MSG_ENTERMENULOOP   0x0174
01777 #define MSG_EXITMENULOOP    0x0175
01778 #define MSG_CONTEXTMENU     0x0176
01779 #define MSG_NEXTMENU        0x0177
01780 
01781 #define MSG_LASTMENUMSG     0x018F
01782 
01790 #define MSG_FIRSTUSERMSG    0x0800
01791 
01792 
01800 #define MSG_USER            0x0800
01801 
01802 #define MSG_LASTUSERMSG     0xEFFF
01803 
01827 typedef struct _MSG
01828 {
01830     HWND             hwnd;
01832     int              message;
01834     WPARAM           wParam;
01836     LPARAM           lParam;
01838     unsigned int     time;
01839 #ifndef _LITE_VERSION
01840 
01841     void*            pAdd;
01842 #endif
01843 } MSG;
01844 typedef MSG* PMSG;
01845 
01846 #define QS_NOTIFYMSG        0x10000000
01847 #ifndef _LITE_VERSION
01848   #define QS_SYNCMSG        0x20000000
01849 #else
01850   #define QS_DESKTIMER      0x20000000
01851 #endif
01852 #define QS_POSTMSG          0x40000000
01853 #define QS_QUIT             0x80000000
01854 #define QS_INPUT            0x01000000
01855 #define QS_PAINT            0x02000000
01856 #define QS_TIMER            0x0000FFFF
01857 #define QS_EMPTY            0x00000000
01858 
01877 MG_EXPORT int GUIAPI GetMessage (PMSG pMsg, HWND hMainWnd);
01878 
01895 MG_EXPORT BOOL GUIAPI WaitMessage (PMSG pMsg, HWND hMainWnd);
01896 
01911 MG_EXPORT BOOL GUIAPI HavePendingMessage (HWND hMainWnd);
01912 
01918 #define PM_NOREMOVE     0x0000
01919 
01925 #define PM_REMOVE       0x0001
01926 
01932 #define PM_NOYIELD      0x0002
01933 
01960 MG_EXPORT BOOL GUIAPI PeekMessage (PMSG pMsg, HWND hWnd,
01961                 int iMsgFilterMin, int iMsgFilterMax, UINT uRemoveMsg);
01962 
01990 MG_EXPORT BOOL GUIAPI PeekMessageEx (PMSG pMsg, HWND hWnd, 
01991                 int iMsgFilterMin, int iMsgFilterMax, 
01992                 BOOL bWait, UINT uRemoveMsg);
01993 
02020 MG_EXPORT BOOL GUIAPI PeekPostMessage (PMSG pMsg, HWND hWnd, int iMsgFilterMin, 
02021                 int iMsgFilterMax, UINT uRemoveMsg);
02022 
02044 MG_EXPORT int GUIAPI PostMessage (HWND hWnd, int iMsg, 
02045                 WPARAM wParam, LPARAM lParam);
02046 
02062 MG_EXPORT int GUIAPI SendMessage (HWND hWnd, int iMsg, 
02063                 WPARAM wParam, LPARAM lParam);
02064 
02080 MG_EXPORT void GUIAPI SetAutoRepeatMessage (HWND hwnd, int msg, 
02081                 WPARAM wParam, LPARAM lParam);
02082 
02083 #ifdef _LITE_VERSION
02084 
02091 #define SendAsyncMessage SendMessage
02092 
02093 #ifndef _STAND_ALONE
02094 
02095 #define CLIENTS_TOPMOST          -1
02096 #define CLIENTS_ALL              -2
02097 #define CLIENTS_EXCEPT_TOPMOST   -3
02098 #define CLIENT_ACTIVE            -4
02099 
02130 int GUIAPI Send2Client (MSG* msg, int cli);
02131 
02151 BOOL GUIAPI Send2TopMostClients (int iMsg, WPARAM wParam, LPARAM lParam);
02152 
02173 BOOL GUIAPI Send2ActiveWindow (const MG_Layer* layer, 
02174                  int iMsg, WPARAM wParam, LPARAM lParam);
02175 
02176 #endif /* !_STAND_ALONE */
02177 
02178 #else /* _LITE_VERSION */
02179 
02200 int GUIAPI PostSyncMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);
02201 
02222 int GUIAPI SendAsyncMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);
02223 #endif
02224 
02243 MG_EXPORT int GUIAPI SendNotifyMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);
02244 
02259 MG_EXPORT int GUIAPI BroadcastMessage (int iMsg, WPARAM wParam, LPARAM lParam);
02260 
02273 MG_EXPORT int GUIAPI PostQuitMessage (HWND hWnd);
02274 
02275 #define KBD_LAYOUT_DEFAULT  "default"
02276 #define KBD_LAYOUT_FRPC     "frpc"
02277 #define KBD_LAYOUT_FR       "fr"
02278 #define KBD_LAYOUT_DE       "de"
02279 #define KBD_LAYOUT_DELATIN1 "delatin1"
02280 #define KBD_LAYOUT_IT       "it"
02281 #define KBD_LAYOUT_ES       "es"
02282 #define KBD_LAYOUT_ESCP850  "escp850"
02283 
02317 MG_EXPORT BOOL GUIAPI SetKeyboardLayout (const char* kbd_layout);
02318 
02339 MG_EXPORT BOOL GUIAPI TranslateMessage (PMSG pMsg);
02340 
02363 MG_EXPORT BOOL GUIAPI TranslateKeyMsgToChar (int message, 
02364                 WPARAM wParam, LPARAM lParam, WORD *ch);
02365 
02382 MG_EXPORT int GUIAPI DispatchMessage (PMSG pMsg);
02383 
02396 MG_EXPORT int GUIAPI ThrowAwayMessages (HWND pMainWnd);
02397 
02398 #ifdef _LITE_VERSION
02399 
02414 MG_EXPORT BOOL GUIAPI EmptyMessageQueue (HWND hWnd);
02415 
02416 #endif
02417 
02418 #ifdef _MSG_STRING
02419 
02434 MG_EXPORT const char* GUIAPI Message2Str (int message);
02435 
02452 MG_EXPORT void GUIAPI PrintMessage (FILE* fp, HWND hWnd, 
02453                 int iMsg, WPARAM wParam, LPARAM lParam);
02454 
02455 #endif
02456 
02468 #define HOOK_GOON       0
02469 
02474 #define HOOK_STOP       1
02475 
02476 #if !defined (_LITE_VERSION) || defined (_STAND_ALONE)
02477 
02484 typedef int (* MSGHOOK)(void* context, HWND dst_wnd, 
02485                 int msg, WPARAM wparam, LPARAM lparam);
02486 
02490 typedef struct _HOOKINFO
02491 {
02493     void* context;
02495     MSGHOOK hook;
02496 } HOOKINFO;
02497 
02514 MG_EXPORT MSGHOOK GUIAPI RegisterKeyMsgHook (void* context, MSGHOOK hook);
02515 
02532 MG_EXPORT MSGHOOK GUIAPI RegisterMouseMsgHook (void* context, MSGHOOK hook);
02533 
02534 #endif /* !_LITE_VERSION || _STAND_ALONE */
02535 
02536 #ifdef _LITE_VERSION
02537 
02551 typedef int (* SRVEVTHOOK) (PMSG pMsg);
02552 
02566 MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
02567 
02568 #ifndef _STAND_ALONE
02569 
02591 MG_EXPORT HWND GUIAPI RegisterKeyHookWindow (HWND hwnd, DWORD flag);
02592 
02614 MG_EXPORT HWND GUIAPI RegisterMouseHookWindow (HWND hwnd, DWORD flag);
02615 
02616 #endif /* !_STAND_ALONE */
02617 #endif /* _LITE_VERSION */
02618 
02619 
02635 #define WS_NONE             0x00000000L
02636 
02637 #define WS_OVERLAPPED       0x00000000L   /*Not supported*/
02638 
02644 #define WS_ABSSCRPOS        0x80000000L
02645 
02650 #define WS_CHILD            0x40000000L
02651 
02656 #define WS_CAPTION          0x20000000L
02657 
02662 #define WS_SYSMENU          0x10000000L
02663 
02668 #define WS_VISIBLE          0x08000000L
02669 
02674 #define WS_DISABLED         0x04000000L
02675 
02676 /* Main window states -- not supported so far */
02677 #define WS_MINIMIZE         0x02000000L
02678 #define WS_MAXIMIZE         0x01000000L
02679 
02680 #define WS_DLGFRAME         0x00800000L
02681 
02686 #define WS_BORDER           0x00400000L
02687 
02692 #define WS_THICKFRAME       0x00200000L
02693 
02698 #define WS_THINFRAME        0x00100000L
02699 
02704 #define WS_VSCROLL          0x00080000L
02705 
02710 #define WS_HSCROLL          0x00040000L
02711 
02716 #define WS_MINIMIZEBOX      0x00020000L
02717 
02722 #define WS_MAXIMIZEBOX      0x00010000L
02723 
02728 #define WS_GROUP            0x00020000L
02729 
02735 #define WS_TABSTOP          0x00010000L
02736 
02741 #define WS_EX_NONE              0x00000000L     /* supported */
02742 
02749 #define WS_EX_USEPRIVATECDC     0x00000002L     /* supported */
02750 
02751 /*Reserved*/
02752 #define WS_EX_NOPARENTNOTIFY    0x00000004L
02753 
02758 #define WS_EX_TOPMOST           0x00000008L     /* supported */
02759 
02765 #define WS_EX_TRANSPARENT       0x00000020L
02766 
02771 #define WS_EX_TOOLWINDOW        0x00000080L     /* supported */
02772 
02777 #define WS_EX_USEPARENTFONT     0x00000100L     /* supported */
02778 
02779 #define WS_EX_CONTEXTHELP       0x00000400L     /*Not supported*/
02780 
02785 #define WS_EX_USEPARENTCURSOR   0x00000800L     /* supported */
02786 
02787 /*Reserved*/
02788 #define WS_EX_RIGHT             0x00001000L
02789 #define WS_EX_LEFT              0x00000000L
02790 #define WS_EX_RTLREADING        0x00002000L
02791 #define WS_EX_LTRREADING        0x00000000L
02792 #define WS_EX_LEFTSCROLLBAR     0x00004000L
02793 #define WS_EX_RIGHTSCROLLBAR    0x00000000L
02794 
02795 #define WS_EX_CONTROLPARENT     0x00010000L
02796 #define WS_EX_STATICEDGE        0x00020000L
02797 #define WS_EX_APPWINDOW         0x00040000L
02798 
02799 /* internal use */
02800 #define WS_EX_MODALDISABLED     0x01000000L
02801 
02802 /* Obsolete style. */
02803 #define WS_EX_IMECOMPOSE        0x10000000L
02804 
02809 #define WS_EX_NOCLOSEBOX        0x20000000L
02810 
02815 #define WS_EX_CTRLASMAINWIN     0x40000000L
02816 
02821 #define WS_EX_CLIPCHILDREN      0x80000000L
02822 
02844 typedef int (* WNDPROC)(HWND, int, WPARAM, LPARAM);
02845 
02846 extern MG_EXPORT HWND __mg_hwnd_desktop;
02847 
02852 #define HWND_DESKTOP        __mg_hwnd_desktop
02853 
02858 #define HWND_NULL           0
02859 
02864 #define HWND_INVALID        0xFFFFFFFF
02865 
02866 #if defined(_LITE_VERSION) && !defined(_STAND_ALONE)
02867     #define HWND_OTHERPROC  0xFFFFFFFE
02868 #endif
02869 
02873 typedef struct _MAINWINCREATE
02874 {
02876     DWORD dwStyle;
02877 
02879     DWORD dwExStyle;
02880 
02882     const char* spCaption;
02883 
02885     HMENU hMenu;
02886 
02888     HCURSOR hCursor;
02889 
02891     HICON hIcon;
02892 
02894     HWND  hHosting;
02895 
02897     int (*MainWindowProc)(HWND, int, WPARAM, LPARAM);
02898 
02900     int lx, ty, rx, by;
02901 
02903     int iBkColor;
02904 
02906     DWORD dwAddData;
02907 
02909     DWORD dwReserved;
02910 }MAINWINCREATE;
02911 typedef MAINWINCREATE* PMAINWINCREATE;
02912 
02913 #ifndef _LITE_VERSION
02914 
02925 MG_EXPORT int GUIAPI CreateThreadForMainWindow(pthread_t* thread, 
02926                                      pthread_attr_t* attr, 
02927                                      void * (*start_routine)(void *), 
02928                                      void * arg);
02929 
02936 MG_EXPORT pthread_t GUIAPI GetMainWinThread(HWND hMainWnd);
02937 
02947 MG_EXPORT int GUIAPI WaitMainWindowClose(HWND hWnd, void** returnval);
02948 #endif
02949 
02965 MG_EXPORT void GUIAPI MainWindowThreadCleanup(HWND hMainWnd);
02966 
02973 #define MainWindowCleanup(hwnd)      MainWindowThreadCleanup(hwnd)
02974 
02992 MG_EXPORT HWND GUIAPI CreateMainWindow (PMAINWINCREATE pCreateStruct);
02993 
03012 MG_EXPORT BOOL GUIAPI DestroyMainWindow (HWND hWnd);
03013 
03014 int GUIAPI PreDefMainWinProc (HWND hWnd, int message, 
03015                 WPARAM wParam, LPARAM lParam);
03016 
03017 int GUIAPI PreDefDialogProc (HWND hWnd, 
03018                 int message, WPARAM wParam, LPARAM lParam);
03019 
03020 int GUIAPI PreDefControlProc (HWND hWnd, int message, 
03021                 WPARAM wParam, LPARAM lParam);
03022 
03040 MG_EXPORT int GUIAPI DefaultWindowProc (HWND hWnd, int message, 
03041                 WPARAM wParam, LPARAM lParam);
03042 
03048 extern MG_EXPORT WNDPROC __mg_def_proc[3];
03049 
03064 #define DefaultMainWinProc (__mg_def_proc[0])
03065 
03082 #define DefaultDialogProc  (__mg_def_proc[1])
03083 
03097 #define DefaultControlProc (__mg_def_proc[2])
03098 
03099 #ifdef _DEBUG
03100 MG_EXPORT void GUIAPI DumpWindow (FILE* fp, HWND hWnd);
03101 #endif /* _DEBUG */
03102 
03108 #define SW_HIDE              0x0000
03109 #define SW_SHOW              0x0010
03110 #define SW_SHOWNORMAL        0x0100
03111 
03127 MG_EXPORT void GUIAPI UpdateWindow (HWND hWnd, BOOL bErase);
03128 
03147 MG_EXPORT BOOL GUIAPI ShowWindow (HWND hWnd, int iCmdShow);
03148 
03165 MG_EXPORT BOOL GUIAPI EnableWindow (HWND hWnd, BOOL fEnable);
03166 
03181 MG_EXPORT BOOL GUIAPI IsWindowEnabled (HWND hWnd);
03182 
03203 MG_EXPORT BOOL GUIAPI GetClientRect(HWND hWnd, PRECT prc);
03204 
03218 MG_EXPORT int GUIAPI GetWindowBkColor (HWND hWnd);
03219 
03235 MG_EXPORT int GUIAPI SetWindowBkColor (HWND hWnd, int new_bkcolor);
03236 
03249 MG_EXPORT PLOGFONT GUIAPI GetWindowFont (HWND hWnd);
03250 
03270 MG_EXPORT PLOGFONT GUIAPI SetWindowFont (HWND hWnd, PLOGFONT pLogFont);
03271 
03284 MG_EXPORT HCURSOR GUIAPI GetWindowCursor (HWND hWnd);
03285 
03299 MG_EXPORT HCURSOR GUIAPI SetWindowCursor (HWND hWnd, HCURSOR hNewCursor);
03300 
03312 MG_EXPORT DWORD GUIAPI GetWindowStyle (HWND hWnd);
03313 
03325 MG_EXPORT DWORD GUIAPI GetWindowExStyle (HWND hWnd);
03326 
03340 MG_EXPORT BOOL GUIAPI ExcludeWindowStyle (HWND hWnd, DWORD dwStyle);
03341 
03355 MG_EXPORT BOOL GUIAPI IncludeWindowStyle (HWND hWnd, DWORD dwStyle);
03356 
03370 MG_EXPORT BOOL GUIAPI ExcludeWindowExStyle (HWND hWnd, DWORD dwStyle);
03371 
03385 MG_EXPORT BOOL GUIAPI IncludeWindowExStyle (HWND hWnd, DWORD dwStyle);
03386 
03399 MG_EXPORT WNDPROC GUIAPI GetWindowCallbackProc (HWND hWnd);
03400 
03418 MG_EXPORT WNDPROC GUIAPI SetWindowCallbackProc (HWND hWnd, WNDPROC newProc);
03419 
03432 MG_EXPORT DWORD GUIAPI GetWindowAdditionalData (HWND hWnd);
03433 
03452 MG_EXPORT DWORD GUIAPI SetWindowAdditionalData (HWND hWnd, DWORD newData);
03453 
03466 MG_EXPORT DWORD GUIAPI GetWindowAdditionalData2 (HWND hWnd);
03467 
03485 MG_EXPORT DWORD GUIAPI SetWindowAdditionalData2 (HWND hWnd, DWORD newData);
03486 
03503 MG_EXPORT DWORD GUIAPI GetWindowClassAdditionalData (HWND hWnd);
03504 
03520 MG_EXPORT DWORD GUIAPI SetWindowClassAdditionalData (HWND hWnd, DWORD newData);
03521 
03534 MG_EXPORT const char* GUIAPI GetWindowCaption (HWND hWnd);
03535 
03549 MG_EXPORT BOOL GUIAPI SetWindowCaption (HWND hWnd, const char* spCaption);
03550 
03569 MG_EXPORT BOOL GUIAPI InvalidateRect(HWND hWnd, 
03570                 const RECT* prc, BOOL bEraseBkgnd);
03571 
03587 MG_EXPORT HDC GUIAPI BeginPaint(HWND hWnd);
03588 
03602 MG_EXPORT void GUIAPI EndPaint(HWND hWnd, HDC hdc);
03603 
03619 MG_EXPORT BOOL GUIAPI GetUpdateRect (HWND hWnd, RECT* update_rect);
03620 
03635 MG_EXPORT int GUIAPI ClientWidthToWindowWidth (DWORD dwStyle, int cw);
03636 
03652 MG_EXPORT int GUIAPI ClientHeightToWindowHeight (DWORD dwStyle, 
03653                 int ch, BOOL hasMenu);
03654 
03668 MG_EXPORT void GUIAPI ClientToScreen (HWND hWnd, int* x, int* y);
03669 
03683 MG_EXPORT void GUIAPI ScreenToClient (HWND hWnd, int* x, int* y);
03684 
03698 MG_EXPORT void GUIAPI WindowToScreen (HWND hWnd, int* x, int* y);
03699 
03713 MG_EXPORT void GUIAPI ScreenToWindow (HWND hWnd, int* x, int* y);
03714 
03728 MG_EXPORT BOOL GUIAPI IsMainWindow (HWND hWnd);
03729 
03742 MG_EXPORT BOOL GUIAPI IsControl (HWND hWnd);
03743 
03757 MG_EXPORT BOOL GUIAPI IsWindow (HWND hWnd);
03758 
03772 MG_EXPORT BOOL GUIAPI IsDialog (HWND hWnd);
03773 
03791 MG_EXPORT HWND GUIAPI GetParent (HWND hWnd);
03792 
03808 MG_EXPORT HWND GUIAPI GetMainWindowHandle (HWND hWnd);
03809 
03821 MG_EXPORT BOOL GUIAPI IsWindowVisible (HWND hWnd);
03822 
03840 MG_EXPORT BOOL GUIAPI GetWindowRect (HWND hWnd, PRECT prc);
03841 
03866 MG_EXPORT HWND GUIAPI GetNextChild (HWND hWnd, HWND hChild);
03867 
03885 MG_EXPORT HWND GUIAPI GetNextMainWindow (HWND hMainWnd);
03886 
03906 MG_EXPORT HWND GUIAPI GetHosting (HWND hMainWnd);
03907 
03927 MG_EXPORT HWND GUIAPI GetFirstHosted (HWND hHosting);
03928 
03953 MG_EXPORT HWND GUIAPI GetNextHosted (HWND hHosting, HWND hHosted);
03954 
03969 MG_EXPORT int GUIAPI GetWindowTextLength (HWND hWnd);
03970 
03987 MG_EXPORT int GUIAPI GetWindowText (HWND hWnd, char* spString, int nMaxLen);
03988 
04004 MG_EXPORT BOOL GUIAPI SetWindowText (HWND hWnd, const char* spString);
04005 
04020 MG_EXPORT HWND GUIAPI GetFocusChild (HWND hParent);
04021 
04035 MG_EXPORT HWND GUIAPI SetNullFocus (HWND hParent);
04036 
04050 MG_EXPORT HWND GUIAPI SetFocusChild (HWND hWnd);
04051 
04056 #define SetFocus SetFocusChild
04057 
04062 #define GetFocus GetFocusChild
04063 
04075 MG_EXPORT HWND GUIAPI GetActiveWindow (void);
04076 
04090 MG_EXPORT HWND GUIAPI SetActiveWindow (HWND hMainWnd);
04091 
04096 #define GetForegroundWindow GetActiveWindow
04097 
04102 #define SetForegroundWindow SetActiveWindow
04103 
04118 MG_EXPORT HWND GUIAPI GetCapture(void);
04119 
04135 MG_EXPORT HWND GUIAPI SetCapture(HWND hWnd);
04136 
04148 MG_EXPORT void GUIAPI ReleaseCapture(void);
04149 
04162 MG_EXPORT HWND GUIAPI GetWindowUnderCursor(void);
04163 
04185 MG_EXPORT BOOL GUIAPI MoveWindow (HWND hWnd, int x, int y, int w, int h, 
04186                 BOOL fPaint);
04187 
04208 MG_EXPORT void GUIAPI ScrollWindow (HWND hWnd, int iOffx, int iOffy, 
04209                 const RECT* rc1, const RECT* rc2);
04210 
04211 #define MWM_MINWIDTH            0
04212 #define MWM_MINHEIGHT           1
04213 #define MWM_BORDER              2
04214 #define MWM_THICKFRAME          3
04215 #define MWM_THINFRAME           4
04216 #define MWM_CAPTIONY            5
04217 #define MWM_ICONX               6
04218 #define MWM_ICONY               7
04219 #define MWM_MENUBARY            8
04220 #define MWM_MENUBAROFFX         9
04221 #define MWM_MENUBAROFFY         10
04222 #define MWM_MENUITEMY           11 
04223 #define MWM_INTERMENUITEMX      12
04224 #define MWM_INTERMENUITEMY      13
04225 #define MWM_MENUITEMOFFX        14
04226 #define MWM_MENUTOPMARGIN       15
04227 #define MWM_MENUBOTTOMMARGIN    16
04228 #define MWM_MENULEFTMARGIN      17
04229 #define MWM_MENURIGHTMARGIN     18
04230 #define MWM_MENUITEMMINX        19
04231 #define MWM_MENUSEPARATORY      20
04232 #define MWM_MENUSEPARATORX      21
04233 #define MWM_SB_HEIGHT           22
04234 #define MWM_SB_WIDTH            23
04235 #define MWM_SB_INTERX           24
04236 #define MWM_CXVSCROLL           25
04237 #define MWM_CYVSCROLL           26
04238 #define MWM_CXHSCROLL           27
04239 #define MWM_CYHSCROLL           28
04240 #define MWM_MINBARLEN           29
04241 #define MWM_DEFBARLEN           30
04242 
04243 #define MWM_ITEM_NUMBER         31
04244 
04245 extern MG_EXPORT int WinMainMetrics [];
04246 
04251 #define GetMainWinMetrics(iItem)    (WinMainMetrics[iItem])
04252 
04331 MG_EXPORT int GUIAPI GetWindowElementMetricsEx (HWND hwnd, Uint16 item);
04332 
04350 MG_EXPORT int GUIAPI SetWindowElementMetricsEx (HWND hwnd, Uint16 item, 
04351                 int new_value);
04352 
04353 #define BKC_CAPTION_NORMAL          0
04354 #define FGC_CAPTION_NORMAL          1
04355 #define BKC_CAPTION_ACTIVED         2
04356 #define FGC_CAPTION_ACTIVED         3
04357 #define BKC_CAPTION_DISABLED        4
04358 #define FGC_CAPTION_DISABLED        5
04359 #define WEC_FRAME_NORMAL            6
04360 #define WEC_FRAME_ACTIVED           7
04361 #define WEC_FRAME_DISABLED          8
04362 
04363 #define BKC_MENUBAR_NORMAL          9
04364 #define FGC_MENUBAR_NORMAL          10
04365 #define BKC_MENUBAR_HILITE          11
04366 #define FGC_MENUBAR_HILITE          12
04367 #define FGC_MENUBAR_DISABLED        13
04368 
04369 #define BKC_MENUITEM_NORMAL         14
04370 #define FGC_MENUITEM_NORMAL         15
04371 #define BKC_MENUITEM_HILITE         16
04372 #define FGC_MENUITEM_HILITE         17
04373 #define FGC_MENUITEM_DISABLED       18
04374 #define BKC_PPPMENUTITLE            19
04375 #define FGC_PPPMENUTITLE            20
04376 
04377 #define FGC_MENUITEM_FRAME              21
04378 
04379 #define WEC_3DBOX_NORMAL            22
04380 #define WED_3DBOX_REVERSE           23
04381 #define WEC_3DBOX_LIGHT             24
04382 #define WEC_3DBOX_DARK              25
04383 
04384 #define WEC_FLAT_BORDER             26
04385 
04386 #define BKC_CONTROL_DEF             27
04387 
04388 #define FGC_CONTROL_NORMAL          28
04389 #define FGC_CONTROL_DISABLED        29
04390 
04391 #define BKC_HILIGHT_NORMAL          30
04392 #define BKC_HILIGHT_LOSTFOCUS       31
04393 #define FGC_HILIGHT_NORMAL          32
04394 #define FGC_HILIGHT_DISABLED        33
04395 
04396 #define BKC_DESKTOP                 34
04397 #define BKC_DIALOG                          35
04398 #define BKC_TIP                             36
04399 
04400 #define WEC_ITEM_NUMBER             37
04401 
04402 /* back compitabilty defines */
04403 #define BKC_BUTTON_DEF              WEC_3DBOX_NORMAL
04404 #define BKC_BUTTON_PUSHED           WEC_3DBOX_DARK
04405 #define FGC_BUTTON_NORMAL           WED_3DBOX_REVERSE
04406 #define FGC_BUTTON_PUSHED           WED_3DBOX_REVERSE
04407 
04408 #define BKC_EDIT_DEF                WEC_3DBOX_LIGHT
04409 #define BKC_EDIT_DISABLED           WEC_3DBOX_NORMAL
04410 
04411 #define WEC_3DFRAME_LEFT_OUTER      WED_3DBOX_REVERSE
04412 #define WEC_3DFRAME_LEFT_INNER      WEC_3DBOX_DARK
04413 #define WEC_3DFRAME_TOP_OUTER       WED_3DBOX_REVERSE
04414 #define WEC_3DFRAME_TOP_INNER       WEC_3DBOX_DARK
04415 #define WEC_3DFRAME_RIGHT_OUTER     WEC_3DBOX_LIGHT
04416 #define WEC_3DFRAME_RIGHT_INNER     WEC_3DBOX_NORMAL
04417 #define WEC_3DFRAME_BOTTOM_OUTER    WEC_3DBOX_LIGHT
04418 #define WEC_3DFRAME_BOTTOM_INNER    WEC_3DBOX_NORMAL
04419 
04420 #define WEC_3DFRAME_LEFT            WEC_3DBOX_LIGHT
04421 #define WEC_3DFRAME_TOP             WEC_3DBOX_LIGHT
04422 #define WEC_3DFRAME_RIGHT           WEC_3DBOX_DARK
04423 #define WEC_3DFRAME_BOTTOM          WEC_3DBOX_DARK
04424 
04425 
04426 extern MG_EXPORT gal_pixel WinElementColors[];
04427 
04432 #define GetWindowElementColor(iItem)    (WinElementColors[iItem])
04433 
04508 MG_EXPORT gal_pixel GUIAPI GetWindowElementColorEx (HWND hwnd, Uint16 item);
04509 
04528 MG_EXPORT gal_pixel GUIAPI SetWindowElementColorEx (HWND hwnd, Uint16 item, 
04529                 gal_pixel new_value);
04530 
04538 #define SYSBMP_CAPBTNS              0
04539 #define SYSBMP_ARROWS               1
04540 #define SYSBMP_SCROLLBAR_HBG        2
04541 #define SYSBMP_SCROLLBAR_HSLIDER    3
04542 #define SYSBMP_SCROLLBAR_VBG        4
04543 #define SYSBMP_SCROLLBAR_VSLIDER    5
04544 
04545 #define SYSBMP_ITEM_NUMBER          6
04546 
04547 #if defined(_LITE_VERSION) && !defined(_STAND_ALONE)
04548 
04576 MG_EXPORT PBITMAP GUIAPI GetSystemBitmap (int id);
04577 #else
04578 extern MG_EXPORT BITMAP SystemBitmap[];
04579 #define GetSystemBitmap(iItem)      (SystemBitmap + iItem)
04580 #endif
04581 
04582 #define IDI_APPLICATION         0
04583 #define IDI_HAND                1
04584 #define IDI_STOP                IDI_HAND
04585 #define IDI_QUESTION            2
04586 #define IDI_EXCLAMATION         3
04587 #define IDI_ASTERISK            4
04588 #define IDI_INFORMATION         IDI_ASTERISK
04589 
04590 #define SYSICO_ITEM_NUMBER      5
04591 
04592 #if defined(_LITE_VERSION) && !defined(_STAND_ALONE)
04593 
04615 MG_EXPORT HICON GUIAPI GetLargeSystemIcon (int id);
04616 
04638 MG_EXPORT HICON GUIAPI GetSmallSystemIcon (int id);
04639 #else
04640 
04641 extern MG_EXPORT HICON LargeSystemIcon[];
04642 #define GetLargeSystemIcon(iItem)   (LargeSystemIcon[iItem])
04643 
04644 extern MG_EXPORT HICON SmallSystemIcon[];
04645 #define GetSmallSystemIcon(iItem)   (SmallSystemIcon[iItem])
04646 
04647 #endif
04648 
04649 #define STOCKBMP_CAPTION              "caption"
04650 #define STOCKBMP_BUTTON               "button"
04651 #define STOCKBMP_DOWNARROW            "downarrow"
04652 #define STOCKBMP_UPDOWNARROW          "updownarrow"
04653 #define STOCKBMP_LEFTRIGHTARROW       "leftrightarrow"
04654 #define STOCKBMP_CHECKMARK            "checkmark"
04655 #define STOCKBMP_TRACKBAR_HBG         "trackbar_hbg"
04656 #define STOCKBMP_TRACKBAR_HSLIDER     "trackbar_hslider"
04657 #define STOCKBMP_TRACKBAR_VBG         "trackbar_vbg"
04658 #define STOCKBMP_TRACKBAR_VSLIDER     "trackbar_vslider"
04659 #define STOCKBMP_SPINBOX_HORZ         "spinbox_horz"
04660 #define STOCKBMP_SPINBOX_VERT         "spinbox_vert"
04661 #define STOCKBMP_LVFOLD               "lvfold"
04662 #define STOCKBMP_LVUNFOLD             "lvunfold"
04663 
04664 #define STOCKBMP_IMECTRLBTN           "IMEctrlbtn"
04665 #define STOCKBMP_LOGO                 "logo"
04666 
04688 MG_EXPORT const BITMAP* GUIAPI GetStockBitmap (const char* name, 
04689                 int ckey_x, int ckey_y);
04690 
04711 MG_EXPORT BOOL GUIAPI LoadSystemBitmapEx (PBITMAP pBitmap, 
04712                 const char* szItemName, int ckey_x, int ckey_y);
04713 
04723 #define LoadSystemBitmap(pBitmap, szItemName) \
04724         LoadSystemBitmapEx (pBitmap, szItemName, -1, -1)
04725 
04726 #define SYSICON_FOLD                "fold"
04727 #define SYSICON_UNFOLD              "unfold"
04728 #define SYSICON_FT_DIR              "dir"
04729 #define SYSICON_FT_FILE             "file"
04730 
04744 MG_EXPORT HICON GUIAPI LoadSystemIcon (const char* szItemName, int which);
04745 
04753 #define SB_HORZ     1
04754 #define SB_VERT     2
04755 
04774 MG_EXPORT BOOL GUIAPI EnableScrollBar (HWND hWnd, int iSBar, BOOL bEnable);
04775 
04797 MG_EXPORT BOOL GUIAPI GetScrollPos (HWND hWnd, int iSBar, int* pPos);
04798 
04823 MG_EXPORT BOOL GUIAPI GetScrollRange (HWND hWnd, int iSBar, 
04824                 int* pMinPos, int* pMaxPos);
04825 
04848 MG_EXPORT BOOL GUIAPI SetScrollPos (HWND hWnd, int iSBar, int iNewPos);
04849 
04874 MG_EXPORT BOOL GUIAPI SetScrollRange (HWND hWnd, int iSBar, 
04875                 int iMinPos, int iMaxPos);
04876 
04896 MG_EXPORT BOOL GUIAPI ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow);
04897 
04898 #define SIF_RANGE           0x0001
04899 #define SIF_PAGE            0x0002
04900 #define SIF_POS             0x0004
04901 #define SIF_DISABLENOSCROLL 0x0008
04902 #define SIF_TRACKPOS        0x0010
04903 #define SIF_ALL             (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)
04904 
04908 typedef struct _SCROLLINFO
04909 {
04911     UINT    cbSize;
04924     UINT    fMask;
04926     int     nMin;
04928     int     nMax;
04930     UINT    nPage;
04932     int     nPos;
04933 #if 0
04934     int     nTrackPos;
04935 #endif
04936 } SCROLLINFO, *PSCROLLINFO;
04937 
04961 MG_EXPORT BOOL GUIAPI SetScrollInfo (HWND hWnd, int iSBar, 
04962                 const SCROLLINFO* lpsi, BOOL fRedraw);
04963 
04986 MG_EXPORT BOOL GUIAPI GetScrollInfo (HWND hWnd, int iSBar, PSCROLLINFO lpsi);
04987 
04995 /* Class styles -- not supported so far */
04996 #define CS_VREDRAW          0x0001
04997 #define CS_HREDRAW          0x0002
04998 #define CS_KEYCVTWINDOW     0x0004
04999 #define CS_DBLCLKS          0x0008
05000 
05001 #define CS_OWNDC            0x0020
05002 #define CS_CLASSDC          0x0040
05003 #define CS_PARENTDC         0x0080
05004 
05005 #define CS_NOKEYCVT         0x0100
05006 #define CS_NOCLOSE          0x0200
05007 #define CS_SAVEBITS         0x0800
05008 
05009 #define CS_BYTEALIGNCLIENT  0x1000
05010 #define CS_BYTEALIGNWINDOW  0x2000
05011 #define CS_GLOBALCLASS      0x4000
05012 #define CS_IME              0x8000
05013 
05014 #define COP_STYLE           0x0001
05015 #define COP_HCURSOR         0x0002
05016 #define COP_BKCOLOR         0x0004
05017 #define COP_WINPROC         0x0008
05018 #define COP_ADDDATA         0x0010
05019 
05023 typedef struct _WNDCLASS
05024 {
05026     char*   spClassName;
05027 
05029     DWORD   opMask;
05030 
05032     DWORD   dwStyle;
05033 
05035     DWORD   dwExStyle;
05036 
05038     HCURSOR hCursor;
05039 
05041     int     iBkColor;
05042 
05044     int     (*WinProc) (HWND, int, WPARAM, LPARAM);
05045 
05047     DWORD dwAddData;
05048 } WNDCLASS;
05049 typedef WNDCLASS* PWNDCLASS;
05050 
05051 #define MAINWINCLASSNAME    ("MAINWINDOW")
05052 #define ROOTWINCLASSNAME    ("ROOTWINDOW")
05053 
05072 MG_EXPORT BOOL GUIAPI RegisterWindowClass (PWNDCLASS pWndClass);
05073 
05087 MG_EXPORT BOOL GUIAPI UnregisterWindowClass (const char* szClassName);
05088 
05102 MG_EXPORT const char* GUIAPI GetClassName (HWND hWnd);
05103 
05119 MG_EXPORT BOOL GUIAPI GetWindowClassInfo (PWNDCLASS pWndClass);
05120 
05135 MG_EXPORT BOOL GUIAPI SetWindowClassInfo (const WNDCLASS* pWndClass);
05136 
05180 MG_EXPORT HWND GUIAPI CreateWindowEx (const char* spClassName, 
05181                 const char* spCaption, DWORD dwStyle, DWORD dwExStyle, 
05182                 int id, int x, int y, int w, int h, HWND hParentWnd, 
05183                 DWORD dwAddData);
05184 
05197 MG_EXPORT BOOL GUIAPI DestroyWindow (HWND hWnd);
05198 
05210 typedef void (* NOTIFPROC) (HWND hwnd, int id, int nc, DWORD add_data);
05211 
05238 MG_EXPORT NOTIFPROC GUIAPI SetNotificationCallback (HWND hwnd, 
05239                 NOTIFPROC notif_proc);
05240 
05254 MG_EXPORT NOTIFPROC GUIAPI GetNotificationCallback (HWND hwnd);
05255 
05262 #define CreateWindow(class_name, caption, style,        \
05263                 id, x, y, w, h, parent, add_data)       \
05264         CreateWindowEx(class_name, caption, style, 0,   \
05265                         id, x, y, w, h, parent, add_data)
05266 
05269 /******************************** Timer Support ******************************/
05305 MG_EXPORT BOOL GUIAPI SetTimer (HWND hWnd, int id, unsigned int speed);
05306 
05319 MG_EXPORT BOOL GUIAPI KillTimer (HWND hWnd, int id);
05320 
05334 MG_EXPORT BOOL GUIAPI ResetTimer (HWND hWnd, int id, unsigned int speed);
05335 
05346 MG_EXPORT unsigned int GUIAPI GetTickCount (void);
05347 
05362 MG_EXPORT BOOL GUIAPI IsTimerInstalled (HWND hWnd, int id);
05363 
05375 MG_EXPORT BOOL GUIAPI HaveFreeTimer (void);
05376 
05384 #ifdef _IME_GB2312
05385 
05402 int GBIMEWinProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam);
05403 
05404 #ifdef _LITE_VERSION
05405 
05430 MG_EXPORT HWND GBIMEWindowEx (HWND hosting, int lx, int ty, int rx, int by, 
05431                 BOOL two_lines);
05432 
05451 #define GBIMEWindow(hosting) GBIMEWindowEx(hosting, 0, 0, 0, 0, TRUE)
05452 
05453 #else
05454 
05455 MG_EXPORT HWND GBIMEWindow (HWND hosting);
05456 
05457 #endif
05458 #endif
05459 
05478 MG_EXPORT int GUIAPI RegisterIMEWindow (HWND hWnd);
05479 
05494 MG_EXPORT int GUIAPI UnregisterIMEWindow (HWND hWnd);
05495 
05518 MG_EXPORT int GUIAPI GetIMEStatus (int StatusCode);
05519 
05543 MG_EXPORT int GUIAPI SetIMEStatus (int StatusCode, int Value);
05544 
05563 MG_EXPORT HACCEL GUIAPI CopyAcceleratorTable (HACCEL hacc);
05564 
05578 MG_EXPORT int GUIAPI DeleteAccelerators (HACCEL hacc, int key, DWORD keymask);
05579 
05580 #define ACCEL_SHIFT     KS_SHIFT
05581 #define ACCEL_ALT       KS_ALT
05582 #define ACCEL_CTRL      KS_CTRL
05583 
05612 MG_EXPORT int GUIAPI AddAccelerators (HACCEL hacc, int key, 
05613                 DWORD keymask, WPARAM wParam, LPARAM lParam);
05614 
05629 MG_EXPORT int GUIAPI DestroyAcceleratorTable (HACCEL hacc);
05630 
05642 MG_EXPORT HACCEL GUIAPI CreateAcceleratorTable (HWND hWnd);
05643 
05655 MG_EXPORT int GUIAPI TranslateAccelerator (HACCEL hAccel, PMSG pMsg);
05656 
05682 MG_EXPORT BOOL GUIAPI CreateCaret (HWND hWnd, PBITMAP pBitmap, 
05683                 int nWidth, int nHeight);
05684 
05700 MG_EXPORT BOOL GUIAPI ChangeCaretSize (HWND hWnd, int newWidth, int newHeight);
05701 
05714 MG_EXPORT BOOL GUIAPI ActiveCaret (HWND hWnd);
05715 
05731 MG_EXPORT UINT GUIAPI GetCaretBlinkTime (HWND hWnd);
05732 
05749 MG_EXPORT BOOL GUIAPI SetCaretBlinkTime (HWND hWnd, UINT uTime);
05750 
05763 MG_EXPORT BOOL GUIAPI DestroyCaret (HWND hWnd);
05764 
05779 MG_EXPORT BOOL GUIAPI HideCaret (HWND hWnd);
05780 
05795 MG_EXPORT BOOL GUIAPI ShowCaret (HWND hWnd);
05796 
05813 MG_EXPORT BOOL GUIAPI SetCaretPos (HWND hWnd, int x, int y);
05814 
05829 MG_EXPORT BOOL GUIAPI GetCaretPos (HWND hWnd, PPOINT pPt);
05830 
05838 /* Menu flags */
05839 #define MF_INSERT           0x00000000L
05840 #define MF_CHANGE           0x00000080L
05841 #define MF_APPEND           0x00000100L
05842 #define MF_DELETE           0x00000200L
05843 #define MF_REMOVE           0x00001000L
05844 
05845 #define MF_BYCOMMAND        0x00000000L
05846 #define MF_BYPOSITION       0x00000400L
05847 
05848 #define MF_SEPARAT