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

C++ GetClassName函数代码示例

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

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



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

示例1: GetWindowThreadProcessId

BOOL CALLBACK 
Application_ClientConfigManager::EnumWindowsProc(HWND hwnd,LPARAM lParam)
{
	DWORD processId = (DWORD)lParam;
	if (GetWindowLong(hwnd,GWL_STYLE) & WS_VISIBLE) {
		DWORD windowsProcessId;
		GetWindowThreadProcessId(hwnd, &windowsProcessId);
		if (windowsProcessId == processId) 
		{
			WCHAR classname[256];
			GetClassName(hwnd, classname, sizeof(classname));
			HWND mainWindow = FindWindow(classname, NULL);
			SendMessage(mainWindow, WM_CLOSE, 1, 0);
		}
	}
	return TRUE;
}
开发者ID:ISergey256,项目名称:capture-hpc,代码行数:17,代码来源:Application_ClientConfigManager.cpp


示例2: EnumChildProc

BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam)
{
	char lpszClassName[100];
	GetClassName(hwnd, lpszClassName, 100);
	if ( strcmp(lpszClassName, "VimTextArea") == 0 ) 
	{
		int cx, cy;
		cx = GetSystemMetrics(SM_CXSCREEN);
		cy = GetSystemMetrics(SM_CYSCREEN);

		SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_EX_CLIENTEDGE); 
		SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_EX_WINDOWEDGE); 
		SetWindowPos(hwnd, HWND_TOP, 0, 0, cx, cy, SWP_SHOWWINDOW);
	}
	return TRUE;
	
}
开发者ID:007slm,项目名称:MyVimForWinxp,代码行数:17,代码来源:gvimfullscreen.c


示例3: MemoryPool

	//! called during the initialization of the entity
	void ParticleGenerator2D::Init()
	{
		super::Init();

		m_Pool = snew MemoryPool(m_PoolSize);

		VertexBuffer* pVertexBuffer = GraphicsDriver::Instance()->CreateVertexBuffer();		
		pVertexBuffer->SetVertexFlag(Vertex3D::VF_Pos);
		pVertexBuffer->SetVertexFlag(Vertex3D::VF_Color);
		pVertexBuffer->SetPrimitiveType(GraphicsDriver::PT_Point);
		pVertexBuffer->SetVertices(snew Vertex3D[m_MaxParticles], m_MaxParticles);
		pVertexBuffer->SetRenderStateSetter(snew PointSpriteStateSetter(m_fParticleSize));
		pVertexBuffer->SetName(GetClassName());
		pVertexBuffer->SetDynamic(true);
		pVertexBuffer->SetApplyWorldTransforms(m_bApplyWorldTransform);
		GetComponent<GraphicComponent>()->SetVertexBuffer(pVertexBuffer);
	}
开发者ID:aminere,项目名称:VLADHeavyStrikePublic,代码行数:18,代码来源:ParticleGenerator2D.cpp


示例4: WindowHidden

BOOL CALLBACK WindowHidden(HWND hWnd, LPARAM lParam)
{
    PROCESS_INFORMATION *ProcessInfo = (PROCESS_INFORMATION *)lParam;
    TCHAR moduleName[ _MAX_PATH * 2 ];
    TCHAR szclass[_MAX_PATH * 2];
    TCHAR szname[_MAX_PATH * 2];
    DWORD dwAppProcessId;
    DWORD dwAppThreadId;
    DWORD dwCmdProcessId;
    DWORD dwCmdThreadId;

    dwCmdThreadId = GetWindowThreadProcessId( hWnd, &dwCmdProcessId);
    dwAppThreadId = GetWindowThreadProcessId( AfxGetApp()->GetMainWnd()->GetSafeHwnd(), &dwAppProcessId);
     
    if( 
        // 同一プロセス
        dwAppProcessId == dwCmdProcessId && 
        (GetWindow(hWnd,GW_OWNER) == 0) &&
        IsWindowVisible(hWnd) &&
        // メインウインドウじゃない
        dwAppThreadId != dwCmdThreadId )
    {
        
        GetClassName( hWnd, szclass, _MAX_PATH );
        GetWindowText( hWnd, szname, 255 );
        GetModuleFileName(GetModuleHandle( AfxGetApp()->m_pszExeName ),
                  moduleName, sizeof( moduleName ) ); 

        /*
            CString info;
            info.Format(_T("***[%s:%s] %x %x %x %x\n"), szclass, szname,
                dwAppProcessId,  dwCmdProcessId,
                dwAppThreadId,   dwCmdThreadId
                );
            AfxGetApp()->GetMainWnd()->SendMessage(WM_CONSOLE_MESG, 0, (LPARAM)(LPCTSTR)info);
        */

        // コンソール窓
        if( _tcscmp( szclass, _T("ConsoleWindowClass") ) == 0)
        {
            ::ShowWindow( hWnd, SW_HIDE );
        }
    }
    return TRUE;
}
开发者ID:katakk,项目名称:iperf,代码行数:45,代码来源:IperfThread.cpp


示例5: _ASSERTE

void CSetPgDebug::debugLogCommand(CESERVER_REQ* pInfo, BOOL abInput, DWORD anTick, DWORD anDur, LPCWSTR asPipe, CESERVER_REQ* pResult/*=NULL*/)
{
	CSetPgDebug* pDbgPg = (CSetPgDebug*)gpSetCls->GetPageObj(thi_Debug);
	if (!pDbgPg)
		return;
	if (pDbgPg->GetActivityLoggingType() != glt_Commands)
		return;

	_ASSERTE(abInput==TRUE || pResult!=NULL || (pInfo->hdr.nCmd==CECMD_LANGCHANGE || pInfo->hdr.nCmd==CECMD_GUICHANGED || pInfo->hdr.nCmd==CMD_FARSETCHANGED || pInfo->hdr.nCmd==CECMD_ONACTIVATION));

	LogCommandsData* pData = (LogCommandsData*)calloc(1,sizeof(LogCommandsData));

	if (!pData)
		return;

	pData->bInput = abInput;
	pData->bMainThread = (abInput == FALSE) && isMainThread();
	pData->nTick = anTick - pDbgPg->mn_ActivityCmdStartTick;
	pData->nDur = anDur;
	pData->nCmd = pInfo->hdr.nCmd;
	pData->nSize = pInfo->hdr.cbSize;
	pData->nPID = abInput ? pInfo->hdr.nSrcPID : pResult ? pResult->hdr.nSrcPID : 0;
	LPCWSTR pszName = asPipe ? PointToName(asPipe) : NULL;
	lstrcpyn(pData->szPipe, pszName ? pszName : L"", countof(pData->szPipe));
	switch (pInfo->hdr.nCmd)
	{
	case CECMD_POSTCONMSG:
		_wsprintf(pData->szExtra, SKIPLEN(countof(pData->szExtra))
			L"HWND=x%08X, Msg=%u, wParam=" WIN3264TEST(L"x%08X",L"x%08X%08X") L", lParam=" WIN3264TEST(L"x%08X",L"x%08X%08X") L": ",
			pInfo->Msg.hWnd, pInfo->Msg.nMsg, WIN3264WSPRINT(pInfo->Msg.wParam), WIN3264WSPRINT(pInfo->Msg.lParam));
		GetClassName(pInfo->Msg.hWnd, pData->szExtra+lstrlen(pData->szExtra), countof(pData->szExtra)-lstrlen(pData->szExtra));
		break;
	case CECMD_NEWCMD:
		lstrcpyn(pData->szExtra, pInfo->NewCmd.GetCommand(), countof(pData->szExtra));
		break;
	case CECMD_GUIMACRO:
		lstrcpyn(pData->szExtra, pInfo->GuiMacro.sMacro, countof(pData->szExtra));
		break;
	case CMD_POSTMACRO:
		lstrcpyn(pData->szExtra, (LPCWSTR)pInfo->wData, countof(pData->szExtra));
		break;
	}

	PostMessage(pDbgPg->Dlg(), DBGMSG_LOG_ID, DBGMSG_LOG_CMD_MAGIC, (LPARAM)pData);
}
开发者ID:ForNeVeR,项目名称:ConEmu,代码行数:45,代码来源:SetPgDebug.cpp


示例6: lpEnumProc

BOOL CALLBACK lpEnumProc(HWND hwnd /*窗口内控件句柄*/, LPARAM lParam)
{
    if (NULL == hwnd)
    {
        return FALSE;
    }

    wchar_t buf[501]={0};
    LRESULT nRecvNum=0;

    if (::IsWindow(hwnd)/* && ::IsWindowVisible(hwnd) */)
    {
        EnumChildWindows(hwnd, (WNDENUMPROC)lpEnumProc, NULL);

        GetClassName(hwnd, buf, 500); 
        if(::GetWindowTextLength(hwnd)==0)        //如果控件是editBox,则需要通过发送消息获得
        {
            nRecvNum=::SendMessage(hwnd, WM_GETTEXT, (WPARAM)500, (LPARAM)buf);
            if(nRecvNum==0)
            {
                return TRUE;
            }
            else
            {
                std::wcout << buf << std::endl;
                return TRUE;
            }
        }
        else
        {
            ::GetClassName(hwnd, buf, 500);         //获得控件上的内容
            std::wcout << buf << std::endl;

        }
    }
    else
    {
        ::GetClassName(hwnd, buf, 500);         //获得控件上的内容
        std::wcout << buf << std::endl;

    }

    //TRACE(buffer);
     return TRUE;
}
开发者ID:mildrock,项目名称:dummy,代码行数:45,代码来源:main.cpp


示例7: MouseHookProc

LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam)
{
DWORD wso;
	
	if ((nCode == HC_ACTION) && ((wParam == WM_MOUSEMOVE) || (wParam == WM_NCMOUSEMOVE)) && (GlobalData != NULL)) {
		wso = WaitForSingleObject(hSynhroMutex, 0);
		if (wso == WAIT_OBJECT_0 || wso == WAIT_ABANDONED) {
			HWND WND;
			TCHAR wClassName[64];

			WND = GetWindowFromPoint(((PMOUSEHOOKSTRUCT)lParam)->pt);

			if(WND == NULL) {
				ReleaseMutex(hSynhroMutex);
				return CallNextHookEx(GlobalData->g_hHookMouse, nCode, wParam, lParam);
			}

			if (GetClassName(WND, wClassName, sizeof(wClassName) / sizeof(TCHAR))) {
					const char* DisableClasses[] = {
						"gdkWindowChild",
						"gdkWindowTemp",
						"Progman",
						"WorkerW",
					};
					int i;
					for (i=0; i<4; i++) {
						if (lstrcmp(wClassName, DisableClasses[i])==0)
							break;
					}
					if (i<4) {
						ReleaseMutex(hSynhroMutex);
						return CallNextHookEx(GlobalData->g_hHookMouse, nCode, wParam, lParam);
					}
			}

			if(GlobalData->LastPt.x!=((PMOUSEHOOKSTRUCT)lParam)->pt.x || GlobalData->LastPt.y!=((PMOUSEHOOKSTRUCT)lParam)->pt.y || GlobalData->LastWND != WND) {
				TimerID = SetTimer(0, TimerID, MOUSEOVER_INTERVAL, TimerFunc);
				GlobalData->LastWND = WND;
				GlobalData->LastPt = ((PMOUSEHOOKSTRUCT)lParam)->pt;
			}
			ReleaseMutex(hSynhroMutex);
		}
	}
	return CallNextHookEx(GlobalData->g_hHookMouse, nCode, wParam, lParam);
}
开发者ID:MCHALAO,项目名称:goldendict,代码行数:45,代码来源:TextOutSpy.c


示例8: win_prepare_option_control

BOOL win_prepare_option_control(HWND control, const option_guide *guide,
	const char *optspec)
{
	BOOL rc = FALSE;
	TCHAR class_name[32];

	SetProp(control, guide_prop, (HANDLE) guide);
	SetProp(control, spec_prop, (HANDLE) optspec);
	GetClassName(control, class_name, sizeof(class_name)
		/ sizeof(class_name[0]));

	if (!_tcsicmp(class_name, TEXT("ComboBox")))
		rc = prepare_combobox(control, guide, optspec);
	else if (!_tcsicmp(class_name, TEXT("Edit")))
		rc = prepare_editbox(control, guide, optspec);

	return rc;
}
开发者ID:kkalmaz,项目名称:psmame,代码行数:18,代码来源:opcntrl.c


示例9: FindWatIDEHwnd

WINEXPORT BOOL CALLBACK FindWatIDEHwnd( HWND hwnd, LPARAM lparam ) {
    char        buf[256];
    BOOL        *found;

    lparam = lparam;
    GetClassName( hwnd, buf, sizeof( buf ) );
    if( !strcmp( buf, "GUIClass" ) ) {
        GetWindowText( hwnd, buf, sizeof( buf ) );
        if( !strncmp( buf, IDE_WINDOW_CAPTION, IDE_WIN_CAP_LEN ) ) {
            SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0,
                          SWP_NOMOVE | SWP_NOSIZE );
            found = (BOOL *)lparam;
            *found = TRUE;
            return( FALSE );
        }
    }
    return( TRUE );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:18,代码来源:ideactiv.c


示例10: MinimizeSkypeProcess

BOOL CALLBACK MinimizeSkypeProcess(
  HWND hwnd,      // handle to parent window
  LPARAM lParam   // application-defined value
)
{
	TCHAR strClassName[_MAX_LINE];
	if(GetClassName(hwnd, strClassName, _MAX_LINE) != 0) {
		if(_tcsicmp(strClassName, _T("tSkMainForm.UnicodeClass")) == 0) {
			GetWindowThreadProcessId(hwnd, (DWORD *) lParam);
//			CloseWindow(hwnd);

			SendMessage(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0);
			return FALSE;
		}
		
	}
	return TRUE;
}
开发者ID:yamamoto123,项目名称:tapur_open,代码行数:18,代码来源:SkypeMessageQueue.cpp


示例11: Debug_ListChild

/*---------------------------------------------------------
  for Debug
----------------------------------------------------------*/
void Debug_ListChild(HWND hwndParent, int depth)
{
	HWND hwnd;
	char classname[80];
	int i;
	
	for(i = 0; i < depth && i < 79; i++) classname[i] = '+';
	classname[i] = 0;
	GetClassName(hwndParent, classname + i, 80 - i);
	WriteDebug(classname);
	
	hwnd = GetWindow(hwndParent, GW_CHILD);
	while(hwnd)
	{
		Debug_ListChild(hwnd, depth + 1);
		hwnd = GetWindow(hwnd, GW_HWNDNEXT);
	}
}
开发者ID:k-takata,项目名称:TClockLight,代码行数:21,代码来源:main.c


示例12: EnumWindowsProcRDM

BOOL CALLBACK EnumWindowsProcRDM(HWND hWnd, LPARAM lParam)
{
    procWnd* myProcWnd1=(procWnd*) lParam;

    //test, if this a window with class name = "Dialog"
    TCHAR strClass[MAX_PATH];
    int iRes = GetClassName(hWnd, strClass, MAX_PATH);
    if(iRes!=0) {
        if(wcscmp(strClass, L"Dialog")==0) { //the windows class name matches
            //test if this window has the same PID
            if(FindPID(hWnd)==myProcWnd1->procID) { //the PIDs match
                myProcWnd1->foundHwnd=hWnd;
                return FALSE; //dont enum more windows
            }
        }
    }
    return TRUE; //continue enumWindows
}
开发者ID:JohnPBuzzell,项目名称:rdp-auto-login,代码行数:18,代码来源:tscDialog.cpp


示例13: LoadXmlFile

// 加载XML文件
BOOL CDlgPopup::LoadXmlFile(CString strFileName)
{
	DuiXmlDocument xmlDoc;
	DuiXmlNode pDivElem;

	if(DuiSystem::Instance()->LoadXmlFile(xmlDoc, strFileName))
	{
		m_strXmlFile = strFileName;
		pDivElem = xmlDoc.child((const LPCTSTR)GetClassName());
		if(pDivElem)
		{
			// 加载popup节点属性
			Load(pDivElem);
		}
	}

	return TRUE;
}
开发者ID:blueantstudio,项目名称:DuiVision,代码行数:19,代码来源:DlgPopup.cpp


示例14: GetClassName

HBRUSH SpotsSurfaceParaSetDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
	HBRUSH hbr = __super::OnCtlColor(pDC, pWnd, nCtlColor);
	// TODO:  在此更改 DC 的任何特性
	// TODO:  如果默认的不是所需画笔,则返回另一个画笔
	CString ClassName;
	GetClassName(pWnd->GetSafeHwnd(), ClassName.GetBuffer(255), 255);

	//if (ClassName.Find(_T("Static"), 0) >= 0 || ClassName.Find(_T("Static"), 0) >= 0 || pWnd->GetDlgCtrlID() == IDC_LB1)
	{
		//pDC->SetBkMode(TRANSPARENT);
		pDC->SetBkColor(RGB(255, 255, 255));
		//pDC->SetTextColor(RGB(0, 0, 0));
		//return (HBRUSH)GetStockObject(HOLLOW_BRUSH);//透明笔刷
		return (HBRUSH)GetStockObject(WHITE_BRUSH);
	}
	return hbr;
}
开发者ID:vshawn,项目名称:cameraTest,代码行数:18,代码来源:SpotsSurfaceParaSetDlg.cpp


示例15: FindWindowProc

/* 位置からウィンドウを探すためのコールバック関数 */
static BOOL CALLBACK FindWindowProc(HWND hwnd, LPARAM lParam)
{
	FindWindowInfo *pInfo = (FindWindowInfo*)lParam;
	RECT rc;
	TCHAR szClass[64];

	if (hwnd != pInfo->hwnd
			&& IsWindowVisible(hwnd)
			&& GetWindowRect(hwnd, &rc)
			&& PtInRect(&rc, pInfo->ptPos)
			&& GetClassName(hwnd, szClass, sizeof(szClass) / sizeof(TCHAR)) > 0
			&& lstrcmpi(szClass, TEXT("tooltips_class32")) != 0
			&& lstrcmpi(szClass, TEXT("SysShadow")) != 0) {
		pInfo->hwnd = hwnd;
		return FALSE;
	}
	return TRUE;
}
开发者ID:iooiau,项目名称:WheelMagic,代码行数:19,代码来源:WheelMagicHook.c


示例16: GetWord

DLLIMPORT void GetWord (TCurrentMode *P)
{
	TCHAR wClassName[64];
	TKnownWndClass WndClass;
	char *p;

	if (GetClassName(P->WND, wClassName, sizeof(wClassName) / sizeof(TCHAR))==0)
		wClassName[0] = '\0';
	WndClass = GetWindowType(P->WND, wClassName);
	p = TryGetWordFromAnyWindow(WndClass, P->WND, P->Pt, &(P->BeginPos));
	if (p) {
	    P->WordLen = strlen(p);
		strcpy(P->MatchedWord, p);
		free(p);
	} else {
		P->WordLen = 0;
	}
}
开发者ID:PurlingNayuki,项目名称:stardictproject,代码行数:18,代码来源:TextOutHook.c


示例17: enumWindowsProc

static BOOL CALLBACK enumWindowsProc( HWND hwnd, LPARAM lParam )
{
	char className[1024];
	GetClassName( hwnd, className, sizeof( className ) );
	if (strcmp( className, "tooltips_class32" ) &&
		strcmp( className, "#32770" ) &&// #32770 is the general dialog class
		GetWindowLong( hwnd, GWL_STYLE ) & WS_VISIBLE)// only visible window
	{
		DWORD processId;
		GetWindowThreadProcessId( hwnd, &processId );
		if( processId == GetCurrentProcessId() )
		{
			*(HWND*)lParam = hwnd;
			return FALSE;
		}
	}
	return TRUE;
}
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:18,代码来源:message_box.cpp


示例18: GetClassName

//! Presubclass-Window-Function
void CRoundButton2::PreSubclassWindow()
{
#ifdef _DEBUG
	// We really should be only sub classing a button control
	TCHAR buffer[255];
	GetClassName (m_hWnd, buffer, sizeof(buffer) / sizeof(TCHAR));
	ASSERT (CString (buffer) == _T("Button"));
#endif

	// Check if it's a default button
	if (GetStyle() & 0x0FL)
		m_bDefaultButton = true;

	// Make the button owner-drawn
	ModifyStyle (0x0FL, BS_OWNERDRAW | BS_AUTOCHECKBOX, SWP_FRAMECHANGED);

	CButton::PreSubclassWindow();
}
开发者ID:IcyX,项目名称:bote,代码行数:19,代码来源:RoundButton2.cpp


示例19: EnumttyWindow

/* Once we are running a child process in our tty, it can no longer 
 * determine which console window is our own, since the window
 * reports that it is owned by the child process.
 */
static BOOL CALLBACK EnumttyWindow(HWND wnd, LPARAM retwnd)
{
    char tmp[20], *tty;
    if (isWindowsNT())
        tty = "ConsoleWindowClass";
    else
        tty = "tty";
    if (GetClassName(wnd, tmp, sizeof(tmp)) && !strcmp(tmp, tty)) 
    {
        DWORD wndproc, thisproc = GetCurrentProcessId();
        GetWindowThreadProcessId(wnd, &wndproc);
        if (wndproc == thisproc) {
            *((HWND*)retwnd) = wnd;
            return FALSE;
        }
    }
    return TRUE;
}
开发者ID:AzerTyQsdF,项目名称:osx,代码行数:22,代码来源:service.c


示例20: DllCanUnloadNow

STDAPI DllCanUnloadNow(void)
{
	if(g_DllRefCount > 0)
	{
		_RPTF1(_CRT_WARN, "RefCount=%d\n", g_DllRefCount);
		for(int i=0; i<ENUM_CLASSES_LENGTH; i++)
		{
			if(g_references[i] > 0)
			{
				LPCTSTR lpszClass = GetClassName(i);
				_RPTF2(_CRT_WARN, "%s has %d references\n", lpszClass, g_references[i]);
			}
		}
		return S_FALSE;
	}
	return S_OK;
	//return ((g_DllRefCount > 0) ? S_FALSE : S_OK);
}
开发者ID:sqba,项目名称:zenfolders,代码行数:18,代码来源:zenfolders.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetClassPtr函数代码示例发布时间:2022-05-30
下一篇:
C++ GetClassLong函数代码示例发布时间: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