Dear All:

I would like to use SHBOXEX to develop some mobile apps.
but I met some difficulties. does anyone could give me some
suggestions.

I would like to show some pictures or icon in a toast window.
Here is the sample code I am trying:
#include "aygshell.h"
#include "wpcpriv.h"

#include "htmlctrl.h"

#pragma comment(lib,"coredll.lib")
#pragma comment(lib,"ossvcs.lib")
#pragma comment(lib,"aygshell.lib")

BOOL CALLBACK ToastHookProc(HWND hwnd, UINT uMsg,
WPARAM wParam, LPARAM lParam, VOID
*pvUser)
{

BOOL fRes = FALSE;
RETAILMSG(1, (L"The uMsg = 0x%x",uMsg));

switch (uMsg)
{
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDOK:
case IDCANCEL:
PostMessage(hwnd, SHBM_CLOSE, wParam, lParam);
break;

} // switch
}
return fRes;

}

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
const TCHAR Info[] = L"Info";
//UINT uiTimeout = 10000;
//LPCTSTR pszText = Text;
HWND hwnd;
LPCTSTR pszTitle = Info;
SH_BOXEX shboxex;
HRESULT hr = S_OK;
int iRet = IDCANCEL;

memset(&shboxex, 0, sizeof(SH_BOXEX));
shboxex.cbSize = sizeof(SH_BOXEX);
shboxex.dwStyle = SHBEXF_TOPMOST | SHBEXF_SETFOREGROUND |
SHBEXF_CLOSE_LIKE_MENUS ;
shboxex.hwndOwner = NULL;

//shboxex.nTimeOut = uiTimeout;

shboxex.info.bi.dwOriginatingIcon = SHNBI_NOTIFICATIONS;
shboxex.info.bi.iXPos = SHBB_DEFAULT_BUBBLEPOS;
shboxex.info.bi.iYPos = SHBB_DEFAULT_BUBBLEPOS;
shboxex.info.bi.cxPos = SHBB_DEFAULT_BUBBLEWIDTH;
shboxex.info.bi.cyPos = -1;
shboxex.info.bi.dwAlign = SHBOX_TOPALIGN;

shboxex.sbextype = sbextToast;
shboxex.info.bi.dwFlags = SHBBIF_HTML;
shboxex.pfnHook = ToastHookProc;

// I would like to show this picture in the pop-up window, but I
found I could display it correctly
TCHAR temp[] = TEXT("<img src='\\windows\\device.bmp'>");
shboxex.info.bi.pszContent = temp;
shboxex.pszTitle = pszTitle;


hr = SHBoxEx(&shboxex);

return hr;
}
How to use this struct to display a picture in the toast window?
Does the toast window receive a WM_PAINT message?
Thanks in advance..

Re: using SHBOXEX by Christopher

Christopher
Sun Feb 24 15:51:55 CST 2008

Hi,

"jianwei" <jianwei.8960@gmail.com> wrote in message
news:cfaf3433-8b90-4779-9cbc-023f988e0dee@i29g2000prf.googlegroups.com...
> // I would like to show this picture in the pop-up window, but I
> found I could display it correctly
> TCHAR temp[] = TEXT("<img src='\\windows\\device.bmp'>");
> shboxex.info.bi.pszContent = temp;
> shboxex.pszTitle = pszTitle;

I am not aware of the API you are utilising, but taking a "semi educated
guess" based upon your code snippet and what I know about Windows Mobile etc
I would suggest trying the following:

TCHAR temp[] = TEXT("<img src='file:///windows/device.bmp'>");
shboxex.info.bi.pszContent = temp;
shboxex.pszTitle = pszTitle;

Notice the slightly different way to specify the image source url?

Hope this helps,
Christopher Fairbairn