本文整理汇总了C++中GetHWND函数的典型用法代码示例。如果您正苦于以下问题:C++ GetHWND函数的具体用法?C++ GetHWND怎么用?C++ GetHWND使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetHWND函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
NS_IMETHODIMP
otSystrayWin::SetTooltip(const nsAString &tooltip)
{
otSystrayBase::SetTooltip(tooltip);
if (mNid) {
NOTIFYICONDATA nid;
nid.cbSize = sizeof(nid);
nid.hWnd = GetHWND();
nid.uFlags = NIF_TIP;
nid.uID = mNid;
StringCchCopy(nid.szTip, 64, NS_ConvertUTF16toUTF8(mTooltip).get());
Shell_NotifyIcon(NIM_MODIFY, &nid);
}
return NS_OK;
}
示例2: wxGetCharSize
wxSize wxSpinCtrl::DoGetSizeFromTextSize(int xlen, int ylen) const
{
wxSize sizeBtn = wxSpinButton::DoGetBestSize();
int y;
wxGetCharSize(GetHWND(), NULL, &y, GetFont());
// JACS: we should always use the height calculated
// from above, because otherwise we'll get a spin control
// that's too big. So never use the height calculated
// from wxSpinButton::DoGetBestSize().
wxSize tsize(xlen + sizeBtn.x + MARGIN_BETWEEN + 3*y/10 + 10,
EDIT_HEIGHT_FROM_CHAR_HEIGHT(y));
// Check if the user requested a non-standard height.
if ( ylen > 0 )
tsize.IncBy(0, ylen - y);
return tsize;
}
示例3: GetHWND
LRESULT TopWindow::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
GuiLock __;
HWND hwnd = GetHWND();
#ifndef PLATFORM_WINCE
bool inloop;
#endif
switch(message) {
#ifndef PLATFORM_WINCE
case WM_QUERYENDSESSION:
inloop = InLoop();
WhenClose();
return inloop ? !InLoop() : !IsOpen();
#endif
case WM_CLOSE:
if(IsEnabled()) {
IgnoreMouseUp();
WhenClose();
}
return 0;
case WM_WINDOWPOSCHANGED:
if(!isopen)
break;
#ifndef PLATFORM_WINCE
if(IsIconic(hwnd))
state = MINIMIZED;
else
if(IsZoomed(hwnd))
state = MAXIMIZED;
else
#endif
{
state = OVERLAPPED;
if(IsWindowVisible(hwnd)) overlapped = GetScreenClient(hwnd); // 12-05-23 Tom added 'if(IsWindowVisible(hwnd))' to get only proper rectangles
}
LLOG("TopWindow::WindowProc::WM_WINDOWPOSCHANGED: overlapped = " << overlapped);
Layout();
break;
}
return Ctrl::WindowProc(message, wParam, lParam);
}
示例4: UpdateMenus
void UpdateMenus()
{
HMENU menu = GetMenu(GetHWND());
#define CHECKITEM(item,value) CheckMenuItem(menu,item,MF_BYCOMMAND | ((value) ? MF_CHECKED : MF_UNCHECKED));
CHECKITEM(ID_EMULATION_SPEEDLIMIT,g_Config.bSpeedLimit);
// CHECK(ID_OPTIONS_ENABLEFRAMEBUFFER,g_Config.bEnableFrameBuffer);
// CHECK(ID_OPTIONS_EMULATESYSCALL,g_bEmulateSyscall);
CHECKITEM(ID_OPTIONS_DISPLAYRAWFRAMEBUFFER, g_Config.bDisplayFramebuffer);
CHECKITEM(ID_OPTIONS_IGNOREILLEGALREADS,g_Config.bIgnoreBadMemAccess);
CHECKITEM(ID_CPU_INTERPRETER,g_Config.iCpuCore == CPU_INTERPRETER);
CHECKITEM(ID_CPU_FASTINTERPRETER,g_Config.iCpuCore == CPU_FASTINTERPRETER);
CHECKITEM(ID_CPU_DYNAREC,g_Config.iCpuCore == CPU_JIT);
CHECKITEM(ID_OPTIONS_BUFFEREDRENDERING, g_Config.bBufferedRendering);
CHECKITEM(ID_OPTIONS_SHOWDEBUGSTATISTICS, g_Config.bShowDebugStats);
BOOL enable = !Core_IsStepping();
EnableMenuItem(menu,ID_EMULATION_RUN,enable);
EnableMenuItem(menu,ID_EMULATION_PAUSE,!enable);
enable = g_State.bEmuThreadStarted;
EnableMenuItem(menu,ID_FILE_LOAD,enable);
EnableMenuItem(menu,ID_CPU_DYNAREC,enable);
EnableMenuItem(menu,ID_CPU_INTERPRETER,enable);
EnableMenuItem(menu,ID_CPU_FASTINTERPRETER,enable);
EnableMenuItem(menu,ID_DVD_INSERTISO,enable);
EnableMenuItem(menu,ID_FILE_BOOTBIOS,enable);
EnableMenuItem(menu,ID_EMULATION_STOP,!enable);
EnableMenuItem(menu,ID_OPTIONS_SETTINGS,enable);
EnableMenuItem(menu,ID_PLUGINS_CHOOSEPLUGINS,enable);
const int zoomitems[4] = {
ID_OPTIONS_SCREEN1X,
ID_OPTIONS_SCREEN2X,
ID_OPTIONS_SCREEN3X,
ID_OPTIONS_SCREEN4X,
};
for (int i = 0; i < 4; i++) {
CheckMenuItem(menu, zoomitems[i], MF_BYCOMMAND | ((i == g_Config.iWindowZoom - 1) ? MF_CHECKED : MF_UNCHECKED));
}
}
示例5: wxStrcpy
// Insert an item
bool wxTabCtrl::InsertItem(int item, const wxString& text, int imageId, void* data)
{
wxChar buf[256];
TC_ITEM tcItem;
tcItem.mask = TCIF_PARAM;
tcItem.lParam = (long) data;
if (!text.empty())
{
tcItem.mask |= TCIF_TEXT;
wxStrcpy(buf, (const wxChar*) text);
tcItem.pszText = buf;
tcItem.cchTextMax = 256;
}
if (imageId != -1)
{
tcItem.mask |= TCIF_IMAGE;
tcItem.iImage = imageId;
}
return (TabCtrl_InsertItem( (HWND) GetHWND(), item, & tcItem) != -1);
}
示例6: RevokeDragDrop
void Ctrl::WndFree()
{
GuiLock __;
if(!top) return;
RevokeDragDrop(GetHWND());
ReleaseUDropTarget(top->dndtgt);
isopen = false;
if(!top) return;
HWND owner = GetWindow(top->hwnd, GW_OWNER);// CXL 31.10.2003 z DoRemove
bool focus = ::GetFocus() == top->hwnd;
LLOG("Ctrl::WndDestroy owner " << (void *)owner
<< " focus " << focus
<< " ::GetFocus() " << (void *)::GetFocus());
if(owner && focus) { // CXL 7.11.2003 presun - melo by to fungovat take a neblikat...
LLOG("Ctrl::WndFree->SetFocus " << UPP::Name(Ctrl::CtrlFromHWND(owner)));
::SetFocus(owner);
}
LLOG(LOG_END << "//Ctrl::WndFree() in " <<UPP::Name(this));
delete top;
top = NULL;
}
示例7: wxGetCharSize
wxSize wxSpinCtrl::DoGetBestSize() const
{
wxSize sizeBtn = wxSpinButton::DoGetBestSize();
sizeBtn.x += DEFAULT_ITEM_WIDTH + MARGIN_BETWEEN;
int y;
wxGetCharSize(GetHWND(), NULL, &y, GetFont());
y = EDIT_HEIGHT_FROM_CHAR_HEIGHT(y);
// JACS: we should always use the height calculated
// from above, because otherwise we'll get a spin control
// that's too big. So never use the height calculated
// from wxSpinButton::DoGetBestSize().
// if ( sizeBtn.y < y )
{
// make the text tall enough
sizeBtn.y = y;
}
return sizeBtn;
}
示例8: DropHelper
HRESULT DropTarget::DragEnter(IDataObject* data_object,
DWORD key_state,
POINTL cursor_position,
DWORD* effect) {
// Tell the helper that we entered so it can update the drag image.
IDropTargetHelper* drop_helper = DropHelper();
if (drop_helper) {
drop_helper->DragEnter(GetHWND(), data_object,
reinterpret_cast<POINT*>(&cursor_position), *effect);
}
// You can't drag and drop within the same HWND.
if (suspended_) {
*effect = DROPEFFECT_NONE;
return S_OK;
}
current_data_object_ = data_object;
POINT screen_pt = { cursor_position.x, cursor_position.y };
*effect = OnDragEnter(current_data_object_, key_state, screen_pt, *effect);
return S_OK;
}
示例9: wxGetWindowText
wxSize wxCheckBox::DoGetBestSize() const
{
static int s_checkSize = 0;
if ( !s_checkSize )
{
wxScreenDC dc;
dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
s_checkSize = dc.GetCharHeight();
}
wxString str = wxGetWindowText(GetHWND());
int wCheckbox, hCheckbox;
if ( !str.empty() )
{
wxClientDC dc(const_cast<wxCheckBox *>(this));
dc.SetFont(GetFont());
dc.GetMultiLineTextExtent(GetLabelText(str), &wCheckbox, &hCheckbox);
wCheckbox += s_checkSize + GetCharWidth();
if ( hCheckbox < s_checkSize )
hCheckbox = s_checkSize;
}
else
{
wCheckbox = s_checkSize;
hCheckbox = s_checkSize;
}
#ifdef __WXWINCE__
hCheckbox += 1;
#endif
wxSize best(wCheckbox, hCheckbox);
CacheBestSize(best);
return best;
}
示例10: CalPos
/* void CEditWnd::Init(CEditUI* pOwner)
{
m_pOwner = pOwner;
RECT rcPos = CalPos();
UINT uStyle = WS_CHILD | ES_AUTOHSCROLL;
if( m_pOwner->IsPasswordMode() ) uStyle |= ES_PASSWORD;
Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos);
HFONT hFont=NULL;
int iFontIndex=m_pOwner->GetFont();
if (iFontIndex!=-1)
hFont=m_pOwner->GetManager()->GetFont(iFontIndex);
if (hFont==NULL)
hFont=m_pOwner->GetManager()->GetDefaultFontInfo()->hFont;
SetWindowFont(m_hWnd, hFont, TRUE);
Edit_LimitText(m_hWnd, m_pOwner->GetMaxChar());
if( m_pOwner->IsPasswordMode() ) Edit_SetPasswordChar(m_hWnd, m_pOwner->GetPasswordChar());
Edit_SetText(m_hWnd, m_pOwner->GetText());
Edit_SetModify(m_hWnd, FALSE);
SendMessage(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELPARAM(0, 0));
Edit_Enable(m_hWnd, m_pOwner->IsEnabled() == true);
Edit_SetReadOnly(m_hWnd, m_pOwner->IsReadOnly() == true);
//Styls
LONG styleValue = ::GetWindowLong(m_hWnd, GWL_STYLE);
styleValue |= pOwner->GetWindowStyls();
::SetWindowLong(GetHWND(), GWL_STYLE, styleValue);
::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE);
::SetFocus(m_hWnd);
m_bInit = true;
}
*/
void CEditWnd::Init(CEditUI* pOwner)
{
m_pOwner = pOwner;
RECT rcPos = CalPos();
//UINT uStyle = WS_CHILD | ES_AUTOHSCROLL;
UINT uStyle = WS_POPUP | ES_AUTOHSCROLL | WS_VISIBLE;
RECT rcWnd={0};
::GetWindowRect(m_pOwner->GetManager()->GetPaintWindow(), &rcWnd);
rcPos.left += rcWnd.left;
rcPos.right += rcWnd.left;
rcPos.top += rcWnd.top;
rcPos.bottom += rcWnd.top;
if( m_pOwner->IsPasswordMode() ) uStyle |= ES_PASSWORD;
Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos);
HFONT hFont=NULL;
int iFontIndex=m_pOwner->GetFont();
if (iFontIndex!=-1)
hFont=m_pOwner->GetManager()->GetFont(iFontIndex);
if (hFont==NULL)
hFont=m_pOwner->GetManager()->GetDefaultFontInfo()->hFont;
SetWindowFont(m_hWnd, hFont, TRUE);
Edit_LimitText(m_hWnd, m_pOwner->GetMaxChar());
if( m_pOwner->IsPasswordMode() ) Edit_SetPasswordChar(m_hWnd, m_pOwner->GetPasswordChar());
Edit_SetText(m_hWnd, m_pOwner->GetText());
Edit_SetModify(m_hWnd, FALSE);
SendMessage(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELPARAM(0, 0));
Edit_Enable(m_hWnd, m_pOwner->IsEnabled() == true);
Edit_SetReadOnly(m_hWnd, m_pOwner->IsReadOnly() == true);
//Styls
LONG styleValue = ::GetWindowLong(m_hWnd, GWL_STYLE);
styleValue |= pOwner->GetWindowStyls();
::SetWindowLong(GetHWND(), GWL_STYLE, styleValue);
::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE);
::SetFocus(m_hWnd);
m_bInit = true;
}
示例11: CalPos
void CEditWnd::Init(CEditUI* pOwner)
{
m_pOwner = pOwner;
RECT rcPos = CalPos();
UINT uStyle = WS_CHILD | ES_AUTOHSCROLL;
if( m_pOwner->IsPasswordMode() ) uStyle |= ES_PASSWORD;
Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos);
SetWindowFont(m_hWnd, m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->hFont, TRUE);
Edit_LimitText(m_hWnd, m_pOwner->GetMaxChar());
if( m_pOwner->IsPasswordMode() ) Edit_SetPasswordChar(m_hWnd, m_pOwner->GetPasswordChar());
Edit_SetText(m_hWnd, m_pOwner->GetText());
Edit_SetModify(m_hWnd, FALSE);
SendMessage(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELPARAM(0, 0));
Edit_Enable(m_hWnd, m_pOwner->IsEnabled() == true);
Edit_SetReadOnly(m_hWnd, m_pOwner->IsReadOnly() == true);
//Styls
LONG styleValue = ::GetWindowLong(m_hWnd, GWL_STYLE);
styleValue |= pOwner->GetWindowStyls();
::SetWindowLong(GetHWND(), GWL_STYLE, styleValue);
::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE);
::SetFocus(m_hWnd);
m_bInit = true;
}
示例12: GetMDIParent
void wxMDIChildFrame::MSWDestroyWindow()
{
wxMDIParentFrame * const parent = GetMDIParent();
// Must make sure this handle is invalidated (set to NULL) since all sorts
// of things could happen after the child client is destroyed, but before
// the wxFrame is destroyed.
HWND oldHandle = (HWND)GetHWND();
SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIDESTROY,
(WPARAM)oldHandle, 0);
if (parent->GetActiveChild() == NULL)
ResetWindowStyle(NULL);
if (m_hMenu)
{
::DestroyMenu((HMENU) m_hMenu);
m_hMenu = 0;
}
wxRemoveHandleAssociation(this);
m_hWnd = 0;
}
示例13: getWindowsBorderRect
void LoginForm::setFrameRegion()
{
#ifdef WIN32
wxRect wbr = getWindowsBorderRect();
wxPoint br = wbr.GetBottomRight();
br.x += 2;
br.y += 2;
wxRegion region = CreateRoundRectRgn(wbr.x, wbr.y, br.x, br.y, 5, 5);
// Windows takes ownership of the region, so
// we'll have to make a copy of the region to give to it.
DWORD noBytes = ::GetRegionData(GetHrgnOf(region), 0, nullptr);
RGNDATA *rgnData = (RGNDATA*) new char[noBytes];
::GetRegionData(GetHrgnOf(region), noBytes, rgnData);
HRGN hrgn = ::ExtCreateRegion(nullptr, noBytes, rgnData);
delete[] (char*) rgnData;
// Now call the shape API with the new region.
::SetWindowRgn((HWND)GetHWND(), hrgn, FALSE);
#endif // LINUX TODO
}
示例14: UpdateCommands
void UpdateCommands() {
static GlobalUIState lastGlobalUIState = UISTATE_PAUSEMENU;
static CoreState lastCoreState = CORE_ERROR;
if (lastGlobalUIState == globalUIState && lastCoreState == coreState)
return;
lastCoreState = coreState;
lastGlobalUIState = globalUIState;
HMENU menu = GetMenu(GetHWND());
const char* pauseMenuText = (Core_IsStepping() || globalUIState != UISTATE_INGAME) ? "Run\tF8" : "Pause\tF8";
ModifyMenu(menu, ID_TOGGLE_PAUSE, MF_BYCOMMAND | MF_STRING, ID_TOGGLE_PAUSE, pauseMenuText);
UINT ingameEnable = globalUIState == UISTATE_INGAME ? MF_ENABLED : MF_GRAYED;
EnableMenuItem(menu, ID_TOGGLE_PAUSE, ingameEnable);
EnableMenuItem(menu, ID_EMULATION_STOP, ingameEnable);
EnableMenuItem(menu, ID_EMULATION_RESET, ingameEnable);
UINT menuEnable = globalUIState == UISTATE_MENU ? MF_ENABLED : MF_GRAYED;
EnableMenuItem(menu, ID_FILE_SAVESTATEFILE, !menuEnable);
EnableMenuItem(menu, ID_FILE_LOADSTATEFILE, !menuEnable);
EnableMenuItem(menu, ID_FILE_QUICKSAVESTATE, !menuEnable);
EnableMenuItem(menu, ID_FILE_QUICKLOADSTATE, !menuEnable);
EnableMenuItem(menu, ID_CPU_DYNAREC, menuEnable);
EnableMenuItem(menu, ID_CPU_INTERPRETER, menuEnable);
EnableMenuItem(menu, ID_CPU_MULTITHREADED, menuEnable);
EnableMenuItem(menu, ID_IO_MULTITHREADED, menuEnable);
EnableMenuItem(menu, ID_TOGGLE_PAUSE, !menuEnable);
EnableMenuItem(menu, ID_EMULATION_STOP, !menuEnable);
EnableMenuItem(menu, ID_EMULATION_RESET, !menuEnable);
EnableMenuItem(menu, ID_DEBUG_LOG, !g_Config.bEnableLogging);
EnableMenuItem(menu, ID_EMULATION_RENDER_MODE_OGL, menuEnable);
EnableMenuItem(menu, ID_EMULATION_RENDER_MODE_SOFT, menuEnable);
EnableMenuItem(menu, ID_EMULATION_ATRAC3_SOUND, !Atrac3plus_Decoder::IsInstalled());
}
示例15: SetName
bool wxWindow::LoadNativeDialog(wxWindow* parent, const wxString& name)
{
SetName(name);
wxWindowCreationHook hook(this);
m_hWnd = (WXHWND)::CreateDialog((HINSTANCE) wxGetInstance(),
name.c_str(),
parent ? (HWND)parent->GetHWND() : 0,
(DLGPROC)wxDlgProc);
if ( !m_hWnd )
return false;
SubclassWin(GetHWND());
if ( parent )
parent->AddChild(this);
else
wxTopLevelWindows.Append(this);
// Enumerate all children
HWND hWndNext;
hWndNext = ::GetWindow((HWND) m_hWnd, GW_CHILD);
if (hWndNext)
CreateWindowFromHWND(this, (WXHWND) hWndNext);
while (hWndNext != (HWND) NULL)
{
hWndNext = ::GetWindow(hWndNext, GW_HWNDNEXT);
if (hWndNext)
CreateWindowFromHWND(this, (WXHWND) hWndNext);
}
return true;
}