怎样用SendMessage()向系统发Ctrl+Alt+Del 同时按下的消息?

yy23rock 2003-08-20 09:39:17
怎样用SendMessage()向系统发Ctrl+Alt+Del 同时按下的消息?
...全文
186 23 打赏 收藏 转发到动态 举报
写回复
用AI写文章
23 条回复
切换为时间正序
请发表友善的回复…
发表回复
kwiner 2003-08-29
  • 打赏
  • 举报
回复
up
libaoli 2003-08-27
  • 打赏
  • 举报
回复
看不懂
liu1hong1yu 2003-08-26
  • 打赏
  • 举报
回复
hehe
yuyong9 2003-08-25
  • 打赏
  • 举报
回复
up!
jiajie828 2003-08-24
  • 打赏
  • 举报
回复
好东东.记录哟.
李_军 2003-08-24
  • 打赏
  • 举报
回复
Keybd_event(17, 0, 0, 0);

Keybd_event(18, 0, 0, 0);
Keybd_event(46, 0, 0, 0);
Keybd_event(46, 0, KEYEVENTF_KEYUP, 0);
Keybd_event(18, 0, KEYEVENTF_KEYUP, 0);
Keybd_event(17, 0, KEYEVENTF_KEYUP, 0);

但是根本不行,所以用sendMessage也不行,但是调出Winlogon,用dll注入,我到是有源码
canoe_eyes 2003-08-23
  • 打赏
  • 举报
回复
使用
keybd_event
sunyuan_01 2003-08-22
  • 打赏
  • 举报
回复
mark
ljfwarrior 2003-08-21
  • 打赏
  • 举报
回复
up你一下
Working20000 2003-08-21
  • 打赏
  • 举报
回复
mark:(
蒋晟 2003-08-21
  • 打赏
  • 举报
回复
http://search.csdn.net/expert/topic/50/5001/2003/6/10/1899152.htm
devil97518 2003-08-21
  • 打赏
  • 举报
回复
hook.比较难,关注
FBugFramework 2003-08-21
  • 打赏
  • 举报
回复
好象在哪里看到过 :说只有系统才能捕获这个消息。
蒋晟 2003-08-21
  • 打赏
  • 举报
回复
在Winlogon桌面上广播WM_HOTKEY就可以
参见http://www.csdn.net/develop/read_article.asp?id=15645
farfh 2003-08-21
  • 打赏
  • 举报
回复
up
chenkk1978 2003-08-21
  • 打赏
  • 举报
回复
up!!
dream_pzy 2003-08-20
  • 打赏
  • 举报
回复
级别不够,不能抢到WINDOWS前头!
fengqinggao 2003-08-20
  • 打赏
  • 举报
回复
之处理过简单的单按键消息问题,不过是否可以这样,不模拟按键消息,直接调出那个对话框不就达到效果了么?我想肯定有接口的
snollow 2003-08-20
  • 打赏
  • 举报
回复
mark
tonyzhengjq 2003-08-20
  • 打赏
  • 举报
回复
up
加载更多回复(3)
Attribute VB_Name = "mdl_Hot_Key"
'\__________________________________________________________________________________
' SetHotkey 1, "Ctrl,112", "Add" '按 Ctrl F1 激活指定程序
' SetHotkey 2, 113, "Add" '按 F2 激活指定程序
' SetHotkey 3, "Ctrl Alt,113", "Add" '按 Ctrl Alt F2 激活指定程序
'注释:注:关于激活热键后的操作,由自定义函数 SetHotkey 的 KeyId 传送的值来判断
'注销 3 个热键:
' SetHotkey 1, "", "Del" '退出程序是一定要用上的,不然会导至程序死掉
' SetHotkey 2, "", "Del"
' SetHotkey 3, "", "Del"
'请大家新建一个模块(.bas)文件,自定义 SetHotkey函数及其他,这样在以后的任何程序中只要调用此模块就可以了。
'注释: 本模块是有关热键操作的
'\____________________________________________________________________________________
Option Explicit
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function RegisterHotKey Lib "user32" (ByVal hwnd As Long, ByVal id As Long, ByVal fskey_Modifiers As Long, ByVal vk As Long) As Long
Private Declare Function UnregisterHotKey Lib "user32" (ByVal hwnd As Long, ByVal id As Long) As Long

Public Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
'Public Declare Function GetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long '|取得控件的在屏幕中的位置
Private Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long '|枚举子控件

Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetForegroundWindow Lib "user32" () As Long '|// 获得当前活动窗体句柄

Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Public Declare Function GetDesktopWindow Lib "user32" () As Long
Public Declare Function IsWindow Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long

Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Public Declare Sub Mouse_Event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
' // 鼠标动作标识 // 鼠标水平方向位置 // 鼠标垂直方向位置 // 鼠标轮子转动的数量 // 一个关联鼠标动作辅加信息

Const WM_HOTKEY =
6 , chunks.zip<br>This will open a file and read it in "Chunks" of a selected file.<END><br>7 , logging.zip<br>This is a bas that will log installation procedures so the file can be removed later.<END><br>8 , savetree.zip<br>This will save the info in a Tree View. "This technique allows a program to save hierarchical information like the data in a TreeView in a way that is easy to understand."<END><br>11 , OLE.zip<br>Demonstrates the use of OLE.<END><br>12 , gradtxt2.zip<br>"A program for drawing horizontal, rectangular or spherical gradient texts."<END><br>13 , sweepgl.zip<br>This example greatly demonstrates how to use OpenGL in Visual Basic.<END><br>15 , drawdemo.zip<br>This is an excellent example of how to make a paint program with a few extras.<END><br>16 , cube.zip<br>This example demonstrates how to rotate a cube in visual basic.<END><br>17 , sprite1.zip<br>This is an Excellent example on how to use sprites in your program.<END><br>18 , charcreate.zip<br>This is an example of how to assign "characters" to differant pictureboxes. This would be a good starting point for VB game developers.<END><br>19 , breakthrough.zip<br>This demonstrates a simple game in Visual Basic. An excellent example.<END><br>26 , openlib.zip<br>These are the type libs that go with OpenGL. This is used to make 3D text.<END><br>27 , basMath.zip<br>This module contains functions for various math equations. <END><br>28 , calc.zip<br>This is a basic calculator written in Visual Basic.<END><br>29 , stopwatch.zip<br>This shows how to count off time in a Stop Watch format.<END><br>31 , taskhide.zip<br>This will hide your application from the taskbar, Alt+Tab, and Alt+Ctrl+Del.<END><br>32 , newbie.zip<br>This is a nicely done help file for programmers that are new to Visual Basic.<END><br>33 , vbfaq.zip<br>This is AOL's PC Dev Visual Basic FAQ. This is an excellent starting point for begginners.<END><br>34 , Bas.zip<br>it is very good modual for activex<END><br>35, paraviasource.zip<br>This is

16,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