- Add support for "!wm <value>" and "!wm <name>" commands.
authorFilip Navara <filip.navara@gmail.com>
Wed, 14 Dec 2005 17:34:00 +0000 (17:34 +0000)
committerFilip Navara <filip.navara@gmail.com>
Wed, 14 Dec 2005 17:34:00 +0000 (17:34 +0000)
- Update the #develop project file.
- Add list of window message values. Thanks to Royce3.

svn path=/trunk/; revision=20164

irc/TechBot/Resources/wm.xml [new file with mode: 0644]
irc/TechBot/TechBot.Console/App.config
irc/TechBot/TechBot.Console/Main.cs
irc/TechBot/TechBot.Library/IrcService.cs
irc/TechBot/TechBot.Library/TechBot.Library.prjx
irc/TechBot/TechBot.Library/TechBotService.cs
irc/TechBot/TechBot.Library/WmCommand.cs [new file with mode: 0644]
irc/TechBot/TechBot/App.config
irc/TechBot/TechBot/ServiceThread.cs

diff --git a/irc/TechBot/Resources/wm.xml b/irc/TechBot/Resources/wm.xml
new file mode 100644 (file)
index 0000000..86994ea
--- /dev/null
@@ -0,0 +1,321 @@
+<?xml version="1.0" ?>\r
+<WindowMessageList>\r
+       <WindowMessage text="WM_APP" value="32768" />\r
+       <WindowMessage text="WM_ACTIVATE" value="6" />\r
+       <WindowMessage text="WM_ACTIVATEAPP" value="28" />\r
+       <WindowMessage text="WM_AFXFIRST" value="864" />\r
+       <WindowMessage text="WM_AFXLAST" value="895" />\r
+       <WindowMessage text="WM_ASKCBFORMATNAME" value="780" />\r
+       <WindowMessage text="WM_CANCELJOURNAL" value="75" />\r
+       <WindowMessage text="WM_CANCELMODE" value="31" />\r
+       <WindowMessage text="WM_CAPTURECHANGED" value="533" />\r
+       <WindowMessage text="WM_CHANGECBCHAIN" value="781" />\r
+       <WindowMessage text="WM_CHANGEUISTATE" value="295" />\r
+       <WindowMessage text="WM_UPDATEUISTATE" value="296" />\r
+       <WindowMessage text="WM_QUERYUISTATE" value="297" />\r
+       <WindowMessage text="WM_CHAR" value="258" />\r
+       <WindowMessage text="WM_CHARTOITEM" value="47" />\r
+       <WindowMessage text="WM_CHILDACTIVATE" value="34" />\r
+       <WindowMessage text="WM_CLEAR" value="771" />\r
+       <WindowMessage text="WM_CLOSE" value="16" />\r
+       <WindowMessage text="WM_COMMAND" value="273" />\r
+       <WindowMessage text="WM_COMMNOTIFY" value="68" />\r
+       <WindowMessage text="WM_COMPACTING" value="65" />\r
+       <WindowMessage text="WM_COMPAREITEM" value="57" />\r
+       <WindowMessage text="WM_CONTEXTMENU" value="123" />\r
+       <WindowMessage text="WM_COPY" value="769" />\r
+       <WindowMessage text="WM_COPYDATA" value="74" />\r
+       <WindowMessage text="WM_CREATE" value="1" />\r
+       <WindowMessage text="WM_CTLCOLORBTN" value="309" />\r
+       <WindowMessage text="WM_CTLCOLORDLG" value="310" />\r
+       <WindowMessage text="WM_CTLCOLOREDIT" value="307" />\r
+       <WindowMessage text="WM_CTLCOLORLISTBOX" value="308" />\r
+       <WindowMessage text="WM_CTLCOLORMSGBOX" value="306" />\r
+       <WindowMessage text="WM_CTLCOLORSCROLLBAR" value="311" />\r
+       <WindowMessage text="WM_CTLCOLORSTATIC" value="312" />\r
+       <WindowMessage text="WM_CUT" value="768" />\r
+       <WindowMessage text="WM_DEADCHAR" value="259" />\r
+       <WindowMessage text="WM_DELETEITEM" value="45" />\r
+       <WindowMessage text="WM_DESTROY" value="2" />\r
+       <WindowMessage text="WM_DESTROYCLIPBOARD" value="775" />\r
+       <WindowMessage text="WM_DEVICECHANGE" value="537" />\r
+       <WindowMessage text="WM_DEVMODECHANGE" value="27" />\r
+       <WindowMessage text="WM_DISPLAYCHANGE" value="126" />\r
+       <WindowMessage text="WM_DRAWCLIPBOARD" value="776" />\r
+       <WindowMessage text="WM_DRAWITEM" value="43" />\r
+       <WindowMessage text="WM_DROPFILES" value="563" />\r
+       <WindowMessage text="WM_ENABLE" value="10" />\r
+       <WindowMessage text="WM_ENDSESSION" value="22" />\r
+       <WindowMessage text="WM_ENTERIDLE" value="289" />\r
+       <WindowMessage text="WM_ENTERMENULOOP" value="529" />\r
+       <WindowMessage text="WM_ENTERSIZEMOVE" value="561" />\r
+       <WindowMessage text="WM_ERASEBKGND" value="20" />\r
+       <WindowMessage text="WM_EXITMENULOOP" value="530" />\r
+       <WindowMessage text="WM_EXITSIZEMOVE" value="562" />\r
+       <WindowMessage text="WM_FONTCHANGE" value="29" />\r
+       <WindowMessage text="WM_GETDLGCODE" value="135" />\r
+       <WindowMessage text="WM_GETFONT" value="49" />\r
+       <WindowMessage text="WM_GETHOTKEY" value="51" />\r
+       <WindowMessage text="WM_GETICON" value="127" />\r
+       <WindowMessage text="WM_GETMINMAXINFO" value="36" />\r
+       <WindowMessage text="WM_GETTEXT" value="13" />\r
+       <WindowMessage text="WM_GETTEXTLENGTH" value="14" />\r
+       <WindowMessage text="WM_HANDHELDFIRST" value="856" />\r
+       <WindowMessage text="WM_HANDHELDLAST" value="863" />\r
+       <WindowMessage text="WM_HELP" value="83" />\r
+       <WindowMessage text="WM_HOTKEY" value="786" />\r
+       <WindowMessage text="WM_HSCROLL" value="276" />\r
+       <WindowMessage text="WM_HSCROLLCLIPBOARD" value="782" />\r
+       <WindowMessage text="WM_ICONERASEBKGND" value="39" />\r
+       <WindowMessage text="WM_INITDIALOG" value="272" />\r
+       <WindowMessage text="WM_INITMENU" value="278" />\r
+       <WindowMessage text="WM_INITMENUPOPUP" value="279" />\r
+       <WindowMessage text="WM_INPUTLANGCHANGE" value="81" />\r
+       <WindowMessage text="WM_INPUTLANGCHANGEREQUEST" value="80" />\r
+       <WindowMessage text="WM_KEYDOWN" value="256" />\r
+       <WindowMessage text="WM_KEYUP" value="257" />\r
+       <WindowMessage text="WM_KILLFOCUS" value="8" />\r
+       <WindowMessage text="WM_MDIACTIVATE" value="546" />\r
+       <WindowMessage text="WM_MDICASCADE" value="551" />\r
+       <WindowMessage text="WM_MDICREATE" value="544" />\r
+       <WindowMessage text="WM_MDIDESTROY" value="545" />\r
+       <WindowMessage text="WM_MDIGETACTIVE" value="553" />\r
+       <WindowMessage text="WM_MDIICONARRANGE" value="552" />\r
+       <WindowMessage text="WM_MDIMAXIMIZE" value="549" />\r
+       <WindowMessage text="WM_MDINEXT" value="548" />\r
+       <WindowMessage text="WM_MDIREFRESHMENU" value="564" />\r
+       <WindowMessage text="WM_MDIRESTORE" value="547" />\r
+       <WindowMessage text="WM_MDISETMENU" value="560" />\r
+       <WindowMessage text="WM_MDITILE" value="550" />\r
+       <WindowMessage text="WM_MEASUREITEM" value="44" />\r
+       <WindowMessage text="WM_MENURBUTTONUP" value="290" />\r
+       <WindowMessage text="WM_MENUCHAR" value="288" />\r
+       <WindowMessage text="WM_MENUSELECT" value="287" />\r
+       <WindowMessage text="WM_NEXTMENU" value="531" />\r
+       <WindowMessage text="WM_MOVE" value="3" />\r
+       <WindowMessage text="WM_MOVING" value="534" />\r
+       <WindowMessage text="WM_NCACTIVATE" value="134" />\r
+       <WindowMessage text="WM_NCCALCSIZE" value="131" />\r
+       <WindowMessage text="WM_NCCREATE" value="129" />\r
+       <WindowMessage text="WM_NCDESTROY" value="130" />\r
+       <WindowMessage text="WM_NCHITTEST" value="132" />\r
+       <WindowMessage text="WM_NCLBUTTONDBLCLK" value="163" />\r
+       <WindowMessage text="WM_NCLBUTTONDOWN" value="161" />\r
+       <WindowMessage text="WM_NCLBUTTONUP" value="162" />\r
+       <WindowMessage text="WM_NCMBUTTONDBLCLK" value="169" />\r
+       <WindowMessage text="WM_NCMBUTTONDOWN" value="167" />\r
+       <WindowMessage text="WM_NCMBUTTONUP" value="168" />\r
+       <WindowMessage text="WM_NCXBUTTONDOWN" value="171" />\r
+       <WindowMessage text="WM_NCXBUTTONUP" value="172" />\r
+       <WindowMessage text="WM_NCXBUTTONDBLCLK" value="173" />\r
+       <WindowMessage text="WM_NCMOUSEMOVE" value="160" />\r
+       <WindowMessage text="WM_NCMOUSEHOVER" value="0x02A0" />\r
+       <WindowMessage text="WM_NCMOUSELEAVE" value="0x02A2" />\r
+       <WindowMessage text="WM_NCPAINT" value="133" />\r
+       <WindowMessage text="WM_NCRBUTTONDBLCLK" value="166" />\r
+       <WindowMessage text="WM_NCRBUTTONDOWN" value="164" />\r
+       <WindowMessage text="WM_NCRBUTTONUP" value="165" />\r
+       <WindowMessage text="WM_NEXTDLGCTL" value="40" />\r
+       <WindowMessage text="WM_NEXTMENU" value="531" />\r
+       <WindowMessage text="WM_NOTIFY" value="78" />\r
+       <WindowMessage text="WM_NOTIFYFORMAT" value="85" />\r
+       <WindowMessage text="WM_NULL" value="0" />\r
+       <WindowMessage text="WM_PAINT" value="15" />\r
+       <WindowMessage text="WM_PAINTCLIPBOARD" value="777" />\r
+       <WindowMessage text="WM_PAINTICON" value="38" />\r
+       <WindowMessage text="WM_PALETTECHANGED" value="785" />\r
+       <WindowMessage text="WM_PALETTEISCHANGING" value="784" />\r
+       <WindowMessage text="WM_PARENTNOTIFY" value="528" />\r
+       <WindowMessage text="WM_PASTE" value="770" />\r
+       <WindowMessage text="WM_PENWINFIRST" value="896" />\r
+       <WindowMessage text="WM_PENWINLAST" value="911" />\r
+       <WindowMessage text="WM_POWER" value="72" />\r
+       <WindowMessage text="WM_POWERBROADCAST" value="536" />\r
+       <WindowMessage text="WM_PRINT" value="791" />\r
+       <WindowMessage text="WM_PRINTCLIENT" value="792" />\r
+       <WindowMessage text="WM_QUERYDRAGICON" value="55" />\r
+       <WindowMessage text="WM_QUERYENDSESSION" value="17" />\r
+       <WindowMessage text="WM_QUERYNEWPALETTE" value="783" />\r
+       <WindowMessage text="WM_QUERYOPEN" value="19" />\r
+       <WindowMessage text="WM_QUEUESYNC" value="35" />\r
+       <WindowMessage text="WM_QUIT" value="18" />\r
+       <WindowMessage text="WM_RENDERALLFORMATS" value="774" />\r
+       <WindowMessage text="WM_RENDERFORMAT" value="773" />\r
+       <WindowMessage text="WM_SETCURSOR" value="32" />\r
+       <WindowMessage text="WM_SETFOCUS" value="7" />\r
+       <WindowMessage text="WM_SETFONT" value="48" />\r
+       <WindowMessage text="WM_SETHOTKEY" value="50" />\r
+       <WindowMessage text="WM_SETICON" value="128" />\r
+       <WindowMessage text="WM_SETREDRAW" value="11" />\r
+       <WindowMessage text="WM_SETTEXT" value="12" />\r
+       <WindowMessage text="WM_SETTINGCHANGE" value="26" />\r
+       <WindowMessage text="WM_SHOWWINDOW" value="24" />\r
+       <WindowMessage text="WM_SIZE" value="5" />\r
+       <WindowMessage text="WM_SIZECLIPBOARD" value="779" />\r
+       <WindowMessage text="WM_SIZING" value="532" />\r
+       <WindowMessage text="WM_SPOOLERSTATUS" value="42" />\r
+       <WindowMessage text="WM_STYLECHANGED" value="125" />\r
+       <WindowMessage text="WM_STYLECHANGING" value="124" />\r
+       <WindowMessage text="WM_SYSCHAR" value="262" />\r
+       <WindowMessage text="WM_SYSCOLORCHANGE" value="21" />\r
+       <WindowMessage text="WM_SYSCOMMAND" value="274" />\r
+       <WindowMessage text="WM_SYSDEADCHAR" value="263" />\r
+       <WindowMessage text="WM_SYSKEYDOWN" value="260" />\r
+       <WindowMessage text="WM_SYSKEYUP" value="261" />\r
+       <WindowMessage text="WM_TCARD" value="82" />\r
+       <WindowMessage text="WM_TIMECHANGE" value="30" />\r
+       <WindowMessage text="WM_TIMER" value="275" />\r
+       <WindowMessage text="WM_SYSTIMER" value="280" />\r
+       <WindowMessage text="WM_UNDO" value="772" />\r
+       <WindowMessage text="WM_USER" value="1024" />\r
+       <WindowMessage text="WM_USERCHANGED" value="84" />\r
+       <WindowMessage text="WM_VKEYTOITEM" value="46" />\r
+       <WindowMessage text="WM_VSCROLL" value="277" />\r
+       <WindowMessage text="WM_VSCROLLCLIPBOARD" value="778" />\r
+       <WindowMessage text="WM_WINDOWPOSCHANGED" value="71" />\r
+       <WindowMessage text="WM_WINDOWPOSCHANGING" value="70" />\r
+       <WindowMessage text="WM_WININICHANGE" value="26" />\r
+       <WindowMessage text="WM_KEYFIRST" value="256" />\r
+       <WindowMessage text="WM_KEYLAST" value="264" />\r
+       <WindowMessage text="WM_SYNCPAINT" value="136" />\r
+       <WindowMessage text="WM_MOUSEACTIVATE" value="33" />\r
+       <WindowMessage text="WM_MOUSEMOVE" value="512" />\r
+       <WindowMessage text="WM_LBUTTONDOWN" value="513" />\r
+       <WindowMessage text="WM_LBUTTONUP" value="514" />\r
+       <WindowMessage text="WM_LBUTTONDBLCLK" value="515" />\r
+       <WindowMessage text="WM_RBUTTONDOWN" value="516" />\r
+       <WindowMessage text="WM_RBUTTONUP" value="517" />\r
+       <WindowMessage text="WM_RBUTTONDBLCLK" value="518" />\r
+       <WindowMessage text="WM_MBUTTONDOWN" value="519" />\r
+       <WindowMessage text="WM_MBUTTONUP" value="520" />\r
+       <WindowMessage text="WM_MBUTTONDBLCLK" value="521" />\r
+       <WindowMessage text="WM_MOUSEWHEEL" value="522" />\r
+       <WindowMessage text="WM_MOUSEFIRST" value="512" />\r
+       <WindowMessage text="WM_XBUTTONDOWN" value="523" />\r
+       <WindowMessage text="WM_XBUTTONUP" value="524" />\r
+       <WindowMessage text="WM_XBUTTONDBLCLK" value="525" />\r
+       <WindowMessage text="WM_MOUSELAST" value="525" />\r
+       <WindowMessage text="WM_MOUSEHOVER" value="0x2A1" />\r
+       <WindowMessage text="WM_MOUSELEAVE" value="0x2A3" />\r
+       <WindowMessage text="WM_THEMECHANGED" value="794" />\r
+       <WindowMessage text="BM_CLICK" value="245" />\r
+       <WindowMessage text="BM_GETCHECK" value="240" />\r
+       <WindowMessage text="BM_GETIMAGE" value="246" />\r
+       <WindowMessage text="BM_GETSTATE" value="242" />\r
+       <WindowMessage text="BM_SETCHECK" value="241" />\r
+       <WindowMessage text="BM_SETIMAGE" value="247" />\r
+       <WindowMessage text="BM_SETSTATE" value="243" />\r
+       <WindowMessage text="BM_SETSTYLE" value="244" />\r
+       <WindowMessage text="CB_ADDSTRING" value="323" />\r
+       <WindowMessage text="CB_DELETESTRING" value="324" />\r
+       <WindowMessage text="CB_DIR" value="325" />\r
+       <WindowMessage text="CB_FINDSTRING" value="332" />\r
+       <WindowMessage text="CB_FINDSTRINGEXACT" value="344" />\r
+       <WindowMessage text="CB_GETCOMBOBOXINFO" value="356" />\r
+       <WindowMessage text="CB_GETCOUNT" value="326" />\r
+       <WindowMessage text="CB_GETCURSEL" value="327" />\r
+       <WindowMessage text="CB_GETDROPPEDCONTROLRECT" value="338" />\r
+       <WindowMessage text="CB_GETDROPPEDSTATE" value="343" />\r
+       <WindowMessage text="CB_GETDROPPEDWIDTH" value="351" />\r
+       <WindowMessage text="CB_GETEDITSEL" value="320" />\r
+       <WindowMessage text="CB_GETEXTENDEDUI" value="342" />\r
+       <WindowMessage text="CB_GETHORIZONTALEXTENT" value="349" />\r
+       <WindowMessage text="CB_GETITEMDATA" value="336" />\r
+       <WindowMessage text="CB_GETITEMHEIGHT" value="340" />\r
+       <WindowMessage text="CB_GETLBTEXT" value="328" />\r
+       <WindowMessage text="CB_GETLBTEXTLEN" value="329" />\r
+       <WindowMessage text="CB_GETLOCALE" value="346" />\r
+       <WindowMessage text="CB_GETTOPINDEX" value="347" />\r
+       <WindowMessage text="CB_INITSTORAGE" value="353" />\r
+       <WindowMessage text="CB_INSERTSTRING" value="330" />\r
+       <WindowMessage text="CB_LIMITTEXT" value="321" />\r
+       <WindowMessage text="CB_RESETCONTENT" value="331" />\r
+       <WindowMessage text="CB_SELECTSTRING" value="333" />\r
+       <WindowMessage text="CB_SETCURSEL" value="334" />\r
+       <WindowMessage text="CB_SETDROPPEDWIDTH" value="352" />\r
+       <WindowMessage text="CB_SETEDITSEL" value="322" />\r
+       <WindowMessage text="CB_SETEXTENDEDUI" value="341" />\r
+       <WindowMessage text="CB_SETHORIZONTALEXTENT" value="350" />\r
+       <WindowMessage text="CB_SETITEMDATA" value="337" />\r
+       <WindowMessage text="CB_SETITEMHEIGHT" value="339" />\r
+       <WindowMessage text="CB_SETLOCALE" value="345" />\r
+       <WindowMessage text="CB_SETTOPINDEX" value="348" />\r
+       <WindowMessage text="CB_SHOWDROPDOWN" value="335" />\r
+       <WindowMessage text="EM_CANUNDO" value="198" />\r
+       <WindowMessage text="EM_CHARFROMPOS" value="215" />\r
+       <WindowMessage text="EM_EMPTYUNDOBUFFER" value="205" />\r
+       <WindowMessage text="EM_FMTLINES" value="200" />\r
+       <WindowMessage text="EM_GETFIRSTVISIBLELINE" value="206" />\r
+       <WindowMessage text="EM_GETHANDLE" value="189" />\r
+       <WindowMessage text="EM_GETLIMITTEXT" value="213" />\r
+       <WindowMessage text="EM_GETLINE" value="196" />\r
+       <WindowMessage text="EM_GETLINECOUNT" value="186" />\r
+       <WindowMessage text="EM_GETMARGINS" value="212" />\r
+       <WindowMessage text="EM_GETMODIFY" value="184" />\r
+       <WindowMessage text="EM_GETPASSWORDCHAR" value="210" />\r
+       <WindowMessage text="EM_GETRECT" value="178" />\r
+       <WindowMessage text="EM_GETSEL" value="176" />\r
+       <WindowMessage text="EM_GETTHUMB" value="190" />\r
+       <WindowMessage text="EM_GETWORDBREAKPROC" value="209" />\r
+       <WindowMessage text="EM_LIMITTEXT" value="197" />\r
+       <WindowMessage text="EM_LINEFROMCHAR" value="201" />\r
+       <WindowMessage text="EM_LINEINDEX" value="187" />\r
+       <WindowMessage text="EM_LINELENGTH" value="193" />\r
+       <WindowMessage text="EM_LINESCROLL" value="182" />\r
+       <WindowMessage text="EM_POSFROMCHAR" value="214" />\r
+       <WindowMessage text="EM_REPLACESEL" value="194" />\r
+       <WindowMessage text="EM_SCROLL" value="181" />\r
+       <WindowMessage text="EM_SCROLLCARET" value="183" />\r
+       <WindowMessage text="EM_SETHANDLE" value="188" />\r
+       <WindowMessage text="EM_SETLIMITTEXT" value="197" />\r
+       <WindowMessage text="EM_SETMARGINS" value="211" />\r
+       <WindowMessage text="EM_SETMODIFY" value="185" />\r
+       <WindowMessage text="EM_SETPASSWORDCHAR" value="204" />\r
+       <WindowMessage text="EM_SETREADONLY" value="207" />\r
+       <WindowMessage text="EM_SETRECT" value="179" />\r
+       <WindowMessage text="EM_SETRECTNP" value="180" />\r
+       <WindowMessage text="EM_SETSEL" value="177" />\r
+       <WindowMessage text="EM_SETTABSTOPS" value="203" />\r
+       <WindowMessage text="EM_SETWORDBREAKPROC" value="208" />\r
+       <WindowMessage text="EM_UNDO" value="199" />\r
+       <WindowMessage text="LB_ADDFILE" value="406" />\r
+       <WindowMessage text="LB_ADDSTRING" value="384" />\r
+       <WindowMessage text="LB_DELETESTRING" value="386" />\r
+       <WindowMessage text="LB_DIR" value="397" />\r
+       <WindowMessage text="LB_FINDSTRING" value="399" />\r
+       <WindowMessage text="LB_FINDSTRINGEXACT" value="418" />\r
+       <WindowMessage text="LB_GETANCHORINDEX" value="413" />\r
+       <WindowMessage text="LB_GETCARETINDEX" value="415" />\r
+       <WindowMessage text="LB_GETCOUNT" value="395" />\r
+       <WindowMessage text="LB_GETCURSEL" value="392" />\r
+       <WindowMessage text="LB_GETHORIZONTALEXTENT" value="403" />\r
+       <WindowMessage text="LB_GETITEMDATA" value="409" />\r
+       <WindowMessage text="LB_GETITEMHEIGHT" value="417" />\r
+       <WindowMessage text="LB_GETITEMRECT" value="408" />\r
+       <WindowMessage text="LB_GETLOCALE" value="422" />\r
+       <WindowMessage text="LB_GETSEL" value="391" />\r
+       <WindowMessage text="LB_GETSELCOUNT" value="400" />\r
+       <WindowMessage text="LB_GETSELITEMS" value="401" />\r
+       <WindowMessage text="LB_GETTEXT" value="393" />\r
+       <WindowMessage text="LB_GETTEXTLEN" value="394" />\r
+       <WindowMessage text="LB_GETTOPINDEX" value="398" />\r
+       <WindowMessage text="LB_INITSTORAGE" value="424" />\r
+       <WindowMessage text="LB_INSERTSTRING" value="385" />\r
+       <WindowMessage text="LB_ITEMFROMPOINT" value="425" />\r
+       <WindowMessage text="LB_RESETCONTENT" value="388" />\r
+       <WindowMessage text="LB_SELECTSTRING" value="396" />\r
+       <WindowMessage text="LB_SELITEMRANGE" value="411" />\r
+       <WindowMessage text="LB_SELITEMRANGEEX" value="387" />\r
+       <WindowMessage text="LB_SETANCHORINDEX" value="412" />\r
+       <WindowMessage text="LB_SETCARETINDEX" value="414" />\r
+       <WindowMessage text="LB_SETCOLUMNWIDTH" value="405" />\r
+       <WindowMessage text="LB_SETCOUNT" value="423" />\r
+       <WindowMessage text="LB_SETCURSEL" value="390" />\r
+       <WindowMessage text="LB_SETHORIZONTALEXTENT" value="404" />\r
+       <WindowMessage text="LB_SETITEMDATA" value="410" />\r
+       <WindowMessage text="LB_SETITEMHEIGHT" value="416" />\r
+       <WindowMessage text="LB_SETLOCALE" value="421" />\r
+       <WindowMessage text="LB_SETSEL" value="389" />\r
+       <WindowMessage text="LB_SETTABSTOPS" value="402" />\r
+       <WindowMessage text="LB_SETTOPINDEX" value="407" />\r
+</WindowMessageList>\r
index f7fa9ac..03b57ba 100644 (file)
@@ -10,6 +10,7 @@
                <add key="NtstatusXml" value="C:\IRC\TechBot\ntstatus.xml" />\r
                <add key="WinerrorXml" value="C:\IRC\TechBot\winerror.xml" />\r
                <add key="HresultXml" value="C:\IRC\TechBot\hresult.xml" />\r
+               <add key="WmXml" value="C:\IRC\TechBot\wm.xml" />\r
                <add key="SvnCommand" value="svn co svn://svn.reactos.com/trunk/reactos" />\r
        </appSettings>\r
 </configuration>\r
index f658ec3..d6e6045 100644 (file)
@@ -134,6 +134,18 @@ namespace TechBot.Console
                        }\r
                }\r
 \r
+               private static string WmXml\r
+               {\r
+                       get\r
+                       {\r
+                               string optionName = "WmXml";\r
+                               string s = ConfigurationSettings.AppSettings[optionName];\r
+                               VerifyRequiredOption(optionName,\r
+                                                    s);\r
+                               return s;\r
+                       }\r
+               }\r
+\r
                private static string SvnCommand\r
                {\r
                        get\r
@@ -157,6 +169,7 @@ namespace TechBot.Console
                                                               NtstatusXml,\r
                                                               WinerrorXml,\r
                                                               HresultXml,\r
+                                                              WmXml,\r
                                                               SvnCommand);\r
                        ircService.Run();\r
                }\r
@@ -176,6 +189,7 @@ namespace TechBot.Console
                                                                    NtstatusXml,\r
                                                                    WinerrorXml,\r
                                                                    HresultXml,\r
+                                                                   WmXml,\r
                                                                    SvnCommand);\r
                        service.Run();\r
                        while (true)\r
index 374c475..587bd9b 100644 (file)
@@ -16,6 +16,7 @@ namespace TechBot.Library
                private string ntstatusXml;\r
                private string winerrorXml;\r
                private string hresultXml;\r
+               private string wmXml;\r
                private string svnCommand;\r
                private IrcClient client;\r
                private ArrayList channels = new ArrayList(); /* IrcChannel */\r
@@ -31,18 +32,20 @@ namespace TechBot.Library
                                  string ntstatusXml,\r
                                  string winerrorXml,\r
                                  string hresultXml,\r
+                                 string wmXml,\r
                                  string svnCommand)\r
                {\r
                        this.hostname = hostname;\r
                        this.port = port;\r
                        this.channelnames = channelnames;\r
-                   this.botname = botname;\r
-                   this.chmPath = chmPath;\r
-                   this.mainChm = mainChm;\r
-                   this.ntstatusXml = ntstatusXml;\r
-                   this.winerrorXml = winerrorXml;\r
-                   this.hresultXml = hresultXml;\r
-                   this.svnCommand = svnCommand;\r
+                       this.botname = botname;\r
+                       this.chmPath = chmPath;\r
+                       this.mainChm = mainChm;\r
+                       this.ntstatusXml = ntstatusXml;\r
+                       this.winerrorXml = winerrorXml;\r
+                       this.hresultXml = hresultXml;\r
+                       this.wmXml = wmXml;\r
+                       this.svnCommand = svnCommand;\r
                }\r
 \r
                public void Run()\r
@@ -53,6 +56,7 @@ namespace TechBot.Library
                                                     ntstatusXml,\r
                                                     winerrorXml,\r
                                                     hresultXml,\r
+                                                    wmXml,\r
                                                     svnCommand);\r
                        service.Run();\r
 \r
index 1f6fd18..cce5c67 100644 (file)
@@ -13,6 +13,8 @@
     <File name=".\HresultCommand.cs" subtype="Code" buildaction="Compile" dependson="" data="" />\r
     <File name=".\WinerrorCommand.cs" subtype="Code" buildaction="Compile" dependson="" data="" />\r
     <File name=".\SvnCommand.cs" subtype="Code" buildaction="Compile" dependson="" data="" />\r
+    <File name=".\WmCommand.cs" subtype="Code" buildaction="Compile" dependson="" data="" />\r
+    <File name=".\MessageContext.cs" subtype="Code" buildaction="Compile" dependson="" data="" />\r
   </Contents>\r
   <References>\r
     <Reference type="Project" refto="CHMLibrary" localcopy="True" />\r
index aede24d..1236998 100644 (file)
@@ -15,16 +15,18 @@ namespace TechBot.Library
                private string ntstatusXml;\r
                private string winerrorXml;\r
                private string hresultXml;\r
+               private string wmXml;\r
                private string svnCommand;\r
                private ArrayList commands = new ArrayList();\r
                \r
                public TechBotService(IServiceOutput serviceOutput,\r
                                      string chmPath,\r
-                                         string mainChm,\r
-                                         string ntstatusXml,\r
-                                         string winerrorXml,\r
-                                         string hresultXml,\r
-                                         string svnCommand)\r
+                                     string mainChm,\r
+                                     string ntstatusXml,\r
+                                     string winerrorXml,\r
+                                     string hresultXml,\r
+                                     string wmXml,\r
+                                     string svnCommand)\r
                {\r
                        this.serviceOutput = serviceOutput;\r
                        this.chmPath = chmPath;\r
@@ -32,6 +34,7 @@ namespace TechBot.Library
                        this.ntstatusXml = ntstatusXml;\r
                        this.winerrorXml = winerrorXml;\r
                        this.hresultXml = hresultXml;\r
+                       this.wmXml = wmXml;\r
                        this.svnCommand = svnCommand;\r
                }\r
                \r
