apiw_sys/
application_support_functions.rs

1#![allow(unused_doc_comments)]
2#[cfg(any(
3    feature = "application-support-functions-string-helpers",
4    feature = "application-support-functions-char-helpers"
5))]
6use windows_sys::Win32::Globalization as g11n;
7#[cfg(feature = "application-support-functions-rect-helpers")]
8use windows_sys::Win32::Graphics::Gdi as gdi;
9#[cfg(feature = "application-support-functions-compressionpath-helpers")]
10use windows_sys::Win32::Storage::FileSystem as storefs;
11#[cfg(any(
12    feature = "application-support-functions-errorlog",
13    feature = "application-support-functions-errorexit",
14    feature = "application-support-functions-alert"
15))]
16use windows_sys::Win32::System::Diagnostics::Debug as diagdbg;
17#[cfg(any(
18    feature = "application-support-functions-ini",
19    feature = "application-support-functions-ini-nonisolated",
20    feature = "application-support-functions-compute",
21))]
22use windows_sys::Win32::System::WindowsProgramming as winprg;
23#[cfg(any(
24    feature = "application-support-functions-extracticon",
25    feature = "application-support-functions-findexecutable"
26))]
27use windows_sys::Win32::UI::Shell as shell;
28#[cfg(any(
29    feature = "application-support-functions-char-helpers",
30    feature = "application-support-functions-string-helpers",
31    feature = "application-support-functions-alert",
32))]
33use windows_sys::Win32::UI::WindowsAndMessaging as winmsg;
34// FIXME: remove this import
35#[cfg(feature = "application-support-functions-char-helpers")]
36use windows_sys::Win32::UI::Controls as ctrls;
37#[cfg(all(
38    feature = "application-support-functions-dialog-color",
39    feature = "application-support-functions-dialog-font",
40    feature = "application-support-functions-dialog-findreplace",
41    feature = "application-support-functions-dialog-filename",
42    feature = "application-support-functions-path-helpers",
43    feature = "application-support-functions-dialog-print",
44))]
45use windows_sys::Win32::UI::Controls::Dialogs as ctrlsdlgs;
46#[cfg(feature = "application-support-functions-keycode-helpers")]
47use windows_sys::Win32::UI::Input::KeyboardAndMouse as kbdmse;
48
49/// `#403` ExtractIcon
50///
51/// returns a handle to an icon stored inside the `szBinary` executable, DLL, or
52/// icon file
53#[cfg(feature = "application-support-functions-extracticon")]
54pub use shell::ExtractIconW as ExtractIcon;
55
56/// `#404` FindExecutable
57///
58/// finds and retrieves the executable filename that is associated with a
59/// specified filename
60#[cfg(feature = "application-support-functions-findexecutable")]
61pub use shell::FindExecutableW as FindExecutable;
62
63/// `#405` GetPrivateProfileString
64///
65/// return a string of data from an initialization file
66#[cfg(feature = "application-support-functions-ini")]
67pub use winprg::GetPrivateProfileStringW as GetPrivateProfileString;
68
69/// `#405` GetProfileString
70///
71/// return a string of data from the default win.ini initialization file
72#[cfg(feature = "application-support-functions-ini-nonisolated")]
73pub use winprg::GetProfileStringW as GetProfileString;
74
75/// `#406` WritePrivateProfileString
76///
77/// write out a key string and its associated data to the requested section of
78/// the specified file
79#[cfg(feature = "application-support-functions-ini")]
80pub use winprg::WritePrivateProfileStringW as WritePrivateProfileString;
81
82/// `#406` WriteProfileString
83///
84/// write out a key string and its associated data to the requested section of
85/// the default win.ini file
86#[cfg(feature = "application-support-functions-ini-nonisolated")]
87pub use winprg::WriteProfileStringW as WriteProfileString;
88
89/// `#407` GetPrivateProfileInt
90///
91/// return an integer value from an initialization file
92#[cfg(feature = "application-support-functions-ini")]
93pub use winprg::GetPrivateProfileIntW as GetPrivateProfileInt;
94
95/// `#407` GetProfileInt
96///
97/// return an integer value from the default win.ini initialization file
98#[cfg(feature = "application-support-functions-ini-nonisolated")]
99pub use winprg::GetProfileIntW as GetProfileInt;
100
101/// `#408` AnsiLower
102///
103/// convert character strings to lowercase
104removed_item!(
105    pub use winmsg::AnsiLower;
106);
107
108/// `#408` AnsiLowerBuff
109///
110/// convert character strings to lowercase
111removed_item!(
112    pub use winmsg::AnsiLowerBuff;
113);
114
115/// `#409` AnsiUpper
116///
117/// convert character strings to uppercase
118removed_item!(
119    pub use winmsg::AnsiUpper;
120);
121
122/// `#409` AnsiUpperBuff
123///
124/// convert character strings to uppercase
125removed_item!(
126    pub use winmsg::AnsiUpperBuff;
127);
128
129/// `#410` AnsiNext
130///
131/// move to the next characters in the string
132removed_item!(
133    pub use winmsg::AnsiNext;
134);
135
136/// `#410` AnsiPrev
137///
138/// move to the previous characters in the string
139removed_item!(
140    pub use winmsg::AnsiPrev;
141);
142
143/// `#411` IsCharAlpha
144///
145/// tests if the character is in the set of alphabetic characters
146#[cfg(feature = "application-support-functions-char-helpers")]
147pub use winmsg::IsCharAlphaW as IsCharAlpha;
148
149/// `#412` IsCharAlphaNumeric
150///
151/// tests if the character is in the set of alphabetic or numeric characters
152#[cfg(feature = "application-support-functions-char-helpers")]
153pub use winmsg::IsCharAlphaNumericW as IsCharAlphaNumeric;
154
155/// `#413` IsCharLower
156///
157/// tests if the character is lower case
158// FIXME: https://github.com/microsoft/windows-rs/issues/3839
159#[cfg(feature = "application-support-functions-char-helpers")]
160pub use ctrls::IsCharLowerW as IsCharLower;
161
162/// `#414` IsCharUpper
163///
164/// tests if the character is in the set of alphabetic characters
165#[cfg(feature = "application-support-functions-char-helpers")]
166pub use winmsg::IsCharUpperW as IsCharUpper;
167
168/// `#415` lstrcmp
169///
170/// compare two strings
171#[cfg(feature = "application-support-functions-string-helpers")]
172pub use g11n::lstrcmpW as lstrcmp;
173
174/// `#415` lstrcmpi
175///
176/// compare two strings
177#[cfg(feature = "application-support-functions-string-helpers")]
178pub use g11n::lstrcmpiW as lstrcmpi;
179
180/// `#416` lstrcat
181///
182/// concatenates the string `lpszSrc` to the end of `lpszDest`
183#[cfg(feature = "application-support-functions-string-helpers")]
184pub use g11n::lstrcatW as lstrcat;
185
186/// `#416` lstrcpy
187///
188/// copy the contents from the string `lpszSrc` to the string `lpszDest`,
189/// including the NULL character
190#[cfg(feature = "application-support-functions-string-helpers")]
191pub use g11n::lstrcpyW as lstrcpy;
192
193/// `#416` lstrcpyn
194///
195/// copy the contents from the string `lpszSrc` to the string `lpszDest`,
196/// including the NULL character
197#[cfg(feature = "application-support-functions-string-helpers")]
198pub use g11n::lstrcpynW as lstrcpyn;
199
200/// `#417` lstrlen
201///
202/// returns the number of characters contained in the string, not including the
203/// NULL terminator
204#[cfg(feature = "application-support-functions-string-helpers")]
205pub use g11n::lstrlenW as lstrlen;
206
207/// `#418` wsprintf
208///
209/// format and convert the characters and values into the string `lpszOut`
210#[cfg(feature = "application-support-functions-string-helpers")]
211pub use winmsg::wsprintfW as wsprintf;
212
213/// `#418` wvsprintf
214///
215/// format and convert the characters and values into the string `lpszOut`
216#[cfg(feature = "application-support-functions-string-helpers")]
217pub use winmsg::wvsprintfW as wvsprintf;
218
219/// `#419` IsDBCSLeadByte
220///
221/// identifies whether the character specified by the TestChar parameter is a
222/// lead byte, meaning it is the first character in a double-byte character set
223/// (DBCS)
224#[cfg(feature = "application-support-functions-char-helpers")]
225pub use g11n::IsDBCSLeadByte;
226
227/// `#420` ToAscii
228///
229/// converts the specified virtual-keycode and keyboard state to the
230/// corresponding windows character or characters
231#[cfg(feature = "application-support-functions-keycode-helpers")]
232pub use kbdmse::ToAscii;
233
234/// `#421` AnsiToOem
235///
236/// takes the string defined by `WindowsSet` and converts it into the OEM format
237/// specified
238removed_item!(
239    pub use winmsg::AnsiToOem;
240);
241
242/// `#421` AnsiToOemBuff
243///
244/// takes the string defined by `WindowsSet` and converts it into the OEM format
245/// specified
246removed_item!(
247    pub use winmsg::AnsiToOemBuff;
248);
249
250/// `#422` OemToAnsi
251///
252/// takes an OEM-defined string, `OemBuffer`, and converts it into a window
253/// string, placing the resultant string in the buffer, `WindowsBuffer`
254removed_item!(
255    pub use winmsg::OemToAnsi;
256);
257
258/// `#422` OemToAnsiBuff
259///
260/// takes an OEM-defined string, `OemBuffer`, and converts it into a window
261/// string, placing the resultant string in the buffer, `WindowsBuffer`
262removed_item!(
263    pub use winmsg::OemToAnsiBuff;
264);
265
266/// `#423` CopyRect
267///
268/// copies the elements from the source rectangle to the destination rectangle
269#[cfg(feature = "application-support-functions-rect-helpers")]
270pub use gdi::CopyRect;
271
272/// `#423` SetRect
273///
274/// copies the given parameters, `nLeft`, `nTop`, `nRight`, and `nBottom`, to
275/// the corresponding elements in the specified rectangle
276#[cfg(feature = "application-support-functions-rect-helpers")]
277pub use gdi::SetRect;
278
279/// `#423` SetRectEmpty
280///
281/// sets each of the elements in the specified rectangle to zero
282#[cfg(feature = "application-support-functions-rect-helpers")]
283pub use gdi::SetRectEmpty;
284
285/// `#423` InflateRect
286///
287/// adds x to the right and left elements, and y to the top and bottom elements
288/// of the specified triangle
289#[cfg(feature = "application-support-functions-rect-helpers")]
290pub use gdi::InflateRect;
291
292/// `#423` OffsetRect
293///
294/// moves the specified rectangle by the amounts given
295#[cfg(feature = "application-support-functions-rect-helpers")]
296pub use gdi::OffsetRect;
297
298/// `#424` EqualRect
299///
300/// compares each element of the first rectangle to its corresponding element in
301/// the second rectangle
302#[cfg(feature = "application-support-functions-rect-helpers")]
303pub use gdi::EqualRect;
304
305/// `#424` IsRectEmpty
306///
307/// checks to see if the given rectangle is empty
308#[cfg(feature = "application-support-functions-rect-helpers")]
309pub use gdi::IsRectEmpty;
310
311/// `#424` PtInRect
312///
313/// checks to see if the point `lprc` lies within the rectangle
314#[cfg(feature = "application-support-functions-rect-helpers")]
315pub use gdi::PtInRect;
316
317/// `#425` IntersectRect
318///
319/// creates a new rectangle consisting of the largest rectangle that is
320/// contained in both source rectangles
321#[cfg(feature = "application-support-functions-rect-helpers")]
322pub use gdi::IntersectRect;
323
324/// `#425` UnionRect
325///
326/// creates the minimum rectangle that completely encloses both of the two
327/// source rectangles
328#[cfg(feature = "application-support-functions-rect-helpers")]
329pub use gdi::UnionRect;
330
331/// `#425` SubtractRect
332///
333/// creates a new rectangle that is the result of subtracting one rectangle from
334/// another
335#[cfg(feature = "application-support-functions-rect-helpers")]
336pub use gdi::SubtractRect;
337
338/// `#426` OutputDebugString
339///
340/// outputs the null-terminated string `lpszStr` to the debugger
341#[cfg(feature = "application-support-functions-errorlog")]
342pub use diagdbg::OutputDebugStringW as OutputDebugString;
343
344/// `#427` DebugOutput
345///
346/// outputs the null-terminated string `lpszStr` to the debugger
347removed_item!(
348    pub use diagdbg::DebugOutput;
349);
350
351/// `#428` FatalAppExit
352///
353/// displays the null-terminated string `lpszMessage` in a message box. When the
354/// user acknowledges the message, the application is terminated
355#[cfg(feature = "application-support-functions-errorexit")]
356pub use diagdbg::FatalAppExitW as FatalAppExit;
357
358/// `#429` FatalExit
359///
360/// displays the error code `nErrCode` in the debugger and halts execution
361#[cfg(feature = "application-support-functions-errorexit")]
362pub use diagdbg::FatalExit;
363
364/// `#430` QuerySendMessage
365///
366/// determines whether a message sent by the SendMessage() function was
367/// originally sent by the current task
368removed_item!(
369    pub use winmsg::QuerySendMessage;
370);
371
372/// `#431` LockInput
373///
374/// locks keyboard and mouse input to all tasks except the current one; or all
375/// locked windows are unlocked
376removed_item!(
377    pub use kbdmse::LockInput;
378);
379
380/// `#432` FlashWindow
381///
382/// flashes a window by toggling its title bar
383#[cfg(feature = "application-support-functions-alert")]
384pub use winmsg::FlashWindow;
385
386/// `#433` MessageBeep
387///
388/// plays a sound corresponding to the alert level specified by `uAlert`
389#[cfg(feature = "application-support-functions-alert")]
390pub use diagdbg::MessageBeep;
391
392/// `#434` MessageBox
393///
394/// displays the null-terminated string `lpszMessage` in a dialog box window
395#[cfg(feature = "application-support-functions-alert")]
396pub use winmsg::MessageBoxW as MessageBox;
397
398/// `#435` SetErrorMode
399///
400/// allows the application to control the appearance of MS-DOS interrupt error
401/// messages
402#[cfg(feature = "application-support-functions-errormode")]
403pub use diagdbg::SetErrorMode;
404
405/// `#436` GetExpandedName
406///
407/// return the name of the original compressed file, `SourceFile`
408#[cfg(feature = "application-support-functions-compressionpath-helpers")]
409pub use storefs::GetExpandedNameW as GetExpandedName;
410
411/// `#437` ChooseColor
412///
413/// provides the user with a modal dialog box, under the control of the `lpcc`
414/// parameter, to allow for the interactive selection of a color or colors
415#[cfg(feature = "application-support-functions-dialog-color")]
416pub use ctrlsdlgs::ChooseColorW as ChooseColor;
417
418/// `C.6` CHOOSECOLOR
419///
420/// contains information that is used by the system to initialize the Color
421/// common dialog box and to return the user's Color common dialog box
422/// selections
423#[cfg(feature = "application-support-functions-dialog-color")]
424pub use ctrlsdlgs::CHOOSECOLORW as CHOOSECOLOR;
425
426/// `#438` ChooseFont
427///
428/// provides the user with a modal dialog box, under the control of the `lpcf`
429/// parameter, which allows for the interactive selection of a font
430#[cfg(feature = "application-support-functions-dialog-font")]
431pub use ctrlsdlgs::ChooseFontW as ChooseFont;
432
433/// `C.7` CHOOSEFONT
434///
435/// contains information that is used by the system to initialize the Font
436/// common dialog box and to return the user's Font common dialog box selections
437#[cfg(feature = "application-support-functions-dialog-font")]
438pub use ctrlsdlgs::CHOOSEFONTW as CHOOSEFONT;
439
440/// `#439` FindText
441///
442/// create modeless dialog boxes, under the control of the `lpfr` parameter,
443/// that make it possible for users to find text within a document
444#[cfg(feature = "application-support-functions-dialog-findreplace")]
445pub use ctrlsdlgs::FindTextW as FindText;
446
447/// `#439` ReplaceText
448///
449/// create modeless dialog boxes, under the control of the `lpfr` parameter,
450/// that make it possible for users to find text within a document
451#[cfg(feature = "application-support-functions-dialog-findreplace")]
452pub use ctrlsdlgs::ReplaceTextW as ReplaceText;
453
454/// `C.14` FINDREPLACE
455///
456/// contains information that is used by the system to initialize the Find and
457/// Replace common dialog boxes and to return the user's dialog box selections
458#[cfg(feature = "application-support-functions-dialog-findreplace")]
459pub use ctrlsdlgs::FINDREPLACEW as FINDREPLACE;
460
461/// `#440` GetOpenFileName
462///
463/// provide the user with a modal dialog box, under the control of the `lpof`
464/// parameter, which allows for the interactive selection of a file, with the
465/// ability to open, create and verify the file
466#[cfg(feature = "application-support-functions-dialog-filename")]
467pub use ctrlsdlgs::GetOpenFileNameW as GetOpenFileName;
468
469/// `#440` GetSaveFileName
470///
471/// provide the user with a modal dialog box, under the control of the `lpof`
472/// parameter, which allows for the interactive selection of a file, with the
473/// ability to open, create and verify the file
474#[cfg(feature = "application-support-functions-dialog-filename")]
475pub use ctrlsdlgs::GetSaveFileNameW as GetSaveFileName;
476
477/// `C.28` OPENFILENAME
478///
479/// contains information that is used by the system to initialize the Open and
480/// Save common dialog boxes and to return the user's dialog box selections
481#[cfg(feature = "application-support-functions-dialog-filename")]
482pub use ctrlsdlgs::OPENFILENAMEW as OPENFILENAME;
483
484/// `#441` GetFileTitle
485///
486/// a utility that extracts the actual filename from a filename specification,
487/// `lpszFile`, that includes path information
488#[cfg(feature = "application-support-functions-path-helpers")]
489pub use ctrlsdlgs::GetFileTitleW as GetFileTitle;
490
491/// `#442` PrintDlg
492///
493/// shows the Print or Print Setup common dialog box
494#[cfg(feature = "application-support-functions-dialog-print")]
495pub use ctrlsdlgs::PrintDlgW as PrintDlg;
496
497/// `C.32` PRINTDLG
498///
499/// contains information that is used by the system to initialize the Print
500/// common dialog box and to return the user's dialog box selections
501#[cfg(feature = "application-support-functions-dialog-print")]
502pub use ctrlsdlgs::PRINTDLGW as PRINTDLG;
503
504/// `#443` CommDlgExtendedError
505///
506/// The last error encountered during execution of one of the common dialog
507/// functions is saved and can be retrieved by this function
508#[cfg(any(
509    feature = "application-support-functions-dialog-color",
510    feature = "application-support-functions-dialog-font",
511    feature = "application-support-functions-dialog-findreplace",
512    feature = "application-support-functions-dialog-filename",
513    feature = "application-support-functions-dialog-print"
514))]
515pub use ctrlsdlgs::CommDlgExtendedError;
516
517/// `#444` MulDiv
518///
519/// performs the following operation: `(Multiplicand * Multiplier) / Divisor =
520/// return value`
521#[cfg(feature = "application-support-functions-compute")]
522pub use winprg::MulDiv;