Advertisement
kazurai

[AHK Script] PostMessage.ahk [Path系] ver.200224

Jun 18th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. 【タイトル】PostMessage.ahk
  3. 【  概要  】PostMessage
  4. 【  Type  】AHK Script[Path系]
  5. 【  Site  】http://pastebin.com/GF1WSFFh
  6.             http://pastebin.com/XB5X1HdQ [Lib版]
  7. 【 更新日 】2020/02/24
  8. 【  用途  】クリップボード拡張ソフトなどの連携ツールとして
  9.  
  10. ┌--------------┐
  11. │コマンドライン│
  12. └--------------┘
  13. PostMessage "ProcessName" "ClassName" Msg wParam    ;クラス名
  14. PostMessage "ProcessName" "Title" Msg wParam 1      ;タイトル(前方一致)
  15. PostMessage "ProcessName" "Title" Msg wParam 2      ;タイトル(部分一致)
  16. PostMessage "ProcessName" "Title" Msg wParam 3      ;タイトル(完全一致)
  17.  
  18. ┌----------┐
  19. │How to Use│
  20. └----------┘
  21. 1) 環境変数のPathが通ったフォルダに作成
  22. 2) コマンド実行
  23.  
  24. ■用途
  25. Θタスクトレイアイコンの右クリックメニュー操作 ※WM_COMMAND(0x111)
  26. Θメニューバーの項目操作                       ※WM_COMMAND(0x111)
  27.   1) PostMessage
  28.   2) ホットキーをSend
  29.   3) アクセラレータキーをSend
  30.  
  31. ■コマンド例
  32. □AutoHotkey
  33. PostMessage "AutoHotkey.exe" "hoge.ahk" 0x111 65300 2   ;ログウィンドウ
  34. PostMessage "AutoHotkey.exe" "hoge.ahk" 0x111 65305 2   ;Suspend
  35. PostMessage "AutoHotkey.exe" "hoge.ahk" 0x111 65306 2   ;Pause
  36.  
  37. □Proxomitron
  38. PostMessage "Proxomitron.exe" "PrxTronCls" 0x111 1007   ;バイパス
  39. PostMessage "Proxomitron.exe" "PrxTronCls" 0x111 1013   ;ログウィンドウ
  40.  
  41. □のどか
  42. PostMessage "nodoka64.exe" "nodokaTasktray" 0x111 40002 ;再読み込み
  43. PostMessage "nodoka64.exe" "nodokaTasktray" 0x111 40007 ;一時停止
  44. PostMessage "nodoka64.exe" "nodokaTasktray" 0x111 40004 ;調査
  45.  
  46. □ペースター
  47. PostMessage "Paster.exe" "PasterFrame" 0x111 32771      ;本体設定
  48. PostMessage "Paster.exe" "PasterFrame" 0x111 32806      ;履歴の編集
  49. PostMessage "Paster.exe" "PasterFrame" 0x111 32777      ;履歴の更新をサスペンド
  50. */
  51. #NoEnv
  52. #NoTrayIcon
  53. #SingleInstance Force
  54. DetectHiddenWindows, On
  55.  
  56. Process, Exist, %1%
  57. if ErrorLevel {
  58.     if !A_Args[5]
  59.         PostMessage, %3%, %4%,,, ahk_class %2% ahk_exe %1%
  60.     else {
  61.         SetTitleMatchMode, %5%
  62.         PostMessage, %3%, %4%,,, %2% ahk_exe %1%
  63.     }
  64. }
  65. ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement