apiw-sys 0.1.0

This crate provides core API bindings for Windows according to ECMA-234.
Documentation
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
#![deny(unused_imports, missing_docs)]

//! Application Programming Interface for Windows (APIW) is a functional
//! specification of the Microsoft Windows application programming interface,
//! published as ECMA-234 in 1995.
//!
//! This crate tries its best to faithfully provided the original interface
//! defined within the specification, the implementation is based on the awesome
//! `windows-sys` crate provided by Microsoft for the Rust community. It is well
//! known that some of the functions has been deleted after the specification is
//! published over the years, sometimes replaced by something else (usually with
//! similiar namings!), so we also included those functions within this crate
//! too.
//!
//! Also, for the completeness of the EMF representable graphics subsystem
//! operations, we expanded the API surface of `graphics_subsystem` feature to
//! also include those operations added since then. EMF stands for Enhanced
//! Metafile Format, an EMF metafile is a sequence of variable-length records
//! that contain drawing commands, object definitions, and graphics properties
//! to render a graphical image on any output device. Thus those drawing
//! commands are provided as the major part of the `graphics_subsystem`. See the
//! \[MS-EMF\] document supplied as part of the Microsoft Open Specifications
//! collection for more details about it.

#[macro_use]
mod macros;

/// Section 2 - Windows Subsystem (6-167)
#[cfg(any(
    feature = "windows-subsystem-basic",
    feature = "windows-subsystem",
    feature = "graphics-subsystem"
))]
pub mod windows_subsystem;

/// Section 3 - Graphics Subsystem (168-304)
#[cfg(any(feature = "graphics-subsystem-basic", feature = "graphics-subsystem"))]
pub mod graphics_subsystem;

/// Section 4 - System Services (305-402)
#[cfg(feature = "system-services")]
pub mod system_services;

/// Section 5 - Application Support Functions (403-444)
#[cfg(feature = "application-support-functions")]
pub mod application_support_functions;

