找回密码
 加入
搜索
查看: 2230|回复: 2

聊天工具菜单源码-无法关连ini配置文件

[复制链接]
发表于 2009-3-9 16:12:56 | 显示全部楼层 |阅读模式


比如说。  我修改配置文件menu.ini里面的[腾讯zz]  聊天工具列表同时也会显示[腾讯zz]

希望高手帮下。 在线等。QB做报酬也可以。

 
#NoTrayIcon
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GuiButton.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Process.au3>
Global $Dll, $Last
Opt("OnExitFunc","Quit")
FileInstall("SkinCrafterDll.dll", @TempDir&"SkinCrafterDll.dll", 1)
FileInstall("vista.skf", @TempDir&"vista.skf", 1)
_CreatIni()
$IniTest = FileOpen(@ScriptDir &"\Menu.ini", 0)
$CopyRight = FileReadLine($IniTest, 2)
If $CopyRight <> "; By: 5i3p  QQ: 87669144  群: 227200" Then
MsgBox(16, "错误", "配置文件Menu.ini第二行请保留作者信息,否则程序无法运行!"& @CRLF & @CRLF &"作者信息已被您更改为:"& @CRLF & @CRLF & $CopyRight & @CRLF & @CRLF &"原作者信息为:"& @CRLF & @CRLF &"; By: 5i3p  QQ: 87669144  群: 227200"& @CRLF & @CRLF &"请修正后再试! (提示: 弹出本对话框时按Ctrl+C键可复制本对话框内容)"& @CRLF)
Exit
EndIf
FileClose($IniTest) 
$Title = IniRead(@ScriptDir & "\Menu.ini", "自定义标题", "标题", "")
$Window = GUICreate($Title, 391, 337)
_SkinGUI(@TempDir&"SkinCrafterDll.dll", @TempDir&"vista.skf", $Window)
GUICtrlCreateGroup("聊天工具列表", 2, 6, 193, 329)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x808080)
$QQ = GUICtrlCreateButton("腾讯QQ   (&A)", 16, 31, 161, 33, 0)
$MSN = GUICtrlCreateButton("MSN      (&B)", 16, 82, 161, 33, 0)
$Skype = GUICtrlCreateButton("Skype    (&C)", 16, 133, 161, 33, 0)
$BaiduHi = GUICtrlCreateButton("BaiduHi  (&D)", 16, 184, 161, 33, 0)
$UC = GUICtrlCreateButton("新浪UC   (&E)", 16, 235, 161, 33, 0)
$Taobao = GUICtrlCreateButton("淘宝旺旺 (&F)", 16, 286, 161, 33, 0)
GUICtrlCreateGroup("$QQ", -99, -99, 1, 1)
GUICtrlCreateGroup("备注", 196, 6, 194, 209)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x808080)
$Label = GUICtrlCreateLabel(@CRLF &"  聊天工具菜单"& @CRLF & @CRLF & "          -- By:5i3p", 202, 24, 180, 182)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("临时会话", 196, 216, 194, 119)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x808080)
$QQNumber = GUICtrlCreateInput("87669144", 246, 256, 129, 21)
GUICtrlSetTip(-1,"请在此输入对方的QQ号码")
GUICtrlSetLimit($QQNumber, 10, 5)
$Chat = GUICtrlCreateButton("跟他/ 她聊聊(&G)", 240, 296, 105, 25, $BS_FLAT)
GUICtrlCreateLabel("QQ:", 208, 258, 30, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x808080)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
  Case $Chat
   If Not StringIsDigit(GUICtrlRead($QQNumber)) Then
    MsgBox(0, '提示','请输入正确的QQ号码(5-10位纯数字)后再试!')
   Else
    ShellExecute("tencent://message/?uin="& GUICtrlRead($QQNumber) &"&Menu=yes","","","",@SW_HIDE)
   EndIf
  Case $QQ
   $var = IniRead (@ScriptDir & "\Menu.ini", "腾讯QQ", "路径", "")
   If $var = '' Then
    MsgBox(0, '提示', '请在脚本目录的 Menu.ini 里设置好正确的完整路径再试!')
   Else
    _RunDOS('start '& $var)
   EndIf
  Case $MSN
   $var = IniRead (@ScriptDir & "\Menu.ini", "MSN", "路径", "")
   If $var = '' Then
    MsgBox(0, '提示', '请在脚本目录的 Menu.ini 里设置好正确的完整路径再试!')
   Else
    _RunDOS('start '& $var)
   EndIf   
  Case $Skype
   $var = IniRead (@ScriptDir & "\Menu.ini", "Skype", "路径", "")
   If $var = '' Then
    MsgBox(0, '提示', '请在脚本目录的 Menu.ini 里设置好正确的完整路径再试!')
   Else
    _RunDOS('start '& $var)
   EndIf   
  Case $BaiduHi
   $var = IniRead (@ScriptDir & "\Menu.ini", "百度Hi", "路径", "")
   If $var = '' Then
    MsgBox(0, '提示', '请在脚本目录的 Menu.ini 里设置好正确的完整路径再试!')
   Else
    _RunDOS('start '& $var)
   EndIf   
  Case $UC
   $var = IniRead (@ScriptDir & "\Menu.ini", "新浪UC", "路径", "")
   If $var = '' Then
    MsgBox(0, '提示', '请在脚本目录的 Menu.ini 里设置好正确的完整路径再试!')
   Else
    _RunDOS('start '& $var)
   EndIf   
  Case $Taobao
   $var = IniRead (@ScriptDir & "\Menu.ini", "淘宝", "路径", "")
   If $var = '' Then
    MsgBox(0, '提示', '请在脚本目录的 Menu.ini 里设置好正确的完整路径再试!')
   Else
    _RunDOS('start '& $var)
   EndIf
  EndSwitch
_ReduceMemory(@AutoItPID)

$Mouse=GUIGetCursorInfo($Window)
If $Last <> $Mouse[4] Then
  Switch $Mouse[4]
   Case $QQ
    $value = IniRead (@ScriptDir & "\Menu.ini", "腾讯QQ", "备注", "")
    GUICtrlSetData($Label, $value)
   Case $MSN
    $value = IniRead (@ScriptDir & "\Menu.ini", "MSN", "备注", "")
    GUICtrlSetData($Label, $value)
   Case $Skype
    $value = IniRead (@ScriptDir & "\Menu.ini", "Skype", "备注", "")
    GUICtrlSetData($Label, $value) 
   Case $BaiduHi
    $value = IniRead (@ScriptDir & "\Menu.ini", "百度Hi", "备注", "")
    GUICtrlSetData($Label, $value)  
   Case $UC
    $value = IniRead (@ScriptDir & "\Menu.ini", "新浪UC", "备注", "")
    GUICtrlSetData($Label, $value) 
   Case $Taobao
    $value = IniRead (@ScriptDir & "\Menu.ini", "淘宝旺旺", "备注", "")
    GUICtrlSetData($Label, $value) 
  EndSwitch
  $Last = $Mouse[4]
EndIf
    _ReduceMemory(@AutoItPID)
WEnd
Func _CreatIni()
If Not FileExists(@ScriptDir & "\Menu.ini") Then
  $Config = FileOpen(@ScriptDir &"\Menu.ini", 1)
  FileWriteLine($Config, @CRLF &"; By: 5i3p  QQ: 87669144  群: 227200" & @CRLF & @CRLF & @CRLF)
  FileWriteLine($Config, "[自定义标题]")
  FileWriteLine($Config, "标题=Chat Menu -- By: 5i3p"& @CRLF & @CRLF)
  FileWriteLine($Config, "[腾讯QQ]")
  FileWriteLine($Config, "路径=")
  FileWriteLine($Config, "备注=关于腾讯QQ的备注"& @CRLF & @CRLF)
  FileWriteLine($Config, "[MSN]")
  FileWriteLine($Config, "路径=")
  FileWriteLine($Config, "备注=关于MSN的备注"& @CRLF & @CRLF)
  FileWriteLine($Config, "[Skype]")
  FileWriteLine($Config, "路径=")
  FileWriteLine($Config, "备注=关于Skype的备注"& @CRLF & @CRLF)
  FileWriteLine($Config, "[百度Hi]")
  FileWriteLine($Config, "路径=")
  FileWriteLine($Config, "备注=BaiduHi的备注"& @CRLF & @CRLF)
  FileWriteLine($Config, "[新浪UC]")
  FileWriteLine($Config, "路径=")
  FileWriteLine($Config, "备注=关于新浪UC的备注"& @CRLF & @CRLF)
  FileWriteLine($Config, "[淘宝旺旺]")
  FileWriteLine($Config, "路径=")
  FileWriteLine($Config, "备注=关于淘宝旺旺的备注"& @CRLF)
  FileClose($Config)
EndIf
EndFunc
Func _SkinGUI($SkincrafterDll, $SkincrafterSkin, $Handle)
   $Dll = DllOpen($SkincrafterDll) 
   DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1") 
   DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1) 
   DllCall($Dll, "int:cdecl", "LoadSkinFromFile", "wstr", $SkincrafterSkin) 
   DllCall($Dll, "int:cdecl", "DecorateAs", "int", $Handle, "int", 25) 
   DllCall($Dll, "int:cdecl", "ApplySkin") 
EndFunc 
Func Quit()
    GUISetState(@SW_HIDE)
    DllCall($Dll, "int:cdecl", "DeInitDecoration")
    DllCall($Dll, "int:cdecl", "RemoveSkin")
    DllClose($Dll)
FileDelete(@TempDir&"SkinCrafterDll.dll")
FileDelete(@TempDir&"vista.skf") 
    Exit
EndFunc
Func _ReduceMemory($i_PID = -1)
If $i_PID <> -1 Then
  Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
  Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
  DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
Else
  Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
EndIf
Return $ai_Return[0]
EndFunc


[ 本帖最后由 tzz365 于 2009-3-9 17:05 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2009-3-9 17:28:30 | 显示全部楼层
要实现楼主所说的功能需要有大改动。。。。。另
Q币不能解决问题 本论坛也不想和钱扯上关系
不过如果楼主想学习学习的话可以找我
发表于 2009-3-10 10:40:08 | 显示全部楼层
读出来的数据 guictrlsetdata
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-15 11:09 , Processed in 0.232151 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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