当前位置: 首页>>代码示例>>C++>>正文


C++ IsWindowUnicode函数代码示例

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


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

示例1: PassWindowsKey

void Ctrl::sProcessMSG(MSG& msg)
{
	if (msg.message == WM_HOTKEY) {
		if(msg.wParam >= 0 && (int)msg.wParam < Ctrl::hotkey.GetCount())
			Ctrl::hotkey[(int)msg.wParam]();
		return;
	}
	if(msg.message != WM_SYSKEYDOWN && msg.message != WM_SYSKEYUP
	|| PassWindowsKey((dword)msg.wParam) || msg.wParam == VK_MENU) //17.11 Mirek - fix to get windows menu invoked on Alt+Space
		TranslateMessage(&msg); // 04/09/07: TRC fix to make barcode reader going better
	if(IsWindowUnicode(msg.hwnd))
		DispatchMessageW(&msg);
	else
		DispatchMessage(&msg);
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:15,代码来源:WinAltWnd.cpp

示例2: getMainWindow

void ShortcutsPlugin::init()
{
    if (m_bInit)
        return;
    QWidget *main = getMainWindow();
    if (main){
        if (IsWindowUnicode(main->winId())){
            oldProc = (WNDPROC)SetWindowLongW(main->winId(), GWL_WNDPROC, (LONG)keysWndProc);
        }else{
            oldProc = (WNDPROC)SetWindowLongA(main->winId(), GWL_WNDPROC, (LONG)keysWndProc);
        }
        m_bInit = true;
        applyKeys();
    }
}
开发者ID:BackupTheBerlios,项目名称:sim-im-svn,代码行数:15,代码来源:shortcuts.cpp

示例3: RemoveWindowSubclass

BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR uID)
{
   LPSUBCLASS_INFO stack;
   LPSUBCLASSPROCS prevproc = NULL;
   LPSUBCLASSPROCS proc;
   BOOL ret = FALSE;

   TRACE ("(%p, %p, %lx)\n", hWnd, pfnSubclass, uID);

   /* Find the Subclass to remove */
   stack = GetPropW (hWnd, COMCTL32_wSubclass);
   if (!stack)
      return FALSE;

   proc = stack->SubclassProcs;
   while (proc) {
      if ((proc->id == uID) &&
         (proc->subproc == pfnSubclass)) {
         
         if (!prevproc)
            stack->SubclassProcs = proc->next;
         else
            prevproc->next = proc->next;
          
         if (stack->stackpos == proc)
            stack->stackpos = stack->stackpos->next;
            
         Free (proc);
         ret = TRUE;
         break;
      }
      prevproc = proc;
      proc = proc->next;
   }
   
   if (!stack->SubclassProcs && !stack->running) {
      TRACE("Last Subclass removed, cleaning up\n");
      /* clean up our heap and reset the original window procedure */
      if (IsWindowUnicode (hWnd))
         SetWindowLongPtrW (hWnd, GWLP_WNDPROC, (DWORD_PTR)stack->origproc);
      else
         SetWindowLongPtrA (hWnd, GWLP_WNDPROC, (DWORD_PTR)stack->origproc);
      Free (stack);
      RemovePropW( hWnd, COMCTL32_wSubclass );
   }
   
   return ret;
}
开发者ID:DeltaYang,项目名称:wine,代码行数:48,代码来源:commctrl.c

示例4: WDML_ServerHandleExecute

 /******************************************************************
 *		WDML_ServerHandleExecute
 *
 *
 */