#[cfg(any(
    feature = "extension-compression",
    feature = "extension-control-panel",
    feature = "extension-dde",
    feature = "extension-debugging",
    feature = "extension-drag-and-drop",
    feature = "extension-driver",
    feature = "extension-edit-control",
    feature = "extension-file-io",
    feature = "extension-font",
    feature = "extension-hook-callback",
    feature = "extension-networking",
    feature = "extension-shell",
    feature = "extension-version"
))]
/// Annex B - Unsupported Windows Functions (provided here as extensions)
pub mod extensions {
    #![allow(missing_docs)]
    #[cfg(feature = "extension-compression")]
    pub mod compression;
    #[cfg(feature = "extension-control-panel")]
    pub mod control_panel;
    #[cfg(feature = "extension-dde")]
    pub mod dde;
    #[cfg(feature = "extension-debugging")]
    pub mod debugging;
    #[cfg(feature = "extension-drag-and-drop")]
    pub mod drag_and_drop;
    #[cfg(feature = "extension-driver")]
    pub mod driver;
    #[cfg(feature = "extension-edit-control")]
    pub mod edit_control;
    #[cfg(feature = "extension-file-io")]
    pub mod file_io;
    removed_item!(
        pub mod file_manager {
            pub use storefs::UndeleteFile;
            use windows_sys::Win32::Storage::FileSystem as storefs;
        }
    );
    #[cfg(feature = "extension-font")]
    pub mod font;
    removed_item!(
        pub mod hardware {
            pub use kbdmse::EnableHardwareInput;
            use windows_sys::Win32::UI::Input::KeyboardAndMouse as kbdmse;
        }
    );
    #[cfg(feature = "extension-hook-callback")]
    pub mod hook_callback;
    removed_item!(
        pub mod memory_management {
            use windows_sys::Win32::System::Memory as sysmem;

            pub use sysmem::GetSelectorBase;
            pub use sysmem::GetSelectorLimit;
            pub use sysmem::GlobalDosAlloc;
            pub use sysmem::GlobalDosFree;
            pub use sysmem::LimitEmsPages;
            pub use sysmem::LockSegment;
            pub use sysmem::SetSelectorBase;
            pub use sysmem::SetSelectorLimit;
            pub use sysmem::SetSwapAreaSize;
            pub use sysmem::SwitchStackBack;
            pub use sysmem::SwitchStackTo;
            pub use sysmem::UnlockSegment;
            pub use sysmem::hmemcopy;
        }
    );
    removed_item!(
        pub mod module_management {
            use windows_sys::Win32::System::Memory as sysmem;

            pub use sysmem::GetCodeHandle;
        }
    );
    removed_item!(
        pub mod message {
            use windows_sys::Win32::UI::WindowsAndMessaging as winmsg;

            pub use winmsg::hardware_event;
        }
    );
    #[cfg(feature = "extension-networking")]
    pub mod networking;
    removed_item!(
        pub mod ole {
            use windows_sys::Win32::System::Ole as ole;

            pub use ole::OleActivate;
            pub use ole::OleBlockServer;
            pub use ole::OleClone;
            pub use ole::OleClose;
            pub use ole::OleCopyFromLink;
            pub use ole::OleCopyToClipboard;
            pub use ole::OleCreate;
            pub use ole::OleCreateFromClip;
            pub use ole::OleCreateFromFile;
            pub use ole::OleCreateFromTemplate;
            pub use ole::OleCreateInvisible;
            pub use ole::OleCreateLinkFromClip;
            pub use ole::OleCreateLinkFromFile;
            pub use ole::OleDelete;
            pub use ole::OleDraw;
            pub use ole::OleEnumFormats;
            pub use ole::OleEnumObjects;
            pub use ole::OleEqual;
            pub use ole::OleExecute;
            pub use ole::OleGetData;
            pub use ole::OleGetLinkUpdateOptions;
            pub use ole::OleIsDcMeta;
            pub use ole::OleLoadFromStream;
            pub use ole::OleLockServer;
            pub use ole::OleObjectConvert;
            pub use ole::OleQueryBounds;
            pub use ole::OleQueryClientVersion;
            pub use ole::OleQueryCreateFromClip;
            pub use ole::OleQueryLinkFromClip;
            pub use ole::OleQueryName;
            pub use ole::OleQueryOpen;
            pub use ole::OleQueryOutOfDate;
            pub use ole::OleQueryProtocol;
            pub use ole::OleQueryReleaseError;
            pub use ole::OleQueryReleaseMethod;
            pub use ole::OleQueryReleaseStatus;
            pub use ole::OleQueryServerVersion;
            pub use ole::OleQuerySize;
            pub use ole::OleQueryType;
            pub use ole::OleReconnect;
            pub use ole::OleRegisterClientDoc;
            pub use ole::OleRegisterServer;
            pub use ole::OleRegisterServerDoc;
            pub use ole::OleRelease;
            pub use ole::OleRename;
            pub use ole::OleRenameClientDoc;
            pub use ole::OleRenameServerDoc;
            pub use ole::OleRequestData;
            pub use ole::OleRevertClientDoc;
            pub use ole::OleRevertServerDoc;
            pub use ole::OleRevokeClientDoc;
            pub use ole::OleRevokeObject;
            pub use ole::OleRevokeServer;
            pub use ole::OleRevokeServerDoc;
            pub use ole::OleSaveToStream;
            pub use ole::OleSavedClientDoc;
            pub use ole::OleSavedServerDoc;
            pub use ole::OleSetBounds;
            pub use ole::OleSetColorScheme;
            pub use ole::OleSetData;
            pub use ole::OleSetHostNames;
            pub use ole::OleSetLinkUpdateOptions;
            pub use ole::OleSetTargetDevice;
            pub use ole::OleUnblockServer;
            pub use ole::OleUnlockServer;
            pub use ole::OleUpdate;
            pub use ole::Open;
        }
    );
    removed_item!(
        pub mod profiler {
            pub use diagdbg::ProfClear;
            pub use diagdbg::ProfFinish;
            pub use diagdbg::ProfFlush;
            pub use diagdbg::ProfInsChk;
            pub use diagdbg::ProfSampRate;
            pub use diagdbg::ProfSetup;
            pub use diagdbg::ProfStart;
            pub use diagdbg::ProfStop;
            use windows_sys::Win32::System::Diagnostics::Debug as diagdbg;
        }
    );
    removed_item!(
        pub mod program_manager {
            use windows_sys::Win32::System::WindowsProgramming as winprg;
            pub use winprg::FMExtensionProc;
        }
    );
    removed_item!(
        pub mod process_management {
            pub use diagdbg::GetCurrentPDB;
            use windows_sys::Win32::System::Diagnostics::Debug as diagdbg;
        }
    );
    removed_item!(
        pub mod resource_manager {
            pub use libloader::AccessResource;
            use windows_sys::Win32::System::LibraryLoader as libloader;
        }
    );
    removed_item!(
        pub mod segment {
            pub use sysmem::AllocDStoCSAlias;
            pub use sysmem::AllocSelector;
            pub use sysmem::FreeSelector;
            pub use sysmem::GetCodeInfo;
            pub use sysmem::GlobalPageLock;
            pub use sysmem::GlobalPageUnlock;
            pub use sysmem::PrestoChangoSelector;
            use windows_sys::Win32::System::Memory as sysmem;
        }
    );
    #[cfg(feature = "extension-shell")]
    pub mod shell;
    removed_item!(
        pub mod stress {
            use windows_sys::Win32::System::WindowsProgramming as winprg;
            pub use winprg::AllocDiskSpace;
            pub use winprg::AllocFileHandles;
            pub use winprg::AllocGDIMem;
            pub use winprg::AllocMem;
            pub use winprg::AllocUserMem;
            pub use winprg::FreeAllGDIMem;
            pub use winprg::FreeAllMem;
            pub use winprg::FreeAllUserMem;
            pub use winprg::GetFreeFileHandles;
            pub use winprg::UnAllocDiskSpace;
            pub use winprg::UnAllocFileHandles;
        }
    );
    removed_item!(
        pub mod system_services {
            use windows_sys::Win32::System::WindowsProgramming as winprg;
            pub use winprg::DOS3Call;
            pub use winprg::GetDOSEnvironment;
            pub use winprg::NetBIOSCall;
            pub use winprg::WaitEvent;
        }
    );
    removed_item!(
        pub mod toolhelp {
            use windows_sys::Win32::System::Diagnostics::Debug as diagdbg;

            pub use diagdbg::ClassFirst;
            pub use diagdbg::ClassNext;
            pub use diagdbg::GlobalEntryHandle;
            pub use diagdbg::GlobalEntryModule;
            pub use diagdbg::GlobalFirst;
            pub use diagdbg::GlobalHandleToSel;
            pub use diagdbg::GlobalInfo;
            pub use diagdbg::GlobalNext;
            pub use diagdbg::InterruptRegister;
            pub use diagdbg::InterruptUnRegister;
            pub use diagdbg::LocalFirst;
            pub use diagdbg::LocalInfo;
            pub use diagdbg::LocalNext;
            pub use diagdbg::MemManInfo;
            pub use diagdbg::MemoryRead;
            pub use diagdbg::MemoryWrite;
            pub use diagdbg::ModuleFindHandle;
            pub use diagdbg::ModuleFindName;
            pub use diagdbg::ModuleFirst;
            pub use diagdbg::ModuleNext;
            pub use diagdbg::NotifyRegister;
            pub use diagdbg::NotifyUnregister;
            pub use diagdbg::StackTraceCSIPFirst;
            pub use diagdbg::StackTraceFirst;
            pub use diagdbg::StackTraceNext;
            pub use diagdbg::SystemHeapInfo;
            pub use diagdbg::TaskFindHandle;
            pub use diagdbg::TaskFirst;
            pub use diagdbg::TaskGetCSIP;
            pub use diagdbg::TaskNext;
            pub use diagdbg::TaskSetCSIP;
            pub use diagdbg::TaskSwitch;
            pub use diagdbg::TerminateApp;
            pub use diagdbg::TimerCount;
        }
    );
    #[cfg(feature = "extension-version")]
    pub mod version;
    removed_item!(
        pub mod winmem32 {
            use windows_sys::Win32::System::Memory as sysmem;

            pub use sysmem::GetWinMem32Version;
            pub use sysmem::Global16PointerAlloc;
            pub use sysmem::Global16PointerFree;
            pub use sysmem::Global32Alloc;
            pub use sysmem::Global32CodeAlias;
            pub use sysmem::Global32CodeAliasFree;
            pub use sysmem::Global32Free;
            pub use sysmem::Global32Realloc;
        }
    );
}

/// Annex C - Data Structures
#[cfg(any(
    feature = "windows-subsystem-basic",
    feature = "graphics-subsystem-basic",
    feature = "system-services",
    feature = "application-support-functions"
))]
pub mod all_data_structures {
    #![allow(unused_doc_comments)]

    #[cfg(feature = "graphics-subsystem-basic")]
    use windows_sys::Win32::Graphics::Gdi as gdi;

    #[cfg(feature = "graphics-subsystem-basic")]
    #[doc(inline)]
    pub use crate::graphics_subsystem::BITMAP;

    /// `C.2` BITMAPCOREHEADER
    ///
    /// contains information about a device-independent bitmap's (DIB)
    /// dimensions and color format
    #[cfg(feature = "graphics-subsystem-basic")]
    pub use gdi::BITMAPCOREHEADER;

    /// `C.3` BITMAPCOREINFO
    ///
    /// contains information about a device-independent bitmap's (DIB)
    /// dimensions, color format, and colors used in the bitmap
    #[cfg(feature = "graphics-subsystem-basic")]
    pub use gdi::BITMAPCOREINFO;

    #[cfg(feature = "graphics-subsystem-basic")]
    #[doc(inline)]
    pub use crate::graphics_subsystem::BITMAPINFOHEADER;

    #[cfg(feature = "graphics-subsystem-basic")]
    #[doc(inline)]
    pub use crate::graphics_subsystem::BITMAPINFO;

