开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

楼主: moiliom
打印 上一主题 下一主题
收起左侧

[易语言] 读取内存取通达信股票代码,怎样才可以实现?

[复制链接]
81
发表于 2024-8-24 15:16:43 | 只看该作者   福建省厦门市
etec 发表于 2024-8-19 03:03
股票代码_字节集 = XNC.读字节集 (进程ID, 进制_十六到十 (“0014BFE0”), )无论怎么改结果都是0,读不到 ...

全部搞透了,通透。
回复

使用道具 举报

签到天数: 2 天

82
发表于 2024-8-24 16:19:15 | 只看该作者   上海市上海市
感谢大佬分享
回复

使用道具 举报

结帖率:87% (13/15)

签到天数: 10 天

83
发表于 2024-12-24 22:24:13 | 只看该作者   湖北省武汉市
通达信还有一种更简单的方式去获得 股票代码
发送消息整数 (通达信句柄, 273, 33780, 0)——本条是获得老版本的
发送消息整数 (通达信句柄, 273, 33819, 0)——本条是获得新版本的
用完上面一条后,可以理解为是复制了当前可视状态的“股票代码+空格+股票名称“,再用下面一条。返回的文本内容是“000019 深粮控股”的字符串,再选择前6位即可。
返回文本 = 剪辑板_取文本 ()
这种方式可以理解为执行了通达信在空白处点击右键→菜单中的“标记当前品种”→“复制到剪切板”这个命令。


回复

使用道具 举报

结帖率:87% (13/15)

签到天数: 10 天

