added wxGetProcessId()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15814 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
f87dfa063a
commit
c1cb41536a
@ -114,6 +114,7 @@ the corresponding topic.
|
||||
\helpref{wxGetPrinterPreviewCommand}{wxgetprinterpreviewcommand}\\
|
||||
\helpref{wxGetPrinterScaling}{wxgetprinterscaling}\\
|
||||
\helpref{wxGetPrinterTranslation}{wxgetprintertranslation}\\
|
||||
\helpref{wxGetProcessId}{wxgetprocessid}\\
|
||||
\helpref{wxGetResource}{wxgetresource}\\
|
||||
\helpref{wxGetSingleChoiceData}{wxgetsinglechoicedata}\\
|
||||
\helpref{wxGetSingleChoiceIndex}{wxgetsinglechoiceindex}\\
|
||||
@ -584,6 +585,18 @@ enum wxKillError
|
||||
|
||||
<wx/utils.h>
|
||||
|
||||
\membersection{::wxGetProcessId}\label{wxgetprocessid}
|
||||
|
||||
\func{unsigned long}{wxGetProcessId}{\void}
|
||||
|
||||
Returns the number uniquely identifying the current process in the system.
|
||||
|
||||
If an error occurs, $0$ is returned.
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/utils.h>
|
||||
|
||||
\membersection{::wxShell}\label{wxshell}
|
||||
|
||||
\func{bool}{wxShell}{\param{const wxString\& }{command = NULL}}
|
||||
|
@ -226,7 +226,7 @@ enum wxShutdownFlags
|
||||
wxSHUTDOWN_REBOOT // shutdown and reboot
|
||||
};
|
||||
|
||||
// Shutdown or reboot the PC
|
||||
// Shutdown or reboot the PC
|
||||
WXDLLEXPORT bool wxShutdown(wxShutdownFlags wFlags);
|
||||
|
||||
// send the given signal to the process (only NONE and KILL are supported under
|
||||
@ -251,6 +251,9 @@ WXDLLEXPORT void wxSleep(int nSecs);
|
||||
// Sleep for a given amount of milliseconds
|
||||
WXDLLEXPORT void wxUsleep(unsigned long milliseconds);
|
||||
|
||||
// Get the process id of the current process
|
||||
WXDLLEXPORT unsigned long wxGetProcessId();
|
||||
|
||||
// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
|
||||
WXDLLEXPORT long wxGetFreeMemory();
|
||||
|
||||
@ -356,6 +359,8 @@ WXDLLEXPORT wxWindow* wxFindWindowByName(const wxString& name, wxWindow *parent
|
||||
// Message/event queue helpers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// NB: these functions are obsolete, please use wxApp methods instead!
|
||||
|
||||
// Yield to other apps/messages
|
||||
WXDLLEXPORT bool wxYield();
|
||||
|
||||
@ -379,14 +384,14 @@ WXDLLEXPORT void wxFlushEvents();
|
||||
// ctor and enables them back in its dtor
|
||||
class WXDLLEXPORT wxWindowDisabler
|
||||
{
|
||||
DECLARE_NO_COPY_CLASS(wxWindowDisabler)
|
||||
|
||||
public:
|
||||
wxWindowDisabler(wxWindow *winToSkip = (wxWindow *)NULL);
|
||||
~wxWindowDisabler();
|
||||
|
||||
private:
|
||||
wxWindowList *m_winDisabled;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxWindowDisabler)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -40,6 +40,12 @@
|
||||
|
||||
#include "wx/msw/private.h" // includes <windows.h>
|
||||
|
||||
#ifdef __GNUWIN32_OLD__
|
||||
// apparently we need to include winsock.h to get WSADATA and other stuff
|
||||
// used in wxGetFullHostName() with the old mingw32 versions
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
|
||||
#include "wx/timer.h"
|
||||
|
||||
#if !defined(__GNUWIN32__) && !defined(__WXWINE__) && !defined(__SALFORDC__) && !defined(__WXMICROWIN__)
|
||||
@ -941,6 +947,15 @@ long wxGetFreeMemory()
|
||||
#endif
|
||||
}
|
||||
|
||||
unsigned long wxGetProcessId()
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
return ::GetCurrentProcessId();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Emit a beeeeeep
|
||||
void wxBell()
|
||||
{
|
||||
|
@ -1018,6 +1018,11 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn)
|
||||
|
||||
#endif // !wxUSE_GUI
|
||||
|
||||
unsigned long wxGetProcessId()
|
||||
{
|
||||
return (unsigned long)getpid();
|
||||
}
|
||||
|
||||
long wxGetFreeMemory()
|
||||
{
|
||||
#if defined(__LINUX__)
|
||||
|
Loading…
Reference in New Issue
Block a user