• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetHwndOf函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetHwndOf函数的典型用法代码示例。如果您正苦于以下问题:C++ GetHwndOf函数的具体用法?C++ GetHwndOf怎么用?C++ GetHwndOf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetHwndOf函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Remove

void wxToolTip::SetWindow(wxWindow *win)
{
    Remove();

    m_window = win;

    // add the window itself
    if ( m_window )
    {
        DoAddHWND(m_window->GetHWND());
    }
#if !defined(__WXUNIVERSAL__)
    // and all of its subcontrols (e.g. radio buttons in a radiobox) as well
    wxControl *control = wxDynamicCast(m_window, wxControl);
    if ( control )
    {
        const wxArrayLong& subcontrols = control->GetSubcontrols();
        size_t count = subcontrols.GetCount();
        for ( size_t n = 0; n < count; n++ )
        {
            int id = subcontrols[n];
            HWND hwnd = GetDlgItem(GetHwndOf(m_window), id);
            if ( !hwnd )
            {
                // maybe it's a child of parent of the control, in fact?
                // (radiobuttons are subcontrols, i.e. children of the radiobox
                // for wxWidgets but are its siblings at Windows level)
                hwnd = GetDlgItem(GetHwndOf(m_window->GetParent()), id);
            }

            // must have it by now!
            wxASSERT_MSG( hwnd, wxT("no hwnd for subcontrol?") );

            AddOtherWindow((WXHWND)hwnd);
        }
    }
#endif // !defined(__WXUNIVERSAL__)
}
开发者ID:EEmmanuel7,项目名称:wxWidgets,代码行数:38,代码来源:tooltip.cpp


示例2: GetHwndOf

bool wxRadioBox::Reparent(wxWindowBase *newParent)
{
    if ( !wxStaticBox::Reparent(newParent) )
    {
        return false;
    }

    HWND hwndParent = GetHwndOf(GetParent());
    for ( size_t item = 0; item < m_radioButtons->GetCount(); item++ )
    {
        ::SetParent((*m_radioButtons)[item], hwndParent);
    }
    return true;
}
开发者ID:Asmodean-,项目名称:Ishiiruka,代码行数:14,代码来源:radiobox.cpp


示例3: LaunchTortoiseAct

void ConflictListDialog::OnMenuDiff(wxCommandEvent&)
{
   int nItems = myFiles->GetItemCount();

   for (int i = 0; i < nItems; ++i)
   {
      if (myFiles->IsSelected(i))
      {
         std::string file = ((ConflictListDialog::ItemData*) myFiles->GetItemData(i))->m_Filename;
         LaunchTortoiseAct(false, CvsDiffVerb, file, "", GetHwndOf(this)); 
         return;
      }
   }
}
开发者ID:pampersrocker,项目名称:G-CVSNT,代码行数:14,代码来源:ConflictListDialog.cpp


示例4: ImageList_Destroy

// Create a drag image for the given tree control item
bool wxDragImage::Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id)
{
    if ( m_hImageList )
        ImageList_Destroy(GetHimageList());
    m_hImageList = (WXHIMAGELIST)
        TreeView_CreateDragImage(GetHwndOf(&treeCtrl), (HTREEITEM) id.m_pItem);
    if ( !m_hImageList )
    {
        // fall back on just the item text if there is no image
        return Create(treeCtrl.GetItemText(id));
    }

    return true;
}
开发者ID:NullNoname,项目名称:dolphin,代码行数:15,代码来源:dragimag.cpp


示例5: EndMeasuring

void wxTextMeasure::EndMeasuring()
{
    if ( m_hfontOld )
    {
        ::SelectObject(m_hdc, m_hfontOld);
        m_hfontOld = NULL;
    }

    if ( m_win )
        ::ReleaseDC(GetHwndOf(m_win), m_hdc);
    //else: our HDC belongs to m_dc, don't touch it

    m_hdc = NULL;
}
开发者ID:0ryuO,项目名称:dolphin-avsync,代码行数:14,代码来源:textmeasure.cpp


示例6: Free