static	WDML_QUEUE_STATE WDML_ServerHandleExecute(WDML_CONV* pConv, WDML_XACT* pXAct)
{
    HDDEDATA	hDdeData = DDE_FNOTPROCESSED;
    BOOL	fAck = FALSE, fBusy = FALSE;

    if (!(pConv->instance->CBFflags & CBF_FAIL_EXECUTES))
    {
	LPVOID	ptr = GlobalLock(pXAct->hMem);
        DWORD size = GlobalSize(pXAct->hMem);

	if (ptr)
	{
            if (pConv->instance->unicode)  /* Unicode server, try to map A->W */
                hDdeData = map_A_to_W( pConv->instance->instanceID, ptr, size );
            else if (!IsWindowUnicode( pConv->hwndClient )) /* ASCII server and client, try to map W->A */
                hDdeData = map_W_to_A( pConv->instance->instanceID, ptr, size );
            else
                hDdeData = DdeCreateDataHandle(pConv->instance->instanceID, ptr, size, 0, 0, CF_TEXT, 0);
	    GlobalUnlock(pXAct->hMem);
	}
	hDdeData = WDML_InvokeCallback(pConv->instance, XTYP_EXECUTE, 0, (HCONV)pConv,
				       pConv->hszTopic, 0, hDdeData, 0L, 0L);
    }

    switch ((ULONG_PTR)hDdeData)
    {
    case (ULONG_PTR)CBR_BLOCK:
	return WDML_QS_BLOCK;

    case DDE_FACK:
	fAck = TRUE;
	break;
    case DDE_FBUSY:
	fBusy = TRUE;
	break;
    default:
	FIXME("Unsupported returned value %p\n", hDdeData);
	/* fall through */
    case DDE_FNOTPROCESSED:
	break;
    }
    WDML_PostAck(pConv, WDML_SERVER_SIDE, 0, fBusy, fAck, (UINT_PTR)pXAct->hMem, 0, 0);

    return WDML_QS_HANDLED;
}
开发者ID:Moteesh,项目名称:reactos,代码行数:50,代码来源:ddeserver.c

示例5: getMainWindow

ShortcutsPlugin::~ShortcutsPlugin()
{
#ifdef WIN32
    QWidget *main = getMainWindow();
    if (main && oldProc) {
        if (IsWindowUnicode(main->winId())) {
            SetWindowLongW(main->winId(), GWL_WNDPROC, (LONG)oldProc);
        } else {
            SetWindowLongA(main->winId(), GWL_WNDPROC, (LONG)oldProc);
        }
    }
#else
#ifndef USE_KDE
    qt_set_x11_event_filter(oldFilter);
#endif
#endif
    releaseKeys();
    free_data(shortcutsData, &data);
}
开发者ID:BackupTheBerlios,项目名称:sim-im-svn,代码行数:19,代码来源:shortcuts.cpp

示例6: QMainWindow

MainWindow::MainWindow(Geometry &geometry)
        : QMainWindow(NULL, "mainwnd",
                      WType_TopLevel | WStyle_Customize |
                      WStyle_Title | WStyle_NormalBorder| WStyle_SysMenu 
#ifdef __OS2__                      
	| WStyle_MinMax 
#endif	
	),
        EventReceiver(LowestPriority)
{
    m_grip	 = NULL;
    h_lay	 = NULL;
    m_bNoResize = false;

    SET_WNDPROC("mainwnd");
    m_icon = "SIM";
    setIcon(Pict(m_icon.c_str()));
    setTitle();

#ifdef WIN32
    pMain = this;
    if (IsWindowUnicode(winId())){
        oldProc = (WNDPROC)SetWindowLongW(winId(), GWL_WNDPROC, (LONG)wndProc);
    }else{
        oldProc = (WNDPROC)SetWindowLongA(winId(), GWL_WNDPROC, (LONG)wndProc);
    }
#endif

    bar = NULL;

    main = new MainWindowWidget(this);
    setCentralWidget(main);

    lay = new QVBoxLayout(main);

    QStatusBar *status = statusBar();
    status->hide();
    status->installEventFilter(this);

    local::restoreGeometry(this, geometry);
}
开发者ID:BackupTheBerlios,项目名称:sim-im-svn,代码行数:41,代码来源:mainwin.cpp

示例7: IsDlgItemUnicode

BOOL
IsDlgItemUnicode(
    IN HWND hWnd,
    IN int ControlId
    )

/*++

Routine Description:

    Determines if the supplied dialog item is a Unicode control.

Arguments:

    hWnd        - Supplies the window (dialog box) handle that contains the
                  control.
    ControlId   - Supplies the control id.

Return Value:

    BOOL        - Returns TRUE if the control is Unicode, FALSE if ANSI.

--*/

