File: Message.html

package info (click to toggle)
polyml 5.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 40,524 kB
  • sloc: cpp: 44,142; ansic: 26,963; sh: 22,002; asm: 13,486; makefile: 602; exp: 525; python: 253; awk: 91
file content (987 lines) | stat: -rw-r--r-- 41,331 bytes parent folder | download | duplicates (5)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<title>Windows Interface Reference: Message structure</title>
</head>

<body>

<h1>Message </h1>

<p>The Message structure contains the definition of the message datatype and functions to
send and receive messages.</p>

<pre>structure Message :
  sig
    datatype ControlType =
          ODT_BUTTON
        | ODT_COMBOBOX
        | ODT_LISTBOX
        | ODT_MENU
        | ODT_STATIC
    datatype ImageType =
          IMAGE_BITMAP
        | IMAGE_CURSOR
        | IMAGE_ENHMETAFILE
        | IMAGE_ICON

    type HGDIOBJ and HWND and HMENU and HICON and HINSTANCE and HDC
    and HFONT and HRGN and HDROP
    type RECT =  { left: int, top: int, right: int, bottom: int }
    type POINT = { x: int, y: int }

    datatype <a
href="#LRESULT">LRESULT</a> = LRESHANDLE of HGDIOBJ | LRESINT of int
    type KeyData
    datatype MDITileFlags = MDITILE_VERTICAL | MDITILE_HORIZONTAL | MDITILE_SKIPDISABLED
    type windowFlags and findReplaceFlags
    datatype ScrollDirection =
          SB_BOTTOM
        | SB_ENDSCROLL
        | SB_LEFT
        | SB_LINEDOWN
        | SB_LINELEFT
        | SB_LINERIGHT
        | SB_LINEUP
        | SB_PAGEDOWN
        | SB_PAGELEFT
        | SB_PAGERIGHT
        | SB_PAGEUP
        | SB_RIGHT
        | SB_THUMBPOSITION
        | SB_THUMBTRACK
        | SB_TOP
    type WindowPositionStyle
    datatype MouseKeyFlags = MK_LBUTTON | MK_RBUTTON | MK_SHIFT | MK_CONTROL | MK_MBUTTON
    type ClipboardFormat and ClassType 

    datatype MarginSettings = 
        UseFontInfo | Margins of {left: int option, right: int option }
    datatype
      SystemCommand =
          SC_ARRANGE
        | SC_CLOSE
        | SC_CONTEXTHELP
        | SC_DEFAULT
        | SC_HOTKEY
        | SC_HSCROLL
        | SC_KEYMENU
        | SC_MAXIMIZE
        | SC_MINIMIZE
        | SC_MONITORPOWER
        | SC_MOUSEMENU
        | SC_MOVE
        | SC_NEXTWINDOW
        | SC_PREVWINDOW
        | SC_RESTORE
        | SC_SCREENSAVE
        | SC_SEPARATOR
        | SC_SIZE
        | SC_TASKLIST
        | SC_VSCROLL
    datatype WMActivateOptions = WA_ACTIVE | WA_CLICKACTIVE | WA_INACTIVE

    datatype
      WMPrintOption =
          PRF_CHECKVISIBLE
        | PRF_CHILDREN
        | PRF_CLIENT
        | PRF_ERASEBKGND
        | PRF_NONCLIENT
        | PRF_OWNED

    datatype WMSizeOptions =
        SIZE_MAXHIDE | SIZE_MAXIMIZED | SIZE_MAXSHOW | SIZE_MINIMIZED | SIZE_RESTORED
    datatype HelpHandle = MenuHandle of HMENU | WindowHandle of HWND

    datatype Message     =
                    WM_ACTIVATE of {active : WMActivateOptions, minimize : bool }
                      (* Indicates a change in activation state *)

                    | WM_ACTIVATEAPP of {active  : bool, threadid: int  } 
                      (* Notifies applications when a new task activates *)

                    | WM_ASKCBFORMATNAME of { length: int, formatName : string ref}    
                      (* Retrieves the name of the clipboard format *)

                    | WM_CANCELJOURNAL    
                      (* Notifies application when user cancels journaling *)

                    | WM_CANCELMODE    
                      (* Notifies a Window to cancel internal modes *)

                    | WM_CHANGECBCHAIN of { removed : HWND, next : HWND  }    
                      (* Notifies clipboard viewer of removal from chain *)

                    | WM_CHAR of {charCode : char, data : KeyData }                       
                      (* Indicates the user pressed a character key *)

                    | WM_CHARTOITEM of {key : int, caretpos : int, listbox  : HWND  }
                      (* Provides list-box keystrokes to owner Window *)

                    | WM_CHILDACTIVATE    
                      (* Notifies a child Window of activation *)

                    | WM_CHOOSEFONT_GETLOGFONT of LOGFONT ref *)
                      (* Retrieves LOGFONT structure for Font dialog box *)

                    | WM_CLEAR
                      (* Clears an edit control *)

 <a
