]> git.saurik.com Git - wxWidgets.git/blob - interface/utils.h
e6337c5f9efae39da1f41b813ba3f2222b12e1b9
[wxWidgets.git] / interface / utils.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: utils.h
3 // Purpose: interface of wxWindowDisabler
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxWindowDisabler
11 @wxheader{utils.h}
12
13 This class disables all windows of the application (may be with the exception
14 of one of them) in its constructor and enables them back in its destructor.
15
16 This is useful when you want to indicate to the user that the application
17 is currently busy and cannot respond to user input.
18
19 @library{wxcore}
20 @category{FIXME}
21
22 @see wxBusyCursor
23 */
24 class wxWindowDisabler
25 {
26 public:
27 /**
28 Disables all top level windows of the applications.
29
30 If @a disable is @c false nothing is done. This can be convenient if
31 the windows should be disabled depending on some condition.
32
33 @since 2.9.0
34 */
35 wxWindowDisabler(bool disable = true);
36
37 /**
38 Disables all top level windows of the applications with the exception of
39 @a winToSkip if it is not @NULL.
40 */
41 wxWindowDisabler(wxWindow* winToSkip);
42
43 /**
44 Reenables back the windows disabled by the constructor.
45 */
46 ~wxWindowDisabler();
47 };
48
49
50
51 /**
52 @class wxBusyCursor
53 @wxheader{utils.h}
54
55 This class makes it easy to tell your user that the program is temporarily busy.
56 Just create a wxBusyCursor object on the stack, and within the current scope,
57 the hourglass will be shown.
58
59 For example:
60
61 @code
62 wxBusyCursor wait;
63
64 for (int i = 0; i 100000; i++)
65 DoACalculation();
66 @endcode
67
68 It works by calling wxBeginBusyCursor() in the constructor,
69 and wxEndBusyCursor() in the destructor.
70
71 @library{wxcore}
72 @category{FIXME}
73
74 @see wxBeginBusyCursor(), wxEndBusyCursor(), wxWindowDisabler
75 */
76 class wxBusyCursor
77 {
78 public:
79 /**
80 Constructs a busy cursor object, calling wxBeginBusyCursor().
81 */
82 wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR);
83
84 /**
85 Destroys the busy cursor object, calling wxEndBusyCursor().
86 */
87 ~wxBusyCursor();
88 };
89
90
91
92 // ============================================================================
93 // Global functions/macros
94 // ============================================================================
95
96
97 /** @ingroup group_funcmacro_dialog */
98 //@{
99
100 /**
101 Changes the cursor to the given cursor for all windows in the application.
102 Use wxEndBusyCursor() to revert the cursor back to its previous state.
103 These two calls can be nested, and a counter ensures that only the outer
104 calls take effect.
105
106 @see wxIsBusy(), wxBusyCursor
107
108 @header{wx/utils.h}
109 */
110 void wxBeginBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR);
111
112 /**
113 Changes the cursor back to the original cursor, for all windows in the
114 application. Use with wxBeginBusyCursor().
115
116 @see wxIsBusy(), wxBusyCursor
117
118 @header{wx/utils.h}
119 */
120 void wxEndBusyCursor();
121
122 /**
123 Returns @true if between two wxBeginBusyCursor() and wxEndBusyCursor()
124 calls.
125
126 @see wxBusyCursor.
127
128 @header{wx/utils.h}
129 */
130 bool wxIsBusy();
131
132 /**
133 Ring the system bell.
134
135 @note This function is categorized as a GUI one and so is not thread-safe.
136
137 @header{wx/utils.h}
138 */
139 void wxBell();
140
141 /**
142 Shows a message box with the information about the wxWidgets build used,
143 including its version, most important build parameters and the version of
144 the underlying GUI toolkit. This is mainly used for diagnostic purposes
145 and can be invoked by Ctrl-Alt-middle clicking on any wxWindow which
146 doesn't otherwise handle this event.
147
148 @wxsince{2.9.0}
149
150 @header{wx/utils.h}
151 */
152 void wxInfoMessageBox(wxWindow parent = NULL);
153
154 //@}
155
156
157
158 /** @ingroup group_funcmacro_env */
159 //@{
160
161 /**
162 This is a macro defined as @c getenv() or its wide char version in Unicode
163 mode.
164
165 Note that under Win32 it may not return correct value for the variables set
166 with wxSetEnv(), use wxGetEnv() function instead.
167
168 @header{wx/utils.h}
169 */
170 wxChar* wxGetenv(const wxString& var);
171
172 /**
173 Returns the current value of the environment variable @c var in @c value.
174 @c value may be @NULL if you just want to know if the variable exists and
175 are not interested in its value.
176
177 Returns @true if the variable exists, @false otherwise.
178
179 @header{wx/utils.h}
180 */
181 bool wxGetEnv(const wxString& var, wxString* value);
182
183 /**
184 Sets the value of the environment variable @c var (adding it if necessary)
185 to @c value.
186
187 Returns @true on success.
188
189 @see wxUnsetEnv()
190
191 @header{wx/utils.h}
192 */
193 bool wxSetEnv(const wxString& var, const wxString& value);
194
195 /**
196 Removes the variable @c var from the environment. wxGetEnv() will return
197 @NULL after the call to this function.
198
199 Returns @true on success.
200
201 @header{wx/utils.h}
202 */
203 bool wxUnsetEnv(const wxString& var);
204
205 //@}
206
207
208
209 /** @ingroup group_funcmacro_log */
210 //@{
211
212 /**
213 @deprecated Replaced by wxLogDebug().
214
215 Displays a debugging message. Under Windows, this will appear on the
216 debugger command window, and under Unix, it will be written to standard
217 error.
218
219 The syntax is identical to @e printf(), pass a format string and a variable
220 list of arguments.
221
222 @note Under Windows, if your application crashes before the message appears
223 in the debugging window, put a wxYield() call after each wxDebugMsg()
224 call. wxDebugMsg() seems to be broken under WIN32s (at least for
225 Watcom C++): preformat your messages and use OutputDebugString
226 instead.
227
228 @header{wx/utils.h}
229 */
230 void wxDebugMsg(const wxString& format, ... );
231
232 /**
233 @deprecated Replaced by wxLogFatalError().
234
235 Displays @a message and exits. This writes to standard error under Unix,
236 and pops up a message box under Windows. Used for fatal internal wxWidgets
237 errors.
238
239 @eee wxError()
240
241 @header{wx/utils.h}
242 */
243 void wxFatalError(const wxString& message,
244 const wxString& title = "wxWidgets Fatal Error");
245
246 /**
247 @deprecated Replaced by wxLogError().
248
249 Displays @a message and continues. This writes to standard error under
250 Unix, and pops up a message box under Windows. Used for internal wxWidgets
251 errors.
252
253 @see wxFatalError()
254
255 @header{wx/utils.h}
256 */
257 void wxError(const wxString& message,
258 const wxString& title = "wxWidgets Internal Error");
259
260 //@}
261
262
263
264 /**
265 Returns the type of power source as one of @c wxPOWER_SOCKET,
266 @c wxPOWER_BATTERY or @c wxPOWER_UNKNOWN.
267 @c wxPOWER_UNKNOWN is also the default on platforms where this
268 feature is not implemented (currently everywhere but MS Windows).
269
270 @header{wx/utils.h}
271 */
272 wxPowerType wxGetPowerType();
273
274 /**
275 This function returns the "user id" also known as "login name" under Unix
276 i.e. something like "jsmith". It uniquely identifies the current user (on
277 this system). Under Windows or NT, this function first looks in the
278 environment variables USER and LOGNAME; if neither of these is found, the
279 entry @b UserId in the @b wxWidgets section of the WIN.INI file is tried.
280
281 @return Returns the login name if successful or an empty string otherwise.
282
283 @see wxGetUserName()
284
285 @header{wx/utils.h}
286 */
287 wxString wxGetUserId();
288
289 /**
290 @deprecated
291 This form is deprecated, use wxGetUserId() version that returns wxString.
292
293 @param buf Buffer to store login name in.
294 @param sz Size of the buffer.
295
296 @return Returns @true if successful, @false otherwise.
297 */
298 bool wxGetUserId(char* buf, int sz);
299
300 /**
301 Returns battery state as one of @c wxBATTERY_NORMAL_STATE,
302 @c wxBATTERY_LOW_STATE, @c wxBATTERY_CRITICAL_STATE,
303 @c wxBATTERY_SHUTDOWN_STATE or @c wxBATTERY_UNKNOWN_STATE.
304 @c wxBATTERY_UNKNOWN_STATE is also the default on platforms where
305 this feature is not implemented (currently everywhere but MS Windows).
306
307 @header{wx/utils.h}
308 */
309 wxBatteryState wxGetBatteryState();
310
311 /**
312 @deprecated
313 This function is obsolete, please use wxWindow::FindWindowByName() instead.
314
315 Find a window by its name (as given in a window constructor or Create()
316 function call). If @a parent is @NULL, the search will start from all
317 top-level frames and dialog boxes; if non-@NULL, the search will be limited
318 to the given window hierarchy. The search is recursive in both cases. If
319 no such named window is found, wxFindWindowByLabel() is called.
320
321 @header{wx/utils.h}
322 */
323 wxWindow* wxFindWindowByName(const wxString& name, wxWindow* parent = NULL);
324
325 /**
326 This function is deprecated as the ids generated by it can conflict with the
327 ids defined by the user code, use @c wxID_ANY to assign ids which are
328 guaranteed to not conflict with the user-defined ids for the controls and menu
329 items you create instead of using this function.
330
331 Generates an integer identifier unique to this run of the program.
332
333 @header{wx/utils.h}
334 */
335 long wxNewId();
336
337 /**
338 Ensures that ids subsequently generated by @b NewId do not clash with
339 the given @b id.
340
341 @header{wx/utils.h}
342 */
343 void wxRegisterId(long id);
344
345 /**
346 For normal keys, returns @true if the specified key is currently down.
347 For togglable keys (Caps Lock, Num Lock and Scroll Lock), returns
348 @true if the key is toggled such that its LED indicator is lit. There is
349 currently no way to test whether togglable keys are up or down.
350 Even though there are virtual key codes defined for mouse buttons, they
351 cannot be used with this function currently.
352
353 @header{wx/utils.h}
354 */
355 bool wxGetKeyState(wxKeyCode key);
356
357 /**
358 Returns the string containing the description of the current platform in a
359 user-readable form. For example, this function may return strings like
360 @c Windows NT Version 4.0 or @c Linux 2.2.2 i386.
361
362 @see ::wxGetOsVersion
363
364 @header{wx/utils.h}
365 */
366 wxString wxGetOsDescription();
367
368 /**
369 Return the (current) user's home directory.
370
371 @see wxGetUserHome(), wxStandardPaths
372
373 @header{wx/utils.h}
374 */
375 wxString wxGetHomeDir();
376
377 /**
378 Sleeps for the specified number of milliseconds. Notice that usage of this
379 function is encouraged instead of calling usleep(3) directly because the
380 standard usleep() function is not MT safe.
381
382 @header{wx/utils.h}
383 */
384 void wxMilliSleep(unsigned long milliseconds);
385
386 /**
387 Sleeps for the specified number of microseconds. The microsecond resolution may
388 not, in fact, be available on all platforms (currently only Unix platforms with
389 nanosleep(2) may provide it) in which case this is the same as
390 wxMilliSleep()(@e microseconds/1000).
391
392 @header{wx/utils.h}
393 */
394 void wxMicroSleep(unsigned long microseconds);
395
396
397 /**
398 Find a menu item identifier associated with the given frame's menu bar.
399
400 @header{wx/utils.h}
401 */
402 int wxFindMenuItemId(wxFrame* frame, const wxString& menuString,
403 const wxString& itemString);
404
405 /**
406 This function enables or disables all top level windows. It is used by
407 ::wxSafeYield.
408
409 @header{wx/utils.h}
410 */
411 void wxEnableTopLevelWindows(bool enable = true);
412
413 /**
414 Strips any menu codes from @a str and returns the result.
415 By default, the functions strips both the mnemonics character (@c '')
416 which is used to indicate a keyboard shortkey, and the accelerators, which are
417 used only in the menu items and are separated from the main text by the
418 @c \t (TAB) character. By using @a flags of
419 @c wxStrip_Mnemonics or @c wxStrip_Accel to strip only the former
420 or the latter part, respectively.
421 Notice that in most cases
422 wxMenuItem::GetLabelFromText or
423 wxControl::GetLabelText can be used instead.
424
425 @header{wx/utils.h}
426 */
427 wxString wxStripMenuCodes(const wxString& str,
428 int flags = wxStrip_All);
429
430 /**
431 Open the @a url in user's default browser. If @a flags parameter contains
432 @c wxBROWSER_NEW_WINDOW flag, a new window is opened for the URL
433 (currently this is only supported under Windows). The @a url may also be a
434 local file path (with or without @c file:// prefix), if it doesn't
435 correspond to an existing file and the URL has no scheme @c http:// is
436 prepended to it by default.
437 Returns @true if the application was successfully launched.
438 Note that for some configurations of the running user, the application which
439 is launched to open the given URL may be URL-dependent (e.g. a browser may be
440 used for
441 local URLs while another one may be used for remote URLs).
442
443 @header{wx/utils.h}
444 */
445 bool wxLaunchDefaultBrowser(const wxString& url, int flags = 0);
446
447 /**
448 Executes a command in an interactive shell window. If no command is
449 specified, then just the shell is spawned.
450 See also wxExecute(), @ref overview_sampleexec "Exec sample".
451
452 @header{wx/utils.h}
453 */
454 bool wxShell(const wxString& command = NULL);
455
456 /**
457 Gets the version and the operating system ID for currently running OS.
458 See wxPlatformInfo for more details about wxOperatingSystemId.
459
460 @see ::wxGetOsDescription, wxPlatformInfo
461
462 @header{wx/utils.h}
463 */
464 wxOperatingSystemId wxGetOsVersion(int* major = NULL,
465 int* minor = NULL);
466
467 /**
468 Returns the FQDN (fully qualified domain host name) or an empty string on
469 error.
470
471 @see wxGetHostName()
472
473 @header{wx/utils.h}
474 */
475 wxString wxGetFullHostName();
476
477 /**
478 Tells the system to delete the specified object when
479 all other events have been processed. In some environments, it is
480 necessary to use this instead of deleting a frame directly with the
481 delete operator, because some GUIs will still send events to a deleted window.
482 Now obsolete: use wxWindow::Close instead.
483
484 @header{wx/utils.h}
485 */
486 void wxPostDelete(wxObject* object);
487
488 /**
489 @b NB: This function is obsolete, please use
490 wxWindow::FindWindowByLabel instead.
491 Find a window by its label. Depending on the type of window, the label may be a
492 window title
493 or panel item label. If @a parent is @NULL, the search will start from all
494 top-level
495 frames and dialog boxes; if non-@NULL, the search will be limited to the given
496 window hierarchy.
497 The search is recursive in both cases.
498
499 @header{wx/utils.h}
500 */
501 wxWindow* wxFindWindowByLabel(const wxString& label,
502 wxWindow* parent = NULL);
503
504
505 /**
506 Returns the mouse position in screen coordinates.
507
508 @header{wx/utils.h}
509 */
510 wxPoint wxGetMousePosition();
511
512 /**
513 Loads a user-defined Windows resource as a string. If the resource is found,
514 the function creates
515 a new character array and copies the data into it. A pointer to this data is
516 returned. If unsuccessful, @NULL is returned.
517 The resource must be defined in the @c .rc file using the following syntax:
518
519 @code
520 myResource TEXT file.ext
521 @endcode
522
523 where @c file.ext is a file that the resource compiler can find.
524 This function is available under Windows only.
525
526 @header{wx/utils.h}
527 */
528 wxString wxLoadUserResource(const wxString& resourceName,
529 const wxString& resourceType = "TEXT");
530
531 /**
532 Returns the amount of free memory in bytes under environments which
533 support it, and -1 if not supported or failed to perform measurement.
534 */
535 wxMemorySize wxGetFreeMemory();
536
537 //@{
538 /**
539 Copies the current host machine's name into the supplied buffer. Please note
540 that the returned name is @e not fully qualified, i.e. it does not include
541 the domain name.
542 Under Windows or NT, this function first looks in the environment
543 variable SYSTEM_NAME; if this is not found, the entry @b HostName
544 in the @b wxWidgets section of the WIN.INI file is tried.
545 The first variant of this function returns the hostname if successful or an
546 empty string otherwise. The second (deprecated) function returns @true
547 if successful, @false otherwise.
548
549 @see wxGetFullHostName()
550
551 @header{wx/utils.h}
552 */
553 wxString wxGetHostName();
554 bool wxGetHostName(char* buf, int sz);
555 //@}
556
557 /**
558 Under X only, returns the current display name. See also wxSetDisplayName().
559
560 @header{wx/utils.h}
561 */
562 wxString wxGetDisplayName();
563
564 /**
565 Returns the home directory for the given user. If the @a user is empty
566 (default value), this function behaves like
567 wxGetHomeDir() i.e. returns the current user home
568 directory.
569 If the home directory couldn't be determined, an empty string is returned.
570
571 @header{wx/utils.h}
572 */
573 wxString wxGetUserHome(const wxString& user = "");
574
575 //@{
576 /**
577 @b wxPerl note: In wxPerl this function is called @c Wx::ExecuteStdoutStderr
578 and it only takes the @c command argument,
579 and returns a 3-element list @c ( status, output, errors ), where
580 @c output and @c errors are array references.
581 Executes another program in Unix or Windows.
582 The first form takes a command string, such as @c "emacs file.txt".
583 The second form takes an array of values: a command, any number of
584 arguments, terminated by @NULL.
585 The semantics of the third and fourth versions is different from the first two
586 and is described in more details below.
587 If @a flags parameter contains @c wxEXEC_ASYNC flag (the default), flow
588 of control immediately returns. If it contains @c wxEXEC_SYNC, the current
589 application waits until the other program has terminated.
590 In the case of synchronous execution, the return value is the exit code of
591 the process (which terminates by the moment the function returns) and will be
592 -1 if the process couldn't be started and typically 0 if the process
593 terminated successfully. Also, while waiting for the process to
594 terminate, wxExecute will call wxYield(). Because of this, by
595 default this function disables all application windows to avoid unexpected
596 reentrancies which could result from the users interaction with the program
597 while the child process is running. If you are sure that it is safe to not
598 disable the program windows, you may pass @c wxEXEC_NODISABLE flag to
599 prevent this automatic disabling from happening.
600 For asynchronous execution, however, the return value is the process id and
601 zero value indicates that the command could not be executed. As an added
602 complication, the return value of -1 in this case indicates that we didn't
603 launch a new process, but connected to the running one (this can only happen in
604 case of using DDE under Windows for command execution). In particular, in this,
605 and only this, case the calling code will not get the notification about
606 process termination.
607 If callback isn't @NULL and if execution is asynchronous,
608 wxProcess::OnTerminate will be called when
609 the process finishes. Specifying this parameter also allows you to redirect the
610 standard input and/or output of the process being launched by calling
611 wxProcess::Redirect. If the child process IO is redirected,
612 under Windows the process window is not shown by default (this avoids having to
613 flush an unnecessary console for the processes which don't create any windows
614 anyhow) but a @c wxEXEC_NOHIDE flag can be used to prevent this from
615 happening, i.e. with this flag the child process window will be shown normally.
616 Under Unix the flag @c wxEXEC_MAKE_GROUP_LEADER may be used to ensure
617 that the new process is a group leader (this will create a new session if
618 needed). Calling wxKill() passing wxKILL_CHILDREN will
619 kill this process as well as all of its children (except those which have
620 started their own session).
621 The @c wxEXEC_NOEVENTS flag prevents processing of any events from taking
622 place while the child process is running. It should be only used for very
623 short-lived processes as otherwise the application windows risk becoming
624 unresponsive from the users point of view. As this flag only makes sense with
625 @c wxEXEC_SYNC, @c wxEXEC_BLOCK equal to the sum of both of these flags
626 is provided as a convenience.
627 Finally, you may use the third overloaded version of this function to execute
628 a process (always synchronously, the contents of @a flags is or'd with
629 @c wxEXEC_SYNC) and capture its output in the array @e output. The
630 fourth version adds the possibility to additionally capture the messages from
631 standard error output in the @a errors array.
632 @b NB: Currently wxExecute() can only be used from the main thread, calling
633 this function from another thread will result in an assert failure in debug
634 build and won't work.
635
636 @param command
637 The command to execute and any parameters to pass to it as a
638 single string.
639 @param argv
640 The command to execute should be the first element of this
641 array, any additional ones are the command parameters and the array must be
642 terminated with a @NULL pointer.
643 @param flags
644 Must include either wxEXEC_ASYNC or wxEXEC_SYNC and can also include
645 wxEXEC_NOHIDE, wxEXEC_MAKE_GROUP_LEADER (in either case) or
646 wxEXEC_NODISABLE and wxEXEC_NOEVENTS or wxEXEC_BLOCK, which is equal to
647 their combination, in wxEXEC_SYNC case.
648 @param callback
649 An optional pointer to wxProcess
650
651 @see wxShell(), wxProcess, @ref overview_sampleexec "Exec sample".
652
653 @header{wx/utils.h}
654 */
655 long wxExecute(const wxString& command,
656 int sync = wxEXEC_ASYNC,
657 wxProcess* callback = NULL);
658 long wxExecute(char** argv,
659 int flags = wxEXEC_ASYNC,
660 wxProcess* callback = NULL);
661 long wxExecute(wchar_t** argv,
662 int flags = wxEXEC_ASYNC,
663 wxProcess* callback = NULL);
664 long wxExecute(const wxString& command,
665 wxArrayString& output,
666 int flags = 0);
667 long wxExecute(const wxString& command,
668 wxArrayString& output,
669 wxArrayString& errors,
670 int flags = 0);
671 //@}
672
673 /**
674 Returns a string representing the current date and time.
675
676 @header{wx/utils.h}
677 */
678 wxString wxNow();
679
680 /**
681 Returns @true if the operating system the program is running under is 64 bit.
682 The check is performed at run-time and may differ from the value available at
683 compile-time (at compile-time you can just check if @c sizeof(void*)==8)
684 since the program could be running in emulation mode or in a mixed 32/64 bit
685 system
686 (bi-architecture operating system).
687 Very important: this function is not 100% reliable on some systems given the
688 fact
689 that there isn't always a standard way to do a reliable check on the OS
690 architecture.
691
692 @header{wx/utils.h}
693 */
694 bool wxIsPlatform64Bit();
695
696 /**
697 Returns the number uniquely identifying the current process in the system.
698 If an error occurs, 0 is returned.
699
700 @header{wx/utils.h}
701 */
702 unsigned long wxGetProcessId();
703
704 /**
705 Equivalent to the Unix kill function: send the given signal @a sig to the
706 process with PID @e pid. The valid signal values are
707
708 @code
709 enum wxSignal
710 {
711 wxSIGNONE = 0, // verify if the process exists under Unix
712 wxSIGHUP,
713 wxSIGINT,
714 wxSIGQUIT,
715 wxSIGILL,
716 wxSIGTRAP,
717 wxSIGABRT,
718 wxSIGEMT,
719 wxSIGFPE,
720 wxSIGKILL, // forcefully kill, dangerous!
721 wxSIGBUS,
722 wxSIGSEGV,
723 wxSIGSYS,
724 wxSIGPIPE,
725 wxSIGALRM,
726 wxSIGTERM // terminate the process gently
727 };
728 @endcode
729
730 @c wxSIGNONE, @c wxSIGKILL and @c wxSIGTERM have the same meaning
731 under both Unix and Windows but all the other signals are equivalent to
732 @c wxSIGTERM under Windows.
733 Returns 0 on success, -1 on failure. If @a rc parameter is not @NULL, it will
734 be filled with an element of @c wxKillError enum:
735
736 @code
737 enum wxKillError
738 {
739 wxKILL_OK, // no error
740 wxKILL_BAD_SIGNAL, // no such signal
741 wxKILL_ACCESS_DENIED, // permission denied
742 wxKILL_NO_PROCESS, // no such process
743 wxKILL_ERROR // another, unspecified error
744 };
745 @endcode
746
747 The @a flags parameter can be wxKILL_NOCHILDREN (the default),
748 or wxKILL_CHILDREN, in which case the child processes of this
749 process will be killed too. Note that under Unix, for wxKILL_CHILDREN
750 to work you should have created the process by passing wxEXEC_MAKE_GROUP_LEADER
751 to wxExecute.
752
753 @see wxProcess::Kill, wxProcess::Exists, @ref overview_sampleexec "Exec sample"
754
755 @header{wx/utils.h}
756 */
757 int wxKill(long pid, int sig = wxSIGTERM, wxKillError rc = NULL,
758 int flags = 0);
759
760 /**
761 Returns the current state of the mouse. Returns a wxMouseState
762 instance that contains the current position of the mouse pointer in
763 screen coordinates, as well as boolean values indicating the up/down
764 status of the mouse buttons and the modifier keys.
765
766 @header{wx/utils.h}
767 */
768 wxMouseState wxGetMouseState();
769
770 //@{
771 /**
772 Copies the user's email address into the supplied buffer, by
773 concatenating the values returned by wxGetFullHostName()
774 and wxGetUserId().
775 Returns @true if successful, @false otherwise.
776
777 @header{wx/utils.h}
778 */
779 wxString wxGetEmailAddress();
780 bool wxGetEmailAddress(char* buf, int sz);
781 //@}
782
783 /**
784 Sleeps for the specified number of seconds.
785
786 @header{wx/utils.h}
787 */
788 void wxSleep(int secs);
789
790 /**
791 Returns @true if the current platform is little endian (instead of big
792 endian).
793 The check is performed at run-time.
794
795 @see @ref overview_byteordermacros "Byte order macros"
796
797 @header{wx/utils.h}
798 */
799 bool wxIsPlatformLittleEndian();
800
801 /**
802 Under X only, sets the current display name. This is the X host and display
803 name such
804 as "colonsay:0.0", and the function indicates which display should be used for
805 creating
806 windows from this point on. Setting the display within an application allows
807 multiple
808 displays to be used.
809 See also wxGetDisplayName().
810
811 @header{wx/utils.h}
812 */
813 void wxSetDisplayName(const wxString& displayName);
814