您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetWindowLong函数代码示例

51自学网 2021-06-01 21:17:55
  C++
这篇教程C++ GetWindowLong函数代码示例写得很实用,希望能帮到您。

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

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

示例1: CheckPrefs

void CheckPrefs(HWND hwnd, int iDlg){	/**************************************************************************************************/	/**************** save the preferances based on the checkmarks/options ****************************/	/**************************************************************************************************/	switch(iDlg)	{	case IDD_EVENTS:		{			SetOption(hwnd, CHAN_HILIGHT,		CHAN_HILIGHT);			SetOption(hwnd, CHAN_INVITE,		CHAN_INVITE);			SetOption(hwnd, CHAN_TOPIC_CHANGE,	CHAN_TOPIC_CHANGE);			SetOption(hwnd, CHAN_BANNED,		CHAN_BANNED);			SetOption(hwnd, CHAN_KICKED,		CHAN_KICKED);			SetOption(hwnd, CTCP_GENERIC,		CTCP_GENERIC);			SetOption(hwnd, PMSG_RECEIVE,		PMSG_RECEIVE);			SetOption(hwnd, SERV_KILLED,		SERV_KILLED);			SetOption(hwnd, SERV_NOTICE,		SERV_NOTICE);			SetOption(hwnd, SERV_DISCONNECT,	SERV_DISCONNECT);			SetOption(hwnd, CHAN_MESSAGE,		CHAN_MESSAGE);		}		break;	case IDD_ALERTS:		{			SetOption(hwnd, PREF_AMAE,	PREF_AMAE);			SetOption(hwnd, PREF_OSBWM,	PREF_OSBWM);			SetOption(hwnd, PREF_UWIOB,	PREF_UWIOB);			SetOption(hwnd, PREF_KAOI,	PREF_KAOI);			SetOption(hwnd, PREF_BLINK,	PREF_BLINK);			/**************************************************************************/			/**************************************************************************/			/**************************************************************************/			TCHAR tTime[512];			GetWindowText(GetDlgItem(hwnd, IDC_ALERT_TIME), tTime, 511);						g_iTime = _tstoi(tTime);						/**************************************************************************/			/**************** Get our Hotkey and save it                     **********/			/**************** then remove the old hotkey and add the new one **********/			/**************************************************************************/			DWORD hHotkey;			hHotkey = SendDlgItemMessage(hwnd, IDC_ALERT_HOTKEY, HKM_GETHOTKEY, 0, 0);						g_hHotKey.key = LOBYTE(hHotkey);			g_hHotKey.mod = HotkeyfToMod(HIBYTE(hHotkey));						if(IsDlgButtonChecked(hwnd, PREF_UWIOB) == BST_CHECKED)			{				UnregisterHotKey(g_hHotkeyWnd, 1);				RegisterHotKey(g_hHotkeyWnd, 1, g_hHotKey.mod, g_hHotKey.key);			}			else			{				UnregisterHotKey(g_hHotkeyWnd, 1);			}			/*************************************************************************/			/*********** Get and save the away msg and alert time ********************/			/*************************************************************************/		}		break;	case IDD_SETTINGS:		{			SetOption(hwnd, PREF_AOM, PREF_AOM);			SetOption(hwnd, PREF_TOT, PREF_TOT);			SetOption(hwnd, PREF_MIOC, PREF_MIOC);			SetOption(hwnd, PREF_DNSIT, PREF_DNSIT);			GetDlgItemText(hwnd, IDC_AWAY_MSG, g_szAway, 511);			if(g_dwPrefs & (1<<PREF_DNSIT))			{				DWORD dwStyle;				dwStyle = GetWindowLong(g_hXchatWnd, GWL_STYLE);				dwStyle |= (1<<WS_CHILD);				SetWindowLongPtr(g_hXchatWnd, GWL_STYLE, (LONG_PTR)dwStyle);				SetWindowLongPtr(g_hXchatWnd, GWL_HWNDPARENT, (LONG_PTR)g_hHotkeyWnd);			}			else			{				DWORD dwStyle;				dwStyle = GetWindowLong(g_hXchatWnd, GWL_STYLE);				dwStyle &= ~(1<<WS_CHILD);				SetWindowLongPtr(g_hXchatWnd, GWL_STYLE, (LONG_PTR)dwStyle);				SetWindowLongPtr(g_hXchatWnd, GWL_HWNDPARENT, NULL);			}		}		break;	} }
开发者ID:94m3k1n9,项目名称:hexchat,代码行数:93,


