# ide.command 库模块帮助文档

## ide 成员列表 <a id="ide" href="#ide">&#x23;</a>

### ide.command() <a id="ide.command" href="#ide.command">&#x23;</a>
[返回对象:ideCommandObject](#ideCommandObject)

### ide.command(窗口对象,是否取消特权隔离) <a id="ide.command" href="#ide.command">&#x23;</a>
创建进程命令对象  
省略窗口参数则创建 message only window,  
该对象定义的成员函数,都可在其他进程中用 thread.command.post()调用

## ide.command 成员列表 <a id="ide.command" href="#ide.command">&#x23;</a>

只允许在 ide 扩展库、以及IDE启动触发器 init.aardio 中使用。  
用于避免在 IDE 中因为导入ide接口而无法支持 process.command

### ide.command.* <a id="ide.command.any" href="#ide.command.any">&#x23;</a>
可指定外部进程的命令函数名,并直接调用该函数，  
可获取外部进程中被调用函数的返回值

### ide.command.each() <a id="ide.command.each" href="#ide.command.each">&#x23;</a>

```aardio
for hwnd,groupId in ide.command.each(){
	/*遍历 aardio 开发环境主窗口。  
hwnd 为主窗口句柄，groupId 为 ide.command 进程群组 ID。*/
}
```

### ide.command.invoke("命令函数名",其他参数) <a id="ide.command.invoke" href="#ide.command.invoke">&#x23;</a>
非阻塞调用跨进程命令,支持返回值

### ide.command.join("群组ID") <a id="ide.command.join" href="#ide.command.join">&#x23;</a>
加入进程命令群组。  
使用群组 ID 区分不同的进程命令分组。  
同一线程应当且必须在定义或发送进程命令前调用该函数一次，  
同一线程可多次调用该函数，但参数必须相同。  
成功返回true。  
试图加入不同的群组会抛出异常。  
ide.command 不能与 process.command 使用相同的群组 ID。

### ide.command.joined() <a id="ide.command.joined" href="#ide.command.joined">&#x23;</a>
进程是否已加入进程命令群组。

### ide.command.post("命令函数名",其他参数) <a id="ide.command.post" href="#ide.command.post">&#x23;</a>
非阻塞调用跨进程命令,无返回值  
此函数需要创建线程调用send函数,不适合频繁调用  
异步命令如果尚未发出前,发送线程如果立即退出会导到命令发送失败

### ide.command.send("命令函数名",其他参数) <a id="ide.command.send" href="#ide.command.send">&#x23;</a>
阻塞调用跨进程命令  
不指定窗口句柄,所有同名的进程命令函数都会被调用,  
可获取处理该命令的回调函数返回值,默认返回0

### ide.command.send(窗口句柄,"命令函数名",其他参数) <a id="ide.command.send" href="#ide.command.send">&#x23;</a>
阻塞调用跨进程命令,  
可获取回调函数的数值返回值,默认返回null

### ide.command.sendPid(目标进程ID,"命令函数名",其他参数) <a id="ide.command.sendPid" href="#ide.command.sendPid">&#x23;</a>
阻塞调用跨进程命令,  
可获取回调函数的数值返回值,默认返回null

## ideCommandObject 成员列表 <a id="ideCommandObject" href="#ideCommandObject">&#x23;</a>

### ideCommandObject._form <a id="ideCommandObject._form" href="#ideCommandObject._form">&#x23;</a>
窗体对象  

[返回对象:winform](https://www.aardio.com/zh-cn/docs/library-reference/win/ui/_.html#winform)

### ideCommandObject.自定义函数名 <a id="ideCommandObject.自定义函数名" href="#ideCommandObject.自定义函数名">&#x23;</a>

```aardio
ideCommandObject.命令函数 = function( ... ) {
	/*支持不定个数参数  
返回值可阻止命令继续传递*/
}
```

