Impl SendImageMsg

This commit is contained in:
Changhua
2021-08-22 21:57:16 +08:00
parent c4d0a521ab
commit ae8e20c4e7
14 changed files with 102 additions and 15 deletions
+7 -4
View File
@@ -26,10 +26,11 @@ int onTextMsg(WxMessage_t msg)
int main()
{
DWORD status = 0;
wstring wxid = L"filehelper"; // 微信ID
wstring at_wxid = L"";
wstring content = L"这里填写消息内容";
DWORD status = 0;
wstring wxid = L"filehelper"; // 微信ID
wstring at_wxid = L"";
wstring content = L"这里填写消息内容";
wstring img_path = L"test.jpg";
//_setmode(_fileno(stdout), _O_WTEXT); // 没有这个wcout遇到一些字符会导致console卡死,用了会导致脱离控制台
_wsetlocale(LC_ALL, L"chs"); // 这是个大坑,不设置中文直接不见了。。。
@@ -51,6 +52,8 @@ int main()
// 测试消息发送
WxSendTextMsg(wxid, at_wxid, content);
// 发送照片
WxSendImageMsg(wxid, img_path);
while (1) {
Sleep(10000); // 休眠,释放CPU
+4
View File
@@ -24,6 +24,10 @@ def main():
print("发送文本消息......")
sdk.WxSendTextMsg("filehelper", "", "message from WeChatFerry...")
time.sleep(2)
print("发送图片消息......")
sdk.WxSendImageMsg("filehelper", "test.jpg")
# 接收消息。先定义消息处理回调
def OnTextMsg(msg: sdk.WxMessage):
if msg.self == 1: # 忽略自己发的消息
+2 -1
View File
@@ -123,7 +123,8 @@ xcopy /y $(OutDir)Spy.dll $(OutDir)wx\
xcopy /y $(OutDir)SDK.dll $(OutDir)wx\
xcopy /y $(OutDir)wcferry.pyd $(OutDir)wx\
xcopy /y $(OutDir)App.exe $(OutDir)wx\
xcopy /y $(SolutionDir)App\App.py $(OutDir)wx\</Command>
xcopy /y $(SolutionDir)App\App.py $(OutDir)wx\
xcopy /y $(SolutionDir)App\test.jpg $(OutDir)wx\</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Copy output</Message>
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 399 KiB