[sword-devel] SwordReader PocketPC and SmartPhone CAB files.
David Trotz
dtrotzjr at crosswire.org
Mon Jul 7 20:33:32 MST 2008
John
Thanks for this. The code to handle this exists in the source code now,
and worked in 0.80 but is broken at the moment.
--
David
SonWon wrote:
> 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 at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
>>
>>
>>
>
>
More information about the sword-devel
mailing list