Jump to content

zhao

Active Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by zhao

  1. I want to register a windows as an appbar,and I found that I can use SHAppBarMessage function by sending ABM_NEW message to do it. In MSDN it says: but I don't know how to specify the "uCallbackMessage",what should I do? here is what I got so far: ;------------------------定义一些将要使用的变量---------------------------- Global Const $ABM_ACTIVATE = 0x06 Global Const $ABM_GETAUTOHIDEBAR = 0x07 Global Const $ABM_GETSTATE = 0x04 Global Const $ABM_SETSTATE = 0x0000000a Global Const $ABM_GETTASKBARPOS = 0x05 Global Const $ABM_NEW = 0x00 Global Const $ABM_QUERYPOS = 0x02 Global Const $ABM_REMOVE = 0x01 Global Const $ABM_SETAUTOHIDEBAR = 0x08 Global Const $ABM_SETPOS = 0x03 Global Const $ABM_WINDOWPOSCHANGED = 0x09 ;--- Global Const $ABS_ALWAYSONTOP = 0x2 Global Const $ABS_AUTOHIDE = 0x1 ;--- Global Const $ABE_LEFT = 0 Global Const $ABE_TOP = 1 Global Const $ABE_RIGHT = 2 Global Const $ABE_BOTTOM = 3 ;--- ;-------------------------定义SHAppBarMessage函数------------------------------ Func SHAppBarMessage($Message,ByRef $pabd) $lResult = DllCall("shell32.dll","int","SHAppBarMessage","int",$Message,"ptr",DllStructGetPtr($pabd)) If Not @error Then If $lResult[0] Then Return $lResult[0] EndIf EndIf SetError(1) Return False EndFunc ;----------------------------------例子开始---------------------------------- Dim $handle = Wingethandle("Notepad - untitled") Dim $uCallbackMessage $pabd = DllStructCreate("dword;int;uint;uint;int;int;int;int;int") DllStructSetData($pabd,1,DllStructGetSize($pabd)) ;cbSize DllStructSetData($pabd,2,$handle) ;hWnd DllStructSetData($pabd,3,$uCallbackMessage) ;uCallbackMessage SHAppBarMessage($ABM_NEW,$pabd) ;----------------------------------例子结束--------------------------------------
  2. here is some vb6 code,could you help me convert it to autoit? and the XdictGrb.dll is needed Option Explicit Implements IXDictGrabSink Private gp As GrabProxy Private Sub Form_Load() Set gp = New GrabProxy With gp .GrabEnabled = True .GrabInterval = 30 .GrabMode = XDictGrabMouse ' .AdviseGrab Me End With End Sub Private Sub Form_Unload(Cancel As Integer) Set gp = Nothing End Sub Private Function IXDictGrabSink_QueryWord(ByVal WordString As String, ByVal lCursorX As Long, ByVal lCursorY As Long, ByVal SentenceString As String, lLoc As Long, lStart As Long) As Long Label1.Caption = "当前坐标:" & "(" & lCursorX & "," & lCursorY & ")" Label2.Caption = "当前语句:" & SentenceString Label3.Caption = "当前字符:" & Mid(SentenceString, lLoc + 1, 1000) End Function
  3. the url i got was "mk:@MSITStore:C:\Program%20Files\AutoIt3\AutoIt.chm::/html/images/autoit_6_240x100.jpg" ,and inetget didn't work in this case
  4. I want to copy image from the browser,I tried to use _IEImgGetCollection,but i could only get the link address of the image,and I could not copy it out. for example,if i want to copy the au3 logo in the autoit help file.what should i do? here is what i get so far: #include <IE.au3> $oIE = _IEAttach ("AutoIt Help","Embedded") $oImg = _IEImgGetCollection ($oIE, 0) $sInfo = "Src: " & $oImg.src & @CR $sInfo &= "FileName: " & $oImg.nameProp & @CR $sInfo &= "Height: " & $oImg.height & @CR $sInfo &= "Width: " & $oImg.width & @CR $sInfo &= "Border: " & $oImg.border MsgBox(0, "Image Info", $sInfo)
  5. Chinese.lng Socket 错误 检查是否已经有一个实例在运行 我的聊天 共有 版本 私人的 发送文件 发送 改变名字 名字 升级 用户 刷新 清除 选项 会议 文字 红色 绿色 蓝色 黄色 黑色 紫罗兰色 橘色 搜索 我已经加入 把文件发送给选定的用户 在这里写上你想发送的文件. 比如说 'About' 在线用户列表 改变名字 显示选定用户的相关信息 刷新用户列表 删除记忆, 然后你应该按下刷新 搜索其他房间的用户 搜索线上的最新聊天 请他注意 点击缩小到托盘图标.@CRLF当你隐藏会话时记住托盘图标. 点击这里隐藏 错误 客户端断开 完成 文件完成 文件传输 开始传输 传输 文件传输 文件成功传输.是否打开? 你正在聊天的对象是 我退出 关于 这个程序使用AutoIt v3编写,@CRLF你可以在 http://www.autoitscript.com/autoit3/免费下载这个程序@CRLF这个聊天程序的版权持有人为Fabrizio2210©.@CRLF'我感谢那些参与翻译的朋友@CRLF升级: http://www.autoitscript.com/forum/index.php?automodule=downloads&showfile=61 选择用户 从用户列表中选出你想聊天的对象 用户 正在发送文件 文件名 大小 你接受吗? 接收文件 任何 我接受文件 发送中... 注意 邀请你参加 我接受新版本 增加更多的人参加会话 断线 你被管理员剔除. 管理员把我踢出. 我会更新自己 用户资料 计算机名 用户在线 在线用户达到最大 你必须选择用户来显示资料. 允许在托盘区显示信息 允许责难 允许注意 会话数量 允许责难,但全看你自己 在托盘图标显示信息 允许接收注意 被禁止的用户 从黑名单中禁止用户 保存 取消 选择你要禁止的用户 我禁止你来 停止 你不能在1分钟内发送多于1次的注意 在你发送注意前请先选择一个用户. 选择要发送的文件 文件不存在 你必须选择一个用户来发送文件. 你不能选择你自己. 我正在刷新 搜索中... 我正在连接的人是 搜索靠 从列表中选择 Ok 按下 ctrl 我已经开始了会话 我已经接受了会话 很多会话已经开始. 某人正尝试发起一个新会话, 但是已经超过了限额 为聊天起个昵称 我已经把名字修改为 再见 语言
  6. I'm learning WMI now ,but autoit doesn't have a "FOR EACH...IN..." statement. So some WMI examples in MSDN cannot run in autoit. such as the code bellow: $strComputer = "." $objWMIService = ObjGet ("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & $strComputer & "\root\cimv2") $colScheduledJobs = $objWMIService.ExecQuery _ ("Select * from Win32_ScheduledJob") For Each objJob in $colScheduledJobs ConsoleWrite( "Job ID: " & objJob.JobId & _ "Command: " & objJob.Command) Next How can I deal with it?
  7. It's Ok now,thanks a lot.
  8. This function returns this: 0x433A5C446F63756D656E747320616E642053657474696E67735C41646D696E6973747261746F722E5A4843485CD7C0C3E6 5C54656D705C6175746F6974335C426565705069616E6F5C54686520456E7465727461696E657220496E74726F2E74787400 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000 and Chr ( _FileSaveDialog("",@DesktopDir)) returns an "C". What should I do?
  9. There is something wrong with your _FileSaveDialog() ,it didn't return the path of file. ConsoleWrite(_FileSaveDialog("",@DesktopDir)) Func _FileSaveDialog ($sTitle, $sInitDir, $sFilter = 'All (*.*)', $iOpt = 0, $sDefaultFile = "", $sDefaultExt = "", $mainGUI = 0) Local $iFileLen = 65536 ; Max chars in returned string ; API flags prepare Local $iFlag = BitOR (BitShift (BitAND ($iOpt, 2),-10), BitShift (BitAND ($iOpt,16), 3 )) ; Filter string to array convertion Local $asFLines = StringSplit ( $sFilter, '|'), $asFilter [$asFLines [0] *2+1] Local $i, $iStart, $iFinal, $suFilter = '' $asFilter [0] = $asFLines [0] *2 For $i=1 To $asFLines [0] $iStart = StringInStr ($asFLines [$i], '(', 0, 1) $iFinal = StringInStr ($asFLines [$i], ')', 0,-1) $asFilter [$i*2-1] = StringStripWS (StringLeft ($asFLines [$i], $iStart-1), 3) $asFilter [$i*2] = StringStripWS (StringTrimRight (StringTrimLeft ($asFLines [$i], $iStart), StringLen ($asFLines [$i]) -$iFinal+1), 3) $suFilter = $suFilter & 'byte[' & StringLen ($asFilter [$i*2-1])+1 & '];byte[' & StringLen ($asFilter [$i*2])+1 & '];' Next ; Create API structures Local $uOFN = DllStructCreate ('dword;int;int;ptr;ptr;dword;dword;ptr;dword' & _ ';ptr;int;ptr;ptr;dword;short;short;ptr;ptr;ptr;ptr;ptr;dword;dword' ) Local $usTitle = DllStructCreate ('byte[' & StringLen ($sTitle) +1 & ']') Local $usInitDir= DllStructCreate ('byte[' & StringLen ($sInitDir) +1 & ']') Local $usFilter = DllStructCreate ($suFilter & 'byte') Local $usFile = DllStructCreate ('byte[' & $iFileLen & ']') Local $usExtn = DllStructCreate ('byte[' & StringLen ($sDefaultExt) +1 & ']') For $i=1 To $asFilter [0] DllStructSetData ($usFilter, $i, $asFilter [$i]) Next ; Set Data of API structures DllStructSetData ($usTitle, 1, $sTitle) DllStructSetData ($usInitDir, 1, $sInitDir) DllStructSetData ($usFile, 1, $sDefaultFile) DllStructSetData ($usExtn, 1, $sDefaultExt) DllStructSetData ($uOFN, 1, DllStructGetSize($uOFN)) DllStructSetData ($uOFN, 2, $mainGUI) DllStructSetData ($uOFN, 4, DllStructGetPtr ($usFilter)) DllStructSetData ($uOFN, 7, 1) DllStructSetData ($uOFN, 8, DllStructGetPtr ($usFile)) DllStructSetData ($uOFN, 9, $iFileLen) DllStructSetData ($uOFN, 12, DllStructGetPtr ($usInitDir)) DllStructSetData ($uOFN, 13, DllStructGetPtr ($usTitle)) DllStructSetData ($uOFN, 14, $iFlag) DllStructSetData ($uOFN, 17, DllStructGetPtr ($usExtn)) DllStructSetData ($uOFN, 23, BitShift (BitAND ($iOpt, 32), 5)) ; Call API function $ret = DllCall ('comdlg32.dll', 'int', 'GetSaveFileName', _ 'ptr', DllStructGetPtr ($uOFN) ) If $ret [0] Then Return DllStructGetData ($usFile, 1) Else SetError (1) Return "" EndIf EndFunc
  10. Is there any way to convert UTF-8 to GB2313?
  11. How to create a button with menu like this? here is the picture: comicsdown_225.zip verycd_140.zip verycd_source_140.zip
  12. the html code: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" id="myopera-theme12" xml:lang="en"> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Files</title><link rel="stylesheet" type="text/css" href="/community/css/users/files_big_white.css" media="all" /></head> <body id="myopera"> <div><form id="fileform" action="/netpand/files/addpic.pl" method="post" enctype="multipart/form-data"> <div><p>1. Select into which directory you wish to upload the file.</p> <input type="radio" name="dir" id="dir_/files" value="/files" /> <label for="dir_/files">/files</label><br /><p style="margin-left:.5em">? <a href="dircreation.dml">Create a new directory</a></p> <p>2. Select a file that you want to upload.</p> <input type="file" name="file" id="file" /><p>3. Click 'upload file'.</p> <input type="submit" value=" UPLOAD " class="submit" id="submit" /></div> </form></div></body></html> my code: #include <IE.au3> $path = "example.html" $oIE = _IECreate (path) $oForm = _IEFormGetCollection ($oIE,0) $oQuery = _IEFormElementGetObjByName ($oForm, "file") _IEFormElementSetValue ($oQuery, "AutoIt IE.au3") but it returns:"--> IE.au3 Error from function _IEFormElementSetValue, $_IEStatus_InvalidObjectType (Browser securuty prevents SetValue of TYPE=FILE)" is there any solution?
  13. How can I get the temporary internet file's path according to its original address? for example,when I navigate this page in IE,this image is saved to the"Temporary Internet Files" folder,so how can I get the image from the "Temporary Internet Files" folder?
  14. I want to get the big image from this page, When I use InetGet("http://manhua.wydm.net/幸运星/01/002.jpg","d.jpg") I got a wrong page,not the image,so I want to try IE UDF,but how can I get the loaded image from a loaded page?
  15. How to get the transparency of a window?
  16. The code bellow is what I get so far,and as you see,it cost so much CPU usage .If I can use GUIRegisterMsg ,it will be much better. HotKeySet("{ESC}", "_Exit") Global $list[22] $list[0] = "" $list[1] = "Default IME" $list[2] = "M" $list[3] = "SysFader" $list[4] = "MCI command handling window" $list[5] = "DirectorExtension" $list[6] = "CiceroUIWndFrame" $list[7] = "TF_FloatingLangBar_WndTitle" $list[8] = "NetDDE Agent" $list[9] = "TrayIcon" $list[10] = "CAsyncSocketEx Helper Window" $list[11] = "Socket Notification Sink" $list[12] = "Logitech GetMessage Hook" $list[13] = "LogiTrayMgrWnd" $list[14] = "Logitech E/M Executive" $list[15] = "Connections Tray" $list[16] = "电表" $list[17] = "Program Manager" $list[18] = "?汐杵湩圠湩潤wж" $list[19] = "Acrobat IEHelper" $list[20] = "MS_WebcheckMonitor" $list[21] = "「开始」菜单" Global $b_list = _Createb_list() While 1 Sleep(200) ;$time1 =TimerInit() $back = _CheckNewWindows($b_list,0) If $back[0][0]>0 Then For $i=1 to $back[0][0] ConsoleWrite($back[$i][0]&@CRLF) Next EndIf ;ConsoleWrite("1 "&TimerDiff($time1)&@CRLF) ;Exit WEnd Func _CheckNewWindows(ByRef $b_list,$flags=0) Local $c_list=WinList(),$return[1][2] $return[0][0]=0 If $c_list[0][0] <> $b_list[0][1] Then $c_list = _Createb_list() ;$time3 =TimerInit() If $flags=2 Then; closed windows For $x = 1 To $b_list[0][0] $found = 0 For $y = 1 To $c_list[0][0] If $b_list[$x][1] = $c_list[$y][1] Then $found = 1 $z = 0 ExitLoop EndIf $z = $x Next If $found = 0 Then ReDim $return[UBound($return)+1][2] $return[UBound($return)-1][0] = $b_list[$z][0] $return[UBound($return)-1][1] = $b_list[$z][1] EndIf Next Else For $x = 1 To $c_list[0][0] $found = 0 $same_name = 0 For $y = 1 To $b_list[0][0] If $flags=0 And $c_list[$x][1] = $b_list[$y][1] Then; new windows $found = 1 $z = 0 ExitLoop ElseIf $flags=1 And $c_list[$x][0] <> $b_list[$y][0] And $c_list[$x][1] = $b_list[$y][1] Then; title changed windows $same_name = 1 ExitLoop EndIf $z = $x Next If $flags=0 And $found = 0 Then ReDim $return[UBound($return)+1][2] $return[UBound($return)-1][0] = $c_list[$z][0] $return[UBound($return)-1][1] = $c_list[$z][1] ElseIf $flags=1 And $same_name = 1 Then ReDim $return[UBound($return)+1][2] $return[UBound($return)-1][0] = $c_list[$z][0] $return[UBound($return)-1][1] = $c_list[$z][1] EndIf Next EndIf $return[0][0] = UBound($return)-1 $b_list = $c_list ;ConsoleWrite("3 "&TimerDiff($time3)&@CRLF) EndIf Return $return EndFunc ;==>_CheckNewWindows Func _Exit() Exit EndFunc ;==>_Exit Func _Createb_list() ;$time2 =TimerInit() Local $a_list=WinList(),$a_b_list $a_list[0][1] = $a_list[0][0] For $x = 1 To $a_list[0][0] If _IsIn($a_list[$x][0]) =0 And $a_list[$x][0] <> ""Then If IsArray($a_b_list) Then ReDim $a_b_list[UBound($a_b_list) + 1][2] Else Dim $a_b_list[2][2] EndIf $a_b_list[0][0] = UBound($a_b_list) - 1 $a_b_list[UBound($a_b_list) - 1][0] = $a_list[$x][0] $a_b_list[UBound($a_b_list) - 1][1] = $a_list[$x][1] EndIf Next ;ConsoleWrite("2 "&TimerDiff($time2)&@CRLF) Return $a_b_list EndFunc ;==>_createb_list Func _IsIn($var) ;$time4 =TimerInit() $result = 0 $var2 = StringStripWS($var,3) For $x = 0 To UBound($list) - 1 If $var2 = $list[$x] Then $result = 1 Next ;ConsoleWrite("4 "&TimerDiff($time4)&@CRLF) Return $result EndFunc
  17. I have used your "mousehook" ,but I got too much information,what I want is only the handle of new window.gafrost's code help me a lot,but using GUIRegisterMsg can save me a lot of time, could you help me? my code: Const $WH_CBT = 5 Const $HCBT_SETFOCUS = 0x1400 + 0x1A30 Const $HCBT_ACTIVATE = 0x1400 + 0x1A31 Const $HCBT_CREATEWND = 0x1400 + 0x1A32 Const $HCBT_DESTROYWND = 0x1400 + 0x1A33 Const $HCBT_MINMAX = 0x1400 + 0x1A34 Global $n,$msg,$buffer = "" HotKeySet("{ESC}","GoAway") $gui = GUICreate("test") Global $DLLinst = DLLCall("kernel32.dll","hwnd","LoadLibrary","str",".\hook.dll") Global $cbtHOOKproc = DLLCall("kernel32.dll","hwnd","GetProcAddress","hwnd",$DLLInst[0],"str","CBTProc") Global $hhCBT = DLLCall("user32.dll","hwnd","SetWindowsHookEx","int",$WH_CBT, _ "hwnd",$cbtHOOKproc[0],"hwnd",$DLLinst[0],"int",0) DLLCall(".\hook.dll","int","SetValuesCBT","hwnd",$gui,"hwnd",$hhCBT[0]) GUIRegisterMsg($HCBT_CREATEWND,"myCBTfunc") While 1 $msg = GUIGetMsg() If $msg = -3 Then ExitLoop WEnd Func MyCBTFunc($hWndGUI, $MsgID, $WParam, $LParam) $n += 1 If $n > 25 Then $n = 25 $buffer = StringTrimLeft($buffer,StringInStr($buffer,@LF)) EndIf $buffer &= "CBT: " & $MsgID & "," & WinGetTitle($WParam) & "," & $LParam & @LF ToolTip($buffer) EndFunc Func GoAway() Exit EndFunc Func OnAutoItExit() ;DLLCall("user32.dll","int","UnhookWindowsHookEx","hwnd",$hhMouse[0]) ;DLLCall("user32.dll","int","UnhookWindowsHookEx","hwnd",$hhKey[0]) DLLCall("user32.dll","int","UnhookWindowsHookEx","hwnd",$hhCBT[0]) DLLCall("kernel32.dll","int","FreeLibrary","hwnd",$DLLinst[0]) EndFunc
  18. I want to be noticed if any new window was created,just like Notify and Name of any New Process Started But my code bellow doesn't work as I wished. Dim $list = WinList() AdlibEnable("chk_Process") While 1 Sleep(20) WEnd Func chk_Process() $list2 = WinList() If $list2[0][0] > $list[0][0] Then if $list2[$list2[0][0]][0] <> "Default IME" then MsgBox(262208,"New Window", $list2[$list2[0][0]][0] & " ") $list[0][0] = $list2[0][0] Else $list[0][0] = $list2[0][0] ; if you close processes - this resets the list EndIf EndFunc
  19. I want to show a msgbox when one program create a window,but my code does not work. #include <GUIConstants.au3> Global Const $WM_CREATE = 0x1 GUIRegisterMsg($WM_CREATE, "MY_WM_CREATE") while 1 wend Func MY_WM_CREATE($hWnd, $Msg, $wParam, $lParam) MsgBox(0,"","someone create a window") EndFunc ;==>MY_WM_CREATE And I want to get the handle of the new window ,but I still have no ideas. edited.I just forget to add a loop,but it still doesn't work
  20. the return value of WM_QUERYUISTATE has no use
  21. Could anyone help with it?
  22. Here is the code, maybe I need to use Windows API #include <GuiConstants.au3> GuiCreate("MyGUI", 241, 80,-1,-1,-1,$WS_EX_TOPMOST) $Label_1 = GuiCtrlCreateLabel("Windows title:", 10, 10, 90, 20) $Input_2 = GuiCtrlCreateInput("", 110, 10, 120, 20) $Button_3 = GuiCtrlCreateButton("set on top flag", 120, 40, 110, 30) GuiSetState() While 1 $newtitle = WinGetTitle ("") If $newtitle <> GUICtrlRead($Input_2) And $newtitle <> "MyGUI" Then GUICtrlSetData($Input_2,$newtitle) ;If the windows is "Always On Top" ,then GUICtrlSetData($Button_3,"remove on top flag") ;If the windows is not "Always On Top" ,then GUICtrlSetData($Button_3,"set on top flag") EndIf $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_3 ;If the windows is "Always On Top" ,then WinSetOnTop (GUICtrlRead($Input_2), "", 0) ;If the windows is not "Always On Top" ,then WinSetOnTop (GUICtrlRead($Input_2), "", 1) EndSelect WEnd Exit
  23. I mean the "Always On Top" ,not the "active". I just want to know whether a window is "Always On Top". My English is not very well,I wish you could understant.
  24. How can I know whether a window is already on top ?
×
×
  • Create New...