- };
-
-
-
- // Activates Previous Instance if a window matching Title is found
- bool ActivatePrevInstance(const wxString & sSearch)
- {
- //store search text and window handle for use by callback
- s_Title = sSearch ;
- FirsthWnd = 0;
-
- EnumWindows (WNDENUMPROC(&EnumWindowsProc), 0L);
- if (FirsthWnd == 0)
- {
- //no matching window found
- return FALSE;
- }
-
- if (::IsIconic(FirsthWnd))
- {
- ::ShowWindow(FirsthWnd, SW_SHOWDEFAULT);
- }
- ::SetForegroundWindow(FirsthWnd);
-
- // now try to deal with any active children
- // Handles to child of previous instance
- HWND FirstChildhWnd;
-
- FirstChildhWnd = ::GetLastActivePopup(FirsthWnd);
- if (FirsthWnd != FirstChildhWnd)
- {
- // A pop-up is active so bring it to the top too.
- ::BringWindowToTop(FirstChildhWnd);
- }
- return TRUE;
- }
-
- // Activates Previous Instance and passes CommandLine to wxCommandLineEvent
- // if a window matching Title is found
- bool PassCommandLineToPrevInstance(const wxString & sTitle, const wxString & sCmdLine)
- {
- // this stores a string of up to 255 bytes
- //ATOM myAtom = GlobalAddAtom ( sCmdLine );
-
- // this would create a call to wxWindow::OnCommandLine(wxCommandLineEvent & event)
- // which should retrieve the commandline, and then delete the atom, GlobalDeleteAtom( myAtom );
- //::SendMessage (FirsthWnd, wxCOMMANDLINE_MESSAGE, 0, myAtom) ;
- return FALSE;