Impl SendImageMsg
This commit is contained in:
+7
-4
@@ -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
|
||||
|
||||
@@ -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
@@ -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>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 399 KiB |
Reference in New Issue
Block a user