这篇教程C++ GetClassLong函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetClassLong函数的典型用法代码示例。如果您正苦于以下问题:C++ GetClassLong函数的具体用法?C++ GetClassLong怎么用?C++ GetClassLong使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetClassLong函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: get_window_icon_bigHICON get_window_icon_big(HWND hwnd, bool allow_from_class){ HICON hIcon = 0; SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon); if (!hIcon) SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon); if (!hIcon) SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon); if (allow_from_class) { if (!hIcon) hIcon = (HICON)GetClassLong(hwnd, GCL_HICON); if (!hIcon) hIcon = (HICON)GetClassLong(hwnd, GCL_HICONSM); } if (!hIcon) SendMessageTimeout(hwnd, WM_QUERYDRAGICON, 0, 0, 0, 1000, (LPDWORD)&hIcon); return hIcon;}
开发者ID:svn2github,项目名称:ros-explorer,代码行数:25,
示例2: dcvoid CSizingControlBar::OnNcPaint(){ // get window DC that is clipped to the non-client area CWindowDC dc(this); CRect rcClient, rcBar; GetClientRect(rcClient); ClientToScreen(rcClient); GetWindowRect(rcBar); rcClient.OffsetRect(-rcBar.TopLeft()); rcBar.OffsetRect(-rcBar.TopLeft()); CDC mdc; mdc.CreateCompatibleDC(&dc); CBitmap bm; bm.CreateCompatibleBitmap(&dc, rcBar.Width(), rcBar.Height()); CBitmap* pOldBm = mdc.SelectObject(&bm); // draw borders in non-client area CRect rcDraw = rcBar; DrawBorders(&mdc, rcDraw); // erase the NC background#ifdef _WIN64 mdc.FillRect(rcDraw, CBrush::FromHandle( (HBRUSH) GetClassLong(m_hWnd, GCLP_HBRBACKGROUND)));#else mdc.FillRect(rcDraw, CBrush::FromHandle( (HBRUSH) GetClassLong(m_hWnd, GCL_HBRBACKGROUND)));#endif if (m_dwSCBStyle & SCBS_SHOWEDGES) { CRect rcEdge; // paint the sizing edges for (int i = 0; i < 4; i++) if (GetEdgeRect(rcBar, GetEdgeHTCode(i), rcEdge)) mdc.Draw3dRect(rcEdge, ::GetSysColor(COLOR_BTNHIGHLIGHT), ::GetSysColor(COLOR_BTNSHADOW)); } NcPaintGripper(&mdc, rcClient); // client area is not our bussiness :) dc.IntersectClipRect(rcBar); dc.ExcludeClipRect(rcClient); dc.BitBlt(0, 0, rcBar.Width(), rcBar.Height(), &mdc, 0, 0, SRCCOPY); ReleaseDC(&dc); mdc.SelectObject(pOldBm); bm.DeleteObject(); mdc.DeleteDC();}
开发者ID:banduladh,项目名称:meplayer,代码行数:55,
示例3: CImageListvoid CTaskSwitcher32Dlg::FilterList(){ m_windowList2.DeleteAllItems(); window_list *list = window_item::get_window_list(); CImageList *pImageList = new CImageList(); pImageList->Create( 16, 16, ILC_COLOR32 | ILC_MASK | ILC_PERITEMMIRROR, 0, 10); m_windowList2.SetImageList( pImageList, LVSIL_SMALL); int default_idx = pImageList->Add( m_hIcon ); for ( unsigned int i = 0; i < list->size(); i++ ) { window_item *item = (*list)[i]; bool ok = true; if ( this->search.length() > 0 ) { int pos = item->get_lower_title().find( this->search ) ; int pos2 = item->get_process_name().find( this->search ); if ( pos == std::string::npos && pos2 == std::string::npos ) ok = false; } if ( ok ) { HWND hwnd = item->get_handle(); HICON hIcon = NULL; SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon); if (!hIcon) SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon); if (!hIcon) SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL, 0, SMTO_ABORTIFHUNG, 1000, (LPDWORD)&hIcon); if (!hIcon) hIcon = (HICON)GetClassLong(hwnd, GCL_HICON); if (!hIcon) hIcon = (HICON)GetClassLong(hwnd, GCL_HICONSM); int imageidx = -1; if ( hIcon != NULL ) { HICON iconCopy = CopyIcon( hIcon ); imageidx = pImageList->Add( iconCopy ); DestroyIcon( iconCopy ); } else { imageidx = 1; } int idx = m_windowList2.InsertItem( 0, item->get_title().c_str(), imageidx ); m_windowList2.SetItem( idx, 1, LVIF_TEXT | LVIF_IMAGE, item->get_process_name().c_str(), imageidx, 0, 0, 0 ); m_windowList2.SetItemData( idx, (DWORD_PTR) item ); } } m_windowList2.SetItemState( 0, LVIS_SELECTED, LVIS_SELECTED ); m_windowList2.SetSelectionMark( 0 );}
开发者ID:jacksondk,项目名称:taskswitcher32,代码行数:54,
示例4: SetWindowLongPtr /////////////////////////////////////////////////////////////////////// /// Function: WindowClassProc /// /// Author: $author$ /// Date: 4/6/2012 /////////////////////////////////////////////////////////////////////// static LRESULT CALLBACK WindowClassProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { LRESULT lResult = 0; XosWinWindow* target = 0; WNDPROC windowSubclassProc = 0; DWORD wndExtra; DWORD wndIndex; DWORD wndClassExtra; DWORD wndClassIndex; if (sizeof(XosWinWindow*) <= (wndExtra = GetClassLong(hWnd, GCL_CBWNDEXTRA))) if (0 <= (wndIndex = wndExtra-sizeof(XosWinWindow*))) if ((target = (XosWinWindow*)(GetWindowLongPtr(hWnd, wndIndex)))) { lResult = target->OnWindowMessage(hWnd, msg, wParam, lParam); return lResult; } else if ((WM_NCCREATE == msg)) { CREATESTRUCT* cs; if ((cs = (CREATESTRUCT*)(lParam))) if ((target = (XosWinWindow*)(cs->lpCreateParams))) if (sizeof(windowSubclassProc) <= (wndClassExtra = GetClassLong(hWnd, GCL_CBCLSEXTRA))) if (0 <= (wndClassIndex = wndClassExtra-sizeof(windowSubclassProc))) if ((windowSubclassProc = (WNDPROC)(GetClassLongPtr(hWnd, wndClassIndex)))) { SetWindowLongPtr(hWnd, wndIndex, (LONG_PTR)(target)); if (!(target->Attached())) target->Attach(hWnd); lResult = target->OnWindowMessage(hWnd, msg, wParam, lParam); return lResult; } } if (sizeof(windowSubclassProc) <= (wndClassExtra = GetClassLong(hWnd, GCL_CBCLSEXTRA))) if (0 <= (wndClassIndex = wndClassExtra-sizeof(windowSubclassProc))) windowSubclassProc = (WNDPROC)(GetClassLongPtr(hWnd, wndClassIndex)); if (windowSubclassProc) lResult = CallWindowProc (windowSubclassProc, hWnd, msg, wParam, lParam); else lResult = DefWindowProc(hWnd, msg, wParam, lParam); return lResult; }
开发者ID:medusade,项目名称:mxde,代码行数:55,
示例5: refresh_happiness_bitmap/**************************************************************************...**************************************************************************/static void refresh_happiness_bitmap(HBITMAP bmp, struct city *pcity, enum citizen_feeling index){ enum citizen_category citizens[MAX_CITY_SIZE]; RECT rc; int i; int num_citizens = get_city_citizen_types(pcity, index, citizens); int pix_width = HAPPINESS_PIX_WIDTH * tileset_small_sprite_width(tileset); int offset = MIN(tileset_small_sprite_width(tileset), pix_width / num_citizens); /* int true_pix_width = (num_citizens - 1) * offset + tileset_small_sprite_width(tileset); */ HDC hdc = CreateCompatibleDC(NULL); HBITMAP old=SelectObject(hdc,bmp); rc.left=0; rc.top=0; rc.right=pix_width; rc.bottom=tileset_small_sprite_height(tileset); FillRect(hdc,&rc,(HBRUSH)GetClassLong(root_window,GCL_HBRBACKGROUND)); for (i = 0; i < num_citizens; i++) { draw_sprite(get_citizen_sprite(tileset, citizens[i], i, pcity), hdc, i * offset, 0); } SelectObject(hdc,old); DeleteDC(hdc);}
开发者ID:zielmicha,项目名称:freeciv-mirror,代码行数:31,
示例6: SetClassLongint CAnsiWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CWnd::OnCreate(lpCreateStruct) == -1) return -1; SetClassLong(GetSafeHwnd(), GCL_STYLE, GetClassLong(GetSafeHwnd(), GCL_STYLE)-CS_VREDRAW); while ( m_strList.GetCount () < pDoc->m_nScrollSize ) m_strList.AddTail(""); // Init colors m_nCurrentBg = 0; m_nCurrentFg =7; //=================================================================================================================== ((CMainFrame*)AfxGetMainWnd())->m_editBar.GetDlgItem(IDC_EDIT)->SetFont(&pDoc->m_fntText); CRect rect; GetClientRect(&rect); // To init screen dimentions in characters !!! SetScrollSettings(); return 0;}
开发者ID:chenwei600,项目名称:jmc,代码行数:26,
示例7: sys_directx_set_close_button_callback/* sys_directx_set_close_button_callback: * Sets the close button callback function. */static int sys_directx_set_close_button_callback(void (*proc)(void)){ DWORD class_style; HMENU sys_menu; HWND allegro_wnd = win_get_window(); user_close_proc = proc; /* get the old class style */ class_style = GetClassLong(allegro_wnd, GCL_STYLE); /* and the system menu handle */ sys_menu = GetSystemMenu(allegro_wnd, FALSE); /* enable or disable the no_close_button flag and the close menu option */ if (proc) { class_style &= ~CS_NOCLOSE; EnableMenuItem(sys_menu, SC_CLOSE, MF_BYCOMMAND | MF_ENABLED); } else { class_style |= CS_NOCLOSE; EnableMenuItem(sys_menu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED); } /* change the class to the new style */ SetClassLong(allegro_wnd, GCL_STYLE, class_style); /* Redraw the whole window to display the changes of the button. * (we use this because UpdateWindow() only works for the client area) */ RedrawWindow(allegro_wnd, NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW); return 0;}
开发者ID:dodamn,项目名称:pkg-allegro4.2,代码行数:37,
示例8: __declspecextern "C" __declspec(dllexport) LRESULT CALLBACK PoeWndProc(int nCode, WPARAM wParam, LPARAM lParam) { PCWPSTRUCT msg = (PCWPSTRUCT)lParam; if (origCursor == 0) { origCursor = (HCURSOR)GetClassLong(msg->hwnd,GCL_HCURSOR); } if (nCode < 0) { return CallNextHookEx(NULL,nCode,wParam,lParam); } if (msg->message == windowMessage) { // time to do magic and stuff. numPulses = 0; currentCursor = 0; SetClassLong(msg->hwnd, GCL_HCURSOR,(LONG)cursors[currentCursor]); SetCursor(cursors[currentCursor]); SetTimer(msg->hwnd,PULSE_TIMER,100,TimerProc); return TRUE; } return CallNextHookEx(NULL,nCode,wParam,lParam);}
开发者ID:AaronOpfer,项目名称:PoEPulse,代码行数:27,
示例9: SetClassLongint CAnsiWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CWnd::OnCreate(lpCreateStruct) == -1) return -1; SetClassLong(GetSafeHwnd(), GCL_STYLE, GetClassLong(GetSafeHwnd(), GCL_STYLE)-CS_VREDRAW); while ( m_strList.GetCount () < nScrollSize ) m_strList.AddTail(""); m_TotalLinesReceived = 0; // Init colors m_nCurrentBg = 0; m_nCurrentFg =7; //=================================================================================================================== CRect rect; GetClientRect(&rect); // To init screen dimentions in characters !!! SetScrollSettings(); return 0;}
开发者ID:konelav,项目名称:jmc,代码行数:26,
示例10: GetClassLongBOOL CDetailCustomDlg::OnInitDialog() { CPropertyPage::OnInitDialog(); DWORD style = GetClassLong(m_lstOptions, GCL_STYLE); SetClassLong(m_lstOptions, GCL_STYLE, style & ~CS_DBLCLKS); IcqContact *contact = ((CViewDetailDlg *) GetParent())->contact; bitset<NR_CONTACT_FLAGS> &f = contact->flags; for (int id = IDS_OPTION_FIRST; id <= IDS_OPTION_LAST; id++) { CString str; str.LoadString(id); int i = m_lstOptions.AddString(str); m_lstOptions.SetCheck(i, f.test(i)); } CheckDlgButton(IDC_CUSTOM_SOUND, contact->flags.test(CF_CUSTOMSOUND)); enableGreeting(); OnCustomSound(); m_cmbSound.SetCurSel(curSel); for (int i = 0; i < NR_CUSTOM_SOUNDS; i++) soundFiles[i] = contact->soundFiles[i].c_str(); SetDlgItemText(IDC_FILE, soundFiles[curSel]); SetDlgItemText(IDC_GREETING, contact->greeting.c_str()); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE}
开发者ID:bugou,项目名称:test,代码行数:28,
示例11: GetClassLong /////////////////////////////////////////////////////////////////////// /// Function: DialogWindow /// /// Author: $author$ /// Date: 1/29/2012 /////////////////////////////////////////////////////////////////////// static XosWinDialogWindow* DialogWindow (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { int wndExtra = GetClassLong(hWnd, GCL_CBWNDEXTRA); if (wndExtra < XosWinDialogWindowClass::WindowExtra()) return 0; int wndExtraOffset = XosWinDialogWindowClass::WindowExtraOffset(); XosWinDialogWindow* dialogWindow = (XosWinDialogWindow*) (GetWindowLongPtr(hWnd, wndExtraOffset)); switch(msg) { case WM_INITDIALOG: SetWindowLongPtr(hWnd, wndExtraOffset, lParam); if ((dialogWindow = (XosWinDialogWindow*)(lParam))) dialogWindow->Attach(hWnd); break; case WM_DESTROY: SetWindowLongPtr(hWnd, wndExtraOffset, 0); break; } return dialogWindow; }
开发者ID:medusade,项目名称:mxde,代码行数:37,
示例12: ShowNotifyIconVOID ShowNotifyIcon(HWND hWnd, BOOL bAdd){ NOTIFYICONDATA nid; ZeroMemory(&nid,sizeof(nid)); nid.cbSize=sizeof(NOTIFYICONDATA); nid.hWnd=hWnd; nid.uID=0; nid.uFlags=NIF_ICON | NIF_MESSAGE | NIF_TIP; nid.uCallbackMessage=WM_TRAYMESSAGE; nid.hIcon = (HICON)GetClassLong(hWnd, GCL_HICONSM); nid.uVersion = 0; GetWindowText(hWnd, nid.szTip, sizeof(nid.szTip)); wcscat_s(nid.szTip, sizeof(nid.szTip), L"/nDouble-click to maximize"); if(bAdd) { for(int i = 0; i < 60; i++) { if(Shell_NotifyIcon(NIM_ADD, &nid)) break; Sleep(1000); } } else Shell_NotifyIcon(NIM_DELETE, &nid);}
开发者ID:dhirallin,项目名称:PlayMailer,代码行数:27,
示例13: GetClassLong//---------------------------------------------------------------------------TColCombo::TColCombo(HANDLE Par,bool Tabstop,HFONT fnt){ VNumItems=0;for (int n=0;n<MAX_CC_ITEMS;n++)VItem[n]=NULL; VVisible=0;VLeft=0;VTop=0;VWidth=100;VHeight=200; VBoxGap=0;VBoxSurround=2;VBoxWidth=25; VParent=Par; for (VId=50000;VId<100000;VId++)if (GetDlgItem(VParent,VId)==NULL) break; Font=fnt;if (Font==NULL)Font=(HFONT)SendMessage(VParent,WM_GETFONT,0,0); VHandle=CreateWindowEx(0,"COMBOBOX","", CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_OWNERDRAWFIXED | WS_BORDER | (Tabstop==true ? WS_TABSTOP:0) | WS_CHILDWINDOW | WS_VSCROLL ,VLeft,VTop,VWidth,VHeight, VParent,(HANDLE) VId,(HANDLE) GetClassLong(VParent,GCL_HMODULE),0); if (IsWindow(VHandle)==0){VHandle=NULL;return;} SendMessage(VHandle,WM_SETFONT,(WPARAM)Font,0); HANDLE tempdc=CreateCompatibleDC(0); HANDLE oldfnt=SelectObject(tempdc,Font); SIZE sz;GetTextExtentPoint32(tempdc,"HjTTLMjpq",strlen("HjTTLMjpq"),&sz); SelectObject(tempdc,oldfnt); DeleteDC(tempdc); FontHeight=sz.cy;VItemHeight=FontHeight;VSelItemHeight=FontHeight+2; SendMessage(VHandle,CB_SETITEMHEIGHT,-1,VSelItemHeight); SendMessage(VHandle,CB_SETITEMHEIGHT,0,VItemHeight);}
开发者ID:TheRelentless,项目名称:steem-engine,代码行数:29,
|