+bool wxIsDebuggerRunning()
+{
+#if wxUSE_DYNLIB_CLASS
+ // IsDebuggerPresent() is not available under Win95, so load it dynamically
+ wxDynamicLibrary dll(wxT("kernel32.dll"), wxDL_VERBATIM);
+
+ typedef BOOL (WINAPI *IsDebuggerPresent_t)();
+ if ( !dll.HasSymbol(wxT("IsDebuggerPresent")) )
+ {
+ // no way to know, assume no
+ return false;
+ }
+
+ return (*(IsDebuggerPresent_t)dll.GetSymbol(wxT("IsDebuggerPresent")))() != 0;
+#else
+ return false;
+#endif
+}
+
+// ----------------------------------------------------------------------------
+// working with MSW resources
+// ----------------------------------------------------------------------------
+
+bool
+wxLoadUserResource(const void **outData,
+ size_t *outLen,
+ const wxString& resourceName,
+ const wxChar* resourceType,
+ WXHINSTANCE instance)
+{
+ wxCHECK_MSG( outData && outLen, false, "output pointers can't be NULL" );
+
+ HRSRC hResource = ::FindResource(instance,
+ resourceName.t_str(),
+ resourceType);
+ if ( !hResource )
+ return false;
+
+ HGLOBAL hData = ::LoadResource(instance, hResource);
+ if ( !hData )
+ {
+ wxLogSysError(_("Failed to load resource \"%s\"."), resourceName);
+ return false;
+ }
+
+ *outData = ::LockResource(hData);
+ if ( !*outData )
+ {
+ wxLogSysError(_("Failed to lock resource \"%s\"."), resourceName);
+ return false;
+ }
+
+ *outLen = ::SizeofResource(instance, hResource);
+
+ // Notice that we do not need to call neither UnlockResource() (which is
+ // obsolete in Win32) nor GlobalFree() (resources are freed on process
+ // termination only)
+
+ return true;
+}
+
+char *
+wxLoadUserResource(const wxString& resourceName,
+ const wxChar* resourceType,
+ int* pLen,
+ WXHINSTANCE instance)