void wxStaticBitmap::SetImageNoCopy( wxGDIImage* image)
{
    Free();

    m_isIcon = image->IsKindOf( CLASSINFO(wxIcon) );
    // the image has already been copied
    m_image = image;

    int x, y;
    int w, h;
    GetPosition(&x, &y);
    GetSize(&w, &h);

#ifdef __WIN32__
    HANDLE handle = (HANDLE)m_image->GetHandle();
    LONG style = ::GetWindowLong( (HWND)GetHWND(), GWL_STYLE ) ;
    ::SetWindowLong( (HWND)GetHWND(), GWL_STYLE, ( style & ~( SS_BITMAP|SS_ICON ) ) |
                     ( m_isIcon ? SS_ICON : SS_BITMAP ) );
    HGDIOBJ oldHandle = (HGDIOBJ)::SendMessage(GetHwnd(), STM_SETIMAGE,
                  m_isIcon ? IMAGE_ICON : IMAGE_BITMAP, (LPARAM)handle);
    // detect if this is still the handle we passed before or
    // if the static-control made a copy of the bitmap!
    if (m_currentHandle != 0 && oldHandle != (HGDIOBJ) m_currentHandle)
    {
        // the static control made a copy and we are responsible for deleting it
        DeleteObject((HGDIOBJ) oldHandle);
    }
    m_currentHandle = (WXHANDLE)handle;
#endif // Win32

    if ( ImageIsOk() )
    {
        int width = image->GetWidth(),
            height = image->GetHeight();
        if ( width && height )
        {
            w = width;
            h = height;

            ::MoveWindow(GetHwnd(), x, y, width, height, FALSE);
        }
    }

    RECT rect;
    rect.left   = x;
    rect.top    = y;
    rect.right  = x + w;
    rect.bottom = y + h;
    ::InvalidateRect(GetHwndOf(GetParent()), &rect, TRUE);
}
开发者ID:DumaGit,项目名称:winsparkle,代码行数:50,代码来源:statbmp.cpp


示例7: CanPaste

bool wxTextCtrl::CanPaste() const
{
    if ( !IsEditable() )
        return false;

    // Standard edit control: check for straight text on clipboard
    if ( !::OpenClipboard(GetHwndOf(wxTheApp->GetTopWindow())) )
        return false;

    bool isTextAvailable = ::IsClipboardFormatAvailable(CF_TEXT) != 0;
    ::CloseClipboard();

    return isTextAvailable;
}
开发者ID:ACanadianKernel,项目名称:pcsx2,代码行数:14,代码来源:textctrlce.cpp


示例8: memset

int wxColourDialog::ShowModal()
{
    CHOOSECOLOR chooseColorStruct;
    COLORREF custColours[16];
    memset(&chooseColorStruct, 0, sizeof(CHOOSECOLOR));

    int i;
    for (i = 0; i < 16; i++)
    {
        if (m_colourData.m_custColours[i].Ok())
            custColours[i] = wxColourToRGB(m_colourData.m_custColours[i]);
        else
            custColours[i] = RGB(255,255,255);
    }

    chooseColorStruct.lStructSize = sizeof(CHOOSECOLOR);
    if ( m_parent )
        chooseColorStruct.hwndOwner = GetHwndOf(m_parent);
    chooseColorStruct.rgbResult = wxColourToRGB(m_colourData.m_dataColour);
    chooseColorStruct.lpCustColors = custColours;

    chooseColorStruct.Flags = CC_RGBINIT | CC_ENABLEHOOK;
    chooseColorStruct.lCustData = (LPARAM)this;
    chooseColorStruct.lpfnHook = wxColourDialogHookProc;

    if (m_colourData.GetChooseFull())
        chooseColorStruct.Flags |= CC_FULLOPEN;

    // Do the modal dialog
    bool success = ::ChooseColor(&(chooseColorStruct)) != 0;

    // Try to highlight the correct window (the parent)
    if (GetParent())
    {
      HWND hWndParent = (HWND) GetParent()->GetHWND();
      if (hWndParent)
        ::BringWindowToTop(hWndParent);
    }


    // Restore values
    for (i = 0; i < 16; i++)
    {
      wxRGBToColour(m_colourData.m_custColours[i], custColours[i]);
    }

    wxRGBToColour(m_colourData.m_dataColour, chooseColorStruct.rgbResult);

    return success ? wxID_OK : wxID_CANCEL;
}
开发者ID:252525fb,项目名称:rpcs3,代码行数:50,代码来源:colordlg.cpp