    #[cfg(feature = "application-support-functions-dialog-color")]
    #[doc(inline)]
    pub use crate::application_support_functions::CHOOSECOLOR;

    #[cfg(feature = "application-support-functions-dialog-font")]
    #[doc(inline)]
    pub use crate::application_support_functions::CHOOSEFONT;

    /// `C.8` CLASSENTRY
    ///
    /// contains the handle to the owner and name of a class
    removed_item!(
        pub use crate::extensions::toolhelp::CLASSENTRY;
    );

    #[cfg(feature = "windows-subsystem-mdi")]
    #[doc(inline)]
    pub use crate::windows_subsystem::CLIENTCREATESTRUCT;

    #[cfg(all(
        feature = "windows-subsystem-message",
        any(
            feature = "windows-subsystem-control-combobox",
            feature = "windows-subsystem-control-listbox"
        )
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::COMPAREITEMSTRUCT;

    #[cfg(feature = "windows-subsystem-basic")]
    #[doc(inline)]
    pub use crate::windows_subsystem::CREATESTRUCT;

    #[cfg(all(
        feature = "windows-subsystem-message",
        any(
            feature = "windows-subsystem-control-combobox",
            feature = "windows-subsystem-control-listbox"
        )
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::DELETEITEMSTRUCT;

    #[cfg(feature = "windows-subsystem-message")]
    #[doc(inline)]
    pub use crate::windows_subsystem::DRAWITEMSTRUCT;

    #[cfg(feature = "application-support-functions-dialog-findreplace")]
    #[doc(inline)]
    pub use crate::application_support_functions::FINDREPLACE;

    #[cfg(feature = "system-services-winhelp")]
    #[doc(inline)]
    pub use crate::system_services::HELPWININFO;

    #[cfg(feature = "graphics-subsystem-basic")]
    #[doc(inline)]
    pub use crate::graphics_subsystem::LOGBRUSH;

    #[cfg(feature = "graphics-subsystem-basic")]
    #[doc(inline)]
    pub use crate::graphics_subsystem::LOGFONT;

    #[cfg(feature = "graphics-subsystem-basic")]
    #[doc(inline)]
    pub use crate::graphics_subsystem::LOGPALETTE;

    #[cfg(feature = "graphics-subsystem-basic")]
    #[doc(inline)]
    pub use crate::graphics_subsystem::LOGPEN;

    #[cfg(feature = "windows-subsystem-mdi")]
    #[doc(inline)]
    pub use crate::windows_subsystem::MDICREATESTRUCT;

    #[cfg(feature = "windows-subsystem-message")]
    #[doc(inline)]
    pub use crate::windows_subsystem::MEASUREITEMSTRUCT;

    #[cfg(feature = "system-services-resource")]
    #[doc(inline)]
    pub use crate::system_services::MENUITEMTEMPLATE;

    #[cfg(feature = "system-services-resource")]
    #[doc(inline)]
    pub use crate::system_services::MENUITEMTEMPLATEHEADER;

    #[cfg(feature = "windows-subsystem-message")]
    #[doc(inline)]
    pub use crate::windows_subsystem::MINMAXINFO;

    #[cfg(feature = "windows-subsystem-message")]
    #[doc(inline)]
    pub use crate::windows_subsystem::MSG;

    #[cfg(feature = "graphics-subsystem-basic")]
    #[doc(inline)]
    pub use crate::graphics_subsystem::NEWTEXTMETRIC;

    #[cfg(feature = "system-services-fileop-deprecated")]
    #[doc(inline)]
    pub use crate::system_services::OFSTRUCT;

    #[cfg(feature = "application-support-functions-dialog-filename")]
    #[doc(inline)]
    pub use crate::application_support_functions::OPENFILENAME;

    #[cfg(feature = "windows-subsystem-paint")]
    #[doc(inline)]
    pub use crate::windows_subsystem::PAINTSTRUCT;

    #[cfg(feature = "graphics-subsystem-basic")]
    #[doc(inline)]
    pub use crate::graphics_subsystem::PALETTEENTRY;

    #[cfg(feature = "graphics-subsystem-basic")]
    #[doc(inline)]
    pub use crate::graphics_subsystem::POINT;

    #[cfg(feature = "application-support-functions-dialog-print")]
    #[doc(inline)]
    pub use crate::application_support_functions::PRINTDLG;

    #[cfg(feature = "graphics-subsystem-basic")]
    #[doc(inline)]
    pub use crate::graphics_subsystem::RECT;

    #[cfg(feature = "graphics-subsystem-basic")]
    #[doc(inline)]
    pub use crate::graphics_subsystem::RGBQUAD;

    #[cfg(feature = "graphics-subsystem-basic")]
    #[doc(inline)]
    pub use crate::graphics_subsystem::RGBTRIPLE;

    #[cfg(feature = "graphics-subsystem-basic")]
    #[doc(inline)]
    pub use crate::graphics_subsystem::SIZE;

    #[cfg(feature = "graphics-subsystem-basic")]
    #[doc(inline)]
    pub use crate::graphics_subsystem::TEXTMETRIC;

    #[cfg(feature = "windows-subsystem-placement")]
    #[doc(inline)]
    pub use crate::windows_subsystem::WINDOWPLACEMENT;

    #[cfg(feature = "windows-subsystem-placement")]
    #[doc(inline)]
    pub use crate::windows_subsystem::WINDOWPOS;

    #[cfg(feature = "windows-subsystem-basic")]
    #[doc(inline)]
    pub use crate::windows_subsystem::WNDCLASS;
}

/// Annex D - Window Messages
#[cfg(feature = "windows-subsystem")]
pub mod all_messages {
    // Window messages for button (D.1 - D.5)
    #[cfg(all(
        feature = "windows-subsystem-message",
        feature = "windows-subsystem-control-button"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::window_messages_for_button::*;

    // Window messages for combo box (D.6 - D.30)
    #[cfg(all(
        feature = "windows-subsystem-message",
        feature = "windows-subsystem-control-combobox"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::window_messages_for_combobox::*;

    // Window messages for dialog box (D.31 - D.32)
    #[cfg(all(
        feature = "windows-subsystem-message",
        feature = "windows-subsystem-dialogbox"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::window_messages_for_dialogbox::*;

