本文整理汇总了C++中HWND函数的典型用法代码示例。如果您正苦于以下问题:C++ HWND函数的具体用法?C++ HWND怎么用?C++ HWND使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HWND函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnShell
LRESULT CMainDlg::OnShell(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
CString strDebug, strTitle;
CWnd* pwnd;
if(::IsWindow(HWND(lParam)))
{
pwnd = CWnd::FromHandle(HWND(lParam));
pwnd->GetWindowText(strTitle);
}
switch (wParam)
{
case HSHELL_WINDOWCREATED:
strDebug.Format("Window[%08X] - %s created!\n", lParam, strTitle);
break;
case HSHELL_WINDOWDESTROYED:
strDebug.Format("Window[%08X] - %s destroyed!\n", lParam, strTitle);
break;
case HSHELL_WINDOWACTIVATED:
strDebug.Format("Window[%08X] - %s activated!\n", lParam, strTitle);
break;
default:
strDebug.Format("%08X, %08X\n", wParam, lParam);
break;
}
Log(strDebug);
return 0;
}
示例2: switch
HRESULT TblurPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_HSCROLL:
if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_BLUR_STRENGTH) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_BLUR_TEMPSMOOTH))
{
cfgSet(IDFF_blurStrength,SendDlgItemMessage(m_hwnd,IDC_TBR_BLUR_STRENGTH ,TBM_GETPOS,0,0));
cfgSet(IDFF_tempSmooth ,SendDlgItemMessage(m_hwnd,IDC_TBR_BLUR_TEMPSMOOTH,TBM_GETPOS,0,0));
blur2dlg();
return TRUE;
}
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_CHB_BLUR:
setInter(getCheck(IDC_CHB_BLUR));
parent->drawInter();
return TRUE;
}
break;
}
return FALSE;
}
示例3: MapHDDWinM_OnCommand
//------------------------------------------------------------------------------
#pragma argsused
static void MapHDDWinM_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT CodeNotify)
{
switch(id)
{
#if defined TEST_FAT1_VOST //Проверка и восстановление FAT1 на потерянные кластеры
case IDC_VOST: Vost_FAT1(); //Чистка FAT1 от потерянных кластеров
break;
#endif
case IDOK: DestroyWindow(hwnd);
break;
}
}
//------------------------------------------------------------------------------
#pragma argsused
static LRESULT CALLBACK WndProc_MapHDD_W1(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
HANDLE_MSG(hwnd, WM_PAINT, MapHDDWin1_OnPaint);
default: return DefWindowProc(hwnd, Msg, wParam, lParam);
}
}
//------------------------------------------------------------------------------
#pragma argsused
static void MapHDDWinM_OnDestroy(HWND hwnd)
{
示例4: ATLASSERT
BOOL CTrayIconHooker::Init(CTrayNotifyIcon* pTrayIcon, CWindow* pNotifyWnd)
#endif
{
//Validate our parameters
ATLASSERT(pTrayIcon); //must have a valid tray notify instance
#ifdef _AFX
ATLASSERT(pNotifyWnd && ::IsWindow(pNotifyWnd->GetSafeHwnd()));
#else
ATLASSERT(pNotifyWnd && pNotifyWnd->IsWindow());
#endif
//Hive away the input parameter
m_pTrayIcon = pTrayIcon;
//Hook the top level frame of the notify window in preference
//to the notify window itself. This will ensure that we get
//the taskbar created message
#ifdef _AFX
CWnd* pTopLevelWnd = pNotifyWnd->GetTopLevelFrame();
if (pTopLevelWnd)
return SubclassWindow(pTopLevelWnd->operator HWND());
else
return SubclassWindow(pNotifyWnd->GetSafeHwnd());
#else
CWindow TopLevelWnd = pNotifyWnd->GetTopLevelWindow();
if (TopLevelWnd.IsWindow())
return SubclassWindow(TopLevelWnd.operator HWND());
else
return SubclassWindow(pNotifyWnd->m_hWnd);
#endif
}
示例5: switch
HRESULT ToffsetPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_HSCROLL:
if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_OFFSETY_X) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_OFFSETY_Y) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_OFFSETUV_X) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_OFFSETUV_Y))
{
cfgSet(IDFF_offsetY_X,SendDlgItemMessage(m_hwnd,IDC_TBR_OFFSETY_X ,TBM_GETPOS,0,0));
cfgSet(IDFF_offsetY_Y,SendDlgItemMessage(m_hwnd,IDC_TBR_OFFSETY_Y ,TBM_GETPOS,0,0));
cfgSet(IDFF_offsetU_X,SendDlgItemMessage(m_hwnd,IDC_TBR_OFFSETUV_X,TBM_GETPOS,0,0));
cfgSet(IDFF_offsetU_Y,SendDlgItemMessage(m_hwnd,IDC_TBR_OFFSETUV_Y,TBM_GETPOS,0,0));
cfgSet(IDFF_offsetV_X,SendDlgItemMessage(m_hwnd,IDC_TBR_OFFSETUV_X,TBM_GETPOS,0,0));
cfgSet(IDFF_offsetV_Y,SendDlgItemMessage(m_hwnd,IDC_TBR_OFFSETUV_Y,TBM_GETPOS,0,0));
offset2dlg();
return TRUE;
}
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_CHB_OFFSET:
cfgSet(IDFF_isOffset,getCheck(IDC_CHB_OFFSET));
parent->drawInter();
return TRUE;
}
break;
}
return FALSE;
}
示例6: WndProc
static LRESULT CALLBACK WndProc(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{ case WM_CTLCOLORSTATIC:
if(HWND(lParam) == hNumSel || HWND(lParam) == hSizeSel)
{ SetTextColor((HDC)wParam, RGB(0, 0, 200));
SetBkColor((HDC)wParam, FonLTGRAY);
return (BOOL)FonBrush;
}
if(HWND(lParam) == hPrShift)
{ SetTextColor((HDC)wParam, RGB(255, 255, 255));
// SetBkColor((HDC)wParam, FonLTGRAY);
SetBkColor((HDC)wParam, RGB(180,0,0));
return (BOOL)FonBrush;
}
if(HWND(lParam) == hSizeHDD)
{ SetTextColor((HDC)wParam, RGB(0, 80, 0));
SetBkColor((HDC)wParam, FonLTGRAY);
return (BOOL)FonBrush;
}
return TRUE;
HANDLE_MSG(hwnd, WM_CREATE, M_Win_OnCreate);
HANDLE_MSG(hwnd, WM_CLOSE, M_Win_OnClose);
HANDLE_MSG(hwnd, WM_DESTROY, M_Win_OnDestroy);
// HANDLE_MSG(hwnd, WM_PAINT, Decod_OnPaint);
HANDLE_MSG(hwnd, WM_COMMAND, M_Win_OnCommand);
HANDLE_MSG(hwnd, WM_NOTIFY, M_Win_OnNotify);
HANDLE_MSG(hwnd, WM_SIZE, M_Win_Size); //Изменение размеров окна
HANDLE_MSG(hwnd, WM_WINDOWPOSCHANGING, NoPosChanged); //Изменение положения окна
default: return DefWindowProc(hwnd, Msg, wParam, lParam);
}
}
示例7: switch
HRESULT TpictPropPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_HSCROLL:
if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_LUMGAIN) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_LUMOFFSET) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_GAMMA))
{
cfgSet(IDFF_lumGain,writeLumGain(SendDlgItemMessage(m_hwnd,IDC_TBR_LUMGAIN,TBM_GETPOS,0,0)));
cfgSet(IDFF_lumOffset,writeLumOffset(SendDlgItemMessage(m_hwnd,IDC_TBR_LUMOFFSET,TBM_GETPOS,0,0))-256);
cfgSet(IDFF_gammaCorrection,writeGamma(SendDlgItemMessage(m_hwnd,IDC_TBR_GAMMA,TBM_GETPOS,0,0)));
return TRUE;
}
else if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_HUE) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_SATURATION))
{
cfgSet(IDFF_hue,writeHue(SendDlgItemMessage(m_hwnd,IDC_TBR_HUE,TBM_GETPOS,0,0)));
cfgSet(IDFF_saturation,writeSaturation(SendDlgItemMessage(m_hwnd,IDC_TBR_SATURATION,TBM_GETPOS,0,0)));
return TRUE;
}
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_CHB_PICTPROP:
setInter(getCheck(IDC_CHB_PICTPROP));
parent->drawInter();
return TRUE;
}
break;
}
return FALSE;
}
示例8: LangSetWindowText
bool CPasswordDialog::OnInit()
{
#ifdef LANG
LangSetWindowText(HWND(*this), 0x02000B00);
LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
#endif
_passwordControl.Attach(GetItem(IDC_EDIT_PASSWORD));
_passwordControl.SetText(Password);
_passwordControl.SetPasswordChar(TEXT('*'));
return CModalDialog::OnInit();
}
示例9: LangSetWindowText
bool CPasswordDialog::OnInit()
{
#ifdef LANG
LangSetWindowText(HWND(*this), 0x02000B00);
LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
#endif
_passwordControl.Attach(GetItem(IDC_EDIT_PASSWORD));
CheckButton(IDC_CHECK_PASSWORD_SHOW, ShowPassword);
SetTextSpec();
return CModalDialog::OnInit();
}
示例10: LangSetDlgItemsText
bool CListViewDialog::OnInit()
{
#ifdef LANG
LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
#endif
_listView.Attach(GetItem(IDC_LISTVIEW_LIST));
if (ReadSingleClick())
_listView.SetExtendedListViewStyle(LVS_EX_ONECLICKACTIVATE | LVS_EX_TRACKSELECT);
SetText(Title);
LVCOLUMN columnInfo;
columnInfo.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM;
columnInfo.fmt = LVCFMT_LEFT;
columnInfo.iSubItem = 0;
columnInfo.cx = 200;
_listView.InsertColumn(0, &columnInfo);
for (int i = 0; i < Strings.Size(); i++)
_listView.InsertItem(i, Strings[i]);
if (Strings.Size() > 0)
_listView.SetItemState_FocusedSelected(0);
_listView.SetColumnWidthAuto(0);
StringsWereChanged = false;
NormalizeSize();
return CModalDialog::OnInit();
}
示例11: ASSERT
LRESULT CALLBACK Interpreter::CbtFilterHook(int code, WPARAM wParam, LPARAM lParam)
{
// Looking for HCBT_CREATEWND, just pass others on...
if (code == HCBT_CREATEWND)
{
//ASSERT(lParam != NULL);
//LPCREATESTRUCT lpcs = ((LPCBT_CREATEWND)lParam)->lpcs;
//ASSERT(lpcs != NULL);
OTE* underConstruction = m_oteUnderConstruction;
if (!underConstruction->isNil())
{
// Nil this out as soon as possible
m_oteUnderConstruction = Pointers.Nil;
underConstruction->countDown();
ASSERT(wParam != NULL); // should be non-NULL HWND
// set m_bDlgCreate to TRUE if it is a dialog box
// (this controls what kind of subclassing is done later)
//pThreadState->m_bDlgCreate = (lpcs->lpszClass == WC_DIALOG);
// Pass to Smalltalk for subclassing (catch unwind failures so not thrown out)
subclassWindow(underConstruction, HWND(wParam));
}
}
return ::CallNextHookEx(hHookOldCbtFilter, code, wParam, lParam);
}
示例12: uint32
//
/// Returns the callback. If the window exists, the handle of the window is returned.
//
uint32
TMci::GetCallback() const
{
if (Window)
return uint32(HWND(*Window));
return 0;
}
示例13: HWND
LRESULT CUIDialog::OnWindowsEnumNotify( WPARAM wparam, LPARAM )
{
HWND hWnd = HWND( wparam );
// 判断是本窗口的子窗口.
if ( GetSafeHwnd() == ::GetParent( hWnd ) )
{
// 判断是不是menu_worker
CString strClassName;
::GetClassName( hWnd, strClassName.GetBuffer( 100 ), 100 );
strClassName.ReleaseBuffer();
if ( strClassName == _T("menu_worker") )
{
// 添加到menu记录中.
this->m_tMenuWorkerWndList.push_back( hWnd );
if ( this->HasCmd( FS_ShowMenuBar ) )
{
// 显示出来会盖住菜单,所以这里暂时不显示.
// ::ShowWindow( hWnd, SW_SHOW );
}
else if( this->HasCmd( FS_HideMenuBar ) )
{
::ShowWindow( hWnd, SW_HIDE );
}
}
}
return TRUE;
}
示例14: Dlg_Warning
static BOOL CALLBACK Dlg_Warning(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_INITDIALOG:
CenterDlg(hDlg, -80); //Центрирование окна диалога в главном окне
SetWindowText(hDlg, (Lan+36)->msg); //Вывели новый заголовок
OutNameDlg(hDlg, IDC_STATICTEXT1, LPSTR(lParam)); //Усечение имени файла
SetDlgItemText(hDlg, IDC_STATICTEXT2, (Lan+65)->msg);
SetDlgItemText(hDlg, IDC_REWRITE, (Lan+66)->msg);
SetDlgItemText(hDlg, IDC_NEW, (Lan+67)->msg);
SetDlgItemText(hDlg, IDCANCEL, (Lan+68)->msg);
return TRUE;
case WM_CTLCOLORSTATIC:
if(GetDlgCtrlID(HWND(lParam)) == IDC_STATICTEXT2)
{ SetTextColor((HDC)wParam, RGB(255, 0, 0));
SetBkColor((HDC)wParam, FonLTGRAY);
return (BOOL)FonBrush;
}
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{ case IDC_REWRITE:
case IDC_NEW:
case IDCANCEL: EndDialog(hDlg, LOWORD(wParam)); //Вернули один из трех кодов
return TRUE;
}
break;
}
return FALSE;
}
示例15: MenuBar
MenuBar(Component* component) : Menu(new MenuAdapter(::CreateMenu())), _component(component)
{
if (component != App::getInstance())
throw UserInterfaceException("Only the App component can currently have a MenuBar.");
::SetMenu(HWND(component->getAdapter()->getHandle()), HMENU(getAdapter()->getHandle()));
}