forked from yisea123/minigui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
window.h
9938 lines (9018 loc) · 311 KB
/
window.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* \file window.h
* \author Wei Yongming <vincent@minigui.org>
* \date 2002/01/26
*
* \brief This file includes windowing interfaces of MiniGUI.
*
\verbatim
This file is part of MiniGUI, a mature cross-platform windowing
and Graphics User Interface (GUI) support system for embedded systems
and smart IoT devices.
Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
Copyright (C) 1998~2002, WEI Yongming
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Or,
As this program is a library, any link to this program must follow
GNU General Public License version 3 (GPLv3). If you cannot accept
GPLv3, you need to be licensed from FMSoft.
If you have got a commercial license of this program, please use it
under the terms and conditions of the commercial license.
For more information about the commercial license, please refer to
<http://www.minigui.com/en/about/licensing-policy/>.
\endverbatim
*/
/*
* $Id: window.h 13674 2010-12-06 06:45:01Z wanzheng $
*
* MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
* pSOS, ThreadX, NuCleus, OSE, and Win32.
*/
#ifndef _MGUI_WINDOW_H
#define _MGUI_WINDOW_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* \defgroup msgs Messages
* @{
*/
/* Definitions of common messages. */
#define MSG_NULLMSG 0x0000
#define MSG_SYNCMSG 0x0000
/**
* \defgroup mouse_msgs Mouse event messages
* @{
*/
/* Group 1 from 0x0001 to 0x000F, the mouse messages. */
#define MSG_FIRSTMOUSEMSG 0x0001
/**
* \def MSG_LBUTTONDOWN
* \brief Left mouse button down message.
*
* This message is posted to the window when the user presses down
* the left button of the mouse in the client area of the window.
*
* \code
* MSG_LBUTTONDOWN
* DWORD key_flags = (DWORD)wParam;
* int x_pos = LOSWORD (lParam);
* int y_pos = HISWORD (lParam);
* \endcode
*
* \param key_flags The shift key status when this message occurred.
* \param x_pos,y_pos The position of the mouse in client coordinates.
*
* \sa MSG_LBUTTONUP, key_defs
*
* Example:
* \include buttondown.c
*/
#define MSG_LBUTTONDOWN 0x0001
/**
* \def MSG_LBUTTONUP
* \brief Left mouse button up message.
*
* This message is posted to the window when the user releases up
* the left button of the mouse in the client area of the window.
*
* \code
* MSG_LBUTTONUP
* DWORD key_flags = (DWORD)wParam;
* int x_pos = LOSWORD (lParam);
* int y_pos = HISWORD (lParam);
* \endcode
*
* \param key_flags The shift key status when this message occurred.
* \param x_pos,y_pos The position of the mouse in client coordinates.
*
* \sa MSG_LBUTTONDOWN, key_defs
*/
#define MSG_LBUTTONUP 0x0002
/**
* \def MSG_LBUTTONDBLCLK
* \brief Left mouse button double clicked message.
*
* This message is posted to the window when the user double clicks
* the left button of the mouse in the client area of the window.
*
* \code
* MSG_LBUTTONDBLCLK
* DWORD key_flags = (DWORD)wParam;
* int x_pos = LOSWORD (lParam);
* int y_pos = HISWORD (lParam);
* \endcode
*
* \param key_flags The shift key status when this message occurred.
* \param x_pos,y_pos The position of the mouse in client coordinates.
*
* \sa MSG_RBUTTONDBLCLK, key_defs
*/
#define MSG_LBUTTONDBLCLK 0x0003
/**
* \def MSG_MOUSEMOVE
* \brief The mouse moved message.
*
* This message is posted to the window when the user moves the mouse
* in the client area of the window.
*
* \code
* MSG_MOUSEMOVE
* DWORD key_flags = (DWORD)wParam;
* int x_pos = LOSWORD (lParam);
* int y_pos = HISWORD (lParam);
* \endcode
*
* \param key_flags The shift key status when this message occurred.
* \param x_pos,y_pos The position of the mouse in client coordinates.
*
* \sa key_defs
*/
#define MSG_MOUSEMOVE 0x0004
/**
* \def MSG_RBUTTONDOWN
* \brief Right mouse button down message.
*
* This message is posted to the window when the user presses down
* the right button of the mouse in the client area of the window.
*
* \code
* MSG_RBUTTONDOWN
* DWORD key_flags = (DWORD)wParam;
* int x_pos = LOSWORD (lParam);
* int y_pos = HISWORD (lParam);
* \endcode
*
* \param key_flags The shift key status when this message occurred.
* \param x_pos,y_pos The position of the mouse in client coordinates.
*
* \sa MSG_RBUTTONUP, key_defs
*
* Example:
* \include buttondown.c
*/
#define MSG_RBUTTONDOWN 0x0005
/**
* \def MSG_RBUTTONUP
* \brief Right mouse button up message.
*
* This message is posted to the window when the user releases up
* the right button of the mouse in the client area of the window.
*
* \code
* MSG_RBUTTONUP
* DWORD key_flags = (DWORD)wParam;
* int x_pos = LOSWORD (lParam);
* int y_pos = HISWORD (lParam);
* \endcode
*
* \param key_flags The shift key status when this message occurred.
* \param x_pos,y_pos The position of the mouse in client coordinates.
*
* \sa MSG_RBUTTONDOWN, key_defs
*/
#define MSG_RBUTTONUP 0x0006
/**
* \def MSG_RBUTTONDBLCLK
* \brief Right mouse button double clicked message.
*
* This message is posted to the window when the user double clicks
* the right button of the mouse in the client area of the window.
*
* \code
* MSG_RBUTTONDBLCLK
* DWORD key_flags = (DWORD)wParam;
* int x_pos = LOSWORD (lParam);
* int y_pos = HISWORD (lParam);
* \endcode
*
* \param key_flags The shift key status when this message occurred.
* \param x_pos,y_pos The position of the mouse in client coordinates.
*
* \sa MSG_LBUTTONDBLCLK, key_defs
*/
#define MSG_RBUTTONDBLCLK 0x0007
#define MSG_NCMOUSEOFF 0x0007
/**
* \def MSG_NCLBUTTONDOWN
* \brief Left mouse button down message in the non-client area.
*
* This message is posted to the window when the user presses down
* the left button of the mouse in the non-client area of the window.
*
* \code
* MSG_NCLBUTTONDOWN
* int hit_code = (int)wParam;
* int x_pos = LOSWORD (lParam);
* int y_pos = HISWORD (lParam);
* \endcode
*
* \param hit_code The hit test code which tells the area of the mouse.
* \param x_pos,y_pos The position of the mouse in window coordinates.
*
* \sa MSG_NCLBUTTONUP, MSG_NCHITTEST
*/
#define MSG_NCLBUTTONDOWN 0x0008
/**
* \def MSG_NCLBUTTONUP
* \brief Left mouse button up message in the non-client area.
*
* This message is posted to the window when the user releases up
* the left button of the mouse in the non-client area of the window.
*
* \code
* MSG_NCLBUTTONUP
* int hit_code = (int)wParam;
* int x_pos = LOSWORD (lParam);
* int y_pos = HISWORD (lParam);
* \endcode
*
* \param hit_code The hit test code which tells the area of the mouse.
* \param x_pos,y_pos The position of the mouse in window coordinates.
*
* \sa MSG_NCLBUTTONDOWN, MSG_NCHITTEST
*/
#define MSG_NCLBUTTONUP 0x0009
/**
* \def MSG_NCLBUTTONDBLCLK
* \brief Left mouse button double clicked in the non-client area.
*
* This message is posted to the window when the user double clicks
* the left button of the mouse in the non-client area of the window.
*
* \code
* MSG_NCLBUTTONDBLCLK
* int hit_code = (int)wParam;
* int x_pos = LOSWORD (lParam);
* int y_pos = HISWORD (lParam);
* \endcode
*
* \param hit_code The hit test code which tells the area of the mouse.
* \param x_pos,y_pos The position of the mouse in window coordinates.
*
* \sa MSG_NCRBUTTONDBLCLK, MSG_NCHITTEST
*/
#define MSG_NCLBUTTONDBLCLK 0x000A
/**
* \def MSG_NCMOUSEMOVE
* \brief Mouse moves in the non-client area.
*
* This message is posted to the window when the user moves the mouse
* in the non-client area of the window.
*
* \code
* MSG_NCMOUSEMOVE
* int hit_code = (int)wParam;
* int x_pos = LOSWORD (lParam);
* int y_pos = HISWORD (lParam);
* \endcode
*
* \param hit_code The hit test code which tells the area of the mouse.
* \param x_pos,y_pos The position of the mouse in window coordinates.
*
* \sa MSG_NCHITTEST
*/
#define MSG_NCMOUSEMOVE 0x000B
/**
* \def MSG_NCRBUTTONDOWN
* \brief Right mouse button down message in the non-client area.
*
* This message is posted to the window when the user presses down
* the right button of the mouse in the non-client area of the window.
*
* \code
* MSG_NCRBUTTONDOWN
* int hit_code = (int)wParam;
* int x_pos = LOSWORD (lParam);
* int y_pos = HISWORD (lParam);
* \endcode
*
* \param hit_code The hit test code which tells the area of the mouse.
* \param x_pos,y_pos The position of the mouse in window coordinates.
*
* \sa MSG_NCRBUTTONUP, MSG_NCHITTEST
*/
#define MSG_NCRBUTTONDOWN 0x000C
/**
* \def MSG_NCRBUTTONUP
* \brief Right mouse button up message in the non-client area.
*
* This message is posted to the window when the user releases up
* the right button of the mouse in the non-client area of the window.
*
* \code
* MSG_NCRBUTTONUP
* int hit_code = (int)wParam;
* int x_pos = LOSWORD (lParam);
* int y_pos = HISWORD (lParam);
* \endcode
*
* \param hit_code The hit test code which tells the area of the mouse.
* \param x_pos,y_pos The position of the mouse in window coordinates.
*
* \sa MSG_NCRBUTTONDOWN, MSG_NCHITTEST
*/
#define MSG_NCRBUTTONUP 0x000D
/**
* \def MSG_NCRBUTTONDBLCLK
* \brief Right mouse button double clicked in the non-client area.
*
* This message is posted to the window when the user double clicks
* the right button of the mouse in the non-client area of the window.
*
* \code
* MSG_NCRBUTTONDBLCLK
* int hit_code = (int)wParam;
* int x_pos = LOSWORD (lParam);
* int y_pos = HISWORD (lParam);
* \endcode
*
* \param hit_code The hit test code which tells the area of the mouse.
* \param x_pos,y_pos The position of the mouse in window coordinates.
*
* \sa MSG_NCLBUTTONDBLCLK, MSG_NCHITTEST
*/
#define MSG_NCRBUTTONDBLCLK 0x000E
#define MSG_LASTMOUSEMSG 0x000F
/** @} end of mouse_msgs */
/**
* \defgroup key_msgs Key event messages
* @{
*/
/* Group 2 from 0x0010 to 0x001F, the key messages. */
#define MSG_FIRSTKEYMSG 0x0010
/**
* \def MSG_KEYDOWN
* \brief User presses a key down.
*
* This message is posted to the current active window when the user
* presses a key down.
*
* \code
* MSG_KEYDOWN
* int scancode = (int)wParam;
* DWORD key_flags = (DWORD)lParam;
* \endcode
*
* \param scancode The scan code of the pressed key.
* \param key_flags The shift key status when this message occurred.
*
* \sa MSG_KEYUP, key_defs
*
* Example:
*
* \include keydown.c
*/
#define MSG_KEYDOWN 0x0010
/**
* \def MSG_CHAR
* \brief A character translated from MSG_KEYDOWN message.
*
* This message is translated from a MSG_KEYDOWN message by \a TranslateMessage
* and sent to the current active window.
*
* \code
* MSG_CHAR
* unsigned char ch_buff [4];
* unsigned char ch_buff [0] = FIRSTBYTE(wParam);
* unsigned char ch_buff [1] = SECONDBYTE(wParam);
* unsigned char ch_buff [2] = THIRDBYTE(wParam);
* unsigned char ch_buff [3] = FOURTHBYTE(wParam);
* DWORD key_flags = (DWORD)lParam;
* \endcode
*
* \param ch_buff The buffer to store the bytes of the character.
* \param key_flags The shift key status when this message occurred.
*
* \note Please use \a FIRSTBYTE ~ \a FOURTHBYTE to get the bytes
* if the character is a multi-byte character. Use MSG_UTF8CHAR
* to handle the characters encoded in UTF-8.
*
* \sa MSG_SYSCHAR, TranslateMessage, key_defs
*/
#define MSG_CHAR 0x0011
/**
* \def MSG_KEYUP
* \brief User releases up a key.
*
* This message is posted to the current active window when the user
* releases up a key.
*
* \code
* MSG_KEYUP
* int scancode = (int)wParam;
* DWORD key_flags = (DWORD)lParam;
* \endcode
*
* \param scancode The scan code of the released key.
* \param key_flags The shift key status when this message occurred.
*
* \sa MSG_KEYDOWN, key_defs
*/
#define MSG_KEYUP 0x0012
/**
* \def MSG_SYSKEYDOWN
* \brief User presses down a key when \<Alt\> key is down.
*
* This message is posted to the current active window when the user
* presses down a key as \<Alt\> key is down.
*
* \code
* MSG_SYSKEYDOWN
* int scancode = (int)wParam;
* DWORD key_flags = (DWORD)lParam;
* \endcode
*
* \param scancode The scan code of the pressed key.
* \param key_flags The shift key status when this message occurred.
*
* \sa MSG_SYSKEYUP, MSG_SYSCHAR, key_defs
*/
#define MSG_SYSKEYDOWN 0x0013
/**
* \def MSG_SYSCHAR
* \brief A system character translated from MSG_SYSKEYDOWN message.
*
* This message is translated from a MSG_SYSKEYDOWN message by
* \a TranslateMessage and sent to the current active window.
*
* \code
* MSG_SYSCHAR
* int ch = (int)wParam;
* DWORD key_flags = (DWORD)lParam;
* \endcode
*
* \param ch The ASCII code of the pressed key.
* \param key_flags The shift key status when this message occurred.
*
* \sa MSG_CHAR, TranslateMessage, key_defs
*/
#define MSG_SYSCHAR 0x0014
/**
* \def MSG_SYSKEYUP
* \brief User releases up a key when \<Alt\> key is down.
*
* This message is posted to the current active window when the user
* releases up a key as \<Alt\> key is down.
*
* \code
* MSG_SYSKEYUP
* int scancode = (int)wParam;
* DWORD key_flags = (DWORD)lParam;
* \endcode
*
* \param scancode The scan code of the released key.
* \param key_flags The shift key status when this message occurred.
*
* \sa MSG_SYSKEYDOWN, key_defs
*/
#define MSG_SYSKEYUP 0x0015
/* keyboard longpress supported */
/**
* \def MSG_KEYLONGPRESS
* \brief A key is long pressed.
*
* This message is sent when a key is pressed exceed user-defined long
* time value.
*/
#define MSG_KEYLONGPRESS 0x0016
/**
* \def MSG_KEYALWAYSPRESS
* \brief A key is always pressed.
*
* This message is sent when a key is pressed to exceed user-defined
* always time value.
*/
#define MSG_KEYALWAYSPRESS 0x0017
/**
* \def MSG_KEYSYM
* \brief A key symbol translated from MSG_KEYDOWN messages.
*
* This message is translated from a MSG_KEYDOWN message by
* \a TranslateMessage and sent to the current active window.
*
* Note that one translation may generate a key symbol made by more than one
* character, e.g., when using default keymap, DEL key will generate the
* key symbol "^[[3~".
*
* \code
* MSG_KEYSYM
* int index = HIBYTE (wParam);
* int keysym = LOBYTE (wParam);
* DWORD key_flags = (DWORD)lParam;
* \endcode
*
* \param index The index of the key symbol in one translation,
* zero for a new translation, and the \a keysym is the first symbol.
* \param keysym The code of the key symbol.
* \param key_flags The shift key status when this message occurred.
*
* \sa MSG_SYSCHAR, TranslateMessage, key_defs
*/
#define MSG_KEYSYM 0x0018
/**
* \def MSG_UTF8CHAR
* \brief A character translated from MSG_KEYDOWN message.
*
* This message generally sent by a IME window to the current active window.
* The chararcter will be encoded in UTF-8.
*
* \code
* MSG_UTF8CHAR
* unsigned char ch_utf8 [6];
* unsigned char ch_utf8 [0] = FIRSTBYTE(wParam);
* unsigned char ch_utf8 [1] = SECONDBYTE(wParam);
* unsigned char ch_utf8 [2] = THIRDBYTE(wParam);
* unsigned char ch_utf8 [3] = FOURTHBYTE(wParam);
* unsigned char ch_utf8 [4] = FIRSTBYTE(lParam);
* unsigned char ch_utf8 [5] = SECONDBYTE(lParam);
* \endcode
*
* \param ch_utf8 The buffer to save the character in UTF-8.
*
* \sa MSG_CHAR, key_defs
*/
#define MSG_UTF8CHAR 0x0019
#define MSG_KEYUP_LONG 0x001A
#define MSG_MAINWIN_KEYDOWN 0x001B
#define MSG_MAINWIN_KEYUP 0x001C
#define MSG_MAINWIN_KEYLONGPRESS 0x001D
#define MSG_MAINWIN_KEYALWAYSPRESS 0x001E
#define MSG_MAINWIN_KEYUP_LONG 0x001F
/**
* \def DEF_LPRESS_TIME
* \brief Default long pressed time of a key.
*
* \sa MSG_KEYLONGPRESS
*/
#define DEF_LPRESS_TIME 500
/**
* \def DEF_APRESS_TIME
* \brief Default always pressed time of a key.
*
* \sa MSG_KEYALWAYSPRESS
*/
#define DEF_APRESS_TIME 1000
/**
* \def DEF_INTERVAL_TIME
* \brief Default send MSG_KEYLONGPRESS in interval value.
*
*/
#define DEF_INTERVAL_TIME 200
extern DWORD __mg_key_longpress_time;
extern DWORD __mg_key_alwayspress_time;
extern DWORD __mg_interval_time;
/**
* \def SetKeyLongPressTime(time)
* \brief User set default long pressed time of a key.
*/
#define SetKeyLongPressTime(time) \
do { \
__mg_key_longpress_time = time; \
} while (0)
/**
* \def SetKeyAlwaysPressTime(time)
* \brief User set default always pressed time of a key.
*/
#define SetKeyAlwaysPressTime(time) \
do { \
__mg_key_alwayspress_time = time; \
} while (0)
/**
* \def SetIntervalTime(time)
* \brief User set default interval time that MSG_KEYLONGPRESS is sent.
*/
#define SetIntervalTime(time) \
do { \
__mg_interval_time = time; \
} while (0)
#define MSG_LASTKEYMSG 0x001F
/** @} end of key_msgs */
/**
* \defgroup post_event_msgs User-machine Interaction messages
* @{
*/
/* Group 3 from 0x0020 to 0x005F, User-machine Interaction messages. */
#define MSG_FIRSTPOSTMSG 0x0020
/**
* \def MSG_SETCURSOR
* \brief Sets cursor shape in the client area.
*
* This message is posted to the window under the cursor when the user moves
* the mouse in order to give the chance to change the cursor shape.
* The default handler set the cursor shape to the default cursor of the window.
* If you set a new cursor shape, your message handler should return
* immediately.
*
* \code
* MSG_SETCURSOR
* int cx = LOSWORD (lParam);
* int cy = HISWORD (lParam);
* \endcode
*
* \param cx,cy The client coordinates of the cursor.
*
* Example:
*
* \include setcursor.c
*
* \sa MSG_NCSETCURSOR
*/
#define MSG_SETCURSOR 0x0020
#define HT_MASK 0xFF
#define HT_UNKNOWN 0x00
#define HT_OUT 0x01
#define HT_MENUBAR 0x02
#define HT_TRANSPARENT 0x03
#define HT_BORDER 0x04
#define HT_CLIENT 0x0C
#define HT_NEEDCAPTURE 0x10
#define HT_ICON 0x14
#define HT_CLOSEBUTTON 0x15
#define HT_MAXBUTTON 0x16
#define HT_MINBUTTON 0x17
#define HT_HSCROLL 0x18
#define HT_VSCROLL 0x19
#define HT_DRAGGABLE 0x20
#define HT_CAPTION 0x20
/*indicate cursor at border */
#define HT_BORDER_MASK 0x28
#define HT_BORDER_TOP 0x28
#define HT_BORDER_BOTTOM 0x29
#define HT_BORDER_LEFT 0x2A
#define HT_BORDER_RIGHT 0x2B
/*indicate cursor at border corner*/
#define HT_CORNER_MASK 0x2C
#define HT_CORNER_TL 0x2C
#define HT_CORNER_TR 0x2D
#define HT_CORNER_BL 0x2E
#define HT_CORNER_BR 0x2F
/*new scrollbar hittest value
* can be AND'ed with HT_NEEDCAPTURE*/
#define HT_SB_MASK 0x50
#define HT_SB_LEFTARROW 0x50
#define HT_SB_RIGHTARROW 0x51
#define HT_SB_LEFTSPACE 0x52
#define HT_SB_RIGHTSPACE 0x53
#define HT_SB_HTHUMB 0x54
#define HT_SB_VMASK 0x58
#define HT_SB_UPARROW 0x58
#define HT_SB_DOWNARROW 0x59
#define HT_SB_UPSPACE 0x5a
#define HT_SB_DOWNSPACE 0x5b
#define HT_SB_VTHUMB 0x5c
#define HT_SB_UNKNOWN 0x5f
/*user defined hittest code are 0x80 ~ 0x8F*/
#define HT_USER_MASK 0x80
/**
* \def MSG_NCHITTEST
* \brief Hit test in non-client area.
* This is an async message.
*/
#define MSG_NCHITTEST 0x0021
/**
* \def MSG_HITTEST
* \brief Hit test in non-client area.
*
* \sa MSG_NCHITTEST
*/
#define MSG_HITTEST MSG_NCHITTEST
/**
* \def MSG_CHANGESIZE
* \brief Change window size.
*/
#define MSG_CHANGESIZE 0x0022
/* reserved */
#define MSG_QUERYNCRECT 0x0023
/**
* \def MSG_QUERYCLIENTAREA
* \brief Query client area.
*/
#define MSG_QUERYCLIENTAREA 0x0024
/**
* \def MSG_SIZECHANGING
* \brief Indicates the size of the window is being changed.
*
* This message is sent to the window when the size is being changed.
* If you want to control the actual position and size of the window when
* the size is being changed (this may be caused by \a MoveWindow or
* other functions), you should handle this message, and return the actual
* position and size of the window through the second parameter.
*
* \code
* MSG_SIZECHANGING
* const RECT* rcExpect = (const RECT*)wParam;
* RECT* rcResult = (RECT*)lParam;
* \endcode
*
* \param rcExpect The expected size of the window after changing.
* \param rcResult The actual size of the window after changing.
*
* Example:
*
* \include msg_sizechanging.c
*/
#define MSG_SIZECHANGING 0x0025
/**
* \def MSG_SIZECHANGED
* \brief Indicates the size of the window has been changed.
*
* This message is sent to the window when the size has been changed.
* If you want adjust the size of the client area of the window,
* you should handle this message, change the values of the client area,
* and return non-zero value to indicate that the client area has been
* modified.
*
* \code
* MSG_SIZECHANGED
* RECT* rcClient = (RECT*)lParam;
* \endcode
*
* \param rcClient The pointer to a RECT structure which contains
* the new client area.
*
* Example:
*
* \include msg_sizechanged.c
*/
#define MSG_SIZECHANGED 0x0026
/**
* \def MSG_CSIZECHANGED
* \brief Indicates the size of the client area of the window has been changed.
*
* This message is sent as a notification to the window when the size of
* the client area has been changed.
*
* \code
* MSG_CSIZECHANGED
* int client_width = (int)wParam;
* int client_height = (int)lParam;
* \endcode
*
* \param client_width The width of the client area.
* \param client_height The height of the client area.
*/
#define MSG_CSIZECHANGED 0x0027
/**
* \def MSG_SETFOCUS
* \brief Indicates that the window has gained the input focus.
*
* \param lparam The parameter passed into used for pass setfocus
* msg to child control if lparam > 0.
*
* This message is sent to the window procedure
* after the window gains the input focus.
*/
#define MSG_SETFOCUS 0x0030
/**
* \def MSG_KILLFOCUS
* \brief Indicates that the window has lost the input focus.
*
* \param lparam The parameter passed into used for pass killfocus
* msg to child control if lparam > 0.
*
* This message is sent to the window procedure
* after the window losts the input focus.
*/
#define MSG_KILLFOCUS 0x0031
/**
* \def MSG_MOUSEACTIVE
* \brief Indicates that the window has gained the input focus because
* the user clicked the window.
*
* This message is sent to the window procedure
* after the user clicked the window and it has gained the input focus.
*/
#define MSG_MOUSEACTIVE 0x0032
/**
* \def MSG_ACTIVE
* \brief Indicates that the window has gained the input focus because
* the user clicked the window.
*
* This message is sent to the window procedure
* after the user clicked the window and it has gained the input focus.
*/
#define MSG_ACTIVE 0x0033
/**
* \def MSG_CHILDHIDDEN
* \brief Hide child window.
*/
#define MSG_CHILDHIDDEN 0x0034
#define RCTM_CLICK 1
#define RCTM_KEY 2
#define RCTM_MESSAGE 3
#define RCTM_SHOWCTRL 4
/**
* \def MSG_ACTIVEMENU
* \brief Indicates that the user activates the menu bar and tracks it.
*
* This message is sent to the window procedure when the user
* activates the menu bar and tracks it.
*
* If you want to change the states of menu items in the submenu
* before displaying it, you can handle this message.
*
* \code
* MSG_ACTIVEMENU
* int pos = (int)wParam;
* HMENU submenu = (HMENU)lParam;
* \endcode
*
* \param pos The position of the activated submenu. The position value of the
* first submenu is 0.
* \param submenu The handle to the activated submenu.
*
* Example:
*
* \include activemenu.c
*/
#define MSG_ACTIVEMENU 0x0040
/**
* \def MSG_DEACTIVEMENU
* \brief Indicates the end of the tracking of a menu bar or a popup menu.
*
* This message is sent to the window procedure when the user has
* closed the tracking menu bar or popup menu.
*
* \code
* MSG_DEACTIVEMENU
* HMENU menubar = (HMENU)wParam;
* HMENU submenu = (HMENU)lParam;
* \endcode
*
* \param menubar The handle to the menu bar. It will be zero when the
* deactivated menu is a popup menu.
* \param submenu The handle to the submenu.
*/
#define MSG_DEACTIVEMENU 0x0041
/* Scroll bar notifying code */
/**
* \defgroup ctrl_scrollbar_ncs Notification codes of srollbar control
* @{
*/
/**
* \def SB_LINEUP
* \brief The SB_LINEUP notification message is sent when the user clicked
* the up arrow on the bar.
*/
#define SB_LINEUP 0x01a
/**
* \def SB_LINEDOWN
* \brief The SB_LINEDOWN notification message is sent when the user clicked
* the down arrow on the bar.
*/
#define SB_LINEDOWN 0x02
/**
* \def SB_LINELEFT
* \brief The SB_LINELEFT notification message is sent when the user clicked
* the left arrow on the bar.
*/
#define SB_LINELEFT 0x03
/**
* \def SB_LINERIGHT
* \brief The SB_LINERIGHT notification message is sent when the user clicked
* the right arrow on the bar.
*/
#define SB_LINERIGHT 0x04
/**
* \def SB_PAGEUP
* \brief The SB_PAGEUP notification message is sent when the user clicked
* the page up area on the bar.
*/
#define SB_PAGEUP 0x05
/**
* \def SB_PAGEDOWN
* \brief The SB_PAGEDOWN notification message is sent when the user clicked
* the page down area on the bar.
*/
#define SB_PAGEDOWN 0x06
/**
* \def SB_PAGELEFT
* \brief The SB_PAGELEFT notification message is sent when the user clicked
* the page left area on the bar.
*/