name="WM_CLOSE"></a>                   | WM_CLOSE       
                      (* System Close menu command was chosen *)

                    | <a
name="WM_COMMAND">WM_COMMAND</a> of {notifyCode : int,
                                  wId        : int,
                                  control    : HWND  }
                      (* Specifies a command message *)
                       
                    | WM_COMPACTING    of { compactratio : int }
                      (* Indicates a low memory condition *)

                    | WM_COMPAREITEM of {controlid : int,
                                           ctlType : ControlType,
                                           ctlID : int,
                                           hItem : HWND,
                                           itemID1 : int,
                                           itemData1 : int,
                                           itemID2 : int,
                                           itemData2 : int                                           
                                           }
                      (* Determines position of combo- or list-box item *)

                    | WM_COPY
                      (* Copies a selection to the clipboard *)

                    | WM_COPYDATA of { sender : HWND, data : int, pdata: Word8Vector.vector }
                      (* Passes data to another application  *)

                    | <a
name="WM_CREATE">WM_CREATE</a>    of { instance: HINSTANCE,
                                     creation: int,
                                     menu : HMENU,
                                     parent : HWND,
                                     cy : int,
                                     cx : int,
                                     y : int,
                                     x : int,
                                     style : windowFlags,
                                     name : string,
                                     (* The class may be a string or an atom. *)
                                     class : ClassType,
                                     extendedstyle : int                                                                          
                                     }
                      (* Indicates a Window is being created *)

                    | WM_CTLCOLORBTN of { displaycontext : HDC, button : HWND  }
                      (* Button is about to be drawn *)

                    | WM_CTLCOLORDLG of { displaycontext : HDC,
                                       dialogbox      : HWND  }
                      (* Dialog box is about to be drawn *)
                     
                    | WM_CTLCOLOREDIT of {  displaycontext : HDC, editcontrol : HWND  }
                      (* Control is about to be drawn *)

                    | WM_CTLCOLORLISTBOX of { displaycontext : HDC, listbox : HWND   }
                      (* List box is about to be drawn *)

                    | WM_CTLCOLORMSGBOX    of { displaycontext : HDC,
                                             messagebox     : HWND  }
                      (* Message box is about to be drawn *)

                    | WM_CTLCOLORSCROLLBAR of { displaycontext : HDC,
                                             scrollbar      : HWND  }
                      (* Indicates scroll bar is about to be drawn *)

                    | WM_CTLCOLORSTATIC    of { displaycontext : HDC,
                                             staticcontrol  : HWND  }
                      (* Control is about to be drawn *)
                      (* Note the return value is an HBRUSH *)

                    | WM_CUT
                      (* Deletes a selection and copies it to the clipboard *)

                    | WM_DEADCHAR of { charCode : char, data  : KeyData   }
                      (* Indicates the user pressed a dead key *)

                    | WM_DELETEITEM    of { controlid : int,
                                             ctlType : ControlType,
                                             ctlID : int,
                                             itemID : int,
                                             item : HWND,
                                             itemData : int                                         
                                           }
                      (* Indicates owner-draw item or control was altered *)

                    | <a
name="WM_DESTROY">WM_DESTROY</a>    
                      (* Indicates Window is about to be destroyed *)

                    | WM_DESTROYCLIPBOARD    
                      (* Notifies owner that the clipboard was emptied *)
                     
                    | WM_DEVMODECHANGE of { devicename : string }    
                      (* Indicates the device-mode settings have changed *)
                     
                    | WM_DRAWCLIPBOARD    
                      (* Indicates the clipboard's contents have changed *) 
                    
                    | WM_DRAWITEM of { controlid : int,
                                       ctlType : ControlType,
                                       ctlID : int,
                                       itemID : int,
                                       itemAction : int,
                                       itemState : int,
                                       hItem : HWND ,
                                       hDC : HDC,
                                       rcItem : RECT,
                                       itemData : int
                                        }    
                      (* Indicates owner-draw control/menu needs redrawing *) 
                     
                    | WM_DROPFILES of { hDrop : HDROP }    
                      (* Indicates that a file has been dropped *)
                    
                    | WM_ENABLE    of { enabled : bool }
                      (* Indicates a Window's enable state is changing *)
                    
                    | WM_ENDSESSION    of { endsession : bool }
                      (* Indicates whether the Windows session is ending *)
                    
                    | WM_ENTERIDLE of { flag : int, window : HWND }
                      (* Indicates a modal dialog box or menu is idle *)
                    
                    | WM_ENTERMENULOOP of { istrack: bool }
                      (* Indicates entry into menu modal loop *)
                    
                    | WM_EXITMENULOOP of { istrack: bool }
                      (* Indicates exit from menu modal loop *)
                    
                    | WM_ERASEBKGND    of { devicecontext : HDC }
                      (* Indicates a Window's background need erasing *)
                    
                    | WM_FONTCHANGE
                      (* Indicates a change in the font-resource pool *)
                     
                    | WM_GETDLGCODE
                      (* Allows dialog procedure to process control input *)
                    
                    | WM_GETFONT    
                      (* Retrieves the font that a control is using *)
                    
                    | WM_GETHOTKEY
                      (* Gets the virtual-key code of a Window's hot key *) 
                    
                    | WM_GETMINMAXINFO of { MaxSizex      : int,
                                            MaxSizey      : int,
                                            MaxPositionx  : int,
                                            MaxPositiony  : int,
                                            MinTrackSizex : int,
                                            MinTrackSizey : int,
                                            MaxTrackSizex : int,
                                            MaxTrackSizey : int                                            
                                             }
                      (* Gets minimum and maximum sizing information *)
                    
                    | WM_GETTEXT of { length: int, text : string ref  }    
                      (* Gets the text that corresponds to a Window *)
                    
                    | WM_GETTEXTLENGTH    
                      (* Gets length of text associated with a Window *)
                    
                    | WM_HOTKEY    of { id : int }
                      (* Hot key has been detected *)
                    
                    | WM_HSCROLL of { value    : ScrollDirection,
                                       position : int,
                                       scrollbar   : HWND  }    
                      (* Indicates a click in a horizontal scroll bar *)
                    
                    | WM_HSCROLLCLIPBOARD of { viewer   : HWND,
                                               code     : int,
                                               position : int  }    
                      (* Prompts owner to scroll clipboard contents *)
                    
                    | WM_ICONERASEBKGND    of { devicecontext : HDC }
                      (* Notifies minimized Window to fill icon background *)
                    
                    | WM_INITDIALOG    of { dialog   : HWND, initdata : int  }
                      (* Initializes a dialog box *)
                    
                    | WM_INITMENU of { menu : HMENU }    
                      (* Indicates a menu is about to become active *)
                    
                    | WM_INITMENUPOPUP of { menupopup  : HMENU,
                                            itemposition : int,
                                            isSystemMenu : bool  }
                      (* Indicates a pop-up menu is being created *)
                    
                    | WM_KEYDOWN of { virtualKey : int, data : KeyData  }    
                      (* Indicates a nonsystem key was pressed *)
                    
                    | WM_KEYUP of { virtualKey : int, data : KeyData  }    
                      (* Indicates a nonsystem key was released *)
                    
                    | WM_KILLFOCUS of { receivefocus : HWND }
                      (* Indicates the Window is losing keyboard focus *)
                    
                    | WM_LBUTTONDBLCLK of { keyflags : MouseKeyFlags list, x : int, y : int  }
                      (* Indicates double-click of left button *) 
                    
                    | WM_LBUTTONDOWN of { keyflags : MouseKeyFlags list, x : int, y : int  }
                      (* Indicates when left mouse button is pressed *)
                    
                    | WM_LBUTTONUP of { keyflags : MouseKeyFlags list, x : int, y : int  }
                      (* Indicates when left mouse button is released *)
                    
                    | WM_MBUTTONDBLCLK of { keyflags : MouseKeyFlags list, x : int, y : int  }
                      (* Indicates double-click of middle mouse button *)
                    
                    | WM_MBUTTONDOWN of { keyflags : MouseKeyFlags list, x : int, y : int  }
                      (* Indicates when middle mouse button is pressed *)
                    
                    | WM_MBUTTONUP of { keyflags : MouseKeyFlags list, x : int, y : int  }
                      (* Indicates when middle mouse button is released *)
                          
                    | WM_MDICASCADE of { skipDisabled : bool  }    
                      (* Arranges MDI child Windows in cascade format *)
                    
                    | WM_MDICREATE of { class : ClassType,
                                         title : string,
                                         instance: HINSTANCE,
                                         x : int,
                                         y : int,
                                         cx : int,
                                         cy : int,
                                         style : int,
                                         cdata : int }    
                      (* Prompts MDI client to create a child Window *) 
                    
                    | WM_MDIDESTROY of { child : HWND  }    
                      (* Closes an MDI child Window *) 
                    
                    | WM_MDIGETACTIVE
                      (* Retrieves data about the active MDI child Window *) 
                    
                    | WM_MDIICONARRANGE    
                      (* Arranges minimized MDI child Windows *) 
                    
                    | WM_MDIMAXIMIZE of {  child: HWND  }    
                      (* Maximizes an MDI child Window *) 
                    
                    | WM_MDINEXT of { child    : HWND, flagnext : bool  }
                      (* Activates the next MDI child Window *) 
                    
                    | WM_MDIREFRESHMENU
                      (* Refreshes an MDI frame Window's menu *) 
                     
                    | WM_MDIRESTORE    of {  child : HWND  }
                      (* Prompts MDI client to restore a child Window *) 
                    
                    | WM_MDISETMENU  of { frameMenu  : HMENU, windowMenu : HMENU  } 
                      (* Replaces an MDI frame Window's menu *) 
                    
                    | WM_MDITILE of { tilingflag : MDITileFlags list }
                      (* Arranges MDI child Windows in tiled format *) 
                    
                    | WM_MEASUREITEM of { controlid  : int,
                                          ctlType    : ControlType,
                                          ctlID      : int,
                                          itemID     : int,
                                          itemWidth  : int,
                                          itemHeight : int,
                                          itemData   : int
                                         }    
                      (* Requests dimensions of owner-draw control or item *)

                    | WM_MENUCHAR of { ch : char, menuflag : MenuBase.MenuFlag, menu : HMENU }    
                      (* Indicates an unknown menu mnemonic was pressed *)
                     
                    | WM_MENUSELECT    of { menuitem  : int,
                                         menuflags : MenuBase.MenuFlag list,
                                         menu      : HMENU  }
                      (* Indicates that the user selected a menu item *)
                    
                    | WM_MOUSEACTIVATE of { parent   : HWND,
                                            hitTest : int,
                                            message  : int  }    
                      (* Indicates a mouse click in an inactive Window *) 
                    
                    | WM_MOUSEMOVE of { keyflags : MouseKeyFlags list, x : int, y : int  }    
                      (* Indicates mouse-cursor movement *)
                    
                    | WM_MOVE of { x : int, y : int  }    
                      (* Indicates a Window's position has changed *)
                    
                    | WM_NCACTIVATE of { active : bool }
                      (* Changes the active state of nonclient area *)
                    
                    | WM_NCCALCSIZE    of { validarea     : bool,
                                             newrect       : RECT,
                                             oldrect       : RECT,
                                             oldclientarea : RECT,
                                             hwnd           : HWND,
                                             insertAfter   : HWND,
                                             x     : int,
                                             y     : int,
                                             cx    : int,
                                             cy    : int,
                                             style : WindowPositionStyle list
                                           }
                      (* Calculates the size of a Window's client area *)
                    
                    | WM_NCCREATE of { instance: HINSTANCE,
                                    creation: int,
                                       menu : HMENU,
                                       parent : HWND,
                                       cy : int,
                                       cx : int,
                                       y : int,
                                       x : int,
                                       style : windowFlags,
                                       name : string,
                                       class : ClassType,
                                       extendedstyle : int                      
                                      }    
                      (* Indicates a Window's nonclient area being created *)

                    | <a
name="WM_NCDESTROY">WM_NCDESTROY</a>    
                      (* Indicates Window's nonclient area being destroyed *)

                    | WM_NCHITTEST of { x : int, y : int  }    
                      (* Indicates mouse-cursor movement *)
                    
                    | WM_NCLBUTTONDBLCLK of { hitTest : int,
                                              x     : int,
                                              y     : int  }    
                      (* Indicates nonclient left button double-click *)
                     
                    | WM_NCLBUTTONDOWN    of { hitTest : int, x : int, y : int  }    
                      (* Indicates left button pressed in nonclient area *)
                    
                    | WM_NCLBUTTONUP of { hitTest : int, x : int, y : int  }    
                      (* Indicates left button released in nonclient area *)
                    
                    | WM_NCMBUTTONDBLCLK of { hitTest : int, x : int, y : int  }    
                      (* Indicates nonclient middle button double-click *)
                    
                    | WM_NCMBUTTONDOWN of { hitTest : int, x : int, y : int  }    
                      (* Indicates middle button pressed in nonclient area *)
                    
                    | WM_NCMBUTTONUP of { hitTest : int, x : int, y : int  }    
                      (* Indicates middle button released in nonclient area *)
                    
                    | WM_NCMOUSEMOVE of { hitTest : int, x : int, y : int  }    
                      (* Indicates mouse-cursor movement in nonclient area *)
                    
                    | WM_NCPAINT of { region : HRGN  }    
                      (* Indicates a Window's frame needs painting *)
                    
                    | WM_NCRBUTTONDBLCLK of { hitTest : int, x : int, y : int  }    
                      (* Indicates nonclient right button double-click *)
                    
                    | WM_NCRBUTTONDOWN of { hitTest : int, x : int, y : int  }    
                      (* Indicates right button pressed in nonclient area *)
                    
                    | WM_NCRBUTTONUP of { hitTest : int, x : int, y : int  }    
                      (* Indicates right button released in nonclient area *)
                    
                    | WM_NEXTDLGCTL    of { control    : int, handleflag : bool  } 
                      (* Sets focus to different dialog box control *) 
                    
                    | WM_PAINT    
                      (* Indicates a Window's client area need painting *)
                    
                    | WM_PAINTCLIPBOARD of { clipboard : HWND }
                      (* Prompts owner to display clipboard contents *)
                    
                    | WM_PAINTICON
                      (* Icon is about to be painted *) 

                    | WM_PALETTECHANGED of { palChg : HWND  }    
                      (* Indicates the focus-Window realized its palette *)
                    
                    | WM_PALETTEISCHANGING of { realize : HWND  }    
                      (* Informs Windows that palette is changing *) 
                    
                    | WM_PARENTNOTIFY of { eventflag : int, idchild   : int, value : int }    
                      (* Notifies parent of child-Window activity *) 
                    
                    | WM_PASTE    
                      (* Inserts clipboard data into an edit control *)
                    
                    | WM_POWER of { powerevent : int  }    
                      (* Indicates the system is entering suspended mode *)
                    
                    | WM_QUERYDRAGICON    
                      (* Requests a cursor handle for a minimized Window *)
                    
                    | WM_QUERYENDSESSION of { source : int  }
                      (* Requests that the Windows session be ended *) 
                    
                    | WM_QUERYNEWPALETTE
                      (* Allows a Window to realize its logical palette *) 
                    
                    | WM_QUERYOPEN
                      (* Requests that a minimized Window be restored *) 
                    
                    | WM_QUEUESYNC
                      (* Delimits CBT messages *) 
                    
                    | <a
name="WM_QUIT">WM_QUIT</a> of { exitcode : int  }    
                      (* Requests that an application be terminated *)
                    
                    | WM_RBUTTONDBLCLK of { keyflags : MouseKeyFlags list, x: int, y: int  }    
                      (* Indicates double-click of right mouse button *)
                    
                    | WM_RBUTTONDOWN of { keyflags : MouseKeyFlags list, x: int, y: int  }    
                      (* Indicates when right mouse button is pressed *)

                    | WM_RBUTTONUP of { keyflags : MouseKeyFlags list, x: int, y: int  }
                      (* Indicates when right mouse button is released *) 
                    
                    | WM_RENDERALLFORMATS    
                      (* Notifies owner to render all clipboard formats *) 
                    
                    | WM_RENDERFORMAT of { format : ClipboardFormat  }    
                      (* Notifies owner to render clipboard data *) 
                    
                    | WM_SETCURSOR of { cursorwindow : HWND, hitTest : int, mousemessage : int  }    
                      (* Prompts a Window to set the cursor shape *) 
                    
<a
name="WM_SETFOCUS"></a>                    | WM_SETFOCUS of { losing : HWND  }
                    
                    | WM_SETFONT of {font : HFONT, redrawflag : bool  }    
                    
                    | WM_SETHOTKEY of { virtualKey : int  }    
                    
                    | WM_SETREDRAW of { redrawflag : int  }
                    
                    | WM_SETTEXT of { text : string  }    
                    
                    | WM_SHOWWINDOW    of { showflag   : bool, statusflag : int  } 
                    
<a
name="WM_SIZE"></a>                    | WM_SIZE of { flag : WMSizeOptions, width : int, height : int  }    
                    
                    | WM_SIZECLIPBOARD of { viewer : HWND}
                    
                    | WM_SPOOLERSTATUS of { jobstatus : int, jobsleft  : int  }    
                    
                    | WM_SYSCHAR of { charCode : char, data : KeyData  }
                    
                    | WM_SYSCOLORCHANGE
                    
                    | WM_SYSCOMMAND of { commandvalue : SystemCommand, p: POINT }
                    
                    | WM_SYSDEADCHAR of { charCode : char, data : KeyData  }
                   
                    | WM_SYSKEYDOWN of { virtualKey : int, data : KeyData  }

                    | WM_SYSKEYUP of { virtualKey : int, data : KeyData  }
                    
                    | WM_TIMECHANGE    
                      (* Indicates the system time has been set *)
                    
                    | WM_TIMER of { timerid : int  }
                    
                    | WM_UNDO    
                     
                    | WM_USER of { uMsg: int, wParam: int, lParam: int }
                    | WM_APP of { uMsg: int, wParam: int, lParam: int }
                    | WM_REGISTERED of { uMsg: int, wParam: int, lParam: int }
                    
                    | WM_VKEYTOITEM    of { virtualKey : int,
                                         caretpos   : int,
                                         listbox    : HWND  }
                     
                    | WM_VSCROLL of { value     : ScrollDirection,
                                      position  : int,
                                      scrollbar : HWND  }

                    | WM_VSCROLLCLIPBOARD of { viewer   : HWND,
                                               code     : int,
                                               position : int  }
                    
                    | WM_WINDOWPOSCHANGED of { hwnd: HWND, front  : HWND,
                                               x   : int,
                                               y   : int,
                                               width  : int,
                                               height : int,
                                               flags  : WindowPositionStyle list }
                    
                    | WM_WINDOWPOSCHANGING of { hwnd: HWND, front  : HWND,
                                                x   : int,
                                                y   : int,
                                                width  : int,
                                                height : int,
                                                flags  : WindowPositionStyle list }    
                     
                    | WM_SETTINGCHANGE of { section_name : string  }    

                    | <a
name="WM_NOTIFY">WM_NOTIFY</a> of {from: HWND, idCtrl: int, idFrom : int, code: int }

                    | WM_CAPTURECHANGED of { newCapture: HWND }

                    | WM_ENTERSIZEMOVE

                    | WM_EXITSIZEMOVE

                    | WM_PRINT of {hdc: HDC, flags: WMPrintOption list }

                    | WM_PRINTCLIENT of {hdc: HDC, flags: WMPrintOption list }

                    | WM_HELP of { ctrlId: int, itemHandle: HelpHandle, contextId: int,
                                   mousePos: POINT }

                    | WM_GETICON of { big: bool }

                    | WM_SETICON of { big: bool, icon: HICON }

                    | WM_CONTEXTMENU of { hwnd: HWND, xPos: int, yPos: int }

                    | WM_DISPLAYCHANGE of { bitsPerPixel: int, xScreen: int, yScreen: int }

 <a
name="Edit"></a>                   | EM_CANUNDO

                    | EM_CHARFROMPOS of { point: POINT }

                    | EM_EMPTYUNDOBUFFER

                    | EM_FMTLINES of {addEOL: bool}

                    | EM_GETFIRSTVISIBLELINE

                    | EM_GETLIMITTEXT

                    | EM_GETLINE of { lineNo: int, size: int, result: string ref }

                    | EM_GETLINECOUNT

                    | EM_GETMARGINS

                    | EM_GETMODIFY

                    | EM_GETPASSWORDCHAR

                    | EM_GETRECT of {rect: RECT ref}

                    | EM_GETSEL of {startPos: int ref, endPos: int ref}

                    | EM_GETTHUMB

                    | EM_LIMITTEXT of {limit: int}

                    | EM_LINEFROMCHAR of {index: int}

                    | EM_LINEINDEX of {line: int}

                    | EM_LINELENGTH of {index: int}

                    | EM_LINESCROLL of {xScroll: int, yScroll: int}

                    | EM_POSFROMCHAR of {index: int}

                    | EM_REPLACESEL of {canUndo: bool, text: string}

                    | EM_SCROLL of {action: ScrollDirection}

                    | EM_SCROLLCARET

                    | EM_SETMARGINS of {margins: MarginSettings}

                    | EM_SETMODIFY of { modified: bool }

                    | EM_SETPASSWORDCHAR of { ch: char }

                    | EM_SETREADONLY of { readOnly: bool }

                    | EM_SETRECT of {rect: RECT}

                    | EM_SETRECTNP of {rect: RECT}

                    | EM_SETSEL of {startPos: int, endPos: int}

                    | EM_SETTABSTOPS of {tabs: int list}

                    | EM_UNDO

  <a
name="Button"></a>                  | BM_CLICK

                    | BM_GETCHECK

                    | BM_GETIMAGE of {imageType: ImageType}

                    | BM_GETSTATE

                    | BM_SETCHECK of {state: int}

                    | BM_SETIMAGE of {image: HGDIOBJ, imageType: ImageType}

                    | BM_SETSTATE of {highlight: bool }

                    | BM_SETSTYLE of {redraw: bool, style: windowFlags}

 <a
name="Combobox"></a>                   | CB_GETEDITSEL of {startPos: int ref, endPos: int ref}

                    | CB_LIMITTEXT of {limit: int}

                    | CB_SETEDITSEL of {startPos: int, endPos: int}

                    | CB_ADDSTRING of { text: string }

                    | CB_DELETESTRING of { index: int }

                    | CB_GETCOUNT

                    | CB_GETCURSEL

                    | CB_DIR of { attrs: ComboBase.CBDirAttr list, fileSpec: string }

                    | CB_GETLBTEXT of { index: int, length: int, text: string ref }

                    | CB_GETLBTEXTLEN of { index: int }

                    | CB_INSERTSTRING of { index: int, text: string }

                    | CB_RESETCONTENT

                    | CB_FINDSTRING of { indexStart: int, text: string }

                    | CB_SELECTSTRING of { indexStart: int, text: string }

                    | CB_SETCURSEL of { index: int }

                    | CB_SHOWDROPDOWN of { show: bool }

                    | CB_GETITEMDATA of { index: int }

                    | CB_SETITEMDATA of { index: int, data: int }

                    | CB_GETDROPPEDCONTROLRECT of { rect: RECT ref }

                    | CB_SETITEMHEIGHT of { index: int, height: int }

                    | CB_GETITEMHEIGHT of { index: int }

                    | CB_SETEXTENDEDUI of { extended: bool }

                    | CB_GETEXTENDEDUI

                    | CB_GETDROPPEDSTATE

                    | CB_FINDSTRINGEXACT of { indexStart: int, text: string }

                    | CB_SETLOCALE of { locale: int }

                    | CB_GETLOCALE

                    | CB_GETTOPINDEX

                    | CB_SETTOPINDEX of { index: int }

                    | CB_GETHORIZONTALEXTENT

                    | CB_SETHORIZONTALEXTENT of { extent: int }

                    | CB_GETDROPPEDWIDTH

                    | CB_SETDROPPEDWIDTH of { width: int }

                    | CB_INITSTORAGE of { items: int, bytes: int }

 <a
name="Listbox"></a>                   | LB_ADDSTRING of { text: string }

                    | LB_INSERTSTRING of { index: int, text: string }

                    | LB_DELETESTRING of { index: int }

                    | LB_SELITEMRANGEEX of { first: int, last: int }

                    | LB_RESETCONTENT

                    | LB_SETSEL of { select: bool, index: int }

                    | LB_SETCURSEL of { index: int }

                    | LB_GETSEL of { index: int }

                    | LB_GETCURSEL

                    | LB_GETTEXT of { index: int, length: int, text: string ref }

                    | LB_GETTEXTLEN of { index: int }

                    | LB_GETCOUNT

                    | LB_SELECTSTRING of { indexStart: int, text: string }

                    | LB_DIR of { attrs: ComboBase.CBDirAttr list, fileSpec: string }

                    | LB_GETTOPINDEX

                    | LB_FINDSTRING of { indexStart: int, text: string }

                    | LB_GETSELCOUNT

                    | LB_GETSELITEMS of { itemCount: int, items: int list ref }

                    | LB_SETTABSTOPS of { tabs: int list }

                    | LB_GETHORIZONTALEXTENT

                    | LB_SETHORIZONTALEXTENT of { extent: int }

                    | LB_SETCOLUMNWIDTH of { column: int }

                    | LB_ADDFILE of { fileName: string }

                    | LB_SETTOPINDEX of { index: int }

                    | LB_GETITEMRECT of { rect: RECT ref, index: int }

                    | LB_GETITEMDATA of { index: int }

                    | LB_SETITEMDATA of { index: int, data: int }

                    | LB_SELITEMRANGE of { select: bool, first: int, last: int }

                    | LB_SETANCHORINDEX of { index: int }

                    | LB_GETANCHORINDEX

                    | LB_SETCARETINDEX of { index: int, scroll: bool }

                    | LB_GETCARETINDEX

                    | LB_SETITEMHEIGHT of { index: int, height: int }

                    | LB_GETITEMHEIGHT of { index: int }

                    | LB_FINDSTRINGEXACT of { indexStart: int, text: string }

                    | LB_SETLOCALE of { locale: int } (* Should be an abstract type? *)

                    | LB_GETLOCALE (* Result will be the type used above. *)

                    | LB_SETCOUNT of { items: int }

                    | LB_INITSTORAGE of { items: int, bytes: int }

                    | LB_ITEMFROMPOINT of { point: POINT }

 <a
name="Static"></a>                   | STM_GETICON

                    | STM_GETIMAGE of {imageType: ImageType}

                    | STM_SETICON of {icon: HICON}

                    | STM_SETIMAGE of {image: HGDIOBJ, imageType: ImageType}

 <a
name="Scrollbar"></a>                   | SBM_SETPOS of { pos: int, redraw: bool }

                    | SBM_GETPOS

                    | SBM_SETRANGE of { minPos: int, maxPos: int }

                    | SBM_SETRANGEREDRAW of { minPos: int, maxPos: int }

                    | SBM_GETRANGE of { minPos: int ref, maxPos: int ref }

                    | SBM_ENABLE_ARROWS of ScrollBase.enableArrows

                    | SBM_SETSCROLLINFO of { info: ScrollBase.SCROLLINFO,
                                             options: ScrollBase.ScrollInfoOption list }

                    | SBM_GETSCROLLINFO of { info: ScrollBase.SCROLLINFO ref,
                                             options: ScrollBase.ScrollInfoOption list }

                    | <a
name="FINDMSGSTRING">FINDMSGSTRING</a> of
                        { flags: findReplaceFlags, findWhat: string, replaceWith: string }

                    | NULL


    type MSG = {
        msg: Message,
        hwnd: HWND,
        time: Time.time,
        pt: {x: int, y: int}
        }

    val GetInputState : unit -&gt; bool
    val GetMessage : HWND option * int * int -&gt; MSG
    val GetMessagePos : unit -&gt; POINT
    val GetMessageTime : unit -&gt; Time.time

    datatype
      QueueStatus =
          QS_ALLPOSTMESSAGE
        | QS_HOTKEY
        | QS_KEY
        | QS_MOUSEBUTTON
        | QS_MOUSEMOVE
        | QS_PAINT
        | QS_POSTMESSAGE
        | QS_SENDMESSAGE
        | QS_TIMER
    val QS_ALLEVENTS : QueueStatus list
    val QS_ALLINPUT : QueueStatus list
    val QS_INPUT : QueueStatus list
    val QS_MOUSE : QueueStatus list
    val GetQueueStatus : QueueStatus list -&gt; QueueStatus list

    val InSendMessage : unit -&gt; bool

    datatype PeekMessageOptions = PM_NOREMOVE | PM_REMOVE
    val PeekMessage : HWND option * int * int * PeekMessageOptions -&gt; MSG option
    val PostQuitMessage : int -&gt; unit
    val RegisterWindowMessage : string -&gt; int
    val <a
href="#RunApplication">RunApplication</a> : unit -&gt; int
    val <a href="#SendMessage">SendMessage</a> : HWND * Message -&gt; LRESULT
    val <a
href="#PostMessage">PostMessage</a> : HWND * Message -&gt; unit
    val HWND_BROADCAST: HWND
    val WaitMessage : unit -&gt; bool
  end</pre>

<p><tt>datatype <a name="LRESULT">LRESULT</a> = LRESHANDLE of HGDIOBJ | LRESINT of int </tt><br>
This type is used as the result of sending a message.&nbsp; Most messages return integers
but a few messages, such as STM_GETICON, return handles to objects.&nbsp; </p>

<p><a name="RunApplication"></a><tt>RunApplication(): int</tt><br>
<strong>ML-Extension</strong>: Processes and dispatches messages to the appropriate
windows.&nbsp; Returns when a WM_QUIT message is processed with the result passed in this
message.&nbsp; It also ensures that keyboard operations are correctly passed to modeless
dialogues by calling IsDialogMessage automatically.&nbsp; RunApplication should be used in
preference to GetMessage.&nbsp; </p>

<p><a name="SendMessage"></a><tt>SendMessage:(hw, msg): LRESULT</tt><br>
Sends a message to a window and returns the result returned by the window procedure.
&nbsp; If the message contains references which are updated by the window procedure the
updates will be made in the message before the function returns.</p>

<p><a name="PostMessage"></a><tt>PostMessage:(hw, msg)</tt>: unit<br>
Queues a message for a window but does not wait until the window procedure processes the
message before it returns.&nbsp; The message is copied to the queue so any updates made by
the window procedure will not affect references in the message.</p>

<p>&nbsp;</p>
</body>
</html>