示例9: ti

void wxToolTip::SetTip( const wxString &tip )
{
    m_text = tip;

    if ( m_window )
    {
#if 0
    // update it immediately
    wxToolInfo ti(GetHwndOf(m_window));
    ti.lpszText = (wxChar *)m_text.c_str();

    (void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, 0, &ti);
#endif
    }
}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:15,代码来源:tooltip.cpp


示例10: MSWShouldPreProcessMessage

bool wxChoice::MSWShouldPreProcessMessage(WXMSG *pMsg)
{
    MSG *msg = (MSG *) pMsg;

    // if the dropdown list is visible, don't preprocess certain keys
    if ( msg->message == WM_KEYDOWN
        && (msg->wParam == VK_ESCAPE || msg->wParam == VK_RETURN) )
    {
        if (::SendMessage(GetHwndOf(this), CB_GETDROPPEDSTATE, 0, 0))
        {
            return false;
        }
    }

    return wxControl::MSWShouldPreProcessMessage(pMsg);
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:16,代码来源:choice.cpp


示例11: notifyData

bool wxTaskBarIcon::RemoveIcon()
{
    if (!m_iconAdded)
        return false;

    m_iconAdded = false;

    NotifyIconData notifyData(GetHwndOf(m_win));

    bool ok = Shell_NotifyIcon(NIM_DELETE, &notifyData) != 0;
    if ( !ok )
    {
        wxLogLastError(wxT("Shell_NotifyIcon(NIM_DELETE)"));
    }

    return ok;
}
开发者ID:EEmmanuel7,项目名称:wxWidgets,代码行数:17,代码来源:taskbar.cpp


示例12: GetPosition

WXLRESULT
wxStatusBar95::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
#ifndef __WXWINCE__
    if ( nMsg == WM_WINDOWPOSCHANGING )
    {
        WINDOWPOS *lpPos = (WINDOWPOS *)lParam;
        int x, y, w, h;
        GetPosition(&x, &y);
        GetSize(&w, &h);

        // we need real window coords and not wx client coords
        AdjustForParentClientOrigin(x, y);

        lpPos->x  = x;
        lpPos->y  = y;
        lpPos->cx = w;
        lpPos->cy = h;

        return 0;
    }

    if ( nMsg == WM_NCLBUTTONDOWN )
    {
        // if hit-test is on gripper then send message to TLW to begin
        // resizing. It is possible to send this message to any window.
        if ( wParam == HTBOTTOMRIGHT )
        {
            wxWindow *win;

            for ( win = GetParent(); win; win = win->GetParent() )
            {
                if ( win->IsTopLevel() )
                {
                    SendMessage(GetHwndOf(win), WM_NCLBUTTONDOWN,
                                wParam, lParam);

                    return 0;
                }
            }
        }
    }
#endif

    return wxStatusBarBase::MSWWindowProc(nMsg, wParam, lParam);
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:46,代码来源:statbr95.cpp


示例13: GetHwndOf

int CocoaDialogApp::OnExit() {
#ifdef __WXMSW__
	if (m_parentWnd) {
		// Activate the parent frame
		HWND hwnd = GetHwndOf(m_parentWnd);
		::SetForegroundWindow(hwnd);
		::SetFocus(hwnd);

		m_parentWnd->DissociateHandle();
		delete m_parentWnd;
	}
#endif //__WXMSW__

	wxLogDebug(wxT("wxCD exit done"));

	return wxApp::OnExit();
}
开发者ID:bluemoon,项目名称:wxcocoadialog,代码行数:17,代码来源:CocoaDialog.cpp


示例14: GetRect

bool wxSpinCtrl::Reparent(wxWindowBase *newParent)
{
    // Reparenting both the updown control and its buddy does not seem to work:
    // they continue to be connected somehow, but visually there is no feedback
    // on the buddy edit control. To avoid this problem, we reparent the buddy
    // window normally, but we recreate the updown control and reassign its
    // buddy.

    // Get the position before changing the parent as it would be offset after
    // changing it.
    const wxRect rect = GetRect();

    if ( !wxWindowBase::Reparent(newParent) )
        return false;

    newParent->GetChildren().DeleteObject(this);

    // destroy the old spin button after detaching it from this wxWindow object
    // (notice that m_hWnd will be reset by UnsubclassWin() so save it first)
    const HWND hwndOld = GetHwnd();
    UnsubclassWin();
    if ( !::DestroyWindow(hwndOld) )
    {
        wxLogLastError(wxT("DestroyWindow"));
    }

    // create and initialize the new one
    if ( !wxSpinButton::Create(GetParent(), GetId(),
                               rect.GetPosition(), rect.GetSize(),
                               GetWindowStyle(), GetName()) )
        return false;

    // reapply our values to wxSpinButton
    wxSpinButton::SetValue(GetValue());
    SetRange(m_min, m_max);

    // also set the size again with wxSIZE_ALLOW_MINUS_ONE flag: this is
    // necessary if our original position used -1 for either x or y
    SetSize(rect, wxSIZE_ALLOW_MINUS_ONE);

    // associate it with the buddy control again
    ::SetParent(GetBuddyHwnd(), GetHwndOf(GetParent()));
    (void)::SendMessage(GetHwnd(), UDM_SETBUDDY, (WPARAM)GetBuddyHwnd(), 0);

    return true;
}
开发者ID:krossell,项目名称:wxWidgets,代码行数:46,代码来源:spinctrl.cpp


示例15: wxCHECK_MSG

bool
wxTaskBarIcon::ShowBalloon(const wxString& title,
                           const wxString& text,
                           unsigned msec,
                           int flags)
{
    wxCHECK_MSG( m_iconAdded, false,
                    wxT("can't be used before the icon is created") );

    const HWND hwnd = GetHwndOf(m_win);

    // we need to enable version 5.0 behaviour to receive notifications about
    // the balloon disappearance
    NotifyIconData notifyData(hwnd);
    notifyData.uFlags = 0;
    notifyData.uVersion = 3 /* NOTIFYICON_VERSION for Windows 2000/XP */;

    if ( !Shell_NotifyIcon(NIM_SETVERSION, &notifyData) )
    {
        wxLogLastError(wxT("Shell_NotifyIcon(NIM_SETVERSION)"));
    }

    // do show the balloon now
    notifyData = NotifyIconData(hwnd);
    notifyData.uFlags |= NIF_INFO;
    notifyData.uTimeout = msec;
    wxStrlcpy(notifyData.szInfo, text.t_str(), WXSIZEOF(notifyData.szInfo));
    wxStrlcpy(notifyData.szInfoTitle, title.t_str(),
                WXSIZEOF(notifyData.szInfoTitle));

    if ( flags & wxICON_INFORMATION )
        notifyData.dwInfoFlags |= NIIF_INFO;
    else if ( flags & wxICON_WARNING )
        notifyData.dwInfoFlags |= NIIF_WARNING;
    else if ( flags & wxICON_ERROR )
        notifyData.dwInfoFlags |= NIIF_ERROR;

    bool ok = Shell_NotifyIcon(NIM_MODIFY, &notifyData) != 0;
    if ( !ok )
    {
        wxLogLastError(wxT("Shell_NotifyIcon(NIM_MODIFY)"));
    }

    return ok;
}
开发者ID:EEmmanuel7,项目名称:wxWidgets,代码行数:45,代码来源:taskbar.cpp


示例16: GetHwndOf

bool wxRadioBox::Reparent(wxWindowBase *newParent)
{
    if ( !wxStaticBox::Reparent(newParent) )
    {
        return false;
    }

    HWND hwndParent = GetHwndOf(GetParent());
    for ( size_t item = 0; item < m_radioButtons->GetCount(); item++ )
    {
        ::SetParent((*m_radioButtons)[item], hwndParent);
    }
#ifdef __WXWINCE__
    // put static box under the buttons in the Z-order
    SetWindowPos(GetHwnd(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
#endif
    return true;
}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:18,代码来源:radiobox.cpp


示例17: GetWindowRect

void wxMDIChildFrame::DoGetPosition(int *x, int *y) const
{
  RECT rect;
  GetWindowRect(GetHwnd(), &rect);
  POINT point;
  point.x = rect.left;
  point.y = rect.top;

  // Since we now have the absolute screen coords,
  // if there's a parent we must subtract its top left corner
  wxMDIParentFrame * const mdiParent = GetMDIParent();
  ::ScreenToClient(GetHwndOf(mdiParent->GetClientWindow()), &point);

  if (x)
      *x = point.x;
  if (y)
      *y = point.y;
}
开发者ID:DumaGit,项目名称:winsparkle,代码行数:18,代码来源:mdi.cpp


示例18: SendDestroyEvent

wxTopLevelWindowMSW::~wxTopLevelWindowMSW()
{
    delete m_menuSystem;

    SendDestroyEvent();

    // after destroying an owned window, Windows activates the next top level
    // window in Z order but it may be different from our owner (to reproduce
    // this simply Alt-TAB to another application and back before closing the
    // owned frame) whereas we always want to yield activation to our parent
    if ( HasFlag(wxFRAME_FLOAT_ON_PARENT) )
    {
        wxWindow *parent = GetParent();
        if ( parent )
        {
            ::BringWindowToTop(GetHwndOf(parent));
        }
    }
}
开发者ID:draekko,项目名称:wxWidgets,代码行数:19,代码来源:toplevel.cpp


示例19: ti

void wxToolTip::SetTip(const wxString& tip)
{
    m_text = tip;

    if ( m_window )
    {
        // update the tip text shown by the control
        wxToolInfo ti(GetHwndOf(m_window), m_id, m_rect);

        // for some reason, changing the tooltip text directly results in
        // repaint of the controls under it, see #10520 -- but this doesn't
        // happen if we reset it first
        ti.lpszText = const_cast<wxChar *>(wxT(""));
        (void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, &ti);

        ti.lpszText = const_cast<wxChar *>(m_text.wx_str());
        (void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, &ti);
    }
}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:19,代码来源:tooltip.cpp


示例20: wxCHECK_MSG

bool
wxNativeWindow::Create(wxWindow* parent,
                       wxWindowID winid,
                       wxNativeWindowHandle hwnd)
{
    wxCHECK_MSG( hwnd, false, wxS("Invalid null HWND") );
    wxCHECK_MSG( parent, false, wxS("Must have a valid parent") );
    wxASSERT_MSG( ::GetParent(hwnd) == GetHwndOf(parent),
                  wxS("The native window has incorrect parent") );

    const wxRect r = wxRectFromRECT(wxGetWindowRect(hwnd));

    // Skip wxWindow::Create() which would try to create a new HWND, we don't
    // want this as we already have one.
    if ( !CreateBase(parent, winid,
                     r.GetPosition(), r.GetSize(),
                     0, wxDefaultValidator, wxS("nativewindow")) )
        return false;

    parent->AddChild(this);

    SubclassWin(hwnd);

    if ( winid == wxID_ANY )
    {
        // We allocated a new ID to the control, use it at Windows level as
        // well because we assume that our and MSW IDs are the same in many
        // places and it seems prudent to avoid breaking this assumption.
        SetId(GetId());
    }
    else // We used a fixed ID.
    {
        // For the same reason as above, check that it's the same as the one
        // used by the native HWND.
        wxASSERT_MSG( ::GetWindowLong(hwnd, GWL_ID) == winid,
                      wxS("Mismatch between wx and native IDs") );
    }

    InheritAttributes();

    return true;
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:42,代码来源:nativewin.cpp



注:本文中的GetHwndOf函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetI18NCategory函数代码示例发布时间:2022-05-30
下一篇:
C++ GetHwnd函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap