Exemple #1
0
    /// \brief Initializes a QnSend instance
    /// @param hWnd         Owning window handle
    /// @param hInstance    Owning instance handle
    QnSend(HWND hWnd, HINSTANCE hInstance)
    {
        _hWnd = hWnd;
        _hInstance = hInstance;
        _notifyIconVisible = false;

        if (WSAStartup(MAKEWORD(2, 2), &_wsaData) != 0)
            ExitProcess(ERROR_C);

        InitNotifyIconData();
        AddNotifyIcon();
    }
/*!
 @brief リサイズイベント\n
 WM_SIZEで呼び出されます。

 @param [in]    nType  リサイズタイプ
 @param [in]    cx     幅
 @param [in]    cy     高さ
 */
void CInspectUsefulToolsDlg::OnSize(UINT nType, int cx, int cy)
{
	CDialog::OnSize(nType, cx, cy);

	// ツリービューの位置調整
	RECT stRect;
	if (m_inMenuTreeCtrl.m_hWnd != NULL) {
		m_inMenuTreeCtrl.GetWindowRect(&stRect);
		this->ScreenToClient(&stRect);
		stRect.bottom = stRect.top + cy;
		m_inMenuTreeCtrl.MoveWindow(&stRect);
	}

	if (m_inContentsTabCtrl.m_hWnd != NULL) {
		m_inContentsTabCtrl.GetWindowRect(&stRect);
		this->ScreenToClient(&stRect);
		stRect.bottom = stRect.top + cy;
		stRect.right = cx - 2;
		m_inContentsTabCtrl.MoveWindow(&stRect);

		CRect    rect;
		m_inContentsTabCtrl.GetClientRect(&rect);
		rect.OffsetRect(1, 3);
		rect.right -= 10;
		rect.bottom -= 9;

		POSITION nMapPosition = m_mapInnerDlg.GetStartPosition();
		while (nMapPosition != NULL) {
			CString strKey;
			void *pDialog;

			m_mapInnerDlg.GetNextAssoc(nMapPosition, strKey, pDialog);
			((CDialog *) pDialog)->MoveWindow(rect);
		}
	}

	if (nType == SIZE_MINIMIZED) {
		this->ShowWindow(SW_HIDE);
		AddNotifyIcon();
	} else {
		DeleteNotifyIcon();
	}
}
/*!
 @brief Win98 以降か IE4 デスクトップ がインストールされている環境であれば、 
  タスクバーを再構築する場合に TaskbarCreated メッセージが送信される 
 */  
LRESULT CInspectUsefulToolsDlg::OnTaskBarCreated(WPARAM, LPARAM)  
{
    AddNotifyIcon();        // タスクバーアイコンの追加  
  
    return NULL;  
}