@@ -48,6 +51,8 @@ namespace TechBot.Library
                                                         winerrorXml));\r
                        commands.Add(new HresultCommand(serviceOutput,\r
                                                        hresultXml));\r
+                       commands.Add(new WmCommand(serviceOutput,\r
+                                                  wmXml));\r
                        commands.Add(new SvnCommand(serviceOutput,\r
                                                    svnCommand));\r
                }\r
diff --git a/irc/TechBot/TechBot.Library/WmCommand.cs b/irc/TechBot/TechBot.Library/WmCommand.cs
new file mode 100644 (file)
index 0000000..0809c3e
--- /dev/null
@@ -0,0 +1,104 @@
+using System;\r
+using System.Xml;\r
+\r
+namespace TechBot.Library\r
+{\r
+       public class WmCommand : BaseCommand, ICommand\r
+       {\r
+               private IServiceOutput serviceOutput;\r
+               private string wmXml;\r
+               private XmlDocument wmXmlDocument;\r
+\r
+               public WmCommand(IServiceOutput serviceOutput,\r
+                                string wmXml)\r
+               {\r
+                       this.serviceOutput = serviceOutput;\r
+                       this.wmXml = wmXml;\r
+                       wmXmlDocument = new XmlDocument();\r
+                       wmXmlDocument.Load(wmXml);\r
+               }\r
+               \r
+               public bool CanHandle(string commandName)\r
+               {\r
+                       return CanHandle(commandName,\r
+                                        new string[] { "wm" });\r
+               }\r
+\r
+               public void Handle(MessageContext context,\r
+                                  string commandName,\r
+                                  string parameters)\r
+               {\r
+                       string wmText = parameters;\r
+                       if (wmText.Equals(String.Empty))\r
+                       {\r
+                               serviceOutput.WriteLine(context,\r
+                                                       "Please provide a valid window message value or name.");\r
+                               return;\r
+                       }\r
+\r
+                       NumberParser np = new NumberParser();\r
+                       long wm = np.Parse(wmText);\r
+                       string output;\r
+                       if (np.Error)\r
+                       {\r
+                               // Assume "!wm <name>" form.\r
+                               output = GetWmNumber(wmText);\r
+                       }\r
+                       else\r
+                       {\r
+                               output = GetWmDescription(wm);\r
+                       }\r
+\r
+                       if (output != null)\r
+                       {\r
+                               serviceOutput.WriteLine(context,\r
+                                                       String.Format("{0} is {1}.",\r
+                                                                     wmText,\r
+                                                                     output));\r
+                       }\r
+                       else\r
+                       {\r
+                               serviceOutput.WriteLine(context,\r
+                                                       String.Format("I don't know about window message {0}.",\r
+                                                                     wmText));\r
+                       }\r
+               }\r
+               \r
+               public string Help()\r
+               {\r
+                       return "!wm <value> or !wm <name>";\r
+               }\r
+               \r
+               private string GetWmDescription(long wm)\r
+               {\r
+                       XmlElement root = wmXmlDocument.DocumentElement;\r
+                       XmlNode node = root.SelectSingleNode(String.Format("WindowMessage[@value='{0}']",\r
+                                                                          wm));\r
+                       if (node != null)\r
+                       {\r
+                               XmlAttribute text = node.Attributes["text"];\r
+                               if (text == null)\r
+                                       throw new Exception("Node has no text attribute.");\r
+                               return text.Value;\r
+                       }\r
+                       else\r
+                               return null;\r
+               }\r
+               \r
+               private string GetWmNumber(string wmName)\r
+               {\r
+                       XmlElement root = wmXmlDocument.DocumentElement;\r
+                       XmlNode node = root.SelectSingleNode(String.Format("WindowMessage[@text='{0}']",\r
+                                                                          wmName));\r
+                       if (node != null)\r
+                       {\r
+                               XmlAttribute value = node.Attributes["value"];\r
+                               if (value == null)\r
+                                       throw new Exception("Node has no value attribute.");\r
+                               return value.Value;\r
+                       }\r
+                       else\r
+                               return null;\r
+               }\r
+       }\r
+}\r
index f7fa9ac..03b57ba 100644 (file)
@@ -10,6 +10,7 @@
                <add key="NtstatusXml" value="C:\IRC\TechBot\ntstatus.xml" />\r
                <add key="WinerrorXml" value="C:\IRC\TechBot\winerror.xml" />\r
                <add key="HresultXml" value="C:\IRC\TechBot\hresult.xml" />\r
+               <add key="WmXml" value="C:\IRC\TechBot\wm.xml" />\r
                <add key="SvnCommand" value="svn co svn://svn.reactos.com/trunk/reactos" />\r
        </appSettings>\r
 </configuration>\r
index 728eb95..5a61219 100644 (file)
@@ -15,6 +15,7 @@ namespace TechBot
                private string MainChm;\r
                private string NtstatusXml;\r
                private string HresultXml;\r
+               private string WmXml;\r
                private string WinerrorXml;\r
                private string SvnCommand;\r
                private EventLog eventLog;\r
@@ -34,6 +35,7 @@ namespace TechBot
                        MainChm = ConfigurationSettings.AppSettings["MainChm"];\r
                        NtstatusXml = ConfigurationSettings.AppSettings["NtstatusXml"];\r
                        HresultXml = ConfigurationSettings.AppSettings["HresultXml"];\r
+                       WmXml = ConfigurationSettings.AppSettings["WmXml"];\r
                        WinerrorXml = ConfigurationSettings.AppSettings["WinerrorXml"];\r
                        SvnCommand = ConfigurationSettings.AppSettings["SvnCommand"];\r
                }\r
@@ -52,6 +54,7 @@ namespace TechBot
                                                               NtstatusXml,\r
                                                               WinerrorXml,\r
                                                               HresultXml,\r
+                                                              WmXml,\r
                                                               SvnCommand);\r
                        ircService.Run();\r
                }\r