84
发表于 2024-12-24 23:50:13 | 只看该作者   湖北省武汉市
jangel1 发表于 2023-9-13 03:07
SendWessageA (TDK_ 窗口句柄, 273. 33780. 0)。请问下这个33780是怎么获取的(你的其他帖子关闭了无法回 ...

;AHK v1.0 x64/x32 compatible update by jeeswg of:
;Get Info from Context Menu - Scripts and Functions - AutoHotkey Community
;https://autohotkey.com/board/topic/19754-get-info-from-context-menu/

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         micha
;
; Script Function:
;        Demonstrates how to retrieve infos from a context/ popup menu
;

/*
This is the struct we are using.
typedef struct tagMENUITEMINFO {
        UINT    cbSize;
        UINT    fMask;
        UINT    fType;
        UINT    fState;
        UINT    wID;
        HMENU   hSubMenu;
        HBITMAP hbmpChecked;
        HBITMAP hbmpUnchecked;
        ULONG_PTR dwItemData;
        LPTSTR  dwTypeData;
        UINT    cch;
        HBITMAP hbmpItem;
} MENUITEMINFO, *LPMENUITEMINFO;

*/
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#Persistent
RunAsAdmin()
SetTimer, Demo, 500
return
Demo:
;constants
MFS_ENABLED = 0
MFS_CHECKED = 8
MFS_DEFAULT = 0x1000
MFS_DISABLED = 2
MFS_GRAYED = 1
MFS_HILITE = 0x80
;MFS_UNCHECKED = 0
;MFS_UNHILITE = 0
;Get mouse position and handle to wnd under the mouse cursor
MouseGetPos, MouseScreenX, MouseScreenY, MouseWindowUID, MouseControlID
WinGet,ControlHwnd, ID,ahk_id %MouseWindowUID%
;Get count of menu items
ContextMenCnt := GetContextMenuCount(ControlHwnd)
if ContextMenCnt < 1
{
        Tooltip,
        return
}
TooltipText =
;Read info for each menu item
loop, %ContextMenCnt%
{
        IsEnabled := GetContextMenuState(ControlHwnd, a_index-1)
        {
                CurrentText =
                ;~ if IsEnabled = 0
                ;~ CurrentText = %CurrentText% Enabled
                ;~ if (IsEnabled & MFS_CHECKED)
                ;~ CurrentText = %CurrentText% Checked
                ;~ if (IsEnabled & MFS_DEFAULT)
                ;~ CurrentText = %CurrentText% Default
                ;~ if (IsEnabled & MFS_DISABLED)
                ;~ CurrentText = %CurrentText% Disabled
                ;~ if (IsEnabled & MFS_GRAYED)
                ;~ CurrentText = %CurrentText% Grayed
                ;~ if (IsEnabled & MFS_HILITE)
                ;~ CurrentText = %CurrentText% Highlight
                ;~ TooltipText = %TooltipText%%a_index%:%CurrentText%`n
                if (IsEnabled & MFS_HILITE)
        {
                CurrentText := GetContextMenuID(ControlHwnd, a_index-1) . A_Tab . GetContextMenuText(ControlHwnd, a_index-1)
        TooltipText := CurrentText   
                }
        }
}
;~ TextText =
;~ loop, %ContextMenCnt%
;~ {
        ;~ StrSize := GetContextMenuText(ControlHwnd, a_index-1)
        ;~ nID := GetContextMenuID(ControlHwnd, a_index-1)
        ;~ TextText = %TextText%%a_index%:%StrSize%-ID=%nID%`n
;~ }
CoordMode, Tooltip, Screen
Tooltip, %TooltipText%---`n%TextText%, 0, 0
return
/***************************************************************
* returns the count of menu items
***************************************************************
*/
GetContextMenuCount(hWnd)
{
        WinGetClass, WindowClass, ahk_id %hWnd%
        ;All popups should have the window class #32768
        if WindowClass <> #32768
        {
                return 0
        }
        ; Retrieve menu handle from window
        SendMessage, 0x01E1, , , , ahk_id %hWnd%
        ;Errorlevel is set by SendMessage. It contains the handle to the menu
        hMenu := errorlevel
        menuitemcount:=DllCall("GetMenuItemCount", Ptr,hMenu)
        Return, menuitemcount
}
/***************************************************************
* returns the state of a menu entry
***************************************************************
*/
GetContextMenuState(hWnd, Position)
{
        WinGetClass, WindowClass, ahk_id %hWnd%
        if WindowClass <> #32768
        {
                return -1
        }
        SendMessage, 0x01E1, , , , ahk_id %hWnd%
        ;Errorlevel is set by SendMessage. It contains the handle to the menu
        hMenu := errorlevel
        ;We need to allocate a struct
        VarSetCapacity(MenuItemInfo, 60, 0)
        ;Set Size of Struct to the first member
        NumPut(A_PtrSize=8?80:48, MenuItemInfo, 0, "UInt")
        ;Get only Flags from dllcall GetMenuItemInfo MIIM_TYPE = 1
        NumPut(1, MenuItemInfo, 4, "UInt")
        ;GetMenuItemInfo: Handle to Menu, Index of Position, 0=Menu identifier / 1=Index
        InfoRes := DllCall("user32.dll\GetMenuItemInfo", Ptr,hMenu, UInt,Position, Int,1, Ptr,&MenuItemInfo)
        InfoResError := errorlevel
        LastErrorRes := DllCall("GetLastError", UInt)
        if InfoResError <> 0
        return -1
        if LastErrorRes != 0
        return -1
        ;Get Flag from struct
        GetMenuItemInfoRes := NumGet(MenuItemInfo, 12, "UInt")
        /*
        IsEnabled = 1
        if GetMenuItemInfoRes > 0
        IsEnabled = 0
        return IsEnabled
        */
        return GetMenuItemInfoRes
}
/***************************************************************
* returns the ID of a menu entry
***************************************************************
*/
GetContextMenuID(hWnd, Position)
{
        WinGetClass, WindowClass, ahk_id %hWnd%
        if WindowClass <> #32768
        {
                return -1
        }
        SendMessage, 0x01E1, , , , ahk_id %hWnd%
        ;Errorlevel is set by SendMessage. It contains the handle to the menu
        hMenu := errorlevel
        ;UINT GetMenuItemID(          HMENU hMenu,    int nPos);
        InfoRes := DllCall("user32.dll\GetMenuItemID", Ptr,hMenu, Int,Position, UInt)
        InfoResError := errorlevel
        LastErrorRes := DllCall("GetLastError", UInt)
        if InfoResError <> 0
        return -1
        if LastErrorRes != 0
        return -1
        return InfoRes
}
/***************************************************************
* returns the text of a menu entry (standard windows context menus only!!!)
***************************************************************
*/
GetContextMenuText(hWnd, Position)
{
        WinGetClass, WindowClass, ahk_id %hWnd%
        if WindowClass <> #32768
        {
                return -1
        }
        SendMessage, 0x01E1, , , , ahk_id %hWnd%
        ;Errorlevel is set by SendMessage. It contains the handle to the menu
        hMenu := errorlevel
        ;We need to allocate a struct
        VarSetCapacity(MenuItemInfo, 200, 0)
        ;Set Size of Struct (48) to the first member
        NumPut(A_PtrSize=8?80:48, MenuItemInfo, 0, "UInt")
        ;Retrieve string MIIM_STRING = 0x40 = 64 (/ MIIM_TYPE = 0x10 = 16)
        NumPut(64, MenuItemInfo, 4, "UInt")
        ;Set type - Get only size of string we need to allocate
        ;NumPut(0, MenuItemInfo, 8, "UInt")
        ;GetMenuItemInfo: Handle to Menu, Index of Position, 0=Menu identifier / 1=Index
        InfoRes := DllCall("user32.dll\GetMenuItemInfo", Ptr,hMenu, UInt,Position, Int,1, Ptr,&MenuItemInfo)
        if InfoRes = 0
        return -1
        InfoResError := errorlevel
        LastErrorRes := DllCall("GetLastError", UInt)
        if InfoResError <> 0
        return -1
        if LastErrorRes <> 0
        return -1
        ;Get size of string from struct
        GetMenuItemInfoRes := NumGet(MenuItemInfo, A_PtrSize=8?64:40, "UInt")
        ;If menu is empty return
        If GetMenuItemInfoRes = 0
        return "{Empty String}"
        ;+1 should be enough, we'll use 2
        GetMenuItemInfoRes += 2
        ;Set capacity of string that will be filled by windows
        VarSetCapacity(PopupText, GetMenuItemInfoRes, 0)
        ;Set Size plus 0 terminator + security ;-)
        NumPut(GetMenuItemInfoRes, MenuItemInfo, A_PtrSize=8?64:40, "UInt")
        NumPut(&PopupText, MenuItemInfo, A_PtrSize=8?56:36, "Ptr")
        InfoRes := DllCall("user32.dll\GetMenuItemInfo", Ptr,hMenu, UInt,Position, Int,1, Ptr,&MenuItemInfo)
        if InfoRes = 0
        return -1
        InfoResError := errorlevel
        LastErrorRes := DllCall("GetLastError", UInt)
        if InfoResError <> 0
        return -1
        if LastErrorRes <> 0
        return -1
        return PopupText
}
;PrintScreen::reload
RunAsAdmin() {
        full_command_line := DllCall("GetCommandLine", "str")
        if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
        {
                try
                {
                        if A_IsCompiled
                                Run *RunAs "%A_ScriptFullPath%" /restart
                        else
                                Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
                }
                ExitApp
        }
}


以上代码复制到txt,改后缀成ahk,安装autohotkey1.X版本的,2.0版本有问题,安装后,直接运行这个txt改后的ahk文件即可,这样右键点击任何位置的时候,左上角就会出现一个小框,鼠标移动到哪,左上角的代码就会跟着改变。
回复

使用道具 举报

85
发表于 2025-1-25 11:55:59 | 只看该作者   四川省成都市
sdfssssssffffff
回复

使用道具 举报

签到天数: 8 天

86
发表于 2025-2-10 15:59:04 | 只看该作者   四川省成都市
干嘛去读内存获取数据,那么多数据,很麻烦哦,TDX安装目录有数据文件,直接调用可获取实时数据
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 793400750,邮箱:[email protected]
网站简介:精易论坛成立于2009年,是一个程序设计学习交流技术论坛,隶属于揭阳市揭东区精易科技有限公司所有。
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表