WIN32汇编之菜单、加速键、快捷键

(一)
Invoke checkmenuitem,hmenu,ebx,eax
.elseif eax>=IDM_BIG&&eax<=DM_DETAIL
invokecheckmenuradioitem,hmenu,IDM_BIG,IDM_DETAIL,eax,MF_BYCOMMAND
.endif
重点与难点:
1、关于checkmenuitem
The CheckMenuItem function sets the state of the specified menuitem's check-mark attribute to either selected or clear.
设置菜单项的check状态的选择或清除
Syntax
DWORD CheckMenuItem(
HMENU hmenu,
UINT uIDCheckItem,
UINT uCheck
);
参数说明
UCHECK如下:
MF_BYCOMMAND uIDCheckItem参数为为命令ID
Indicates that the uIDCheckItem parameter gives the identifier ofthe menu item. The MF_BYCOMMAND flag is the default, if neither theMF_BYCOMMAND nor MF_BYPOSITION flag is specified.
MF_BYPOSITION uIDCheckItem参数为从0起始的菜单序号
Indicates that the uIDCheckItem parameter gives the zero-basedrelative position of the menu item.
MF_CHECKED 设置菜单项为选择
Sets the check-mark attribute to the selected state.
MF_UNCHECKED 设置菜单项为没有选择
Sets the check-mark attribute to the clear state
2、关于checkmenuradioitem
The CheckMenuRadioItem function checks a specified menu item andmakes it a radio item. At the same time, the function clears allother menu items in the associated group and clears the radio-itemtype flag for those items
用于radio类型的菜单项选择,选中某一项并清除其它项的选择标志,其它项由 UINT idFirst,
UINT idLast两个参数指定。
Syntax
BOOL CheckMenuRadioItem(

HMENU hmenu,
UINT idFirst,
UINT idLast,
UINT idCheck,
UINT uFlags
);
uFlags 参数:If this parameter is MF_BYCOMMAND, the other parametersspecify menu item identifiers(命令ID). If it is MF_BYPOSITION, theother parameters specify the menu item positions(菜单序号)
(二)
.elseif eax==wm_bycommand
mov eax,wparam
movzx eax,ax
..if eax==IDM_HELP||IDM_ABOUT
invoke _displaymenuitem,wparam
.else
invoke defwindowproc,hwnd,umsg,wparam,lparam;交给默认窗口处理程序处理
ret
.endif
.elseif

(三)右键弹出菜单
.elseif eax==WM_RBUTTONDOWN
invoke getcursorpos,addr @stpos;
invoketrackpopupmenu,hsubmenu,TPM_LEFT,@stops.x,@stops.y,null,hwnd,null;
.elseif eax==wm_close
call _quit
.else
invoke defwindowproc,hwnd,umsg,wparam,lparam;交给默认窗口处理程序处理
ret
.endif

重点与难点:
1、 the GetCursorPos function retrieves the cursor's position, inscreen coordinates.
返回当前光标位置,即鼠标位置是是相对于屏幕的座标。
Syntax
BOOL GetCursorPos(

LPPOINT lpPoint
);
2、 trackpopupmenu
The TrackPopupMenu function displays a shortcut menu at thespecified location and tracks the selection of items on the menu.The shortcut menu can appear anywhere on the screen.
在屏幕的任何指定位置显示一个弹出菜单。
Syntax
BOOL TrackPopupMenu(

HMENU hMenu,
UINT uFlags,
int x,
int y,
int nReserved,
HWND hWnd,
HWND prcRect
);
参数说明
(1) uFlags
TPM_CENTERALIGN
If this flag is set, the function centers the shortcut menuhorizontally relative to the coordinate specified by the xparameter.
TPM_LEFTALIGN
If this flag is set, the function positions the shortcut menu sothat its left side is aligned with the coordinate specified by thex parameter.
TPM_RIGHTALIGN
Positions the shortcut menu so that its right side is aligned withthe coordinate specified by the x parameter.
Use one of the following flags to specify how the functionpositions the shortcut menu vertically.
TPM_BOTTOMALIGN
If this flag is set, the function positions the shortcut menu sothat its bottom side is aligned with the coordinate specified bythe y parameter.
TPM_TOPALIGN
If this flag is set, the function positions the shortcut menu sothat its top side is aligned with the coordinate specified by the yparameter.
TPM_VCENTERALIGN
If this flag is set, the function centers the shortcut menuvertically relative to the coordinate specified by the yparameter.
Use the following flags to determine the user selection withouthaving to set up a parent window for the menu.
以上为菜单显示时的对齐方式相对于x、y参数
TPM_NONOTIFY用户选择菜单项时不发送通知消息
If this flag is set, the function does not send notificationmessages when the user clicks on a menu item.
TPM_RETURNCMD 返回命令ID
If this flag is set, the function returns the menu item identifierof the user's selection in the return value.
Use one of the following flags to specify which mouse button theshortcut menu tracks.
TPM_LEFTBUTTON 左键键选择菜单
If this flag is set, the user can select menu items with only theleft mouse button.
TPM_RIGHTBUTTON 右键选择菜单
If this flag is set, the user can select menu items with both theleft and right mouse buttons.
Windows 98/Me, Windows 2000/XP:Use any reasonable combination ofthe following flags to modify the animation of a menu. For example,by selecting a horizontal and a vertical flag you can achievediagonal animation. 可以用下列参数来展示菜单显示的动态效果
TPM_HORNEGANIMATION
Animates the menu from right to left.
TPM_HORPOSANIMATION
Animates the menu from left to right.
TPM_NOANIMATION
Displays menu without animation.
TPM_VERNEGANIMATION
Animates the menu from bottom to top.
TPM_VERPOSANIMATION
Animates the menu from top to bottom
(2) nReserved
Reserved; must be zero. 必须为null
(3) hWnd 要弹出菜单的句柄
[in] Handle to the window that owns the shortcut menu. This windowreceives all messages from the menu. The window does not receive aWM_COMMAND message from the menu until the function returns. If youspecify TPM_NONOTIFY in the uFlags parameter, the function does notsend messages to the window identified by hWnd. However, you muststill pass a window handle in hWnd. It can be any window handlefrom your application
仅指窗口的弹出菜单类型,在本函数返回后,窗口才会接收到wm_command消息,但POPUP类型的菜单只能在第二层中定义,如文件属于第一层,打开、新建等才属于第二层,所以hdunmrnu参数取得了子菜单句柄,invokegetsubmenu.hnemu,npos
,mov hsubmenu,eax。npos指定要取得的第一层菜单的序号,如第一层有2个菜单项,文件和查看,则文件为0,查看为1。
  _procwinmain endp

_winmaing proc
local @stwndclass:wndclassex
local @stmsg:MSG
local @haccelerator
invoke getmodulehandle,null
mov hinstance,eax
invoke loadmenu,hinstance,IDM_MIAN;加载菜单
mov hmenu,eax
invoke loadaccelerators,hinstance,IDA_MAIN;加载加速键
mov @haccelerator,eax
;注册窗口类和建立显示窗口省略
;...............
;...............
;重点:消息循环
.while true
invoke getmessage,addr @stmsg,null,0,0
.break .if eax==0
invoke translateaccelerator,hwinmain,@haccelerator,addr@stmsg
;关于translateaccelerator
;-----------
The TranslateAccelerator function processes accelerator keys formenu commands. The function translates a WM_KEYDOWN orWM_SYSKEYDOWN message to a WM_COMMAND or WM_SYSCOMMAND message (ifthere is an entry for the key in the specified accelerator table)and then sends the WM_COMMAND or WM_SYSCOMMAND message directly tothe appropriate window procedure. TranslateAccelerator does notreturn until the window procedure has processed the message.
对菜单的快键进行预处理,将WM_KEYDOWN或WM_SYSKEYDOWN消息处理成为WM_COMMAND或WM_SYSCOMMAND,并直接将消息送到窗口过程处理,直到窗口过程处理该消息后才返回.
Syntax

int TranslateAccelerator( HWND hWnd,
HACCEL hAccTable,加速键表的资源句柄
LPMSG lpMsg
);
Parameters

hWnd
[in] Handle to the window whose messages are to betranslated.
hAccTable
[in] Handle to the accelerator table. The accelerator table musthave been loaded by a call to the LoadAccelerators function orcreated by a call to the CreateAcceleratorTable function.
lpMsg
[in] Pointer to an MSG structure that contains message informationretrieved from the calling thread's message queue using theGetMessage or PeekMessage function.


[Return Value]

If the function succeeds, the return value isnonzero.执行成功返回非0

If the function fails, the return value is zero.不成功返回0

;-----------

;如果不属于加速键消息或处理失败,则进行标准的处理方案,否则以下不执行,因为该函数直接把
;消息发送到窗口过程,再进行发送
.if eax==0
invoke translatemessage,addr @stmsg
invoke dispatchmessage.addr @stmsg
.endif
.endw
ret
_winmain endp
start:
call _winmain
invoke exitprocess,null
end start

    菜单IDMENU [DISCARDABLE]
BEGIN
菜单项定义
....
END
菜单ID可以是字符型也可以是数值型,数值型ID>10000h,DISCARDABLE表示菜单不再使用的时候暂从内存释放。
MENUITEM 菜单文字,命令ID[,选荐列表]

MENUITEM SEPARATOR分隔条

POPUP 菜单文字[,选项列表]
BEGIN
item-definitions
...
END
顶层菜单
菜单文字:显示在菜单中的字符串。
命令ID:用来分辨不同的菜单项。
选项:用来定义菜单项的各种属性。
CHECKED
GRAYED:灰化
INACTIVE:禁用
MENUBREAK,MENUBARBREAK:此菜单项和以后的菜单项列到新的列中。
.386
.model flat,stdcall
option casemap:none
;---------------
include windows.inc
include user32.inc
include user32.lib
include kernel32.inc
include kernel32.lib
;-----------
ICO_MAIN EQU 1000H;图标
IDM_MAIN EQU 2000H;菜单
IDA_MAIN EQU 2000H;加速键
;-------------下面定义命令ID
IDM_OPEN EQU 4101H
IDM_OPTION EQU 4102H
IDM_EXIT EQU 4103H
......................
IDM_ABOUT EQU 4302H
;--------------------命令ID定义完毕
;------变量
.DATA?
hinstance dd ?
hwinmain dd ?
hmenu dd?
hsubmenu dd ?
;--------常量
.const
szclassname db 'menu example',0
szcaptionmain db 'menu',0
szmenuhellp db '帮助主题(&H)',0
szmenuabout db '关于本程序(&A)....',0
szcaption db '菜单选择',0
szformat db '您选择了菜单命令%08x',0
;---------代码段
.code
_displaymenuitem proc _dwcommandid;显示当前选择的菜单命令
local @szbuffer[256]:byte
pushad

invoke wsprintf,addr @szbuffer,addr szformat,_dwcommandid

;关于wsprintf函数

The wsprintf function formats and stores a series of characters andvalues in a buffer. Any arguments are converted and copied to theoutput buffer according to the corresponding format specificationin the format string. The function appends a terminating nullcharacter to the characters it writes, but the return value doesnot include the terminating null character in its charactercount.
格式化一系列的字符和值在缓冲区内,函数将一个终止的NULL字符插入字符的后面,返回 字符个数,不包括终止符。
语法:
int wsprintf(
LPTSTR lpOut,
LPCTSTR lpFmt,
...
);


lpOut缓冲区
[out] Pointer to a buffer to receive the formatted output. Themaximum size of the buffer is 1024 bytes.
lpFmt
含格式化控制符的字符串
[in] Pointer to a null-terminated string that contains theformat-control specifications. In addition to ordinary ASCIIcharacters, a format specification for each argument appears inthis string. For more information about the format specification,see the Remarks section.

被格化后插入上述字符串中的参数(可以有多个参数,随着上述字符串所含格式化控制符数量而定)
[in] Specifies one or more optional arguments. The number and typeof argument parameters depend on the corresponding format-controlspecifications in the lpFmt parameter.
 格式化规范如下
A format specification has the following form:

%[-][
[img][width][.precision]type
Field Meaning 以上规范中字段的意义
– Pad the output with blanks or zeros to the right to fill thefield width, justifying output to the left. If this field isomitted, the output is padded to the left, justify填充ing it to theright.
-:输出有左边开始的,用空格或0右填充宽度,如果没有这个则左填充。
[/img]
Prefix hexadecimal values with 0x (lowercase) or 0X(uppercase).
将数字用16进制格式0x或oX前缀
0 Pad the output value with zeros to fill the field width. If thisfield is omitted, the output value is padded with blankspaces.
用0填充宽度,没有这个参数用空格填充
width: Copy the specified minimum number of characters to theoutput buffer. The width field is a nonnegative integer. The widthspecification never causes a value to be truncated; if the numberof characters in the output value is greater than the specifiedwidth, or if the width field is not present, all characters of thevalue are printed, subject to the precision specification.
复制指定最小数量的字符到缓冲区中,但是如字符的实际宽度比指定最小数量还大,或这个参数缺省,所有字符被输出。

.precision :For numbers, copy the specified minimum number ofdigits to the output buffer. If the number of digits in theargument is less than the specified precision, the output value ispadded on the left with zeros. The value is not truncated when thenumber of digits exceeds the specified precision. If the specifiedprecision is 0 or omitted entirely, or if the period (.) appearswithout a number following it, the precision is set to 1.

数字的精确度
复制指定最小位数的数字到缓冲区中,但是如数字的实际位数比指定最小数量还小,用0从左边填充,实际位数超过指定,则值不会被删短,如果说指定为0或这个参数缺省,或这个参数指定时,该参数其小数点没有数字,则精确度为1,对于字符来说是复制最大数量的字符。

type Output the corresponding argument as acharacter, a string, or a number. This field can be any of thefollowing values.
type就是指输出到缓冲区的类型。
Value Meaning
c Single character. This value is interpreted as type WCHAR if thecalling application defines Unicode and as type __wchar_totherwise.
C Single character. This value is interpreted as type __wchar_t ifthe calling application defines Unicode and as type WCHARotherwise.
d Signed decimal integer. This value is equivalent to i.带符号的整数
hc, hC Single character. The wsprintf function ignores characterarguments with a numeric value of zero. This value is alwaysinterpreted as type __wchar_t, even when the calling applicationdefines Unicode.
hd Signed short integer argument.
hs, hS String. This value is always interpreted as typeLPSTR(被指定为lpstr类型), even when the calling application definesUnicode.
hu Unsigned short integer.
i Signed decimal integer. This value is equivalent to d.十进制整数
lc, lC Single character. The wsprintf function ignores characterarguments with a numeric value of zero. This value is alwaysinterpreted as type WCHAR, even when the calling application doesnot define Unicode.
ld Long signed integer. This value is equivalent to li.
li Long signed integer. This value is equivalent to ld.
ls, lS String. This value is always interpreted as typeLPWSTR(被指定为LPWSTR类型), even when the calling application does notdefine Unicode. This value is equivalent to ws.
lu Long unsigned integer.长整型无符号整数
lx, lX Long unsigned hexadecimal integer in lowercase oruppercase.
p Windows 2000/XP: Pointer. The address is printed usinghexadecimal. (16进制的指针类型)
s String. This value is interpreted as type LPWSTR when the callingapplication defines Unicode and as type LPSTR otherwise.
S String. This value is interpreted as type LPSTR when the callingapplication defines Unicode and as type LPWSTR otherwise.
u Unsigned integer argument. 无符号整数
x, X Unsigned hexadecimal integer in lowercase or uppercase.无符号16进制


To use buffers larger than 1024 bytes, use_snwprintf当缓冲区超过1024bytes时用_snwprintf
 接着1的程序

invoke messagebox,hwinmain,addr @szbuffer,offsetszcaption,MB_OK
popad;将前面保存的寄存器值复原,PUSHAD指令是把32位的通用寄存器全部入栈,入栈顺序为EAX,ECX,EDX,EX,质量保证执行前的ESP、
EBP、ESI、EDI。出栈顺序相反。
ret
_displaymenuitem endp

;退出
_quit proc
invoke destroywindow,hwinmain
invoke postquitmessagfe,null
ret
_quit endp
;窗口过程
_procwinmain proc uses ebx edi esi hwnd,umsg,wparam,lparam
local @stpos:point
local @hsysmenu

mov eax,umsg

.if eax==WM_CREATE

invokegetsubmenu,hmenu,1;得到第2个子菜单的句柄也就是查看,hmenu为总菜单的句柄。总菜单句柄用getmenu得到
mov hsubmenu,eax

;得到系统菜单并在系统菜单上增加自己的菜单即在系统菜单中的还原,移动等下面增加

invoke getsystemmenu,hwnd,false;

;-------------------------
;关于getsystemmenu访问系统菜单或控制菜单
Syntax

HMENU GetSystemMenu(
HWND hWnd,
BOOL bRevert
);
如果bRevert为true则将窗口菜单重置到缺省标准状态,以前的菜单销毁,返回NULL;为FALSE,则返回系统菜单拷贝的句柄。
这里的菜单项发送wm_syscommand消息。

;----------
mov @hsysmenu,eax
invoke appendmenu,@hsysmenu,MF_SPARATOR,0,NULL;在系统菜单里增加分隔符
invoke appendmenu,@hsysmenu,0,IDM_HELP,offsetszmenuhelp;增加‘帮助主题’菜单项
invoke appendmenu,@hsysmenu,0,IDM_ABOUT,offsetszmenuabout;增加‘关于本程序’菜单项
;----------
;关于appendmenu
;----------msdn
The AppendMenu function appends a new item to the end of thespecified menu bar, drop-down menu, submenu, or shortcut menu. Youcan use this function to specify the content, appearance, andbehavior of the menu item.

Syntax

BOOL AppendMenu(
HMENU hMenu,
UINT uFlags,
UINT_PTR uIDNewItem,
LPCTSTR lpNewItem
);
Parameters

hMenu
[in] Handle to the menu bar, drop-down menu, submenu, or shortcutmenu to be changed.
=================================================
uFlags
[in] Specifies flags to control the appearance and behavior of thenew menu item. This parameter can be a combination of the valueslisted in the following
Value Description
MF_BITMAP Uses a bitmap as the menu item. The lpNewItem parametercontains a handle to the bitmap.
MF_CHECKED Places a check mark next to the menu item. If theapplication provides check-mark bitmaps (see SetMenuItemBitmaps,this flag displays the check-mark bitmap next to the menuitem.
MF_DISABLED Disables the menu item so that it cannot be selected,but the flag does not gray it.
MF_ENABLED Enables the menu item so that it can be selected, andrestores it from its grayed state.
MF_GRAYED Disables the menu item and grays it so that it cannot beselected.
MF_MENUBARBREAK Functions the same as the MF_MENUBREAK flag for amenu bar. For a drop-down menu, submenu, or shortcut menu, the newcolumn is separated from the old column by a vertical line.
MF_MENUBREAK Places the item on a new line (for a menu bar) or in anew column (for a drop-down menu, submenu, or shortcut menu)without separating columns.
MF_OWNERDRAW Specifies that the item is an owner-drawn item. Beforethe menu is displayed for the first time, the window that owns themenu receives a WM_MEASUREITEM message to retrieve the width andheight of the menu item. The WM_DRAWITEM message is then sent tothe window procedure of the owner window whenever the appearance ofthe menu item must be updated.
MF_POPUP Specifies that the menu item opens a drop-down menu orsubmenu. The uIDNewItem parameter specifies a handle to thedrop-down menu or submenu. This flag is used to add a menu name toa menu bar, or a menu item that opens a submenu to a drop-downmenu, submenu, or shortcut menu.
MF_SEPARATOR Draws a horizontal dividing line. This flag is usedonly in a drop-down menu, submenu, or shortcut menu. The linecannot be grayed, disabled, or highlighted. The lpNewItem anduIDNewItem parameters are ignored.
MF_STRING Specifies that the menu item is a text string; thelpNewItem parameter is a pointer to the string.
MF_UNCHECKED Does not place a check mark next to the item(default). If the application supplies check-mark bitmaps (seeSetMenuItemBitmaps), this flag displays the clear bitmap next tothe menu item.


The following groups of flags cannot be used together:


MF_BITMAP, MF_STRING, and MF_OWNERDRAW
MF_CHECKED and MF_UNCHECKED
MF_DISABLED, MF_ENABLED, and MF_GRAYED
MF_MENUBARBREAK and MF_MENUBREAK

===========================
uIDNewItem
[in] Specifies either the identifier of the new menu item or, ifthe uFlags parameter is set to MF_POPUP, a handle to the drop-downmenu or submenu.


lpNewItem
[in] Specifies the content of the new menu item. The interpretationof lpNewItem depends on whether the uFlags parameter includes theMF_BITMAP, MF_OWNERDRAW, or MF_STRING flag, as shown in thefollowing table.


MF_BITMAP
Contains a bitmap handle.
MF_OWNERDRAW
Contains an application-supplied value that can be used to maintainadditional data related to the menu item. The value is in theitemData member of the structure pointed to by the lParam parameterof the WM_MEASUREITEM or WM_DRAWITEM message sent when the menu iscreated or its appearance is updated.
MF_STRING
Contains a pointer to a null-terminated string.
Return Value

If the function succeeds, the return value is nonzero. If thefunction fails, the return value is zero. To get extended errorinformation, call GetLastError.

;------------
RK3568平台开发系列讲解(项目篇)手写数字识别 📢 本篇章带大家基于飞桨(PaddlePaddle),完成一个简单的手写数字识别任务。 阅读详情

相关推荐

【CV论文精读】【BEV感知】BEVFormer:通过时空Transformer学习多摄像机图像的鸟瞰图表示

3D视觉感知任务,包括基于多摄像头图像的3D检测和地图分割,对于自动驾驶系统至关重要。在这项工作中,我们提出了一个称为BEVFormer的新框架,它通过时空Transformer学习统一的BEV表示,以支持多个自动驾驶感知任务。简而言之,BEVFormer通过预定义的网格形状的BEV queries与空间和时间进行交互,从而利用空间和时间信息。为了聚集空间信息,我们设计了空间交叉注意力,每个BEV query从跨摄像机视图的感兴趣区域中提取空间特征。

weixin_44184852的博客 6037

Win32基础

先release生成,再把静态库头文件 .lib文件和.dll文件复制到目标项目路径下,再添加现有项–>(添加头文件)源文件中声明头文件(#include "MyTool.h)–>**//vs2019步骤:**创建一个静态库(删掉代码中的示例函数,因为它没用)->头文件右键->添加->新建项。先release生成,再把静态库的.h文件和.lib文件复制到目标项目路径下->右键头文件再添加现有项–>它告诉链接器调用的函数在哪个d中,函数执行代码在d中的什么位置。当我们在程序中引用了一个.h文件里面的函数,

m0_67787176的博客 578

从音频录制到智能手表:Sigma-Delta ADC是如何在低功耗场景下‘欺骗’噪声的?

本文深入解析Sigma-Delta ADC在智能穿戴设备中的低功耗高精度实现原理,重点介绍其通过过采样和噪声整形技术‘欺骗’噪声的独特方法。以TWS耳机和医疗级健康监测为例,展示该技术如何在有限功耗预算下实现专业级信号采集,为消费电子设计提供关键解决方案。

weixin_30825581的博客 394

Python自动操作电脑|pywin32

在windows系统上用Python脚本完成自动化办公,提高办公效率,消灭重复性劳动

yurensan的博客 2679

USB通讯速度翻倍秘诀:手把手教你用WinUsb替代HID协议(附Zadig驱动配置图解)

本文详细介绍了如何通过WinUsb技术替代传统HID协议,实现USB通讯速度的显著提升。从技术对比、实现原理到Zadig驱动配置图解,手把手教你完成免驱高速通讯方案,适用于数据采集、固件升级等场景,实测速度可达HID协议的2倍以上。

weixin_29168675的博客 145

[arcgis插件]在批量出图时,如何把图层属性表以动态表格的形式插入到布局页面

在批量出图时,如何把图层属性表以动态表格的形式插入到布局页面。

坐听风雨 4590

python 桌面级快捷键

可以直接copy到.txt记事本并通过迅雷云盘下载包并运行的python 全局键盘监听hook及桌面级快捷键应用

I_say_lie的博客 964

NY8A053E 例程 之 PWM Ouput

更多关于NY8A053E的相关例程请留言!

倪彬笑阳的博客 2969

孙鑫VC++深入详解(5):菜单

1、菜单命令响应函数  弹出式菜单(子菜单)Popup属性为true,其ID不能编辑,没有菜单命令响应函数;非弹出式菜单(菜单项)Popup属性为false,可以编辑其ID,可以为其设置菜单命令响应函数。  一般菜单资源ID前缀设为IDM_,光标资源ID前缀设为IDC_,图标资源ID前缀设为IDI_....... 右击菜单项为其添加菜单命令响应函数,消息类型选择COMMAND,类列表选择CM

milanleon的专栏 2368

价值投资/指标选股(akshare)

利用akshare的数据源,可以获取所有的股票数据以及公开的财务数据,可以进行条件筛选,获取满足条件的股票。 这套模板可以用于价值投资,指标选股。选股周期为日线级别。然后结果可以邮箱发送。 import time import akshare as ak ## A 股上市公司的实时行情数据 stock_zh_a_spot_df = ak.stock_zh_a_spot() #print(stock_zh_a_spot_df) ##取前300测试 ##取前300测试 df_stock =...

qq_26742269的博客 1万+

Visual Studio Community与Visual Studio Community与VS Code有啥区别

Visual Studio Code提供了基本的代码编辑、调试和版本控制功能,以及丰富的插件和扩展库。Visual Studio Community和Visual Studio Code在功能上有很大的差异,Visual Studio Community提供了比Visual Studio Code更多的功能,包括代码重构、智能提示、图形化设计等。他的优势在于它的轻量级和灵活性。此外,Visual Studio Code还具有丰富的扩展和插件生态系统,用户可以通过安装插件来扩展其功能,从而满足自己的需求。

m0_56551554的博客 2853

创建弹出式菜单

创建弹出式菜单时,先创建一个菜单资源,然后调用LoadMenu方法加载菜单资源。 BOOL LoadMenu( LPCTSTR lpszResourceName ); BOOL LoadMenu( UINT nIDResource ); 返回值:如果菜单资源装载成功,则返回非零值,否则为0。 参数: lpszResourceName指向一个空终止的字符串,该字符串包含了要

CSDNzhwk的博客 2427

[QMT量化交易小白入门]-七十六、从tick数据中获取高频交易的量价背离信号

本专栏主要是介绍QMT的基础用法,常见函数,写策略的方法,也会分享一些量化交易的思路,大概会写100篇左右。QMT的相关资料较少,在使用过程中不断的摸索,遇到了一些问题,记录下来和大家一起沟通,共同进步。

木头大左的博客 803

汇编语言全接触-61.Win32汇编教程五

其中,加速键ID是我们在程序中用LoadAccelerator装入加速键的资源编号,下面的每一项定义了一个键,VK_F1表示用F1,“A”表示键A,下面的VIRTKEY是必需的,再下面的CONTROL“或SHIFT、ALT”表示用CONTROL键组合,也就是说,如果你定义了:"C",IDM_COPY,VIRTKEY,CONTROL 而且在菜单定义中定义了 menuitem "拷贝",IDM_COPY,那么,你在程序中按下Ctrl-C实际上就是执行了菜单项“拷贝”。

qq_41237850的博客 1105

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

Win32汇编--如何使用资源 [菜单和加速键]

使用资源 —— 菜单和加速键     主菜单,顶层菜单,弹出式菜单,子菜单,右键弹出式菜单,系统弹出式菜单。菜单中的菜单项有好几种,从资源定义的角度来看,分隔用的横线也是一个菜单项,除横线外其他菜单项可以供用户选择,也可以设置为“禁止”或“灰化”状态暂时停用。   菜单项上的圆点表示选中标记是互斥的,对钩表示是不互斥的。   加速键就是菜单项的快捷键。表示当窗口是激活的时候

new blog: www.burningcodes.net 4250

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

Win32汇编--使用资源--菜单和加速键

使用资源 —— 菜单和加速键 主菜单,顶层菜单弹出式菜单,子菜单右键弹出式菜单系统弹出式菜单 菜单中的菜单项有好几种,从资源定义的角度来看,分隔用的横线也是一个菜单项,除横线外其他菜单项可以供用户选择,也可以设置为“禁止”或“灰化”状态暂时停用。 菜单项上的圆点表示选中标记是互斥的,对钩表示是不互斥的。 加速键就是菜单项的快捷键。表示当窗口是激活的时候,不必打开菜单,直接按快捷键就相当于选择了菜单

1475

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

Win32汇编教程5-菜单和加速键的使用

<br />本节的内容是上一节内容的扩展,所以示范的源程序是在上一节的基础上扩展的。<br /><br /> 有关菜单和加速键<br /><br />     菜单是Windows标准界面的最重要的组成部分,窗口的菜单条位于标题栏的下方,这个菜单通常被称为主菜单,列在主菜单下面的菜单项被称为下拉式菜单, 或弹出式菜单、子菜单等,而在标题栏左边的图标上点击也会弹出一个菜单,叫做系统菜单。加速键实际上是菜单项的快捷键,应用程序常在菜单项的右边标出激活 这个菜单项的快捷键,这就是加速键。菜单的结构是

Dark Night 710

win32 015使用菜单和加速键

.rc   资源     //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> #include   //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> #define ICO_MAIN  0x1000 //图标 /

刘明智的专栏 798

Win32汇编教程五 菜单和加速键的使用

--------------------------------------------------------------------------------有关菜单和加速键菜单是Windows标准界面的最重要的组成部分,窗口的菜单条位于标题栏的下方,这个菜单通常被称为主菜单,列在主菜单下面的菜单项被称为下拉式菜单,或弹出式菜单、子菜单等,而在标题栏左边的图标上点击也会弹出一个菜单,叫做系统菜单

蝈蝈俊.net 2646

win32汇编程序设计中菜单资源的定义

1.菜单的基本概念 如下图所示,在窗口中,菜单位于标题栏下边。这个菜单称为"主菜单"或者"顶层菜单",图中菜单的菜单项有"文件"、"查看"和"帮助"。单机主菜单上的项目后,可以弹出下一层菜单,叫做"弹出式菜单"或"子菜单"。子菜单中可以继续包含下一层子菜单。如单机"查看"弹出一个自子菜单后,再单机其中的"工具栏"可以继续弹出一个子菜单。在子菜单中可以继续弹出下一层子菜单的菜单项最...

paradox_1_0的博客 590

Win32汇编教程五:菜单和加速键的使用

有关菜单和加速键菜单是Windows标准界面的最重要的组成部分,窗口的菜单条位于标题栏的下方,这个菜单通常被称为主菜单,列在主菜单下面的菜单项被称为下拉式菜单,或弹出式菜单、子菜单等,而在标题栏左边的图标上点击也会弹出一个菜单,叫做系统菜单。加速键实际上是菜单项的快捷键,应用程序常在菜单项的右边标出激活这个菜单项的快捷键,这就是加速键。菜单的结构是可嵌套的,也就是说,你可以在选择一个菜单项时弹

zhangkala的专栏 1019

《WINDOWS 环境下32位汇编语言程序设计》第5章 使用资源(1)

菜单、图标与对话框都是可执行文件的组成部分,它们是以资源的形式存放在文件中的。但这些资源并不在源代码的数据段中定义,而是由链接程序放入文件的单独一个节区中,当运行中要用到资源的时候,必须借助API函数装入后才能使用。除了菜单、图标与对话框,Windows中还有其他一些类型的资源,它们是:● 菜单和加速键● 光标和图标● 位图● 对话框● 字符串资源● 版本信息● 自定义资源。本章介绍Win32程序使用这些资源。

chenyijun的专栏 1039

Win32汇编教程五

有关菜单和加速键     菜单是Windows标准界面的最重要的组成部分,窗口的菜单条位于标题栏的下方,这个菜单通常被称为主菜单,列在主菜单下面的菜单项被称为下拉式菜单,或弹出式菜单、子菜单等,而在标题栏左边的图标上点击也会弹出一个菜单,叫做系统菜单。加速键实际上是菜单项的快捷键,应用程序常在菜单项的右边标出激活这个菜单项的快捷键,这就是加速键。菜单的结构是可嵌套的,也就是说,

hnhbdss的专栏 799

VC++运行时库与可再发行组件:Windows开发依赖管理的核心

在Windows平台软件开发中,动态链接库(DLL)和运行时库是构建可执行程序的基础组件。其核心原理在于将通用功能代码封装为共享库,实现代码复用、减小程序体积并便于统一更新。这一机制的技术价值在于提升开发效率、保证系统稳定性,并简化软件分发流程。在桌面应用、游戏及系统工具等场景中,开发者必须正确处理运行时库依赖,否则会导致“找不到MSVCP140.dll”等常见错误。本文聚焦于VC++生态中的运行时库与可再发行组件包,深入解析其版本绑定机制、平台匹配原则及静默安装方式,帮助开发者从根本上解决软件部署中的依赖

all00747的博客 322

MFC工程框架深度解析:从核心原理到现代化改造实战

在Windows桌面应用开发领域,文档-视图架构是一种经典的软件设计模式,它实现了数据模型与用户界面的分离,提升了代码的可维护性和复用性。其核心原理在于通过明确的职责划分,让文档类专注于数据管理与持久化,视图类负责数据呈现与用户交互,框架类则协调两者并管理应用程序生命周期。这一设计思想在微软基础类库(MFC)中得到了经典实现,为无数遗留系统提供了稳定基石。理解MFC的工程框架,不仅有助于掌握Windows桌面应用的传统设计哲学,更能为维护和现代化改造那些仍在服役的核心业务系统提供关键支撑。本文将从工程结构与

weixin_30432579的博客 473

Win32之菜单和库

1.1 概念分类1、静态菜单:在菜单资源编辑器预先编辑好2、动态菜单:在程序运行的过程中通过代码生成3、快捷菜单:是前两种菜单的组合,在菜单资源编辑器中预先编辑好,然后在程序运行的过程中动态显示菜单项菜单里面的每一个元素都是一个菜单项菜单项包含两个最基本的要素:1、菜单项名字,2、该菜单项唯一的标识ID每一个菜单项还可以是嵌套的子菜单数组1.2 操作@1 点击资源文件中的”菜单和库.rc*"@2 鼠标右击Menu->选择添加资源或者直接插入然后就可以直接编辑了。

weixin_73548574的博客 1177
上一篇: WIN32汇编学习应用之defwindowproc
下一篇: win32汇编-送消息给其它应用程序
deepfuture
博客等级 码龄17年 211粉丝 1287原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址