{
    HWND    hWndControl;

    DbgHandleAssert( hWnd );

    //
    // Get the handle for the supplied control so that it can be determined
    // if it is ANSI or UNICODE.
    //

    hWndControl = GetDlgItem( hWnd, ControlId );
    DbgHandleAssert( hWndControl );

    return IsWindowUnicode( hWndControl );
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:39,代码来源:controls.c

示例8: OnDDExecute

LRESULT OnDDExecute(HWND hwnd, WPARAM wparam, LPARAM lparam)
{
    UINT_PTR lo, hi;
    UnpackDDElParam(WM_DDE_EXECUTE, lparam, &lo, &hi);

    ScopedMem<WCHAR> cmd;
    DDEACK ack = { 0 };

    LPVOID command = GlobalLock((HGLOBAL)hi);
    if (!command)
        goto Exit;

    if (IsWindowUnicode((HWND)wparam))
        cmd.Set(str::Dup((const WCHAR*)command));
    else
        cmd.Set(str::conv::FromAnsi((const char*)command));

    const WCHAR *currCmd = cmd;
    while (!str::IsEmpty(currCmd)) {
        const WCHAR *nextCmd = NULL;
        if (!nextCmd) nextCmd = HandleSyncCmd(currCmd, ack);
        if (!nextCmd) nextCmd = HandleOpenCmd(currCmd, ack);
        if (!nextCmd) nextCmd = HandleGotoCmd(currCmd, ack);
        if (!nextCmd) nextCmd = HandlePageCmd(currCmd, ack);
        if (!nextCmd) nextCmd = HandleSetViewCmd(currCmd, ack);
        if (!nextCmd) {
            ScopedMem<WCHAR> tmp;
            nextCmd = str::Parse(currCmd, L"%S]", &tmp);
        }
        currCmd = nextCmd;
    }

Exit:
    GlobalUnlock((HGLOBAL)hi);

    lparam = ReuseDDElParam(lparam, WM_DDE_EXECUTE, WM_DDE_ACK, *(WORD *)&ack, hi);
    PostMessage((HWND)wparam, WM_DDE_ACK, (WPARAM)hwnd, lparam);
    return 0;
}
开发者ID:Jshauk,项目名称:sumatrapdf,代码行数:39,代码来源:Search.cpp

示例9: DevView_EditWndProc

static LRESULT CALLBACK DevView_EditWndProc(HWND hwndEdit, UINT nMessage, WPARAM wParam, LPARAM lParam)
{
	struct DevViewInfo *pDevViewInfo;
	struct DevViewEntry *pEnt;
	LRESULT rc;
	HWND hwndDevView;
	LONG_PTR l;

	l = GetWindowLongPtr(hwndEdit, GWLP_USERDATA);
	pEnt = (struct DevViewEntry *) l;
	if (IsWindowUnicode(hwndEdit))
		rc = CallWindowProcW(pEnt->pfnEditWndProc, hwndEdit, nMessage, wParam, lParam);
	else
		rc = CallWindowProcA(pEnt->pfnEditWndProc, hwndEdit, nMessage, wParam, lParam);

	if (nMessage == WM_SETTEXT)
	{
		hwndDevView = GetParent(hwndEdit);
		pDevViewInfo = GetDevViewInfo(hwndDevView);
		DevView_TextChanged(hwndDevView, pEnt - pDevViewInfo->pEntries, (LPCTSTR) lParam);
	}
	return rc;
}
开发者ID:rogerjowett,项目名称:ClientServerMAME,代码行数:23,代码来源:devview.c

示例10: InitMainWindow

void InitMainWindow(HWND hwnd) {
	BOOL isUnicode = IsWindowUnicode(hwnd);
	if (isUnicode) {
		if (IsWindowClassW(hwnd, L"VirtualDub")) {
			g_hWndVDub = hwnd;
			__VDProjectUI_MainWndProcOrig = (WNDPROC)GetWindowLongPtrW(hwnd, GWLP_WNDPROC);
		}
	} else {
		if (IsWindowClassA(hwnd, "VirtualDub")) {
			g_hWndVDub = hwnd;
			__VDProjectUI_MainWndProcOrig = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_WNDPROC);
		}
	}
	if (g_hWndVDub) {

		LoadPlugins();

		if (!g_bAPIOverride) {
			HINSTANCE hInst = (HINSTANCE)GetWindowLongPtr(g_hWndVDub, GWLP_HINSTANCE);
			if (hInst) {
				if (WinAPIOverride32Init(hInst)) {
					LoadFakeAPIDefinitionArray(FakeApiInfos);
					g_bAPIOverride = true;
				}
			}
		}

		if (__VDProjectUI_MainWndProcOrig) {
			if (isUnicode)
				SetWindowLongPtrW(g_hWndVDub, GWLP_WNDPROC, (LONG)__VDProjectUI_MainWndProc);
			else
				SetWindowLongPtrA(g_hWndVDub, GWLP_WNDPROC, (LONG)__VDProjectUI_MainWndProc);
		}

		PostMessage(g_hWndVDub, WM_NULL, 0, 0);
	}
}
开发者ID:KGE-INC,项目名称:vdubauo,代码行数:37,代码来源:main.cpp

示例11: while

void CCustomIOCPBaseList::ProcessMsgEvent()
{
	MSG Msg;

	while (PeekMessage(&Msg, 0, 0, 0, PM_NOREMOVE)) {
		BOOL Unicode;
		BOOL MsgExists;

		Unicode = (Msg.hwnd == 0) || IsWindowUnicode(Msg.hwnd);
		if (Unicode) {
			MsgExists = PeekMessageW(&Msg, 0, 0, 0, PM_REMOVE);
		} else {
			MsgExists = PeekMessageA(&Msg, 0, 0, 0, PM_REMOVE);
		}
		if (MsgExists) {
			TranslateMessage(&Msg);
			if (Unicode) {
				DispatchMessageW(&Msg);
			} else {
				DispatchMessageA(&Msg);
			}
		}
	}
}
开发者ID:jimmy486,项目名称:lcxl-iocp,代码行数:24,代码来源:lcxl_iocp_base.cpp

示例12: MCWindowProc


//.........这里部分代码省略.........
		else
		{
			MCEventnode *tptr = new MCEventnode(hwnd, msg, wParam, lParam, 0,
			                                    MCmodifierstate, MCeventtime);
			pms->appendevent(tptr);
		}
		break;
	case WM_KILLFOCUS: //FocusOut:
		if (curinfo->dispatch)
		{
			if (MCtracewindow == DNULL || hwnd != (HWND)MCtracewindow->handle.window)
				MCdispatcher->wkunfocus(dw);
			curinfo->handled = True;
		}
		else
		{
			MCEventnode *tptr = new MCEventnode(hwnd, msg, wParam, lParam, 0,
			                                    MCmodifierstate, MCeventtime);
			pms->appendevent(tptr);
		}
		break;

	case WM_SYSKEYDOWN:
	case WM_SYSCHAR:
	case WM_CHAR:
	case WM_KEYDOWN:
	{
		if (wParam == VK_CONTROL)
			break;

		char t_input_char;
		t_input_char = (char)wParam;

		if (IsWindowUnicode(hwnd))
		{
			if (wParam >= 128)
			{
				bool t_is_unicode;
				WCHAR t_wide[1];
			
				// MW-2012-07-25: [[ Bug 9200 ]] Make sure we roundtrip the input character
				//   through 1252 *not* the active code page (which could be anything).
				t_wide[0] = (WCHAR)wParam;
				t_is_unicode = (WideCharToMultiByte(1252, 0, t_wide, 1, &t_input_char, 1, NULL, NULL) == 0);
				if (!t_is_unicode)
				{
					WCHAR t_reverse_wide[1];
					t_is_unicode = MultiByteToWideChar(1252, 0, &t_input_char, 1, t_reverse_wide, 1) == 0;
					if (!t_is_unicode)
						t_is_unicode = t_reverse_wide[0] != t_wide[0];
				}

				if (t_is_unicode && (msg == WM_CHAR || msg == WM_SYSCHAR))
				{
					if (MCactivefield)
					{
						MCString t_unicode_string;
						t_unicode_string . set((char *)t_wide, 2);

						// MW-2012-02-03: [[ Unicode Block ]] Use the new finsert method to insert
						//   text in unicode mode.
						MCactivefield -> finsertnew(FT_IMEINSERT, t_unicode_string, LCH_UNICODE, true);
					}
					break;
				}
			}
开发者ID:elphinkuo,项目名称:livecode,代码行数:67,代码来源:w32dcw32.cpp

示例13: WDML_ServerNameProc

/******************************************************************
 *		WDML_ServerNameProc
 *
 *
 */
static LRESULT CALLBACK WDML_ServerNameProc(HWND hwndServer, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
    HWND		hwndClient;
    HSZ			hszApp, hszTop;
    HDDEDATA		hDdeData = 0;
    WDML_INSTANCE*	pInstance;
    UINT		uiLo, uiHi;

    switch (iMsg)
    {
    case WM_DDE_INITIATE:

	/* wParam         -- sending window handle
	   LOWORD(lParam) -- application atom
	   HIWORD(lParam) -- topic atom */

	TRACE("WM_DDE_INITIATE message received!\n");
	hwndClient = (HWND)wParam;

	pInstance = WDML_GetInstanceFromWnd(hwndServer);
	TRACE("idInst=%ld, threadID=0x%lx\n", pInstance->instanceID, GetCurrentThreadId());
	if (!pInstance) return 0;

	/* don't free DDEParams, since this is a broadcast */
	UnpackDDElParam(WM_DDE_INITIATE, lParam, &uiLo, &uiHi);

	hszApp = WDML_MakeHszFromAtom(pInstance, uiLo);
	hszTop = WDML_MakeHszFromAtom(pInstance, uiHi);

	if (!(pInstance->CBFflags & CBF_FAIL_CONNECTIONS))
	{
	    BOOL 		self = FALSE;
	    CONVCONTEXT		cc;
	    CONVCONTEXT*	pcc = NULL;
	    WDML_CONV*		pConv;
	    char		buf[256];

	    if (GetWindowThreadProcessId(hwndClient, NULL) == GetWindowThreadProcessId(hwndServer, NULL) &&
		WDML_GetInstanceFromWnd(hwndClient) == WDML_GetInstanceFromWnd(hwndServer))
	    {
		self = TRUE;
	    }
	    /* FIXME: so far, we don't grab distant convcontext, so only check if remote is
	     * handled under DDEML, and if so build a default context
	     */
	    if ((GetClassNameA(hwndClient, buf, sizeof(buf)) &&
		 strcmp(buf, WDML_szClientConvClassA) == 0) ||
		(GetClassNameW(hwndClient, (LPWSTR)buf, sizeof(buf)/sizeof(WCHAR)) &&
		 lstrcmpW((LPWSTR)buf, WDML_szClientConvClassW) == 0))
	    {
		pcc = &cc;
		memset(pcc, 0, sizeof(*pcc));
		pcc->cb = sizeof(*pcc);
		pcc->iCodePage = IsWindowUnicode(hwndClient) ? CP_WINUNICODE : CP_WINANSI;
	    }
	    if ((pInstance->CBFflags & CBF_FAIL_SELFCONNECTIONS) && self)
	    {
		TRACE("Don't do self connection as requested\n");
	    }
	    else if (hszApp && hszTop)
	    {
		WDML_SERVER*	pServer = (WDML_SERVER*)GetWindowLongA(hwndServer, GWL_WDML_SERVER);

		/* check filters for name service */
		if (!pServer->filterOn || DdeCmpStringHandles(pServer->hszService, hszApp) == 0)
		{
		    /* pass on to the callback  */
		    hDdeData = WDML_InvokeCallback(pInstance, XTYP_CONNECT,
						   0, 0, hszTop, hszApp, 0, (DWORD)pcc, self);
		    if ((UINT)hDdeData)
		    {
			pConv = WDML_CreateServerConv(pInstance, hwndClient, hwndServer,
						      hszApp, hszTop);
			if (pConv && pcc) pConv->wStatus |= ST_ISLOCAL;
		    }
		}
	    }
	    else if (pInstance->servers)
	    {
		/* pass on to the callback  */
		hDdeData = WDML_InvokeCallback(pInstance, XTYP_WILDCONNECT,
					       0, 0, hszTop, hszApp, 0, (DWORD)pcc, self);

		if (hDdeData == (HDDEDATA)CBR_BLOCK)
		{
		    /* MS doc is not consistent here */
		    FIXME("CBR_BLOCK returned for WILDCONNECT\n");
		}
		else if ((UINT)hDdeData != 0)
		{
		    HSZPAIR*	hszp;

		    hszp = (HSZPAIR*)DdeAccessData(hDdeData, NULL);
		    if (hszp)
		    {
//.........这里部分代码省略.........
开发者ID:NVIDIA,项目名称:winex_lgpl,代码行数:101,代码来源:server.c

示例14: key_PicViewSlideshow

bool CConEmuCtrl::key_PicViewSlideshow(const ConEmuChord& VkState, bool TestOnly, const ConEmuHotKey* hk, CRealConsole* pRCon)
{
	if (!pRCon)
		return false;
	//if (TestOnly) -- ниже, доп.проверки
	//	return true;

	if (VkState.Vk == VK_PAUSE)
	{
		// SlideShow в PicView2 подзадержался
		if (gpConEmu->isPictureView() /*&& !IsWindowUnicode(hPictureView)*/)
		{
			bool lbAllowed = true;
			if (IsWindowUnicode(gpConEmu->hPictureView))
			{
				// На будущее, если будет "встроенный" SlideShow - вернуть на это сообщение TRUE
				UINT nMsg = RegisterWindowMessage(L"PicView:HasSlideShow");
				DWORD_PTR nRc = 0;
				LRESULT lRc = SendMessageTimeout(gpConEmu->hPictureView, nMsg, 0,0, SMTO_NORMAL, 1000, &nRc);
				if (!lRc || nRc == TRUE)
					lbAllowed = false;
			}

			if (!lbAllowed)
				return false;
			if (TestOnly)
				return true;

			gpConEmu->bPicViewSlideShow = !gpConEmu->bPicViewSlideShow;

			if (gpConEmu->bPicViewSlideShow)
			{
				if (gpSet->nSlideShowElapse<=500) gpSet->nSlideShowElapse=500;

				gpConEmu->dwLastSlideShowTick = GetTickCount() - gpSet->nSlideShowElapse;
			}

			return true;
		}
	}
	else if (gpConEmu->bPicViewSlideShow)
	{
		//KillTimer(hWnd, 3);
		if ((VkState.Vk == 0xbd/* -_ */) || (VkState.Vk == 0xbb/* =+ */))
		{
			if (TestOnly)
				return true;

			if (VkState.Vk == 0xbb)
			{
				gpSet->nSlideShowElapse = 1.2 * gpSet->nSlideShowElapse;
			}
			else
			{
				gpSet->nSlideShowElapse = gpSet->nSlideShowElapse / 1.2;

				if (gpSet->nSlideShowElapse<=500) gpSet->nSlideShowElapse=500;
			}

			return true;
		}
		//else
		//{
		//	//bPicViewSlideShow = false; // отмена слайдшоу
		//	return false;
		//}
	}

	return false;
}
开发者ID:negadj,项目名称:ConEmu,代码行数:70,代码来源:ConEmuCtrl.cpp

示例15: ProcessAttach

void ProcessAttach()
{
#define FOR_COMMON
#ifdef FOR_COMMON

    GetInjectWindow();
    if (NULL == g_hCalc)
    {
        return;
    }

#else
    HWND hParent = ::FindWindow(NULL, "计算器");
    g_hCalc = hParent;
#endif
    
    ////检查窗口口是否UNICODE
    g_bUnicode = IsWindowUnicode(g_hCalc);
    
#ifdef HOOK_HOME
    //对进程所有窗口进行遍历,并更改消息过程函数。
    
    //消息过程函数需要临界区同步
    InitializeCriticalSection(&g_cs);
    
    if (g_bUnicode)
    {
        //不要忘记主窗口的消息过程函数的替换
        g_hWnd[g_nCount] = g_hCalc;
        g_OldProc[g_nCount] = (WNDPROC)::SetWindowLongW(g_hCalc, 
                                                        GWL_WNDPROC, 
                                                        (LONG)WindowProc);
        g_nCount++;
        
        EnumChildWindows(g_hCalc,  
                        EnumChildProc_Unicode, 
                        g_bUnicode); 
    }
    else
    {
        g_hWnd[g_nCount] = g_hCalc;
        g_OldProc[g_nCount] = (WNDPROC)::SetWindowLongA(g_hCalc, 
                                                        GWL_WNDPROC, 
                                                        (LONG)WindowProc);
        g_nCount++;
        
        EnumChildWindows(g_hCalc,  
                        EnumChildProc, 
                        g_bUnicode); 
    }       
    
#else 
    
    #ifdef WIN7
    g_hCalc = ::GetWindow(hParent, GW_CHILD);
    if (g_hCalc == NULL)
    {
        ::MessageBox(NULL, "没找到计算器", NULL, MB_OK);
        return TRUE;
    }
    
    #endif
    
    if (g_bUnicode)
    {
        //修改窗口过程函数
        g_pfnOld = (WNDPROC)::SetWindowLongW(g_hCalc, 
                                            GWL_WNDPROC, 
                                            (LONG)WindowProc);
    }
    else
    {
        //修改窗口过程函数
        g_pfnOld = (WNDPROC)::SetWindowLongA(g_hCalc,
                                            GWL_WNDPROC, 
                                            (LONG)WindowProc);
    }
#endif  //end for HOOK_HOME
}
开发者ID:xuwenbo,项目名称:KR_Ph2,代码行数:79,代码来源:InjectDll.cpp


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