示例2: GetParent

BOOL player_impl::full_screen(BOOL fullscreen){	HWND hparent = GetParent(m_hwnd);	// 不支持非顶层窗口全屏操作.	if (IsWindow(hparent))	{		::logger("do/'nt support full screen mode/n");		return FALSE;	}	// Save the current windows placement/placement to	// restore when fullscreen is over	WINDOWPLACEMENT window_placement;	window_placement.length = sizeof(WINDOWPLACEMENT);	GetWindowPlacement(m_hwnd, &window_placement);	if (fullscreen && !m_full_screen)	{		m_full_screen = true;		m_wnd_style = GetWindowLong(m_hwnd, GWL_STYLE);		printf("entering fullscreen mode./n");		SetWindowLong(m_hwnd, GWL_STYLE, WS_CLIPCHILDREN | WS_VISIBLE);		if (IsWindow(hparent))		{			// Retrieve current window position so fullscreen will happen			// on the right screen			HMONITOR hmon = MonitorFromWindow(hparent, MONITOR_DEFAULTTONEAREST);			MONITORINFO mi;			mi.cbSize = sizeof(MONITORINFO);			if (::GetMonitorInfo(hmon, &mi))				::SetWindowPos(m_hwnd, 0,				mi.rcMonitor.left,				mi.rcMonitor.top,				mi.rcMonitor.right - mi.rcMonitor.left,				mi.rcMonitor.bottom - mi.rcMonitor.top,				SWP_NOZORDER | SWP_FRAMECHANGED);		}		else		{			// Maximize non embedded window			ShowWindow(m_hwnd, SW_SHOWMAXIMIZED);		}		if (IsWindow(hparent))		{			// Hide the previous window			RECT rect;			GetClientRect(m_hwnd, &rect);			// SetParent(hwnd, hwnd);			SetWindowPos(m_hwnd, 0, 0, 0,				rect.right, rect.bottom,				SWP_NOZORDER|SWP_FRAMECHANGED);			HWND topLevelParent = GetAncestor(hparent, GA_ROOT);			ShowWindow(topLevelParent, SW_HIDE);		}		SetForegroundWindow(m_hwnd);		return TRUE;	}	if (!fullscreen && m_full_screen)	{		m_full_screen = FALSE;		printf("leaving fullscreen mode./n");		// Change window style, no borders and no title bar		SetWindowLong(m_hwnd, GWL_STYLE, m_wnd_style);		if (hparent)		{			RECT rect;			GetClientRect(hparent, &rect);			// SetParent(hwnd, hparent);			SetWindowPos(m_hwnd, 0, 0, 0,				rect.right, rect.bottom,				SWP_NOZORDER | SWP_FRAMECHANGED);			HWND topLevelParent = GetAncestor(hparent, GA_ROOT);			ShowWindow(topLevelParent, SW_SHOW);			SetForegroundWindow(hparent);			ShowWindow(m_hwnd, SW_HIDE);		}		else		{			// return to normal window for non embedded vout			SetWindowPlacement(m_hwnd, &window_placement);			ShowWindow(m_hwnd, SW_SHOWNORMAL);		}		return TRUE;	}	return FALSE;}
开发者ID:chinshou,项目名称:avplayer,代码行数:93,


示例3: SetIcon

BOOL CRegDlg::OnInitDialog() {	CDialog::OnInitDialog();		// TODO: Add extra initialization here	SetIcon(m_hIcon, TRUE);			// Set big icon	SetIcon(m_hIcon, FALSE);		// Set small icon	CString str;	sockaddr_in  sockAddr;	memset(&sockAddr, 0, sizeof(sockAddr));	int nSockAddrLen = sizeof(sockAddr);	BOOL bResult = getpeername(m_pContext->m_Socket, (SOCKADDR*)&sockAddr, &nSockAddrLen);	str.Format("////%s - 注册表管理", bResult != INVALID_SOCKET ? inet_ntoa(sockAddr.sin_addr) : "");	SetWindowText(str);	size[0]=120;size[1]=80;size[2]=310;	m_list.InsertColumn(0,"名称",LVCFMT_LEFT,size[0],-1);	m_list.InsertColumn(1,"类型",LVCFMT_LEFT,size[1],-1);	m_list.InsertColumn(2,"数据",LVCFMT_LEFT,size[2],-1);    m_list.SetExtendedStyle(LVS_EX_FULLROWSELECT);	//////添加图标//////	m_HeadIcon.Create(16,16,TRUE,2,2);	m_HeadIcon.Add(AfxGetApp()->LoadIcon(IDI_STR_ICON));	m_HeadIcon.Add(AfxGetApp()->LoadIcon(IDI_DWORD_ICON));			m_list.SetImageList(&m_HeadIcon,LVSIL_SMALL);			//树控件设置		HICON hIcon = NULL;	m_ImageList_tree.Create(18, 18, ILC_COLOR16,10, 0);		hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_FATHER_ICON), IMAGE_ICON, 18, 18, 0);	m_ImageList_tree.Add(hIcon);	hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_DIR_ICON), IMAGE_ICON, 32, 32, 0);	m_ImageList_tree.Add(hIcon);				m_tree.SetImageList ( &m_ImageList_tree,TVSIL_NORMAL );		DWORD	dwStyle = GetWindowLong(m_tree.m_hWnd,GWL_STYLE);	    dwStyle |=TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT;	    SetWindowLong(m_tree.m_hWnd,GWL_STYLE,dwStyle);    m_hRoot = m_tree.InsertItem("注册表管理",0,0,0,0);   		HKCU=m_tree.InsertItem("HKEY_CURRENT_USER",1,1,m_hRoot,0);	HKLM=m_tree.InsertItem("HKEY_LOCAL_MACHINE",1,1,m_hRoot,0);	HKUS=m_tree.InsertItem("HKEY_USERS",1,1,m_hRoot,0);	HKCC=m_tree.InsertItem("HKEY_CURRENT_CONFIG",1,1,m_hRoot,0);	HKCR=m_tree.InsertItem("HKEY_CLASSES_ROOT",1,1,m_hRoot,0);		m_tree.Expand(m_hRoot,TVE_EXPAND);			CreatStatusBar();	CRect rect;	GetWindowRect(&rect);	rect.bottom+=20;	MoveWindow(&rect,true);	return TRUE;  // return TRUE unless you set the focus to a control	              // EXCEPTION: OCX Property Pages should return FALSE}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:64,


示例4:

cNinjaProgressBar *getNinjaProgressBar(HWND hwHost){	cNinjaProgressBar *cNL = (cNinjaProgressBar*)GetWindowLong(hwHost,GWL_USERDATA);	return cNL;}
开发者ID:ishani,项目名称:Oddity,代码行数:5,


示例5: makeWindow

void makeWindow( ){	WNDCLASSEX	wndClass;	wndClass.cbSize        = sizeof(wndClass);	wndClass.style         = CS_HREDRAW | CS_VREDRAW;	wndClass.lpfnWndProc   = CGameGirlProc;	wndClass.cbClsExtra    = 0;	wndClass.cbWndExtra    = 0;	wndClass.hInstance     = g_pWindows->m_hInstance;	wndClass.hIcon         = LoadIcon( g_pWindows->m_hInstance , MAKEINTRESOURCE(IDI_APP));	wndClass.hCursor       = LoadCursor(NULL, IDC_ARROW);	wndClass.hbrBackground = (HBRUSH)GetStockObject(DKGRAY_BRUSH);	wndClass.lpszMenuName  = NULL;//MAKEINTRESOURCE(CGameGirl::GetInstance()->MENU_BAR);	wndClass.lpszClassName = TEXT( NAME_APRICLASS );	wndClass.hIconSm       = LoadIcon (NULL, _T( "MAIN" ));	RegisterClassEx(&wndClass);	//画面の中央にセット	RECT		desktop;	GetWindowRect(GetDesktopWindow(), (LPRECT)&desktop);	/*-- フレ
C++ GetWindowLongPtr函数代码示例
C++ GetWindowInfo函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。