    // Window messages for edit (D.33 - D.60)
    #[cfg(all(
        feature = "windows-subsystem-message",
        feature = "windows-subsystem-control-edit"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::window_messages_for_edit::*;

    // Window messages for combo box (D.61 - D.91)
    #[cfg(all(
        feature = "windows-subsystem-message",
        feature = "windows-subsystem-control-listbox"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::window_messages_for_listbox::*;

    // Window messages for static (D.92 - D.93)
    #[cfg(all(
        feature = "windows-subsystem-message",
        feature = "windows-subsystem-control-static"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::window_messages_for_static::*;

    // General window messages (D.94 - D.217)
    #[cfg(feature = "windows-subsystem-message")]
    #[doc(inline)]
    pub use crate::windows_subsystem::general_window_messages::*;
}

/// Annex E - Control Notifications
#[cfg(feature = "windows-subsystem")]
pub mod all_control_notifications {
    // Control notifications for button (E.1 - E.6)
    #[cfg(all(
        feature = "windows-subsystem-message",
        feature = "windows-subsystem-control-button"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::control_notifications_for_button::*;

    // Control notifications for combo box (E.7 - E.17)
    #[cfg(all(
        feature = "windows-subsystem-message",
        feature = "windows-subsystem-control-combobox"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::control_notifications_for_combobox::*;

    // Control notifications for edit (E.18 - E.25)
    #[cfg(all(
        feature = "windows-subsystem-message",
        feature = "windows-subsystem-control-edit"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::control_notifications_for_edit::*;

    // Control notifications for list box (E.26 - E.31)
    #[cfg(all(
        feature = "windows-subsystem-message",
        feature = "windows-subsystem-control-listbox"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::control_notifications_for_listbox::*;
}

/// Annex F - Window Styles
#[cfg(feature = "windows-subsystem")]
pub mod all_window_styles {
    // General window styles (F.1)
    #[cfg(feature = "windows-subsystem-basic")]
    #[doc(inline)]
    pub use crate::windows_subsystem::general_window_styles::*;

    // Button styles (F.2)
    #[cfg(all(
        feature = "windows-subsystem-basic",
        feature = "windows-subsystem-control-button"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::window_styles_for_button::*;

    // Combo box styles (F.3)
    #[cfg(all(
        feature = "windows-subsystem-basic",
        feature = "windows-subsystem-control-combobox"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::window_styles_for_combobox::*;

    // Edit control styles (F.4)
    #[cfg(all(
        feature = "windows-subsystem-basic",
        feature = "windows-subsystem-control-edit"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::window_styles_for_edit::*;

    // List box styles (F.5)
    #[cfg(all(
        feature = "windows-subsystem-basic",
        feature = "windows-subsystem-control-listbox"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::window_styles_for_listbox::*;

    // Scroll bar styles (F.6)
    #[cfg(all(
        feature = "windows-subsystem-basic",
        feature = "windows-subsystem-control-scrollbar"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::window_styles_for_scrollbar::*;

    // Static control styles (F.7)
    #[cfg(all(
        feature = "windows-subsystem-basic",
        feature = "windows-subsystem-control-static"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::window_styles_for_static::*;

    // Dialog box styles (F.8)
    #[cfg(all(
        feature = "windows-subsystem-basic",
        feature = "windows-subsystem-dialogbox"
    ))]
    #[doc(inline)]
    pub use crate::windows_subsystem::window_styles_for_dialogbox::*;
}

/// Annex G - Macros (experimental)
#[cfg(feature = "macros")]
pub mod all_macros {
    #![allow(unused_doc_comments)]

    /// `G.1` DECLARE_HANDLE
    ///
    /// define a data type that has the name specified in the parameter
    #[macro_export]
    macro_rules! DECLARE_HANDLE {
        ($v:vis $n:ident) => {
            $v type $n = *mut $crate::deps::core::ffi::c_void;
        };
    }

    /// `G.2` DECLARE_HANDLE32
    ///
    /// define a data type that has the name specified in the parameter
    removed_item!(
        #[macro_export]
        macro_rules! DECLARE_HANDLE32 {
            ($v:vis $n:ident) => {
                $v type $n = *mut $crate::deps::core::ffi::c_void;
            };
        }
    );

    /// `G.3` FIELDOFFSET
    ///
    /// retrieves the address offset of an element that is inside of a structure
    #[macro_export]
    macro_rules! FIELDOFFSET {
        ($structure:ty, $element:ident $(,)?) => {
            $crate::deps::core::mem::offset_of!($structure, $element)
        };
    }

    /// `G.4` GetBValue
    ///
    /// returns a value that represents the intensity of blue color in a
    /// red-green-blue (RGB) value
    #[macro_export]
    macro_rules! GetBValue {
        ($e:expr) => {
            u32::to_be_bytes($e)[1]
        };
    }

    /// `G.5` GetGValue
    ///
    /// returns a value that represents the intensity of green color in a
    /// red-green-blue (RGB) value
    #[macro_export]
    macro_rules! GetGValue {
        ($e:expr) => {
            u32::to_be_bytes($e)[2]
        };
    }

    /// `G.6` GetRValue
    ///
    /// returns a value that represents the intensity of red color in a
    /// red-green-blue (RGB) value
    #[macro_export]
    macro_rules! GetRValue {
        ($e:expr) => {
            u32::to_be_bytes($e)[3]
        };
    }

    /// `G.7` HIBYTE
    ///
    /// returns the value of the hi-order byte of a WORD value
    #[macro_export]
    macro_rules! HIBYTE {
        ($e:expr) => {
            u16::to_be_bytes($e)[0]
        };
    }

    /// `G.8` HIWORD
    ///
    /// returns the value of the high-order WORD of a DWORD value
    #[macro_export]
    macro_rules! HIWORD {
        ($e:expr) => {
            (u32::from($e) >> 16) as u16
        };
    }

    /// `G.9` LOBYTE
    ///
    /// returns the value of the low-order byte of a WORD value
    #[macro_export]
    macro_rules! LOBYTE {
        ($e:expr) => {
            u16::to_be_bytes($e)[1]
        };
    }

    /// `G.10` LockData
    ///
    /// locks the current data segment in memory and returns a handle to it
    removed_item!(
        macro_rules! LockData {}
    );

    /// `G.11` LOWORD
    ///
    /// returns the value of the low-order WORD of a DWORD value
    #[macro_export]
    macro_rules! LOWORD {
        ($e:expr) => {
            (u32::from($e) >> 0) as u16
        };
    }

    /// `G.12` MAKEINTATOM
    ///
    /// creates an integer atom from a given WORD value
    #[macro_export]
    macro_rules! MAKEINTATOM {
        ($e:expr) => {
            (u16::from($e)) as usize as $crate::deps::windows_sys::core::PCWSTR
        };
    }

    /// `G.13` MAKEINTRESOURCE
    ///
    /// processed a resource’s identifier and returns it in a form that will be
    /// understood by the API’s resource-management functions
    #[macro_export]
    macro_rules! MAKEINTRESOURCE {
        ($e:expr) => {
            (u16::from($e)) as usize as $crate::deps::windows_sys::core::PCWSTR
        };
    }

    /// `G.14` MAKELONG
    ///
    /// returns a DWORD value with the specified high-order and low-order WORD
    /// values
    #[macro_export]
    macro_rules! MAKELONG {
        ($loword:expr, $hiword:expr $(,)?) => {
            ((u16::from($loword)) as u32 + (((u16::from($hiword)) as u32) << 16 << 16))
        };
    }

    /// `G.15` MAKELP
    ///
    /// returns a pointer to the memory address specified by a specified segment
    /// selector and an address offset
    removed_item!(
        macro_rules! MAKELP {}
    );

    /// `G.16` MAKELPARAM
    ///
    /// returns a value of type LPARAM with the specified high-order and
    /// low-order WORD values
    #[macro_export]
    macro_rules! MAKELPARAM {
        ($loword:expr, $hiword:expr $(,)?) => {
            ((u16::from($loword)) as u32 + (((u16::from($hiword)) as u32) << 16 << 16))
                as $crate::deps::windows_sys::Win32::Foundation::LPARAM
        };
    }

    /// `G.17` MAKELRESULT
    ///
    /// returns a value of type LRESULT with the specified high-order and
    /// low-order WORD values
    #[macro_export]
    macro_rules! MAKELRESULT {
        ($loword:expr, $hiword:expr $(,)?) => {
            ((u16::from($loword)) as u32 + (((u16::from($hiword)) as u32) << 16 << 16))
                as $crate::deps::windows_sys::Win32::Foundation::LRESULT
        };
    }

    /// `G.18` MAKEPOINT
    ///
    /// converts a specified DWORD value into a point’s coordinates and returns
    /// the coordinates in a POINT structure
    removed_item!(
        macro_rules! MAKEPOINT {}
    );

    /// `G.19` max
    ///
    /// compares two values and returns the larger of the two values
    removed_item!(
        macro_rules! max {}
    );

    /// `G.20` min
    ///
    /// compares two values and returns the lesser of the two values
    removed_item!(
        macro_rules! min {}
    );

    /// `G.21` OFFSETOF
    ///
    /// retrieves the address offset of the given pointer
    removed_item!(
        macro_rules! OFFSETOF {}
    );

    /// `G.22` PALETTEINDEX
    ///
    /// creates a palette-relative RGB specifier from the specified index to a
    /// logical-color palette entry passed to the macro
    #[macro_export]
    macro_rules! PALETTEINDEX {
        ($e:expr) => {
            ((0x01000000 as $crate::deps::windows_sys::Win32::Foundation::COLORREF)
                | (u16::from($e) as $crate::deps::windows_sys::Win32::Foundation::COLORREF))
        };
    }

    /// `G.23` PALETTERGB
    ///
    /// creates a palette-relative RGB specifier from the specified red, green,
    /// and blue relative intensity values passed to the macro
    #[macro_export]
    macro_rules! PALETTERGB {
        ($r:expr, $g:expr, $b:expr $(,)?) => {
            ((0x02000000 as $crate::deps::windows_sys::Win32::Foundation::COLORREF)
                | ((u8::from($r) as $crate::deps::windows_sys::Win32::Foundation::COLORREF)
                    | ((u8::from($g) as $crate::deps::windows_sys::Win32::Foundation::COLORREF)
                        << 8)
                    | ((u8::from($b) as $crate::deps::windows_sys::Win32::Foundation::COLORREF)
                        << 16)))
        };
    }

    /// `G.24` RGB
    ///
    /// returns a value of type COLORREF that contains the specified red, green,
    /// and blue relative intensity values passed to the macro
    #[macro_export]
    macro_rules! RGB {
        ($r:expr, $g:expr, $b:expr $(,)?) => {
            (u8::from($r) as $crate::deps::windows_sys::Win32::Foundation::COLORREF)
                | ((u8::from($g) as $crate::deps::windows_sys::Win32::Foundation::COLORREF) << 8)
                | ((u8::from($b) as $crate::deps::windows_sys::Win32::Foundation::COLORREF) << 16)
        };
    }

    /// `G.25` SELECTOROF
    ///
    /// retrieves the segment selector of the given pointer
    removed_item!(
        macro_rules! SELECTOROF {}
    );

    /// `G.26` UnlockData
    ///
    /// unlocks the current data segment
    removed_item!(
        macro_rules! UnlockData {}
    );

    /// `G.27` UnlockResource
    ///
    /// unlocks the handle of a resource
    removed_item!(
        macro_rules! UnlockResource {}
    );
}

/// Annex H - Binary Raster Operations
#[cfg(all(feature = "windows-subsystem", feature = "graphics-subsystem-basic"))]
pub mod all_binary_raster_ops {
    #[doc(inline)]
    pub use crate::windows_subsystem::binary_raster_ops::*;
}

#[doc(hidden)]
pub mod deps {
    pub use core;
    pub use windows_sys;
}

#[doc(hidden)]
mod helper {
    #[allow(dead_code)]
    pub trait OptInner {
        type Inner;
    }

    impl<T> OptInner for Option<T> {
        type Inner = T;
    }
}