📄 ltwtdlg.cpp
字号:
// the message was not processed
// indicate if the base class handled it
*pbProcessed = bWasProcessed;
lResult = FALSE;
return lResult;
}
break;
case WM_ACTIVATE:
switch ( dialog_view )
{
case 1:
// CASE 1: normal - Start Bar (top) and Menu Bar (bottom)
SHFullScreen( hDlg, SHFS_SHOWTASKBAR | SHFS_SHOWSIPBUTTON );
break;
case 2:
// CASE 2: Start Bar and NO Menu Bar
SHFullScreen( hDlg, SHFS_SHOWTASKBAR | SHFS_HIDESIPBUTTON );
break;
case 3:
// CASE 3: NO Start Bar and Menu Bar
SHFullScreen( hDlg, SHFS_HIDETASKBAR | SHFS_SHOWSIPBUTTON );
break;
case 4:
// CASE 4: NO Start Bar and NO Menu Bar
SHFullScreen( hDlg, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON );
break;
default:
// the message was not processed
// indicate if the base class handled it
*pbProcessed = bWasProcessed;
lResult = FALSE;
return lResult;
}
break;
case WM_INITDIALOG:
{
RECT rc;
SHMENUBARINFO mbi;
// Make sure the Soft Input Panel (SIP) is down
// if you don't want the SIP down you should use SHIDIF_SIZEDLG
shidi.dwFlags = SHIDIF_SIPDOWN;
shidi.dwMask = SHIDIM_FLAGS;
shidi.hDlg = hDlg;
memset( &mbi, 0, sizeof( SHMENUBARINFO ) );
mbi.cbSize = sizeof( SHMENUBARINFO );
mbi.hwndParent = hDlg;
mbi.nToolBarId = IDM_MENU;
mbi.hInstRes = hInst;
mbi.nBmpId = 0;
mbi.cBmpImages = 0;
// the method of creating the dialog depends on if you want the
// top and bottom bars to display.
switch ( dialog_view )
{
case 1:
// CASE 1: normal - Start Bar (top) and Menu Bar (bottom)
// add a simple menu
SHCreateMenuBar( &mbi );
hwndCB = mbi.hwndMB;
// expand the dialog to full screen
shidi.dwFlags |= SHIDIF_SIZEDLGFULLSCREEN;
SHInitDialog( &shidi );
SetForegroundWindow( hDlg );
SHFullScreen( hDlg, SHFS_SHOWTASKBAR | SHFS_SHOWSIPBUTTON );
break;
case 2:
// CASE 2: Start Bar and NO Menu Bar
// expand the dialog to full screen
shidi.dwFlags |= SHIDIF_SIZEDLGFULLSCREEN;
SHInitDialog( &shidi );
// expand the size of the dialog to cover the bottom bar
GetWindowRect( hDlg, &rc );
rc.bottom += MENU_HEIGHT;
MoveWindow( hDlg, rc.left, rc.top, rc.right, rc.bottom, TRUE );
SetForegroundWindow( hDlg );
SHFullScreen( hDlg, SHFS_SHOWTASKBAR | SHFS_HIDESIPBUTTON );
break;
case 3:
// CASE 3: NO Start Bar and Menu Bar
// add a simple menu
SHCreateMenuBar( &mbi );
hwndCB = mbi.hwndMB;
// expand the dialog to full screen give dialog control over
// the Menu Bar area.
shidi.dwFlags |= SHIDIF_FULLSCREENNOMENUBAR;
SHInitDialog( &shidi );
// expand the size of the dialog to cover the top bar
GetWindowRect( hDlg, &rc );
rc.top -= MENU_HEIGHT;
MoveWindow( hDlg, rc.left, rc.top, rc.right, rc.bottom, TRUE );
SetForegroundWindow( hDlg );
// push Menu Bar (alias Task Bar) to the bottom of the z-order
SHFullScreen( hDlg, SHFS_HIDETASKBAR | SHFS_SHOWSIPBUTTON );
break;
case 4:
// CASE 4: NO Start Bar and NO Menu Bar
// expand the dialog to full screen give dialog control over
// the Menu Bar area.
shidi.dwFlags |= SHIDIF_FULLSCREENNOMENUBAR;
SHInitDialog( &shidi );
// expand the size of the dialog to cover the top bar
GetWindowRect( hDlg, &rc );
rc.top -= MENU_HEIGHT;
MoveWindow( hDlg, rc.left, rc.top, rc.right, rc.bottom, TRUE );
SetForegroundWindow( hDlg );
// push Menu Bar (alias Task Bar) to the bottom of the z-order
SHFullScreen( hDlg, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON );
break;
default:
// the message was not processed
// indicate if the base class handled it
*pbProcessed = bWasProcessed;
lResult = FALSE;
return lResult;
}
// Load the Icons for the application
HICON hIcon = LoadIcon( hInst, MAKEINTRESOURCE( IDI_LtWtDlg ) );
if ( hIcon )
{
SendMessage( hDlg, WM_SETICON, WPARAM( ICON_SMALL ), LPARAM( hIcon ) );
SendMessage( hDlg, WM_SETICON, WPARAM( ICON_BIG ), LPARAM( hIcon ) );
}
}
break;
case WM_DESTROY:
PostQuitMessage( 0 );
break;
case WM_CLOSE:
DestroyWindow( hWnd );
break;
case WM_SETTINGCHANGE:
// The debugger keeps complaining that it is being passed a bad hWin
// value, but I think it is just the debugger.
SHHandleWMSettingChange( hDlg, wParam, lParam, &s_sai );
break;
default:
// another instance of this app is looking for this instance by sending
// this message and looking for the unique value in return.
//
// return a unique message value to say that the window was found
if ( message == UWM_ARE_YOU_ME )
{
SetForegroundWindow( hDlg );
ShowWindow( hDlg, SW_SHOW );
UpdateWindow( hDlg );
return lResult;
}
// the message was not processed
// indicate if the base class handled it
*pbProcessed = bWasProcessed;
lResult = FALSE;
return lResult;
}
return lResult;
} /* CDialogWindow::WndProc */
//***************************************************************************
// FUNCTION: CAboutWindow::WndProc
//
// PURPOSE: Mesage handler for the About box.
//
// Comments:
//***************************************************************************
LRESULT CAboutWindow::WndProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam, PBOOL pbProcessed )
{
RECT rc;
// call the base class first
LRESULT lResult = CBaseWindow::WndProc( hDlg, message, wParam, lParam, pbProcessed );
BOOL bWasProcessed = *pbProcessed;
*pbProcessed = TRUE;
switch ( message )
{
case WM_INITDIALOG:
// Create a Done button and size it.
shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | SHIDIF_FULLSCREENNOMENUBAR;
shidi.hDlg = hDlg;
SHInitDialog( &shidi );
GetWindowRect( hDlg, &rc );
rc.top -= MENU_HEIGHT;
// resize the dialog to fit
MoveWindow( hDlg, rc.left, rc.top, rc.right, rc.bottom, TRUE );
SetForegroundWindow( hDlg );
SHFullScreen( hDlg, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON );
break;
case WM_COMMAND:
if ( LOWORD(wParam) == IDOK ||
LOWORD(wParam) == IDC_OK_BTN )
{
EndDialog( hDlg, LOWORD( wParam ) );
break;
}
break;
default:
// the message was not processed
// indicate if the base class handled it
*pbProcessed = bWasProcessed;
lResult = FALSE;
return lResult;
}
return lResult;
} /* CAboutWindow::WndProc */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -