本文整理汇总了C++中GetClassName函数的典型用法代码示例。如果您正苦于以下问题:C++ GetClassName函数的具体用法?C++ GetClassName怎么用?C++ GetClassName使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetClassName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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 );
}
示例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;
}
示例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);
}
}
示例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
}
示例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;
}
示例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;
}
示例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;
}