David, Not sure if this is useful since it is pure Win32.
Try this out, call in WinMain(): globals: TCHAR g_szClassName[11] = TEXT("App name here"); // Main window class name TCHAR g_szTitle[11] = TEXT("Window name here"); // Main window name /*********************************************************************** FUNCTION: SetFocusToApp PURPOSE: function to set the focus back to the main window ***********************************************************************/ HWND SetFocusToApp() { HWND hWnd = NULL; // Check if the application is running. If it's running then focus on the window. hWnd = FindWindow(g_szClassName, g_szTitle); // Bring to front if running if(hWnd) SetForegroundWindow(hWnd); return hWnd; } Code snip it for WinMain() HWND hWnd = SetFocusToApp(); if(hWnd) return 0; David Trotz wrote: >> Another thing to sort out. If I exit SwordReader using the exit >> menuitem, it's OK. If I exit using the close button, as you know, >> Windows Mobile leaves the program running in the background. When I try >> to re-start SwordReader, another instance opens, and won't run properly >> because the module files are already open in the first instance. >> >> > I must not be registering the window correctly with the OS. This should > be an easy fix. > -- > David > > _______________________________________________ > sword-devel mailing list: sword-devel@crosswire.org > http://www.crosswire.org/mailman/listinfo/sword-devel > Instructions to unsubscribe/change your settings at above page > > -- SonWon I choose God and all that my choice entails in this life even unto death and look forward to the new life that will come. _______________________________________________ sword-devel mailing list: sword-devel@crosswire.org http://www.crosswire.org/mailman/listinfo/sword-devel Instructions to unsubscribe/change your settings at above page