zoukankan      html  css  js  c++  java
  • WinCE进程ID获取窗口句柄

    HWND hwndFind = NULL;
    
    /*
    1、枚举所有顶层窗口(不包括子窗口),并将窗口句柄依次传给回调函数
    2、枚举结束条件:枚举完成或回调函数返回FALSE
    */ BOOL bRt = EnumWindows(EnumWindowsProc, dwProcessId); //回调函数 BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam) { DWORD dwPI; GetWindowThreadProcessId(hwnd, &dwPI); if ( dwPI == (DWORD)lParam ) { hwndFind = hwnd; return FALSE; } return TRUE; }

    MSDN说明:

    • The EnumWindows function does not enumerate child windows. 

    • This function is more reliable than calling the GetWindow function in a loop. An application that calls GetWindow to perform this task risks being caught in an infinite loop or referencing a handle to a window that has been destroyed

  • 相关阅读:
    08-30 作业整理
    JS题目整理
    08-20作业整理
    CSS3知识总结
    CSS样式表知识总结
    html标签知识总结
    Dice (III) 概率dp
    Island of Survival 概率
    How far away ?
    Hdu 2874 Connections between cities
  • 原文地址:https://www.cnblogs.com/dahai/p/2792259.html
Copyright © 2011-2022 走看看