将activesync改为不显示对话框而成为声音提示
ATLASII_HH.BAT添加BSP_ACTIVESYNC_HIDE=1
Platform.reg添加:
IF BSP_ACTIVESYNC_HIDE
[HKEY_LOCAL_MACHINE/Comm]
"ActiveSyncShow"=dword:0
ELSE
[HKEY_LOCAL_MACHINE/Comm]
"ActiveSyncShow"=dword:1
ENDIF
修改PUBLIC目录下Rnaapp.c (public/common/oak/drivers/netsamp/rnaapp),
文件头添加BOOL g_bActiveSyncShow = TRUE;
函数WndProc,
消息WM_INITDIALOG添加代码:
//add by zjh
DWORD DretValue = 1;
DWORD Disp = REG_OPENED_EXISTING_KEY;
HKEY hKey;
if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, _T("//Comm"), 0, NULL, 0, KEY_READ, NULL, &hKey, &Disp) == ERROR_SUCCESS)
{
RegQueryValueEx(hKey, _T("ActiveSyncShow"), 0, &Disp, (BYTE*)&DretValue, &Disp);
RegCloseKey(hKey);
}
g_bActiveSyncShow = DretValue;
消息IDM_START_RASDIAL,
ShowWindow( hWnd, SW_SHOW );
修改为
//modify by zjh
ShowWindow( hWnd, g_bActiveSyncShow ? SW_SHOW : SW_HIDE );
ShowWindow( hWnd, SW_SHOW );
SetForegroundWindow ( hWnd );
修改为
//modify by zjh
if(g_bActiveSyncShow)
SetForegroundWindow ( hWnd );
函数:RasDisconnect
// sndPlaySound(TEXT("RNIntr"), SND_ALIAS|SND_ASYNC|SND_NODEFAULT);
修改:为 if(!g_bActiveSyncShow)
sndPlaySound(TEXT("//windows//infintr.wav"), SND_FILENAME|SND_ASYNC|SND_NODEFAULT);
函数:RasDialEvent
case RASCS_Connected:处
// sndPlaySound(TEXT("RNBegin"), SND_ALIAS|SND_ASYNC|SND_NODEFAULT);
修改为
if(!g_bActiveSyncShow)
sndPlaySound(TEXT("//windows//infbeg.wav"), SND_FILENAME|SND_ASYNC|SND_NODEFAULT);
函数WndProc
消息case IDB_DISCONNECT:
// sndPlaySound(TEXT("RNEnd"), SND_ALIAS|SND_ASYNC|SND_NODEFAULT);
修改为
if(!g_bActiveSyncShow)
sndPlaySound(TEXT("//windows//infend.wav"), SND_FILENAME|SND_ASYNC|SND_NODEFAULT);
函数 InitInstance
if(IsAPIReady(SH_SHELL))
ShowWindow(v_hMainWnd, SW_HIDE);
else
SetWindowPos(v_hMainWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
UpdateWindow(v_hMainWnd);
修改为:
if(g_bActiveSyncShow)
{
if(IsAPIReady(SH_SHELL))
ShowWindow(v_hMainWnd, SW_HIDE);
else
SetWindowPos(v_hMainWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
UpdateWindow(v_hMainWnd);
}
修改D:/WINCE500/PUBLIC/COMMON/OAK/DRIVERS/NETSAMP/RNAAPP目录下的rnaapp.rc资源里的IDD_DCCSTATUS和IDD_DCCSTATUS2,
将里面的对话框风格由overlapped改为popup,去掉对话框里各个控件的TAB_STOP和group风格(不进行这一步,即使activesync窗口不进行显示,
但是仍然会使系统当前的窗口丢失焦点)
编译:
PB中进入/WINCE500/PUBLIC/COMMON/OAK/DRIVERS/NETSAMP/RNAAPP/ ,选择build and sysgen current project;