• 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

  • 相关阅读:
    os和sys模块
    time模块
    collections模块
    re模块
    Python初识一
    Python闭包函数
    压栈
    isinstance()和issubclass()
    匿名函数--lambda函数
    机器学习入门文章
  • 原文地址:https://www.cnblogs.com/dahai/p/2792259.html
Copyright © 2020-2023  润新知