- 浏览: 4397552 次
- 性别:
- 来自: 湛江
博客专栏
-
SQLite源码剖析
浏览量:80021
-
WIN32汇编语言学习应用...
浏览量:69978
-
神奇的perl
浏览量:103284
-
lucene等搜索引擎解析...
浏览量:285605
-
深入lucene3.5源码...
浏览量:15001
-
VB.NET并行与分布式编...
浏览量:67489
-
silverlight 5...
浏览量:32095
-
算法下午茶系列
浏览量:45963
文章分类
最新评论
-
yoyo837:
counters15 写道目前只支持IE吗?插件的东西是跨浏览 ...
Silverlight 5 轻松开启绚丽的网页3D世界 -
shuiyunbing:
直接在前台导出方式:excel中的单元格样式怎么处理,比如某行 ...
Flex导出Excel -
di1984HIT:
写的很好~
lucene入门-索引网页 -
rjguanwen:
在win7 64位操作系统下,pygtk的Entry无法输入怎 ...
pygtk-entry -
ldl_xz:
http://www.9958.pw/post/php_exc ...
PHPExcel常用方法汇总(转载)
2个函数
invoke postmessage,hwnd,msg,wparam,lparam
invoke sendmessage,hwnd,msg,wparam,lparam
对于不同的MSG,WPARAM和LPARAM所代表的信息是不同的
1、postmessage
MSDN
The PostMessage function places (posts) a message in the messagequeue associated with the thread that created the specified windowand returns without waiting for the thread to process themessage.
这个函数将消息送到指定窗口的线程后马上返回而不等待,sendmessage必须等该消息被处理后才能返回。
To post a message in the message queue associate with a thread, usethe PostThreadMessage function.
Syntax
BOOL PostMessage( HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
Parameters
hWnd
[in] Handle to the window whose window procedure is to receive themessage. The following values have special meanings.
HWND_BROADCAST
The message is posted to all top-level windows in the system,including disabled or invisible unowned windows, overlappedwindows, and pop-up windows. The message is not posted to childwindows
送给系统的的所有顶层主窗口,不会送到子窗口
.
NULL
The function behaves like a call to PostThreadMessage with thedwThreadId parameter set to the identifier of the currentthread.
Msg
[in] Specifies the message to be posted.
wParam
[in] Specifies additional message-specific information.
lParam
[in] Specifies additional message-specific information.
Return Value
If the function succeeds, the return value is nonzero.成功返回非0
If the function fails, the return value is zero. To get extendederror information, call GetLastError. 错误返回0
Remarks
Messages in a message queue are retrieved by calls to theGetMessage or PeekMessage function.
Applications that need to communicate using HWND_BROADCAST shoulduse the RegisterWindowMessage function to obtain a unique messagefor inter-application communication.
The system only does marshalling for system messages (those in therange 0 to WM_USER). To send other messages (those above WM_USER)to another process, you must do custom marshalling.
If you send a message in the range below WM_USER to theasynchronous message functions (PostMessage, SendNotifyMessage, andSendMessageCallback), its message parameters cannot includepointers. Otherwise, the operation will fail. The functions willreturn before the receiving thread has had a chance to process themessage and the sender will free the memory before it isused.
Do not post the WM_QUIT message using PostMessage; use thePostQuitMessage function.
Windows 2000/XP: There is a limit of 10,000 posted messages permessage queue. This limit should be sufficiently large. If yourapplication exceeds the limit, it should be redesigned to avoidconsuming so many system resources. To adjust this limit, modifythe following registry key:
2、SendMessage Function
--------------------------------------------------------------------------------
The SendMessage function sends the specified message to a window orwindows. It calls the window procedure for the specified window anddoes not return until the window procedure has processed themessage.
发送消息给窗口,并调用指定窗口的窗口过程,到窗口过程处理该消息才返回。
To send a message and return immediately, use theSendMessageCallback or SendNotifyMessage function. To post amessage to a thread's message queue and return immediately, use thePostMessage or PostThreadMessage function.
Syntax
LRESULT SendMessage( HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
Parameters
hWnd
[in] Handle to the window whose window procedure will receive themessage. If this parameter is HWND_BROADCAST, the message is sentto all top-level windows in the system, including disabled orinvisible unowned windows, overlapped windows, and pop-up windows;but the message is not sent to child windows.
Msg
[in] Specifies the message to be sent.
wParam
[in] Specifies additional message-specific information.
lParam
[in] Specifies additional message-specific information.
Return Value
The return value specifies the result of the message processing; itdepends on the message sent.
Remarks
Applications that need to communicate using HWND_BROADCAST shoulduse the RegisterWindowMessage function to obtain a unique messagefor inter-application communication.
The system only does marshalling for system messages (those in therange 0 to WM_USER). To send other messages (those above WM_USER)to another process, you must do custom marshalling.
If the specified window was created by the calling thread, thewindow procedure is called immediately as a subroutine. If thespecified window was created by a different thread, the systemswitches to that thread and calls the appropriate window procedure.Messages sent between threads are processed only when the receivingthread executes message retrieval code. The sending thread isblocked until the receiving thread processes the message. However,the sending thread will process incoming nonqueued messages whilewaiting for its message to be processed. To prevent this, useSendMessageTimeout with SMTO_BLOCK set. For more information onnonqueued messages, see Nonqueued Messages.
==============
一个发送消息的子程序,将消息发送到打开的记事本窗口中。
szdestclass db 'notepad',0
_sndtontoepad proc _lpsz
local @hwinntoepad
pushad
invoke findwindow,addrszdestclass,null;找到指定应用程序即WINDOWS的记事本程序的句柄
===================
;关于findwindow
msdn
The FindWindow function retrieves a handle to the top-level windowwhose class name and window name match the specified strings. Thisfunction does not search child windows. This function does notperform a case-sensitive search.
获得顶层窗口的句柄,不查找子窗口,查找时不分大小写
To search child windows, beginning with a specified child window,use the FindWindowEx function.
Syntax
HWND FindWindow(
LPCTSTR lpClassName,;窗口类名
LPCTSTR lpWindowName;窗口标题名称
);
Parameters
lpClassName窗口类名
[in] Pointer to a null-terminated string that specifies the classname or a class atom created by a previous call to theRegisterClass or RegisterClassEx function. The atom must be in thelow-order word of lpClassName; the high-order word must bezero.
If lpClassName points to a string, it specifies the window classname. The class name can be any name registered with RegisterClassor RegisterClassEx, or any of the predefined control-classnames.
If lpClassName is NULL, it finds any window whose title matches thelpWindowName parameter. 如果窗口类名为NULL,则按标题名称查找
lpWindowName窗口标题名称
[in] Pointer to a null-terminated string that specifies the windowname (the window's title). If this parameter is NULL, all windownames match.
Return Value
If the function succeeds, the return value is a handle to thewindow that has the specified class name and window name.
If the function fails, the return value is NULL. To get extendederror information, call GetLastError.
Remarks
If the lpWindowName parameter is not NULL, FindWindow calls theGetWindowText function to retrieve the window name for comparison.For a description of a potential problem that can arise, see theRemarks for GetWindowText.
举例:☆☆☆☆☆☆☆☆☆
To check if the Microsoft IntelliType version 1.x software isrunning, call FindWindow as follows:
FindWindow("MSITPro::EventQueue",NULL);
To check if the IntelliType version 2.0 software is running, callFindWindow as follows:
FindWindow("Type32_Main_Window", NULL);
If the IntelliType software is running, it sends WM_APPCOMMANDmessages to the application. Otherwise the application must installa hook to receive WM_APPCOMMAND messages.
☆☆☆☆☆☆☆☆☆☆
Microsoft Windows 95 or later: FindWindowW is supported by theMicrosoft Layer for Unicode (MSLU). To use this, you must addcertain files to your application, as outlined in Microsoft Layerfor Unicode on Windows 95/98/Me Systems.
===========
.if eax
mov ecx,eax
.endif
;☆☆☆☆☆☆关于childwindowfrompoint
ChildWindowFromPoint Function
--------------------------------------------------------------------------------
The ChildWindowFromPoint function determines which, if any, of thechild windows belonging to a parent window contains the specifiedpoint. The search is restricted to immediate child windows,grandchildren, and deeper descendant windows are notsearched.
获取处在父窗口指定位置的子窗口的句柄。
Syntax
HWND ChildWindowFromPoint( HWND hWndParent,
POINT Point
);
Parameters
hWndParent
[in] Handle to the parent window.
Point
[in] Specifies a POINT structure that defines the clientcoordinates (relative to hWndParent of the point to bechecked.
Return Value
The return value is a handle to the child window that contains thepoint, even if the child window is hidden or disabled. If the pointlies outside the parent window, the return value is NULL. If thepoint is within the parent window but not within any child window,the return value is a handle to the parent window.
;☆☆☆☆☆☆☆
.if eax ;获得了子窗口即编辑窗口的指针
mov @hwinnotepad,eax
mov esi,_lpsz
@@:
loadsb;将数据送向累加器,数据在ds:esi中,而movs中,目的地址为es:dsi
or al,al
movzx eax,al
invoke postmessage,@hwinnotepad,WM_CHAR,eax,1
jmp @B
@@:
.endif
popad
ret
_setndtonotepad endp
发表评论
-
win下开发跨平台GUI程序的另类选择
2011-05-03 17:21 2208GTK+ ● GTK+的网站:www.gtk. ... -
WIN32汇编之菜单、加速键、快捷键
2010-02-20 16:38 3156(一)Invoke checkmenuitem,h ... -
WIN32汇编学习应用之defwindowproc
2010-02-20 16:36 2718defwindowproc窗口过程对一些消息的默认处理方式WM ... -
windows中WM_CLOSE消息和WM_DESTORY消息的不同之处
2010-02-20 16:33 24341、WM_CLOSE仅代表用户发出了关闭的指令,但窗口过程可以 ... -
WIN32汇编获取应用程序句柄
2010-02-20 16:32 2199getmodulehandle使用方法invoke getm ... -
WIN32汇编语言学习应用之消息获取
2010-02-20 16:31 1731MSG结构:MSG STURCTHwnd DWORD ?Mes ... -
一个WIN32汇编的完整窗口入门程序的理解与注释
2010-02-20 16:28 3736;WIN32汇编的注释是;,其实WIN32汇编和VC有很多 ... -
汇编中通用寄存器的目的
2010-02-20 16:24 21921、EAX和AX:累加器,所有的I/O指令用它来与外部设备 ... -
汇编几个段
2010-02-17 16:39 4220反汇编后几个段的含义 预定义段 一个WindowsNT ... -
WIN32汇编语言解析
2010-02-17 16:36 2570win32汇编中的sizeof win32汇编中的s ... -
设置与获取窗口标题文本
2010-02-17 16:32 2016获得: CString xx=""; ... -
win32汇编快速入门
2010-02-17 16:31 4670汇编可以开发WINDOWS程序 ... -
WIN32汇编-HELLO,WORLD!
2010-02-17 16:29 4443我们用WIN32汇编构建 ... -
保护模式下段寄存器的作用
2010-02-17 14:39 32631、保护模式一,虽然在寻址上没有分段的限制问题,但对要对一个地 ... -
WIN32汇编-反汇编
2010-02-17 14:33 2801学好WIN32汇编,平时需 ... -
玩转菜单-菜单资源
2010-02-08 17:31 1946菜单资源 WINDOWS程序的菜单通常编译前定义在资 ... -
二进制资源和自定义资源使用定义
2010-02-08 17:29 21961、二进制资源 (1)定义格式: 资源IDRCDA ... -
LISTBOX和LIST CONTROL的项目增加方法
2010-02-08 17:28 54631、LIST CONTROL(report方式): (1)类 ... -
取IP寄存器的当前值
2010-02-08 17:27 1946call $+3 POP CX 把IP寄存器的当前值放 ... -
ret/retn人为改变执行地址
2010-02-08 17:27 28331、CALL和RET/RETN是一对指令,CALL把返回 ...
相关推荐
总之,"WIN32汇编程序源码级调试_VS2019"涵盖了使用汇编语言开发Win32应用程序的关键技术,包括设置VS2019项目、调用Win32 API、使用MASM汇编器和调试技巧。通过学习和实践,开发者可以提高对计算机底层运作的理解,...
Win32应用程序虽然和其他32位应用程序(例如32位保护模式DOS程序)一样可以使用386汇编语言和保护模式编程,但是Win32应用程序的执行机制与其他32位应用程序有一定的差别,例如消息循环、动态链接等,Win32汇编语言...
在深入探讨之前,让我们先明确一点:Win32汇编并不是一个独立的语言,而是指使用Intel x86架构上的汇编语言来编写针对Windows 32位环境的应用程序。在Windows系统中,API(应用程序编程接口)调用通常是通过汇编代码...
在计算机编程领域,尽管C语言是开发Win32应用程序的常见选择,但在特定情况下,如系统底层操作、性能优化或病毒分析等,汇编语言显得更为重要。Win32汇编语言与32位保护模式DOS程序的汇编语言有区别,它涉及到...
MinGW-w64是一个开源项目,它的目标是提供一个与GCC(GNU Compiler Collection)兼容的编译环境,使得开发者能够在Windows系统上编译原生的Win32和Win64应用程序。这个项目不仅包含了C和C++编译器,还包含其他构建...
Win32汇编是针对Windows操作系统API(应用程序接口)进行编程的一种汇编语言。开发者可以直接调用Windows API函数,如窗口创建、消息处理、图形绘制等,从而构建复杂的Windows应用程序。 在创建俄罗斯方块游戏中,...
与传统的DOS编程不同,Win32汇编语言利用了Windows操作系统提供的API(应用程序接口)来实现功能,使得程序设计更为复杂且功能强大。此教程旨在帮助学习者从基础入手,逐步掌握Win32汇编语言的各个方面,通过实例...
《Win32汇编语言程序设计教程》是一本专注于教授如何使用汇编语言在Windows 32位环境下编写程序的专业教程。汇编语言是计算机科学的基础之一,它是一种低级编程语言,允许程序员直接控制硬件资源,对于理解计算机...
《Win32汇编语言程序设计》是由罗云彬撰写的一本深入探讨Win32平台汇编语言编程的专业书籍。这本书旨在帮助读者理解和掌握在Windows操作系统环境下,如何使用汇编语言进行程序设计。通过学习本书,读者将能够利用...
在《Win32汇编教程》中,iczelion详尽地讲解了如何使用汇编语言与Win32 API相结合,创建Windows应用程序。教程内容包括但不限于: 1. **基础篇**:介绍汇编语言的基本概念,如指令集、寄存器、寻址方式等。讲解MASM...
“服务”则指的是Windows操作系统中运行在后台的进程,负责提供特定的功能或支持其他应用程序。 【压缩包子文件的文件名称列表】: 1. `ServicesManager.Inc`:这可能是一个包含汇编语言宏定义和服务管理相关常量的...
在Windows平台上,通过Win32 API,汇编语言程序员可以访问系统服务,创建复杂的应用程序。 Windows 32位汇编语言程序设计的关键知识点包括: 1. **基本概念**:理解汇编语言的基本元素,如指令、寄存器、操作码、...
本书从编写应用程序的角度,从“Hello World!”这个简单的例子开始到编写多线程、注册表和网络通信等复杂的程序,通过60多个实例逐渐深入Win32汇编语言的方方面面。本书作者罗云彬拥有十余年汇编语言编程经验,是...
1. **Win32 API**:Win32 API(应用程序接口)是微软为Windows操作系统提供的一个庞大的函数库,它包含了创建和管理窗口、处理消息、访问系统资源等所有功能。使用汇编语言调用这些API函数,可以实现对Windows系统的...
《罗云彬--Win32汇编教程源码》是一份珍贵的学习资源,它包含了罗云彬在其《Win32汇编教程》一书中提到的各种示例代码。这份压缩包文件是针对那些想要深入理解汇编语言,特别是针对Windows 32位平台汇编编程的初学者...
在IT领域,汇编语言是一种低级编程语言,它与计算机硬件紧密相关,直接对应于机器指令。在Windows 32位环境下,汇编语言被...通过实践这些示例,你可以逐步掌握Win32汇编的使用,以及如何创建和打包自己的应用程序。
首先,我们要理解Win32 API(应用程序接口),它是Windows操作系统提供的一组函数,用于开发基于Windows的应用程序。在汇编语言中使用Win32 API,我们需要定义函数调用约定,例如stdcall约定,其中被调用者负责清理...
本书从编写应用程序的角度,从“Hello World!”这个简单的例子开始到编写多线程、注册表和网络通信等复杂的程序,通过60多个实例逐渐深入Win32汇编语言的方方面面。本书作者罗云彬拥有十余年汇编语言编程经验,是...
2. **Win32 API接口**:详细介绍如何调用Windows API函数,如窗口创建、消息处理、内存管理、文件操作等,这些是构建Windows应用程序的基础。 3. **过程调用约定**:讲解stdcall和fastcall等调用约定,理解参数传递...
1. **Win32汇编环境**:设置汇编语言的开发环境,包括使用MASM汇编器、链接器和其他相关工具。 2. **Windows API**:理解并使用Windows API函数,如CreateWindow、SendMessage、DispatchMessage等,这些函数是构建...