| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 587 人关注过本帖
标题:GetWindowThreadProcessId的一些问题
只看楼主 加入收藏
diejianwu
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2013-1-24
结帖率:0
收藏
已结贴  问题点数:10 回复次数:1 
GetWindowThreadProcessId的一些问题
先看代码
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long

Private Sub Form_Click()
      
Dim a As Long

Dim b As Long
      
a = FindWindow(vbNullString, "计算器")  '获得窗口句柄

b = GetWindowThreadProcessId(a, vbNull) '获得进程PID

Print a

Print CStr(b)

End Sub
b的值和任务管理器的PID值不一样?  不管是 什么程序  都不一样? 怎么回事,  360  什么的都关了 就开一个VB 。。

搜索更多相关主题的帖子: 计算器 任务管理器 
2013-01-27 15:06
bczgvip
Rank: 14Rank: 14Rank: 14Rank: 14
等 级:贵宾
威 望:66
帖 子:1310
专家分:5312
注 册:2009-2-26
收藏
得分:10 
Dim b As Long
dim c as long
a = FindWindow(vbNullString, "计算器")  '获得窗口句柄

b = GetWindowThreadProcessId(a, c) '获得进程PID 话说这没出错?

2013-02-01 18:22
快速回复:GetWindowThreadProcessId的一些问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015882 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved