diff options
Diffstat (limited to 'dspcontrol')
31 files changed, 3485 insertions, 0 deletions
diff --git a/dspcontrol/BETA b/dspcontrol/BETA new file mode 100644 index 0000000..ed24b78 --- /dev/null +++ b/dspcontrol/BETA @@ -0,0 +1 @@ +DspControl_v.0.1.1.30
\ No newline at end of file diff --git a/dspcontrol/CHANGELOG.txt b/dspcontrol/CHANGELOG.txt new file mode 100644 index 0000000..b87620d --- /dev/null +++ b/dspcontrol/CHANGELOG.txt @@ -0,0 +1,159 @@ +///////////////////////////////////////////////////////////////////
+// Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+// https://opensvn.csie.org/traccgi/DspControl/
+// Copyright © 2006-2007 A. Chilaru (FlexLabs Inc. <flexlabs@gmail.com>)
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+///////////////////////////////////////////////////////////////////
+
+ [*] Feature/code/some other change
+ [!] Bugfix
+ [+] New feature
+ [-] Feature remove
+ [c] Comment
+
+0.1.1.30: 2007-07-20
+ [*] Moved to new host (thanks to cris)
+
+0.1.1.29: 2007-01-10
+ [!] Fixed plugin name in IcoLib
+ [*] Minor code cleaning
+ [*] Rewritten the message function
+
+0.1.1.28: 2006-11-27
+ [!] Fixed an old ghost bug
+ [+] Disable plugin for contacts not on list (Unknown contacts)
+
+0.1.1.27: 2006-11-27
+ [*] Fully rewritten Unicode engine.
+ [+] MetaContacts support. Mainly for clist_modern, but also works good in others
+ [+] Now you can show/hide hidden contacts from list
+ [*] Minor changes
+
+0.1.1.26: 2006-11-26
+ [!] Generic bug with betas
+
+0.1.1.25: 2006-11-25
+ [*] Had to specifically show the path to IcoLib
+
+0.1.1.24: 2006-11-25
+ [*] Finally a new icon instead of the Miranda "message" one. Thanks to Faith Healer
+ [+] IcoLib support
+ [*] Small change in localisation strings
+ [!] Fixed a stack overflow error
+
+0.1.1.23: 2006-11-22
+ [!] Incorrect URL's for Miranda archive downloads
+
+0.1.1.22: 2006-11-22
+ [!] Fixed a bug when updater messed up with the options
+ [!] Updater won't download the zip.. Changed to 2 dll's in betas.
+
+0.1.1.21: 2006-11-22
+ [*] Changed plugin name for versionInfo (Unicode or ANSI)
+
+0.1.1.20: 2006-11-22
+ [+] Separated Unicode code from ANSI. Now two separate dll's
+ [+] Full unicode support (Thanks to ghazan)
+ [!] With unicode enabled, localisation problems fixed!
+
+0.1.1.19 beta: 2006-11-22
+ [*] Standartized some text fields in options dialog
+ (stuff like Not available became NA. Good for language packs)
+
+0.1.1.18 beta: 2006-11-21
+ [*] Major code cleaning
+ [*] Protocol ignore now uses protocol info. No need to update manually
+ [!] Minor memory and stack fixes
+ [*] Lots of Code comments. Now easy to understand for beginners even. Using "miranda style" includes unlike local definitions
+ [*] Now contact triggers are enabled by default
+
+0.1.1.17 dev: 2006-11-21
+ [+] Message functions now reads contact triggers.
+ [*] Contact trigger finished. Beta release
+
+0.1.1.16 dev: 2006-11-20
+ [*] Changed hooked function definitions to C style. Parameters accessible now
+ [*] Miranda internal function calls now done through subfunctions. Now using invoke
+ [*] Code optimized for debugging. Function definitions for ollyDbg in .\common.arg available
+ [!] Possible memory leak fixed
+
+0.1.1.15 dev: 2006-11-20
+ [+] Embedded CListControl in options (Thanks to FYR)
+ [+] Load options into CListControl (Not using them yet)
+ [*] Adjusted the source for debugging. Now function names visible (function definitions)
+ [c] Currently using "Mesage" icon from miranda. Accepting new ideas ;)
+
+0.1.1.14: 2006-11-17
+ [+] Localisation support. See TRANSLATION.txt
+
+0.1.1.13: 2006-11-16
+ [*] Disabled second tab for stable version
+
+0.1.1.12 beta: 2006-11-9
+ [!] Fixed bugs in tabbed interface. Should be working now
+
+0.1.1.11 beta: 2006-11-8
+ [!] Now the time selectors enable the Apply button
+ [*] Tabbed interface developed.. But still buggy, so it's a NON_RECOMMENDED update
+
+0.1.1.10 beta: 2006-11-7
+ [+] Added hardcoded protocol ignore list (non protocols as mRadio)
+ [!] Fixed an error with saving options if non-protocols exist
+
+0.1.1.9 beta: 2006-11-7
+ [+] Tabbed interface (for .20 release)
+ [+] Time trigger
+ [*] A bit of code cleaning
+
+0.1.1.8: 2006-11-5
+ [+] Add Event type trigger (Message, Contact, File)
+ [*] Redesigned the options dialog
+ [!] Small fix in options dialog
+
+0.1.1.7: 2006-11-4
+ [+] Updater support for beta versions
+
+0.1.1.6: 2006-11-4
+ [+] Protocol filter finished
+ [!] Minor fixes
+
+0.1.1.5: 2006-11-2
+ [*] Disable the status checkboxes when "Enable plugin" is unchecked
+
+0.1.1.4: 2006-11-2
+ [!] Infinite loop created on some of the systems (fixed)
+
+0.1.1.3: 2006-11-2
+ [!] Bug in source turning off the screen on every message (fixed)
+
+0.1.1.2: 2006-11-2
+ [!] Saved the option even if Cancel pressed (fixed)
+ [*] Version value updated
+ [*] Updated Homepage value
+
+0.1.1.1: 2006-11-2
+ [+] Status mode filters (e.g. turn screen on only if occupied)
+
+0.1.0.2: 2006-11-1
+ [*] Typo removed
+
+0.1.0.1: 2006-11-1
+ [*] Changed mouse move function to API call
+
+0.1.0.0: 2006-11-1
+ --- Initial Release
+
+Copyright © 2006-2007 A. Chilaru (FlexLabs Inc. <flexlabs@gmail.com>)
\ No newline at end of file diff --git a/dspcontrol/LICENSE.txt b/dspcontrol/LICENSE.txt new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/dspcontrol/LICENSE.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/dspcontrol/README.txt b/dspcontrol/README.txt new file mode 100644 index 0000000..3c46416 --- /dev/null +++ b/dspcontrol/README.txt @@ -0,0 +1,76 @@ +///////////////////////////////////////////////////////////////////
+// Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+// https://opensvn.csie.org/traccgi/DspControl/
+// Copyright © 2006-2007 A. Chilaru (FlexLabs Inc. <flexlabs@gmail.com>)
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+///////////////////////////////////////////////////////////////////
+
+1. About
+--------
+The Display Control plugin allows you to know if a message arrived, even if your computer entered the low-consumption mode, and turned off the screen by just turning the screen back on.
+
+2. Features
+-----------
+ - Turning on the screen when a message is received
+ - Status mode trigger (e.g. turn on only if in away mode)
+ - Protocol trigger (e.e turning on only on messages from certain protocols)
+ - Message type trigger
+ - Time trigger
+ - Individual contact trigger
+ - Meta contacts support
+
+4. Todo
+-------
+ - Move everything to new host (and finish this README)
+
+5. History
+----------
+ See CHANGELOG.txt
+
+6. Known issues
+---------------
+ None known
+
+7. Latest development version:
+------------------------------
+ You can download the latest developement version from here:
+ http://opensvn.csie.org/DspControl/bin/DspControl.zip
+ Alternatively, you can download the latest source code on the project homepage:
+ http://svn.mirandaim.ru/mainrepo/dspcontrol
+
+8. Bugs
+-------
+ - Before sending reports check if bugs are still present in the latest developement version
+ - and that such a bug hasn't been submitted earlier:
+ https://opensvn.csie.org/traccgi/DspControl/report/3
+ - [English or Russian] You can send bug reports on the project homepage:
+ https://opensvn.csie.org/traccgi/DspControl/newticket
+
+9. Discussion & Feature Requests
+--------------------------------
+ - Request features, discuss plugin at Miranda IM forum thread page:
+ http://forums.miranda-im.org/showthread.php?p=94775
+ - Or you can e-mail me them..
+ - Feature requests can also be submitted ot the project homepage:
+ https://opensvn.csie.org/traccgi/DspControl/newticket
+
+10. Localisation
+--------------------------------
+ - Available since v.0.1.1.14
+ - Unicode support since v.0.1.1.20
+ - See TRANSLATION.txt for details
+
+Copyright © 2006-2007 A. Chilaru (FlexLabs Inc. <flexlabs@gmail.com>)
\ No newline at end of file diff --git a/dspcontrol/TRANSLATION.txt b/dspcontrol/TRANSLATION.txt new file mode 100644 index 0000000..4c3986f --- /dev/null +++ b/dspcontrol/TRANSLATION.txt @@ -0,0 +1,96 @@ +///////////////////////////////////////////////////////////////////
+// Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+// https://opensvn.csie.org/traccgi/DspControl/
+// Copyright © 2006-2007 A. Chilaru (FlexLabs Inc. <flexlabs@gmail.com>)
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+///////////////////////////////////////////////////////////////////
+
+This is a list of all the text lines that can be translated. I've already given them a value, so that you can see how to use them, if you don't know. Add these lines to your langpack file, and restart miranda to apply these settings.
+
+[Display Control]
+_Display Control
+
+[Triggers]
+_Triggers
+[Display Control enabled]
+_Display Control enabled
+
+[Status trigger]
+_Status trigger
+[Online]
+_Online
+[Away]
+_Away
+[DND]
+_DND
+[NA]
+_NA
+[Occupied]
+_Occupied
+[Free for chat]
+_Free for chat
+[Invisible]
+_Invisible
+[On the phone]
+_On the phone
+[Out to lunch]
+_Out to lunch
+
+[Event type trigger]
+_Event type trigger
+[Incoming message]
+_Incoming message
+[Incoming URL]
+_Incoming URL
+[Incoming contacts]
+_Incoming contacts
+[You Were Added Message]
+_You Were Added Message
+[Authorisation Request]
+_Authorisation Request
+[Incoming file]
+_Incoming file
+
+[Time trigger]
+_Time trigger
+[Enable plugin:]
+_Enable plugin:
+[From]
+_From
+[to]
+_to
+
+[Protocol trigger]
+_Protocol trigger
+
+[Select when do you want the plugin to turn on your screen. Treat the following options as event triggers. Select only the options that you want to trigger the screen to turn on.]
+_Long line 1
+[Enter the range in time, when you want your screen turning on. Note that starting time can be higher then the ending time.]
+_Long line 2
+
+[Contacts]
+_Contacts
+[** All contacts **]
+_** All contacts **
+[** Unknown contacts **]
+_** Unknown contacts **
+[Show hidden]
+_Show hidden
+[To enable or disable the plugin for an individual contact, click on the icon to the right of it. Clicking on the group's icon, enables/disables the plugin for all the contacts in that group.]
+_Long line 3
+
+[Enabled]
+_Enabled
\ No newline at end of file diff --git a/dspcontrol/bin/ANSI/DspControl.dll b/dspcontrol/bin/ANSI/DspControl.dll Binary files differnew file mode 100644 index 0000000..2eae98a --- /dev/null +++ b/dspcontrol/bin/ANSI/DspControl.dll diff --git a/dspcontrol/bin/ANSI/DspControl_d.dll b/dspcontrol/bin/ANSI/DspControl_d.dll Binary files differnew file mode 100644 index 0000000..9b40e2d --- /dev/null +++ b/dspcontrol/bin/ANSI/DspControl_d.dll diff --git a/dspcontrol/bin/Unicode/DspControl.dll b/dspcontrol/bin/Unicode/DspControl.dll Binary files differnew file mode 100644 index 0000000..23c7143 --- /dev/null +++ b/dspcontrol/bin/Unicode/DspControl.dll diff --git a/dspcontrol/bin/Unicode/DspControl_d.dll b/dspcontrol/bin/Unicode/DspControl_d.dll Binary files differnew file mode 100644 index 0000000..df82830 --- /dev/null +++ b/dspcontrol/bin/Unicode/DspControl_d.dll diff --git a/dspcontrol/common.arg b/dspcontrol/common.arg new file mode 100644 index 0000000..c32339f --- /dev/null +++ b/dspcontrol/common.arg @@ -0,0 +1,63 @@ +
+ STDFUNC _SetAllChildIcons@16
+ "hCList" HWND
+ "hFirstItem" HANDLE
+ "iColumn" INT
+ "iImage" INT
+ END
+
+ STDFUNC _SetListGroupIcons@16
+ "hCList" HWND
+ "hFirstItem" HANDLE
+ "hParentItem" HMODULE
+ "groupChildCount" INT
+ END
+
+ STDFUNC _SetAllContactIcons@4
+ "hCList" HWND
+ END
+
+ STDFUNC _ResetListOptions@4
+ "hCList" HWND
+ END
+
+ STDFUNC _MetaConClick@12
+ "hContact" HWND
+ "iCount" INT
+ "iValue" INT
+ END
+
+ STDFUNC _MetaSubClick@4
+ "hParent" HWND
+ END
+
+ STDFUNC _CallService@12
+ "lpServiceName" ASCII
+ "wParam" HEX
+ "lParam" PTR
+ END
+
+ STDFUNC _ServiceExists@4
+ "lpServiceName" ASCII
+ END
+
+ STDFUNC _HookEvent@8
+ "lpHookNam" ASCII
+ "lpFunction" PTR
+ END
+
+ STDFUNC _UnhookEvent@4
+ "HookHandle" HANDLE
+ END
+
+ STDFUNC _Translate@4
+ "lpStr" ASCII
+ END
+
+ STDFUNC _Error@4
+ "lpStr" ASCII
+ END
+
+ STDFUNC _IgnoreCheck@12
+ "pStri" ASCII
+ END
diff --git a/dspcontrol/inc/IcoLib.inc b/dspcontrol/inc/IcoLib.inc new file mode 100644 index 0000000..2cf2b25 --- /dev/null +++ b/dspcontrol/inc/IcoLib.inc @@ -0,0 +1,54 @@ +;Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+;Copyright (C) 2006 A. Chilaru
+;
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+;
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;GNU General Public License for more details.
+;
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+SKINICONDESC struct
+ cbSize dd ?
+ pszSection dd ?;section name used to group icons
+ pszDescription dd ?;description for options dialog
+ pszName dd ?;name to refer to icon when playing and in db
+ ;this name is miranda-wide. so use prefixes of your plugin
+ ;e.g: "isee_connect", "clist_delete", etc
+ pszDefaultFile dd ?;default icon file to use
+ iDefaultIndex dd ?
+SKINICONDESC ends
+
+SKINICONDESC2 struct
+ cbSize dd ?
+ pszSection dd ?;section name used to group icons
+ pszDescription dd ?;description for options dialog
+ pszName dd ?;name to refer to icon when playing and in db
+ pszDefaultFile dd ?
+ iDefaultIndex dd ?
+ hDefaultIcon dd ?
+SKINICONDESC2 ends
+
+;
+; Add a icon into options UI
+;
+; wParam = (WPARAM)0
+; lParam = (LPARAM)(SKINICONDESC*)sid;
+;
+;MS_SKIN2_ADDICON db "Skin2/Icons/AddIcon",0
+;
+; Retrieve HICON with name specified in lParam
+; Returned HICON SHOULDN'T be destroyed, it managed by IcoLib
+;
+;MS_SKIN2_GETICON "Skin2/Icons/GetIcon",0
+;
+; Icons change notification
+;
+;ME_SKIN2_ICONSCHANGED "Skin2/IconsChanged",0
\ No newline at end of file diff --git a/dspcontrol/inc/m_clc.inc b/dspcontrol/inc/m_clc.inc new file mode 100644 index 0000000..5882c69 --- /dev/null +++ b/dspcontrol/inc/m_clc.inc @@ -0,0 +1,206 @@ +;Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+;Copyright © 2006-2007 A. Chilaru
+;
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+;
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;GNU General Public License for more details.
+;
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+CLS_MANUALUPDATE equ 0001h ;todo
+CLS_SHOWHIDDEN equ 0002h
+CLS_HIDEOFFLINE equ 0004h ;hides all offline users
+CLS_CHECKBOXES equ 0008h
+CLS_MULTICOLUMN equ 0010h ;not true multi-column, just for ignore/vis options
+CLS_HIDEEMPTYGROUPS equ 0020h ;note: this flag will be spontaneously removed if the 'new subgroup' menu item is clicked, for obvious reasons
+CLS_USEGROUPS equ 0040h
+CLS_NOHIDEOFFLINE equ 0080h ;overrides CLS_HIDEOFFLINE and the per-group hideoffline setting
+CLS_GREYALTERNATE equ 0100h ;make every other line slightly grey
+CLS_GROUPCHECKBOXES equ 0200h ;put checkboxes on groups too (managed by CLC)
+CLS_CONTACTLIST equ 0400h ;this control will be the main contact list (v. 0.3.4.3+ 2004/11/02)
+
+CLS_EX_DISABLEDRAGDROP equ 00000001h
+CLS_EX_EDITLABELS equ 00000002h
+CLS_EX_SHOWSELALWAYS equ 00000004h
+CLS_EX_TRACKSELECT equ 00000008h
+CLS_EX_SHOWGROUPCOUNTS equ 00000010h
+CLS_EX_DIVIDERONOFF equ 00000020h
+CLS_EX_HIDECOUNTSWHENEMPTY equ 00000040h
+CLS_EX_NOTRANSLUCENTSEL equ 00000080h
+CLS_EX_LINEWITHGROUPS equ 00000100h
+CLS_EX_QUICKSEARCHVISONLY equ 00000200h
+CLS_EX_SORTGROUPSALPHA equ 00000400h
+CLS_EX_NOSMOOTHSCROLLING equ 00000800h
+
+
+CLM_FIRST equ 1000h ;this is the same as LVM_FIRST
+CLM_LAST equ 1100h
+
+;messages, compare with equivalent TVM_s in the MSDN
+CLM_ADDCONTACT equ (CLM_FIRST+0) ;wParam=hContact
+CLM_ADDGROUP equ (CLM_FIRST+1) ;wParam=hGroup
+CLM_AUTOREBUILD equ (CLM_FIRST+2)
+CLM_DELETEITEM equ (CLM_FIRST+3) ;wParam=hItem
+CLM_EDITLABEL equ (CLM_FIRST+4) ;wParam=hItem
+CLM_ENDEDITLABELNOW equ (CLM_FIRST+5) ;wParam=cancel, 0 to save
+CLM_ENSUREVISIBLE equ (CLM_FIRST+6) ;wParam=hItem, lParam=partialOk
+CLE_TOGGLE equ -1
+CLE_COLLAPSE equ 0
+CLE_EXPAND equ 1
+CLE_INVALID equ FFFFh
+CLM_EXPAND equ (CLM_FIRST+7) ;wParam=hItem, lParam=CLE_
+CLM_FINDCONTACT equ (CLM_FIRST+8) ;wParam=hContact, returns an hItem
+CLM_FINDGROUP equ (CLM_FIRST+9) ;wParam=hGroup, returns an hItem
+CLM_GETBKCOLOR equ (CLM_FIRST+10) ;returns a COLORREF
+CLM_GETCHECKMARK equ (CLM_FIRST+11) ;wParam=hItem, returns 1 or 0
+CLM_GETCOUNT equ (CLM_FIRST+12) ;returns the total number of items
+CLM_GETEDITCONTROL equ (CLM_FIRST+13) ;returns the HWND, or NULL
+CLM_GETEXPAND equ (CLM_FIRST+14) ;wParam=hItem, returns a CLE_, CLE_INVALID if not a group
+CLM_GETEXTRACOLUMNS equ (CLM_FIRST+15) ;returns number of extra columns
+CLM_GETEXTRAIMAGE equ (CLM_FIRST+16) ;wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),0), returns iImage or 0xFF
+CLM_GETEXTRAIMAGELIST equ (CLM_FIRST+17) ;returns HIMAGELIST
+CLM_GETFONT equ (CLM_FIRST+18) ;wParam=fontId, see clm_setfont. returns hFont.
+CLM_GETINDENT equ (CLM_FIRST+19) ;wParam=new group indent
+CLM_GETISEARCHSTRING equ (CLM_FIRST+20) ;lParam=(char*)pszStr, max 120 bytes, returns number of chars in string
+CLM_GETITEMTEXT equ (CLM_FIRST+21) ;wParam=hItem, lParam=(char*)pszStr, max 120 bytes
+CLM_GETSCROLLTIME equ (CLM_FIRST+22) ;returns time in ms
+CLM_GETSELECTION equ (CLM_FIRST+23) ;returns hItem
+CLCHT_ABOVE equ 0001h ;above client area
+CLCHT_BELOW equ 0002h ;below client area
+CLCHT_TOLEFT equ 0004h ;left of client area
+CLCHT_TORIGHT equ 0008h ;right of client area
+CLCHT_NOWHERE equ 0010h ;in client area, not on an item
+CLCHT_ONITEMICON equ 0020h
+CLCHT_ONITEMCHECK equ 0040h
+CLCHT_ONITEMLABEL equ 0080h
+CLCHT_ONITEMINDENT equ 0100h ;to the left of an item icon
+CLCHT_ONITEMEXTRA equ 0200h ;on an extra icon, HIBYTE(HIWORD()) says which
+CLCHT_ONITEM equ 03E0h
+CLCHT_INLEFTMARGIN equ 0400h
+CLCHT_BELOWITEMS equ 0800h ;in client area but below last item
+CLM_HITTEST equ (CLM_FIRST+25) ;lParam=MAKELPARAM(x,y) (relative to control), wParam=(PDWORD)&hitTest (see encoding of HitTest() in clc.h, can be NULL) returns hItem or NULL
+CLM_SELECTITEM equ (CLM_FIRST+26) ;wParam=hItem
+CLB_TOPLEFT equ 0
+CLB_STRETCHV equ 1
+CLB_STRETCHH equ 2 ;and tile vertically
+CLB_STRETCH equ 3
+CLBM_TYPE equ 00FFh
+CLBF_TILEH equ 1000h
+CLBF_TILEV equ 2000h
+CLBF_PROPORTIONAL equ 4000h
+CLBF_SCROLL equ 8000h
+CLM_SETBKBITMAP equ (CLM_FIRST+27) ;wParam=mode, lParam=hBitmap (don't delete it), NULL for none
+CLM_SETBKCOLOR equ (CLM_FIRST+28) ;wParam=a COLORREF, default is GetSysColor(COLOR_3DFACE)
+CLM_SETCHECKMARK equ (CLM_FIRST+29) ;wParam=hItem, lParam=1 or 0
+CLM_SETEXTRACOLUMNS equ (CLM_FIRST+30) ;wParam=number of extra columns (zero to MAXEXTRACOLUMNS from clc.h, currently 16)
+CLM_SETEXTRAIMAGE equ (CLM_FIRST+31) ;wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),iImage). iImage=0xFF is a blank
+CLM_SETEXTRAIMAGELIST equ (CLM_FIRST+32) ;lParam=HIMAGELIST
+
+FONTID_CONTACTS equ 0
+FONTID_INVIS equ 1
+FONTID_OFFLINE equ 2
+FONTID_NOTONLIST equ 3
+FONTID_GROUPS equ 4
+FONTID_GROUPCOUNTS equ 5
+FONTID_DIVIDER equ 6
+FONTID_OFFINVIS equ 7
+FONTID_STATUSMSG equ 8
+FONTID_GROUPSCLOSED equ 9
+FONTID_CONTACTSHOVER equ 10
+FONTID_MAX equ 18
+
+CLM_SETFONT equ (CLM_FIRST+33) ;wParam=hFont, lParam=MAKELPARAM(fRedraw,fontId)
+CLM_SETINDENT equ (CLM_FIRST+34) ;wParam=new indent, default is 3 pixels
+CLM_SETITEMTEXT equ (CLM_FIRST+35) ;wParam=hItem, lParam=(char*)pszNewText
+CLM_SETSCROLLTIME equ (CLM_FIRST+36) ;wParam=time in ms, default 200
+
+CLM_SETHIDEEMPTYGROUPS equ (CLM_FIRST+38) ;wParam=TRUE/FALSE
+GREYF_UNFOCUS equ 80000000h
+MODEF_OFFLINE equ 40000000h
+
+;and use the PF2_ #defines from m_protosvc.h
+CLM_SETGREYOUTFLAGS equ (CLM_FIRST+39) ;wParam=new flags
+CLM_GETHIDEOFFLINEROOT equ (CLM_FIRST+40) ;returns TRUE/FALSE
+CLM_SETHIDEOFFLINEROOT equ (CLM_FIRST+41) ;wParam=TRUE/FALSE
+CLM_SETUSEGROUPS equ (CLM_FIRST+42) ;wParam=TRUE/FALSE
+CLM_SETOFFLINEMODES equ (CLM_FIRST+43) ;for 'hide offline', wParam=PF2_ flags and MODEF_OFFLINE
+CLM_GETEXSTYLE equ (CLM_FIRST+44) ;returns CLS_EX_ flags
+CLM_SETEXSTYLE equ (CLM_FIRST+45) ;wParam=CLS_EX_ flags
+CLM_GETLEFTMARGIN equ (CLM_FIRST+46) ;returns count of pixels
+CLM_SETLEFTMARGIN equ (CLM_FIRST+47) ;wParam=pixels
+
+CLCINFOITEM struct
+ cbSize dd ?
+ pszText dd ?
+ hParentGroup dd ?
+ flags dd ?
+ hIcon dd ?
+CLCINFOITEM ends
+
+CLCIIF_BELOWGROUPS equ 1 ;put it between groups and contacts, default is at top
+CLCIIF_BELOWCONTACTS equ 2 ;put it at the bottom
+CLCIIF_CHECKBOX equ 40h ;give this item a check box
+CLCIIF_GROUPFONT equ 80h ;draw the item using FONTID_GROUPS
+
+CLM_ADDINFOITEMA equ (CLM_FIRST+48) ;lParam=&cii, returns hItem
+CLM_ADDINFOITEMW equ (CLM_FIRST+53) ;lParam=&cii, returns hItem
+IFDEF _UNICODE
+ CLM_ADDINFOITEM equ CLM_ADDINFOITEMW
+ELSE
+ CLM_ADDINFOITEM equ CLM_ADDINFOITEMA
+ENDIF
+
+CLCIT_INVALID equ -1
+CLCIT_GROUP equ 0
+CLCIT_CONTACT equ 1
+CLCIT_DIVIDER equ 2
+CLCIT_INFO equ 3
+CLM_GETITEMTYPE equ (CLM_FIRST+49) ;wParam=hItem, returns a CLCIT_
+CLGN_ROOT equ 0
+CLGN_CHILD equ 1
+CLGN_PARENT equ 2
+CLGN_NEXT equ 3
+CLGN_PREVIOUS equ 4
+CLGN_NEXTCONTACT equ 5
+CLGN_PREVIOUSCONTACT equ 6
+CLGN_NEXTGROUP equ 7
+CLGN_PREVIOUSGROUP equ 8
+CLM_GETNEXTITEM equ (CLM_FIRST+50) ;wParam=flag, lParam=hItem, returns an hItem
+CLM_GETTEXTCOLOR equ (CLM_FIRST+51) ;wParam=FONTID_, returns COLORREF
+CLM_SETTEXTCOLOR equ (CLM_FIRST+52) ;wParam=FONTID_, lParam=COLORREF
+
+;notifications (most are omitted because the control processes everything)
+CLNF_ISGROUP equ 1
+CLNF_ISINFO equ 2
+
+NMCLISTCONTROL struct
+ hdr NMHDR <>
+ hItem dd ?
+ action dd ?
+ iColumn dd ? ;-1 if not on an extra column
+ flags dd ?
+ pt POINT <>
+NMCLISTCONTROL ends
+
+CLN_FIRST equ (0-100)
+CLN_EXPANDED equ (CLN_FIRST-0) ;hItem=hGroup, action=CLE_*
+CLN_LISTREBUILT equ (CLN_FIRST-1)
+CLN_ITEMCHECKED equ (CLN_FIRST-2) ;todo //hItem,action,flags valid
+CLN_DRAGGING equ (CLN_FIRST-3) ;hItem,pt,flags valid. only sent when cursor outside window, return nonzero if processed
+CLN_DROPPED equ (CLN_FIRST-4) ;hItem,pt,flags valid. only sent when cursor outside window, return nonzero if processed
+CLN_LISTSIZECHANGE equ (CLN_FIRST-5) ;pt.y valid. the vertical height of the visible items in the list has changed.
+CLN_OPTIONSCHANGED equ (CLN_FIRST-6) ;nothing valid. If you set some extended options they have been overwritten and should be re-set
+CLN_DRAGSTOP equ (CLN_FIRST-7) ;hItem,flags valid. sent when cursor goes back in to the window having been outside, return nonzero if processed
+CLN_NEWCONTACT equ (CLN_FIRST-8) ;hItem,flags valid. sent when a new contact is added without a full list rebuild
+CLN_CONTACTMOVED equ (CLN_FIRST-9) ;hItem,flags valid. sent when contact is moved without a full list rebuild
+CLN_CHECKCHANGED equ (CLN_FIRST-10) ;hItem,flags valid. sent when any check mark is changed, but only for one change if there are many
+;NM_CLICK //hItem,iColumn,pt,flags valid
+;NM_KEYDOWN //NMKEY structure, only sent when key is not already processed, return nonzero to prevent further processing
\ No newline at end of file diff --git a/dspcontrol/inc/m_clist.inc b/dspcontrol/inc/m_clist.inc new file mode 100644 index 0000000..491e6dc --- /dev/null +++ b/dspcontrol/inc/m_clist.inc @@ -0,0 +1,36 @@ +;Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+;Copyright © 2006-2007 A. Chilaru
+;
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+;
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;GNU General Public License for more details.
+;
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+CLISTMENUITEM struc
+ cbSize dd ?
+ UNION NONUNIQUE
+ pszName dd ?
+ ptszName dd ?
+ ENDS
+ flags dd ?
+ position dd ?
+ hIcon HICON ?
+ pszService dd ?
+ ;UNION NONUNIQUE
+ pszPopupName dd ?
+ ; ptszPopupName dd ?
+ ; ENDS
+ popupPosition dd ?
+ hotKey dd ?
+ pszContactOwner dd ?
+CLISTMENUITEM ends
+
diff --git a/dspcontrol/inc/m_database.inc b/dspcontrol/inc/m_database.inc new file mode 100644 index 0000000..5d0f76e --- /dev/null +++ b/dspcontrol/inc/m_database.inc @@ -0,0 +1,63 @@ +;Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+;Copyright © 2006-2007 A. Chilaru
+;
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+;
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;GNU General Public License for more details.
+;
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+DBCONTACTGETSETTING struct
+ szModule dd ?
+ szSetting dd ?
+ pValue dd ?
+DBCONTACTGETSETTING ends
+
+DBCONTACTWRITESETTING struct
+ szModule dd ?
+ szSetting dd ?
+ VAR1 dd ?
+ VAR2 dd ?
+ VAR3 dd ?
+DBCONTACTWRITESETTING ends
+
+DBVT_DELETED equ 0 ;this setting just got deleted, no other values are valid
+DBVT_BYTE equ 1 ;bVal and cVal are valid
+DBVT_WORD equ 2 ;wVal and sVal are valid
+DBVT_DWORD equ 4 ;dVal and lVal are valid
+DBVT_ASCIIZ equ 255 ;pszVal is valid
+DBVT_BLOB equ 254 ;cpbVal and pbVal are valid
+DBVT_UTF8 equ 253 ;pszVal is valid
+DBVT_WCHAR equ 252 ;pszVal is valid
+DBVTF_VARIABLELENGTH equ 80h
+
+DBVARIANT struct
+ VAR1 dd ?
+ VAR2 dd ?
+ VAR3 dd ?
+DBVARIANT ends
+
+DBEVENTINFO struct
+ cbSize dd ?
+ szModule dd ?
+ timestamp dd ?
+ flags dd ?
+ eventType dd ?
+ cbBlob dd ?
+ pBlob dd ?
+DBEVENTINFO ends
+
+EVENTTYPE_MESSAGE equ 0
+EVENTTYPE_URL equ 1
+EVENTTYPE_CONTACTS equ 2 ;v0.1.2.2+
+EVENTTYPE_ADDED equ 1000 ;v0.1.1.0+: these used to be module-
+EVENTTYPE_AUTHREQUEST equ 1001 ;specific codes, hence the module-
+EVENTTYPE_FILE equ 1002 ;specific limit has been raised to 2000
\ No newline at end of file diff --git a/dspcontrol/inc/m_langpack.inc b/dspcontrol/inc/m_langpack.inc new file mode 100644 index 0000000..5e3cf5b --- /dev/null +++ b/dspcontrol/inc/m_langpack.inc @@ -0,0 +1,33 @@ +;Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+;Copyright © 2006-2007 A. Chilaru
+;
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+;
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;GNU General Public License for more details.
+;
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+IFDEF _UNICODE
+ LANG_UNICODE equ 1000h
+ELSE
+ LANG_UNICODE equ 0
+ENDIF
+
+LANGPACKTRANSLATEDIALOG struct
+ cbSize dd ?
+ flags dd ?
+ hwndDlg dd ?
+ ignoreControls dd ?
+LANGPACKTRANSLATEDIALOG ends
+
+LPTDF_NOIGNOREEDIT equ 1 ;translate all edit controls. By default
+ ;non-read-only edit controls are not translated
+LPTDF_NOTITLE equ 2 ;do not translate the title of the dialog
diff --git a/dspcontrol/inc/m_metacontacts.inc b/dspcontrol/inc/m_metacontacts.inc new file mode 100644 index 0000000..74e5029 --- /dev/null +++ b/dspcontrol/inc/m_metacontacts.inc @@ -0,0 +1,152 @@ +;Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+;Copyright © 2006-2007 A. Chilaru
+;
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+;
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;GNU General Public License for more details.
+;
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+;get the handle for a contact's parent metacontact
+;wParam=(HANDLE)hSubContact
+;lParam=0
+;returns a handle to the parent metacontact, or null if this contact is not a subcontact
+;MS_MC_GETMETACONTACT "MetaContacts/GetMeta"
+
+;gets the handle for the default contact
+;wParam=(HANDLE)hMetaContact
+;lParam=0
+;returns a handle to the default contact, or null on failure
+;MS_MC_GETDEFAULTCONTACT "MetaContacts/GetDefault"
+
+;gets the contact number for the default contact
+;wParam=(HANDLE)hMetaContact
+;lParam=0
+;returns a DWORD contact number, or -1 on failure
+;MS_MC_GETDEFAULTCONTACTNUM "MetaContacts/GetDefaultNum"
+
+;gets the handle for the 'most online' contact
+;wParam=(HANDLE)hMetaContact
+;lParam=0
+;returns a handle to the 'most online' contact
+;MS_MC_GETMOSTONLINECONTACT "MetaContacts/GetMostOnline"
+
+;gets the number of subcontacts for a metacontact
+;wParam=(HANDLE)hMetaContact
+;lParam=0
+;returns a DWORD representing the number of subcontacts for the given metacontact
+;MS_MC_GETNUMCONTACTS "MetaContacts/GetNumContacts"
+
+;gets the handle of a subcontact, using the subcontact's number
+;wParam=(HANDLE)hMetaContact
+;lParam=(DWORD)contact number
+;returns a handle to the specified subcontact
+;MS_MC_GETSUBCONTACT "MetaContacts/GetSubContact"
+
+;sets the default contact, using the subcontact's contact number
+;wParam=(HANDLE)hMetaContact
+;lParam=(DWORD)contact number
+;returns 0 on success
+;MS_MC_SETDEFAULTCONTACTNUM "MetaContacts/SetDefault"
+
+;sets the default contact, using the subcontact's handle
+;wParam=(HANDLE)hMetaContact
+;lParam=(HANDLE)hSubcontact
+;returns 0 on success
+;MS_MC_SETDEFAULTCONTACT "MetaContacts/SetDefaultByHandle"
+
+;forces the metacontact to send using a specific subcontact, using the subcontact's contact number
+;wParam=(HANDLE)hMetaContact
+;lParam=(DWORD)contact number
+;returns 0 on success
+;MS_MC_FORCESENDCONTACTNUM "MetaContacts/ForceSendContact"
+
+;forces the metacontact to send using a specific subcontact, using the subcontact's handle
+;wParam=(HANDLE)hMetaContact
+;lParam=(HANDLE)hSubcontact
+;returns 0 on success (will fail if 'force default' is in effect)
+;MS_MC_FORCESENDCONTACT "MetaContacts/ForceSendContactByHandle"
+
+;'unforces' the metacontact to send using a specific subcontact
+;wParam=(HANDLE)hMetaContact
+;lParam=0
+;returns 0 on success (will fail if 'force default' is in effect)
+;MS_MC_UNFORCESENDCONTACT "MetaContacts/UnforceSendContact"
+
+;'forces' or 'unforces' (i.e. toggles) the metacontact to send using it's default contact
+; overrides (and clears) 'force send' above, and will even force use of offline contacts
+; will send ME_MC_FORCESEND or ME_MC_UNFORCESEND event
+;wParam=(HANDLE)hMetaContact
+;lParam=0
+;returns 1(true) or 0(false) representing new state of 'force default'
+;MS_MC_FORCEDEFAULT "MetaContacts/ForceSendDefault"
+
+; method to get state of 'force' for a metacontact
+; wParam=(HANDLE)hMetaContact
+; lParam= (DWORD)&contact_number or NULL
+;
+; if lparam supplied, the contact_number of the contatct 'in force' will be copied to the address it points to,
+; or if none is in force, the value (DWORD)-1 will be copied
+; (v0.8.0.8+ returns 1 if 'force default' is true with *lParam == default contact number, else returns 0 with *lParam as above)
+;MS_MC_GETFORCESTATE "MetaContacts/GetForceState"
+
+; fired when a metacontact's default contact changes (fired upon creation of metacontact also, when default is initially set)
+; wParam=(HANDLE)hMetaContact
+; lParam=(HANDLE)hDefaultContact
+;ME_MC_DEFAULTTCHANGED "MetaContacts/DefaultChanged"
+
+; fired when a metacontact's subcontacts change (fired upon creation of metacontact, when contacts are added or removed, and when
+; contacts are reordered) - a signal to re-read metacontact data
+; wParam=(HANDLE)hMetaContact
+; lParam=0
+;ME_MC_SUBCONTACTSCHANGED "MetaContacts/SubcontactsChanged"
+
+; fired when a metacontact is forced to send using a specific subcontact
+; wParam=(HANDLE)hMetaContact
+; lParam=(HANDLE)hForceContact
+;ME_MC_FORCESEND "MetaContacts/ForceSend"
+
+; fired when a metacontact is 'unforced' to send using a specific subcontact
+; wParam=(HANDLE)hMetaContact
+; lParam=0
+;ME_MC_UNFORCESEND "MetaContacts/UnforceSend"
+
+; method to get protocol name - used to be sure you're dealing with a "real" metacontacts plugin :)
+; wParam=lParam=0
+;MS_MC_GETPROTOCOLNAME "MetaContacts/GetProtoName"
+
+
+; added 0.9.5.0 (22/3/05)
+; wParam=(HANDLE)hContact
+; lParam=0
+; convert a given contact into a metacontact
+;MS_MC_CONVERTTOMETA "MetaContacts/ConvertToMetacontact"
+
+; added 0.9.5.0 (22/3/05)
+; wParam=(HANDLE)hContact
+; lParam=(HANDLE)hMeta
+; add an existing contact to a metacontact
+;MS_MC_ADDTOMETA "MetaContacts/AddToMetacontact"
+
+; added 0.9.5.0 (22/3/05)
+; wParam=0
+; lParam=(HANDLE)hContact
+; remove a contact from a metacontact
+;MS_MC_REMOVEFROMMETA "MetaContacts/RemoveFromMetacontact"
+
+
+; added 0.9.13.2 (6/10/05)
+; wParam=(BOOL)disable
+; lParam=0
+; enable/disable the 'hidden group hack' - for clists that support subcontact hiding using 'IsSubcontact' setting
+; should be called once in the clist 'onmodulesloaded' event handler (which, since it's loaded after the db, will be called
+; before the metacontact onmodulesloaded handler where the subcontact hiding is usually done)
+;MS_MC_DISABLEHIDDENGROUP "MetaContacts/DisableHiddenGroup"
diff --git a/dspcontrol/inc/m_options.inc b/dspcontrol/inc/m_options.inc new file mode 100644 index 0000000..7e0c0ac --- /dev/null +++ b/dspcontrol/inc/m_options.inc @@ -0,0 +1,39 @@ +;Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+;Copyright © 2006-2007 A. Chilaru
+;
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+;
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;GNU General Public License for more details.
+;
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+OPTIONSDIALOGPAGE struct
+ cbSize dd ? ;cbSize
+ position dd ? ;position
+ pszTitle dd ? ;*pszTitle
+ pfnDlgProc dd ? ;pfnDlgProc
+ pszTemplate dd ? ;*pszTemplate
+ hInstance dd ? ;hInstance
+ hIcon dd ? ;hIcon
+ pszGroup dd ? ;*pszGroup
+ groupPosition dd ? ;groupPosition
+ hGroupIcon dd ? ;hGroupIcon
+ flags dd ? ;flags
+ nIDBottomSimpleControl dd ? ;nIDBottomSimpleControl
+ nIDRightSimpleControl dd ? ;nIDRightSimpleControl
+ expertOnlyControls dd ? ;*expertOnlyControls
+ nExpertOnlyControls dd ? ;nExpertOnlyControls
+OPTIONSDIALOGPAGE ends
+
+ODPF_SIMPLEONLY equ 1 ; page is only shown when in simple mode
+ODPF_EXPERTONLY equ 2 ; " expert mode
+ODPF_BOLDGROUPS equ 4 ; give group box titles a bold font
+ODPF_UNICODE equ 8 ; string fields in OPTIONSDIALOGPAGE are WCHAR*
diff --git a/dspcontrol/inc/m_protocols.inc b/dspcontrol/inc/m_protocols.inc new file mode 100644 index 0000000..c137504 --- /dev/null +++ b/dspcontrol/inc/m_protocols.inc @@ -0,0 +1,17 @@ +;Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+;Copyright © 2006-2007 A. Chilaru
+;
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+;
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;GNU General Public License for more details.
+;
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
diff --git a/dspcontrol/inc/m_protosvc.inc b/dspcontrol/inc/m_protosvc.inc new file mode 100644 index 0000000..ac1dea3 --- /dev/null +++ b/dspcontrol/inc/m_protosvc.inc @@ -0,0 +1,21 @@ +;Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+;Copyright © 2006-2007 A. Chilaru
+;
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+;
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;GNU General Public License for more details.
+;
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+PFLAGNUM_1 equ 1
+PF1_IMSEND equ 00000001h ;supports IM sending
+PF1_IMRECV equ 00000002h ;supports IM receiving
+PF1_IM equ (PF1_IMSEND or PF1_IMRECV)
\ No newline at end of file diff --git a/dspcontrol/inc/m_updater.inc b/dspcontrol/inc/m_updater.inc new file mode 100644 index 0000000..f16bac2 --- /dev/null +++ b/dspcontrol/inc/m_updater.inc @@ -0,0 +1,32 @@ +;Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+;Copyright © 2006-2007 A. Chilaru
+;
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+;
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;GNU General Public License for more details.
+;
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+UPDATE struct
+ cbSize dd ?
+ szComponentName dd ?
+ szVersionURL dd ?
+ pbVersionPrefix dd ?
+ cpbVersionPrefix dd ?
+ szUpdateURL dd ?
+ szBetaVersionURL dd ?
+ pbBetaVersionPrefix dd ?
+ cpbBetaVersionPrefix dd ?
+ szBetaUpdateURL dd ?
+ pbVersion dd ?
+ cpbVersion dd ?
+ szBetaChangelogURL dd ?
+UPDATE ends
\ No newline at end of file diff --git a/dspcontrol/inc/newpluginapi.inc b/dspcontrol/inc/newpluginapi.inc new file mode 100644 index 0000000..ed998b2 --- /dev/null +++ b/dspcontrol/inc/newpluginapi.inc @@ -0,0 +1,47 @@ +;Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+;Copyright © 2006-2007 A. Chilaru
+;
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+;
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;GNU General Public License for more details.
+;
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+PLUGININFO struc
+ cbSize dd ?
+ shortName dd ?
+ version dd ?
+ description dd ?
+ author dd ?
+ authorEmail dd ?
+ copyright dd ?
+ homepage dd ?
+ isTransient dd ?
+ replacesDefaultModule dd ?
+PLUGININFO ends
+
+PLUGINLINK struc
+ lpCreateHookableEvent dd ? ;(const char *);
+ lpDestroyHookableEvent dd ? ;(HANDLE);
+ lpNotifyEventHooks dd ? ;(HANDLE,WPARAM,LPARAM);
+ lpHookEvent dd ? ;(const char *,MIRANDAHOOK);
+ lpHookEventMessage dd ? ;(const char *,HWND,UINT);
+ lpUnhookEvent dd ? ;(HANDLE);
+ lpCreateServiceFunction dd ? ;(const char *,MIRANDASERVICE)
+ lpCreateTransientServiceFunction dd ? ;(const char *,MIRANDASERVICE)
+ lpDestroyServiceFunction dd ? ;(HANDLE)
+ lpCallService dd ? ;(const char *,WPARAM,LPARAM)
+ lpServiceExists dd ? ;(const char *); //v0.1.0.1+
+ lpCallServiceSync dd ? ;(const char *,WPARAM,LPARAM); //v0.3.3+
+ lpCallFunctionAsync dd ? ;(void (__stdcall *)(void *), void *); //v0.3.4+
+ lpSetHookDefaultForHookableEvent dd ? ;(HANDLE, MIRANDAHOOK); // v0.3.4 (2004/09/15)
+PLUGINLINK ends
+
diff --git a/dspcontrol/inc/resource.h b/dspcontrol/inc/resource.h new file mode 100644 index 0000000..f5fabad --- /dev/null +++ b/dspcontrol/inc/resource.h @@ -0,0 +1,39 @@ +//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by c:\masm32\FlexLabs\DspControl\source\trunk\res\DspControl.rc
+//
+#define IDI_PC 101
+#define IDC_LIST 102
+#define IDT_MAIN 1000
+#define IDC_CLIST 3000
+#define IDC_ENABLED 40071
+#define IDC_STATUS_ONLINE 40072
+#define IDC_STATUS_AWAY 40073
+#define IDC_STATUS_DND 40074
+#define IDC_STATUS_NA 40075
+#define IDC_STATUS_OCCUPIED 40076
+#define IDC_STATUS_FREECHAT 40077
+#define IDC_STATUS_INVISIBLE 40078
+#define IDC_STATUS_ONTHEPHONE 40079
+#define IDC_STATUS_OUTTOLUNCH 40080
+#define IDC_PROTO 40081
+#define IDC_ETYPE_MESSAGE 40082
+#define IDC_ETYPE_URL 40083
+#define IDC_ETYPE_CONTACTS 40084
+#define IDC_ETYPE_ADDED 40085
+#define IDC_ETYPE_AUTHREQUEST 40086
+#define IDC_ETYPE_FILE 40087
+#define IDC_STARTTIME 40088
+#define IDC_ENDTIME 40089
+#define IDC_SHOWHIDDEN 50071
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 105
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1004
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/dspcontrol/inc/statusmodes.inc b/dspcontrol/inc/statusmodes.inc new file mode 100644 index 0000000..c570e57 --- /dev/null +++ b/dspcontrol/inc/statusmodes.inc @@ -0,0 +1,29 @@ +;Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+;Copyright © 2006-2007 A. Chilaru
+;
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+;
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;GNU General Public License for more details.
+;
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+MAX_CONNECT_RETRIES equ 10000
+ID_STATUS_OFFLINE equ 40071
+ID_STATUS_ONLINE equ 40072
+ID_STATUS_AWAY equ 40073
+ID_STATUS_DND equ 40074
+ID_STATUS_NA equ 40075
+ID_STATUS_OCCUPIED equ 40076
+ID_STATUS_FREECHAT equ 40077
+ID_STATUS_INVISIBLE equ 40078
+ID_STATUS_ONTHEPHONE equ 40079
+ID_STATUS_OUTTOLUNCH equ 40080
+ID_STATUS_IDLE equ 40081 ;do not use as a status
\ No newline at end of file diff --git a/dspcontrol/plugin/DspControl.asm b/dspcontrol/plugin/DspControl.asm new file mode 100644 index 0000000..54b2a50 --- /dev/null +++ b/dspcontrol/plugin/DspControl.asm @@ -0,0 +1,1533 @@ +;Display Control plugin for Miranda. Turns on the screen if in power saving mode, when a message arives
+;Copyright © 2006-2007 A. Chilaru
+;
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+;
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;GNU General Public License for more details.
+;
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+.386
+.model flat,stdcall
+option casemap:none
+include \masm32\include\windows.inc
+include \masm32\include\kernel32.inc
+include \masm32\include\user32.inc
+include \masm32\include\comctl32.inc
+include \masm32\include\gdi32.inc
+include ..\inc\IcoLib.inc
+include ..\inc\m_clist.inc
+include ..\inc\m_clc.inc
+include ..\inc\m_database.inc
+include ..\inc\m_langpack.inc
+include ..\inc\m_options.inc
+include ..\inc\m_protocols.inc
+include ..\inc\m_protosvc.inc
+include ..\inc\m_updater.inc
+include ..\inc\newpluginapi.inc
+include ..\inc\statusmodes.inc
+
+includelib \masm32\lib\kernel32.lib
+includelib \masm32\lib\user32.lib
+includelib \masm32\lib\comctl32.lib
+includelib \masm32\lib\gdi32.lib
+
+ ;function definitions for debuggers
+ ;hook functions are C-style functions. The rest are stdcall
+OptInit proto C wParam:DWORD, lParam:DWORD
+Message proto C wParam:DWORD, lParam:DWORD
+MdLoaded proto C wParam:DWORD, lParam:DWORD
+IcoLibEv proto C wParam:DWORD, lParam: DWORD
+
+CallService proto lpServiceName:DWORD, wParam:DWORD, lParam:DWORD
+ServiceExists proto lpServiceName:DWORD
+HookEvent proto lpHookName:DWORD, lpFunction:DWORD
+UnhookEvent proto HookHandle:DWORD
+
+Translate proto lpStr:DWORD
+Error proto lpStr:DWORD
+IgnoreCheck proto pStri:DWORD
+ResetListOptions proto hCList:DWORD
+SetAllContactIcons proto hCList:DWORD
+SetListGroupIcons proto hCList:DWORD, hFirstItem:DWORD, hParentItem:DWORD, groupChildCount:DWORD
+SetAllChildIcons proto hCList:DWORD, hFirstItem:DWORD, iColumn:DWORD, iImage:DWORD
+MetaConClick proto hContact:DWORD, iCount:DWORD, iValue: DWORD
+MetaSubClick proto hContact:DWORD
+
+DLGHDR struct ;Structure to hold info about tabs
+ hDlg dd ?
+ hTab dd ?
+ hDisplay dd ?
+ rcDisplay RECT <>
+ hTab1 dd ?
+ hTab2 dd ?
+DLGHDR ends
+
+ ;Macro to create lParam DWORD from two WORDs (low WORDs used if DWORD given)
+MAKELPARAM macro lowWord, highWord
+ push ebx
+ mov ebx, lowWord
+ mov eax, highWord
+ shl eax, 16
+ mov ax, bx
+ pop ebx
+ ENDM
+
+.const
+ ;option controls
+IDC_ENABLED equ 40071 ;Plugin enables checkbox ID
+IDC_PROTO equ 40081 ;Protocol listbox ID
+IDC_STARTTIME equ 40088 ;time selector
+IDC_ENDTIME equ 40089 ;time selector
+IDC_SHOWHIDDEN equ 50071 ;Show hidden contacts
+
+IDC_CLIST equ 3000 ;CList component
+
+IDI_PC equ 101 ;PC icon
+
+ ;const from miranda resource file (small dot in CListControl)
+IDI_SMALLDOT equ 211
+
+ ;const from skin header
+SKINICON_EVENT_MESSAGE equ 100
+
+WM_IMGLIST equ WM_USER+273
+
+.data
+hInstance dd 0 ;Plugin hWnd
+hApp dd 0 ;Miranda .exe hWnd
+hDlgWnd dd 0 ;Option dialog hWnd
+hIcoLibEv dd 0 ;IcoLib dialog hWnd
+hIml dd 0 ;Image list
+hItemAll dd 0 ;CListControl "Group" ** All contacts **"
+hItemUnk dd 0 ;CListControl "Group" ** Unknown contacts **"
+
+ddRetAddr dd 0 ;Miranda proto ret. address
+ddRetStack dd 0 ;Miranda proto EBP backup
+
+hMsgHook dd 0 ;Message hook hWnd
+hOptHook dd 0 ;Options hook hWnd
+hMdLHook dd 0 ;Modules loaded hook
+
+ddVar1 dd 0
+ddVar2 dd 0 ;Just three DWORD variables ;)
+ddVar3 dd 0
+ddInt dd 0
+ddFlags dd 0 ;Various flags. Descriptions (starting from the lower bit)
+ ;Reserved
+ ;OptEditing2 On while options are loaded from the DB
+ ;OptEditing2 On while options are loaded from the DB
+ ;noUniConvert Don't convert to Unicode while translating
+
+sPluginInfo PLUGININFO <0> ;plugin info structure
+sPluginLink PLUGINLINK <> ;miranda procedure adresses structure
+sOptionsPage OPTIONSDIALOGPAGE <0> ;options struct
+sDBVariant DBVARIANT <> ;DB write/get variable struct
+sDBGetSetting DBCONTACTGETSETTING <> ;DB get struct
+sDBWriteSetting DBCONTACTWRITESETTING <>;DB write struct
+sDBEventInfo DBEVENTINFO <> ;Event ifnfo struct
+sUpdate UPDATE <0> ;Updater struct
+sTCITEM TCITEM <0> ;struct for tabbing
+sDlgHdr DLGHDR <0> ;struct for tabbing
+sSystemTime SYSTEMTIME <> ;datetime struct
+sLngPackDialog LANGPACKTRANSLATEDIALOG <> ;langpack dialog struct
+sClcInfoItem CLCINFOITEM <> ;contact list child item info
+sSkinIconDesc SKINICONDESC <> ;IcoLib struct
+
+ ;plugin details
+szShortName db "Display Control",0
+szShortNamev db "Display Control "
+IFDEF _UNICODE
+ szPlVer db "(Unicode)",0
+ELSE
+ szPlVer db "(ANSI)",0
+ENDIF
+ddVersion dd 0001011Eh
+szDescription db "The plugin turns your monitor power on as soon as a message arrives.",10,13,"Uses triggers, such as time, protocol, message type, status and individual contact, as rules.",0
+szAuthor db "A. Chilaru",0
+szAthorEmail db "flexlabs@gmail.com",0
+szCopyright db "© 2007 A. Chilaru (FlexLabs Inc.)",0
+szHomepage db "http://dev.mirandaim.ru/dspcontrol",0
+
+ ;additional details for updater
+IFDEF _UNICODE
+ szURL db "http://addons.miranda-im.org/details.php?action=viewfile&id=3232",0
+ szURLKey db "<span class=",22h,"fileNameHeader",22h,">Display Control (Unicode) ",0
+ ddURLKeyLen dd 37h
+ szDnURL db "http://addons.miranda-im.org/feed.php?dlfile=3232",0
+ELSE
+ szURL db "http://addons.miranda-im.org/details.php?action=viewfile&id=3261",0
+ szURLKey db "<span class=",22h,"fileNameHeader",22h,">Display Control (ANSI) ",0
+ ddURLKeyLen dd 34h
+ szDnURL db "http://addons.miranda-im.org/feed.php?dlfile=3261",0
+ENDIF
+szBetaURL db "http://svn.mirandaim.ru/mainrepo/dspcontrol/trunk/BETA",0
+szBetaURLKey db "DspControl_v.",0
+ddBetaURLKeyLen dd 0Dh
+IFDEF _UNICODE
+ szBetaDnURL db "http://svn.mirandaim.ru/mainrepo/dspcontrol/trunk/bin/Unicode/DspControl.dll",0
+ELSE
+ szBetaDnURL db "http://svn.mirandaim.ru/mainrepo/dspcontrol/trunk/bin/ANSI/DspControl.dll",0
+ENDIF
+szVersion db "0.1.1.30",0
+ddVersionLen dd 08h
+ddBeta dd 0 ;If plugin is beta - 1. Else - 0
+szBetaChangelogURL db "http://svn.mirandaim.ru/mainrepo/dspcontrol/trunk/CHANGELOG.txt",0
+
+ ;miranda functions
+MS_DB_CONTACT_GETSETTING db "DB/Contact/GetSetting",0
+MS_DB_CONTACT_WRITESETTING db "DB/Contact/WriteSetting",0
+MS_DB_CONTACT_FINDFIRST db "DB/Contact/FindFirst",0
+MS_DB_CONTACT_FINDNEXT db "DB/Contact/FindNext",0
+MS_DB_EVENT_GET db "DB/Event/Get",0
+MS_DB_EVENT_GETBLOBSIZE db "DB/Event/GetBlobSize",0
+MS_DB_EVENT_GETCONTACT db "DB/Event/GetContact",0
+MS_PROTO_GETCONTACTBASEPROTO db "Proto/GetContactBaseProto",0
+MS_CLIST_ADDMAINMENUITEM db "CList/AddMainMenuItem",0
+MS_CLIST_GETSTATUSMODE db "CList/GetStatusMode",0
+MS_OPT_ADDPAGE db "Opt/AddPage",0
+MS_PROTO_ENUMPROTOCOLS db "Proto/EnumProtocols",0
+MS_MC_GETMETACONTACT db "MetaContacts/GetMeta",0
+MS_MC_GETSUBCONTACT db "MetaContacts/GetSubContact",0
+ME_SYSTEM_MODULESLOADED db "Miranda/System/ModulesLoaded",0
+MS_SKIN_LOADICON db "Skin/Icons/Load",0
+MS_SKIN2_ADDICON db "Skin2/Icons/AddIcon",0
+MS_SKIN2_GETICON db "Skin2/Icons/GetIcon",0
+MS_UPDATE_REGISTER db "Update/Register",0
+MS_LANGPACK_TRANSLATESTRING db "LangPack/TranslateString",0
+MS_LANGPACK_TRANSLATEDIALOG db "LangPack/TranslateDialog",0
+
+PS_GETCAPS db "/GetCaps",0 ;Takes form of "PROTO/GetCaps",0 (GetCapabilities of a PROTO)
+
+ ;miranda events
+ME_DB_EVENT_ADDED db "DB/Event/Added",0
+ME_OPT_INITIALISE db "Opt/Initialise",0
+ME_SKIN2_ICONSCHANGED db "Skin2/IconsChanged",0
+
+ ;options
+szOptGroup db "Events",0
+szOptGroupW db "Unicod",0
+szOptTitle db "Display Control",0
+szOptTitleW db "UnicodeUnicodeU",0
+szOModule db "DspControl",0
+szOFlags db "Flags",0
+szOTime db "Time",0
+szOEnabled db "Enabled",0
+szONotOnList db "NotOnList",0
+szOCList db "CList",0
+szOShowHidden db "ShowHidden",0
+szOMetaContacts db "MetaContacts",0
+szOMetaCount db "NumContacts",0
+szOMetaLink db "MetaLink",0
+
+ ;tab captions
+szTab1 db "Triggers",0
+szTab1W db "UnicodeU",0
+szTab2 db "Contacts",0
+szTab2W db "UnicodeU",0
+
+ ;IcoLib
+szIlDesc db "Enabled",0
+szIlName db "dspc_screen",0
+
+ ;other strings
+szDtFormat db "HH':'mm",0
+szError db "Default error message",0
+szAllContacts db "** All contacts **",0
+szAllContactsW db "UnicodeUnicodeUnic",0
+szUnkContacts db "** Unknown contacts **",0
+szUnkContactsW db "UnicodeUnicodeUnicodeU",0
+
+ ;option control info
+IDC_ETYPE_MESSAGE dd 40082
+IDC_ETYPE_MESSAGE_V dd EVENTTYPE_MESSAGE
+IDC_ETYPE_URL dd 40083
+IDC_ETYPE_URL_V dd EVENTTYPE_URL
+IDC_ETYPE_CONTACTS dd 40084
+IDC_ETYPE_CONTACTS_V dd EVENTTYPE_CONTACTS
+IDC_ETYPE_ADDED dd 40085
+IDC_ETYPE_ADDED_V dd EVENTTYPE_ADDED
+IDC_ETYPE_AUTHREQUEST dd 40086
+IDC_ETYPE_AUTHREQUEST_V dd EVENTTYPE_AUTHREQUEST
+IDC_ETYPE_FILE dd 40087
+IDC_ETYPE_FILE_V dd EVENTTYPE_FILE
+
+.data?
+ ;option control hWnd's
+HC_CLIST dd ?
+HC_ENABLED dd ?
+HC_STATUS_ONLINE dd ?
+HC_STATUS_AWAY dd ?
+HC_STATUS_DND dd ?
+HC_STATUS_NA dd ?
+HC_STATUS_OCCUPIED dd ?
+HC_STATUS_FREECHAT dd ?
+HC_STATUS_INVISIBLE dd ?
+HC_STATUS_ONTHEPHONE dd ?
+HC_STATUS_OUTTOLUNCH dd ?
+HC_PROTO dd ?
+HC_ETYPE_MESSAGE dd ?
+HC_ETYPE_URL dd ?
+HC_ETYPE_CONTACTS dd ?
+HC_ETYPE_ADDED dd ?
+HC_ETYPE_AUTHREQUEST dd ?
+HC_ETYPE_FILE dd ?
+HC_STARTTIME dd ?
+HC_ENDTIME dd ?
+
+HC_SHOWHIDDEN dd ?
+
+ ;empty string space
+szGeneral db 256 DUP(?)
+
+.code
+DllMain proc hInst:HINSTANCE, reason:DWORD, reserved1:DWORD
+ push hInst
+ pop hInstance ;save hWnd of the library
+ invoke GetModuleHandle, NULL
+ mov hApp, eax ;save hWnd of Miranda
+
+ mov sPluginInfo.cbSize, sizeof PLUGININFO ;set the library's info
+ mov sPluginInfo.shortName, offset szShortNamev
+ push ddVersion
+ pop sPluginInfo.version
+ mov sPluginInfo.description, offset szDescription
+ mov sPluginInfo.author, offset szAuthor
+ mov sPluginInfo.authorEmail, offset szAthorEmail
+ mov sPluginInfo.copyright, offset szCopyright
+ mov sPluginInfo.homepage, offset szHomepage
+
+ mov eax, TRUE
+ ret
+DllMain Endp
+
+MirandaPluginInfo proc
+ mov eax, offset sPluginInfo ;return plugin info struct
+ ret
+MirandaPluginInfo Endp
+
+ ;internal miranda functions. Not necessary, but allow viewing them in the debugger
+CallService proc lpServiceName:DWORD, wParam:DWORD, lParam:DWORD
+ pop ddRetStack
+ pop ddRetAddr
+ call sPluginLink.lpCallService
+ push ddRetAddr
+ push ddRetStack
+ ret
+CallService endp
+
+ServiceExists proc lpServiceName:DWORD
+ pop ddRetStack
+ pop ddRetAddr
+ call sPluginLink.lpServiceExists
+ push ddRetAddr
+ push ddRetStack
+ ret
+ServiceExists endp
+
+HookEvent proc lpHookName:DWORD, lpFunction:DWORD
+ pop ddRetStack
+ pop ddRetAddr
+ call sPluginLink.lpHookEvent
+ push ddRetAddr
+ push ddRetStack
+ ret
+HookEvent endp
+
+UnhookEvent proc HookHandle:DWORD
+ pop ddRetStack
+ pop ddRetAddr
+ call sPluginLink.lpUnhookEvent
+ push ddRetAddr
+ push ddRetStack
+ ret
+UnhookEvent endp
+
+ ;call to Miranda translate module
+Translate proc lpString:DWORD
+ LOCAL ddLng:DWORD
+
+ mov eax, ddFlags
+ and eax, 8
+ .IF eax==0
+ IFDEF _UNICODE
+ mov ddLng, LANG_UNICODE
+ ELSE
+ mov ddLng, 0
+ ENDIF
+ .ELSE
+ and ddFlags, -9
+ mov ddLng, 0
+ .ENDIF
+ invoke CallService, offset MS_LANGPACK_TRANSLATESTRING, ddLng, lpString ;translate the string
+ ret
+Translate endp
+
+ ;Just an info func. Shows a message or Default error if NULL
+Error proc lpString:DWORD
+ .IF lpString==0
+ mov lpString, offset szError
+ .ENDIF
+ invoke MessageBox, NULL, lpString, addr szShortName, MB_OK
+ ret
+Error endp
+
+ ;ignores protocols that can't receive messages...
+IgnoreCheck proc pStri:DWORD
+ invoke lstrcpy, offset szGeneral, pStri
+ invoke lstrcat, offset szGeneral, offset PS_GETCAPS
+ invoke CallService, offset szGeneral, PFLAGNUM_1, 0
+ and eax, PF1_IMRECV
+ .IF eax!=0
+ mov eax, 1
+ .ENDIF
+ ret
+IgnoreCheck endp
+
+Load proc link:DWORD
+ invoke RtlMoveMemory, addr sPluginLink, link, sizeof PLUGINLINK ;get miranda proc struct
+
+ IFDEF _UNICODE
+ invoke lstrcpy, offset szGeneral, offset szOptGroup
+ invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szOptGroup, 7
+ invoke lstrcpy, offset szGeneral, offset szOptTitle
+ invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szOptTitle, 16
+ invoke lstrcpy, offset szGeneral, offset szTab1
+ invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szTab1, 9
+ invoke lstrcpy, offset szGeneral, offset szTab2
+ invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szTab2, 9
+ invoke lstrcpy, offset szGeneral, offset szAllContacts
+ invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szAllContacts, 19
+ invoke lstrcpy, offset szGeneral, offset szUnkContacts
+ invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szUnkContacts, 23
+ ENDIF
+
+ mov sSystemTime.wYear, 1870
+ mov sSystemTime.wMonth, 1
+ mov sSystemTime.wDay, 1
+ mov sOptionsPage.cbSize, sizeof OPTIONSDIALOGPAGE ;set the option dialog's properties
+ invoke Translate, offset szOptTitle
+ IFDEF _UNICODE
+ mov sOptionsPage.flags, ODPF_UNICODE
+ ENDIF
+ mov sOptionsPage.pszTitle, eax
+ mov sOptionsPage.pfnDlgProc, offset TabOptions
+ mov sOptionsPage.pszTemplate, 100
+ push hInstance
+ pop sOptionsPage.hInstance
+ push offset szOptGroup
+ pop sOptionsPage.pszGroup
+
+ invoke HookEvent, offset ME_DB_EVENT_ADDED, offset Message ;set the message hook
+ mov hMsgHook, eax ;save hook hWnd
+ invoke HookEvent, offset ME_OPT_INITIALISE, offset OptInit ;set the options hook
+ mov hOptHook, eax ;save hook hWnd
+ invoke HookEvent, offset ME_SYSTEM_MODULESLOADED, offset MdLoaded ;set the ModulesLoaded hook
+ mov hMdLHook, eax ;save hook hWnd
+
+ xor eax, eax
+ ret
+Load Endp
+
+IcoLibEv proc C wParam:DWORD, lParam: DWORD
+ invoke SendMessage, hDlgWnd, WM_IMGLIST, 0, 0
+ xor eax, eax
+ ret
+IcoLibEv endp
+
+;##############################
+; Runs when all modules are loaded
+;##############################
+MdLoaded proc C wParam:DWORD, lParam:DWORD
+ invoke UnhookEvent, hMdLHook ;unhook
+
+ invoke ServiceExists, offset MS_UPDATE_REGISTER
+ .IF eax!=0
+ mov sUpdate.cbSize, sizeof UPDATE ;initialize updater struct
+ mov sUpdate.szComponentName, offset szShortNamev
+ .IF ddBeta==0
+ mov sUpdate.szVersionURL, offset szURL ;check if is Beta
+ .ENDIF
+ mov sUpdate.pbVersionPrefix, offset szURLKey
+ push ddURLKeyLen
+ pop sUpdate.cpbVersionPrefix
+ mov sUpdate.szUpdateURL, offset szDnURL
+ mov sUpdate.szBetaVersionURL, offset szBetaURL
+ mov sUpdate.pbBetaVersionPrefix, offset szBetaURLKey
+ push ddBetaURLKeyLen
+ pop sUpdate.cpbBetaVersionPrefix
+ mov sUpdate.szBetaUpdateURL, offset szBetaDnURL
+ mov sUpdate.pbVersion, offset szVersion
+ push ddVersionLen
+ pop sUpdate.cpbVersion
+ mov sUpdate.szBetaChangelogURL, offset szBetaChangelogURL
+ invoke CallService, offset MS_UPDATE_REGISTER, 0, offset sUpdate ;register updater service
+ .ENDIF
+
+ ;registering icon in IcoLib
+ invoke ServiceExists, offset MS_SKIN2_ADDICON
+ .IF eax!=0
+ invoke GetModuleFileNameA, hInstance, offset szGeneral, 255
+ mov sSkinIconDesc.cbSize, sizeof SKINICONDESC
+ mov sSkinIconDesc.pszSection, offset szShortName
+ or ddFlags, 8
+ invoke Translate, offset szIlDesc
+ mov sSkinIconDesc.pszDescription, eax
+ mov sSkinIconDesc.pszName, offset szIlName
+ mov sSkinIconDesc.pszDefaultFile, offset szGeneral
+ mov sSkinIconDesc.iDefaultIndex, -IDI_PC
+ invoke CallService, offset MS_SKIN2_ADDICON, 0, offset sSkinIconDesc
+ invoke HookEvent, offset ME_SKIN2_ICONSCHANGED, offset IcoLibEv ;set the IconChanged hook
+ mov hIcoLibEv, eax ;save hook hWnd
+ .ENDIF
+
+ xor eax, eax
+ ret
+MdLoaded endp
+
+ ;set CListControl style defaults
+ResetListOptions proc hCList:DWORD
+ LOCAL Col, i:DWORD
+
+ invoke SendMessage, hCList, CLM_SETBKBITMAP, 0, 0
+ invoke GetSysColor, COLOR_WINDOW
+ mov Col, eax
+ invoke SendMessage, hCList, CLM_SETBKCOLOR, Col, 0
+ invoke SendMessage, hCList, CLM_SETGREYOUTFLAGS, 0, 0
+ invoke SendMessage, hCList, CLM_SETLEFTMARGIN, 2, 0
+ invoke SendMessage, hCList, CLM_SETINDENT, 10, 0
+ invoke GetSysColor, COLOR_WINDOWTEXT
+ mov Col, eax
+ mov i, FONTID_MAX
+ .WHILE i!=0
+ invoke SendMessage, hCList, CLM_SETTEXTCOLOR, i, Col
+ dec i
+ .ENDW
+ mov sDBGetSetting.szModule, offset szOModule ;load the flags
+ mov sDBGetSetting.szSetting, offset szOShowHidden
+ mov sDBGetSetting.pValue, offset sDBVariant
+ mov sDBVariant.VAR1, DBVT_DWORD
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting
+ .IF eax==0
+ .IF sDBVariant.VAR2!=0
+ invoke GetWindowLong, hCList, GWL_STYLE
+ or eax, CLS_SHOWHIDDEN
+ invoke SetWindowLong, hCList, GWL_STYLE, eax
+ .ENDIF
+ .ENDIF
+ xor eax, eax
+ ret
+ResetListOptions endp
+
+ ;load per contact trigger settings from DB
+SetAllContactIcons proc hCList:DWORD
+ LOCAL hContact, hItem, szProto, flags, flag:DWORD
+
+ invoke CallService, offset MS_DB_CONTACT_FINDFIRST, 0, 0
+ mov hContact, eax
+ invoke SendMessage, hCList, WM_TIMER, 14, 0 ;Note: Hack. Wait for the CList To be ready. Thanks to FYR
+ .WHILE hContact!=0
+ invoke SendMessage, hCList, CLM_FINDCONTACT, hContact, 0
+ mov hItem, eax
+ .IF eax!=0
+ invoke CallService, offset MS_PROTO_GETCONTACTBASEPROTO, hContact, 0 ;get PROTO for each contact
+ mov szProto, eax
+ .IF eax==0
+ mov flag, 1
+ mov flags, 1
+ .ELSE
+ invoke IgnoreCheck, szProto ;Check PROTO Capabilities
+ mov flags, eax
+ mov sDBGetSetting.szModule, offset szOModule ;load settings
+ mov sDBGetSetting.szSetting, offset szOEnabled
+ mov sDBGetSetting.pValue, offset sDBVariant
+ mov sDBVariant.VAR1, DBVT_WORD
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, hContact, offset sDBGetSetting
+ .IF eax==0
+ push sDBVariant.VAR2
+ pop flag
+ .ELSE
+ mov flag, 1
+ .ENDIF
+ .ENDIF
+ .IF flags!=0 ;finally set the necesarry image
+ xor eax, eax ;Use (MAKELPARAM "column", "image") instead of just 0
+ invoke SendMessage, hCList, CLM_GETEXTRAIMAGE, hItem, eax
+ .IF eax==0FFh
+ .IF flag!=0
+ mov flag, 1
+ .ENDIF
+ MAKELPARAM 0, flag
+ invoke SendMessage, hCList, CLM_SETEXTRAIMAGE, hItem, eax
+ .ENDIF
+ .ENDIF
+ .ENDIF
+ invoke CallService, offset MS_DB_CONTACT_FINDNEXT, hContact, 0
+ mov hContact, eax
+ .ENDW
+ ret
+SetAllContactIcons endp
+
+ ;Set group icons according to the contacts inside
+SetListGroupIcons proc hCList:DWORD, hFirstItem:DWORD, hParentItem:DWORD, groupChildCount:DWORD
+ LOCAL typeOfFirst, iconOn, childCount, iImage, hItem, hChildItem:DWORD
+
+ mov iconOn, 1 ;assume all are enabled
+ mov childCount, 0
+ invoke SendMessage, hCList, CLM_GETITEMTYPE,hFirstItem, 0
+ mov typeOfFirst, eax
+
+ ;check groups
+ .IF typeOfFirst==CLCIT_GROUP
+ push hFirstItem
+ pop hItem
+ .ELSE
+ invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hFirstItem
+ mov hItem, eax
+ .ENDIF
+ .WHILE hItem!=NULL
+ invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_CHILD, hItem
+ mov hChildItem, eax
+ .IF eax!=0
+ invoke SetListGroupIcons, hCList, hChildItem, hItem, addr childCount
+ .ENDIF
+ .IF iconOn!=0
+ invoke SendMessage, hCList, CLM_GETEXTRAIMAGE, hItem, 0
+ .IF eax==0
+ mov iconOn, 0
+ .ENDIF
+ .ENDIF
+ invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hItem
+ mov hItem, eax
+ .ENDW
+
+ ;check contacts
+ .IF typeOfFirst==CLCIT_CONTACT
+ push hFirstItem
+ pop hItem
+ .ELSE
+ invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hFirstItem
+ mov hItem, eax
+ .ENDIF
+ .WHILE hItem!=0
+ invoke SendMessage, hCList, CLM_GETEXTRAIMAGE, hItem, 0
+ .IF iconOn!=0
+ .IF eax==0
+ mov iconOn, 0
+ .ENDIF
+ .ENDIF
+ .IF eax!=0FFh
+ inc childCount
+ .ENDIF
+ invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hItem
+ mov hItem, eax
+ .ENDW
+
+ ;set group icons
+ .IF childCount==0
+ mov eax, 0FFh
+ .ELSEIF iconOn==0
+ mov eax, 0
+ .ELSE
+ mov eax, 1
+ .ENDIF
+ MAKELPARAM 0, eax
+ invoke SendMessage, hCList, CLM_SETEXTRAIMAGE, hParentItem, eax
+ .IF groupChildCount!=0
+ mov eax, [groupChildCount]
+ add eax, childCount
+ mov [groupChildCount], eax
+ .ENDIF
+ ret
+SetListGroupIcons endp
+
+ ;set group child icons
+SetAllChildIcons proc hCList:DWORD, hFirstItem:DWORD, iColumn:DWORD, iImage:DWORD
+ LOCAL typeOfFirst, iOldIcon, hItem, hChildItem:DWORD
+
+ invoke SendMessage, hCList, CLM_GETITEMTYPE, hFirstItem, 0
+ mov typeOfFirst, eax
+
+ ;set icons for groups
+ .IF typeOfFirst==CLCIT_GROUP
+ push hFirstItem
+ pop hItem
+ .ELSE
+ invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hFirstItem
+ mov hItem, eax
+ .ENDIF
+ .WHILE hItem!=0
+ invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_CHILD, hItem
+ mov hChildItem, eax
+ .IF hChildItem!=0
+ invoke SetAllChildIcons, hCList, hChildItem, iColumn, iImage
+ .ENDIF
+ invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hItem
+ mov hItem, eax
+ .ENDW
+
+ ;set icons for contacts
+ .IF typeOfFirst==CLCIT_CONTACT
+ push hFirstItem
+ pop hItem
+ .ELSE
+ invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hFirstItem
+ mov hItem, eax
+ .ENDIF
+ .WHILE hItem!=0
+ invoke SendMessage, hCList, CLM_GETEXTRAIMAGE, hItem, iColumn
+ mov iOldIcon, eax
+ .IF iOldIcon!=0FFh
+ mov eax, iImage
+ .IF iOldIcon!=eax
+ MAKELPARAM iColumn, iImage
+ invoke SendMessage, hCList, CLM_SETEXTRAIMAGE, hItem, eax
+ mov sDBGetSetting.szModule, offset szOMetaContacts ;load settings
+ mov sDBGetSetting.szSetting, offset szOMetaCount
+ mov sDBGetSetting.pValue, offset sDBVariant
+ mov sDBVariant.VAR1, DBVT_WORD
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, hItem, offset sDBGetSetting
+ .IF eax==0
+ invoke MetaConClick, hItem, sDBVariant.VAR2, iImage
+ .ENDIF
+ .ENDIF
+ .ENDIF
+ invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hItem
+ mov hItem, eax
+ .ENDW
+ ret
+SetAllChildIcons endp
+
+ ;set icons to contacts Not on list
+SetUnkChildIcons proc hCList:DWORD, hFirstItem:DWORD, iColumn:DWORD, iImage:DWORD
+ LOCAL typeOfFirst, iOldIcon, hItem, hChildItem:DWORD
+
+ invoke SendMessage, hCList, CLM_GETITEMTYPE, hFirstItem, 0
+ mov typeOfFirst, eax
+
+ ;set icons for groups
+ .IF typeOfFirst==CLCIT_GROUP
+ push hFirstItem
+ pop hItem
+ .ELSE
+ invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hFirstItem
+ mov hItem, eax
+ .ENDIF
+ .WHILE hItem!=0
+ invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_CHILD, hItem
+ mov hChildItem, eax
+ .IF hChildItem!=0
+ invoke SetUnkChildIcons, hCList, hChildItem, iColumn, iImage
+ .ENDIF
+ invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hItem
+ mov hItem, eax
+ .ENDW
+
+ ;set icons for contacts
+ .IF typeOfFirst==CLCIT_CONTACT
+ push hFirstItem
+ pop hItem
+ .ELSE
+ invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hFirstItem
+ mov hItem, eax
+ .ENDIF
+ .WHILE hItem!=0
+ invoke SendMessage, hCList, CLM_GETEXTRAIMAGE, hItem, iColumn
+ mov iOldIcon, eax
+ .IF iOldIcon!=0FFh
+ mov eax, iImage
+ .IF iOldIcon!=eax
+ mov sDBGetSetting.szModule, offset szOCList
+ mov sDBGetSetting.szSetting, offset szONotOnList
+ mov sDBGetSetting.pValue, offset sDBVariant
+ mov sDBVariant.VAR1, DBVT_BYTE
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, hItem, offset sDBGetSetting
+ .IF eax==0
+ lea esi, sDBVariant.VAR2
+ mov al, [esi]
+ .IF al!=0
+ MAKELPARAM iColumn, iImage
+ invoke SendMessage, hCList, CLM_SETEXTRAIMAGE, hItem, eax
+ .ENDIF
+ .ENDIF
+ .ENDIF
+ .ENDIF
+ invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hItem
+ mov hItem, eax
+ .ENDW
+ ret
+SetUnkChildIcons endp
+
+MetaConClick proc hContact:DWORD, iCount:DWORD, iValue: DWORD
+ dec iCount
+ .WHILE iCount!=-1
+ invoke CallService, offset MS_MC_GETSUBCONTACT, hContact, iCount
+ .IF eax!=0
+ mov ebx, eax
+ MAKELPARAM 0, 0
+ invoke SendDlgItemMessage, hDlgWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, ebx, eax
+ .IF eax!= 0FFh
+ MAKELPARAM 0, iValue
+ invoke SendDlgItemMessage, hDlgWnd, IDC_CLIST, CLM_SETEXTRAIMAGE, ebx, eax
+ .ENDIF
+ .ENDIF
+ dec iCount
+ .ENDW
+ ret
+MetaConClick endp
+
+MetaSubClick proc hContact:DWORD
+ LOCAL iVal, iCounter:DWORD
+
+ invoke CallService, offset MS_MC_GETMETACONTACT, hContact, 0
+ .IF eax!=0
+ mov hContact, eax
+ mov sDBGetSetting.szModule, offset szOMetaContacts ;load settings
+ mov sDBGetSetting.szSetting, offset szOMetaCount
+ mov sDBGetSetting.pValue, offset sDBVariant
+ mov sDBVariant.VAR1, DBVT_WORD
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, hContact, offset sDBGetSetting
+ .IF eax==0
+ push sDBVariant.VAR2
+ pop iCounter
+ dec iCounter
+ mov iVal, 1
+ .WHILE iCounter!=-1
+ invoke CallService, offset MS_MC_GETSUBCONTACT, hContact, iCounter
+ .IF eax!=0
+ mov ebx, eax
+ MAKELPARAM 0, 0
+ invoke SendDlgItemMessage, hDlgWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, ebx, eax
+ .IF eax==0
+ mov iVal, 0
+ .ENDIF
+ .ENDIF
+ dec iCounter
+ .ENDW
+ .ENDIF
+ .ENDIF
+ MAKELPARAM 0, iVal
+ invoke SendDlgItemMessage, hDlgWnd, IDC_CLIST, CLM_SETEXTRAIMAGE, hContact, eax
+ ret
+MetaSubClick endp
+
+;##############################
+; Options hook proc
+;##############################
+OptInit proc C wParam:DWORD, lParam:DWORD
+ mov eax, wParam ;init the options dialog
+ invoke CallService, addr MS_OPT_ADDPAGE, eax, addr sOptionsPage
+ xor eax, eax
+ ret
+OptInit Endp
+
+;##############################
+; Message hook proc
+;##############################
+Message proc C wParam:DWORD, lParam:DWORD
+ LOCAL hContact:DWORD
+
+ push lParam ;save hDBEvent
+ pop ddVar1
+ invoke CallService, offset MS_DB_EVENT_GETCONTACT, ddVar1, 0
+ mov hContact, eax
+ mov sDBGetSetting.szModule, offset szOModule ;load the flags
+ mov sDBGetSetting.szSetting, offset szOEnabled
+ mov sDBGetSetting.pValue, offset sDBVariant
+ mov sDBVariant.VAR1, DBVT_DWORD
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, hContact, offset sDBGetSetting
+ .IF eax==0
+ .IF sDBVariant.VAR2==0
+ ret
+ .ENDIF
+ .ENDIF
+ mov sDBGetSetting.szModule, offset szOCList
+ mov sDBGetSetting.szSetting, offset szONotOnList
+ mov sDBVariant.VAR1, DBVT_BYTE
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, hContact, offset sDBGetSetting
+ .IF eax==0
+ push esi
+ lea esi, sDBVariant.VAR2
+ mov al, [esi]
+ pop esi
+ .IF al!=0
+ mov sDBGetSetting.szModule, offset szOModule
+ mov sDBVariant.VAR1, DBVT_DWORD
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting
+ .IF eax==0
+ .IF sDBVariant.VAR2==0
+ ret
+ .ENDIF
+ .ENDIF
+ .ENDIF
+ .ENDIF
+ mov sDBGetSetting.szModule, offset szOModule
+ mov sDBGetSetting.szSetting, offset szOFlags
+ mov sDBVariant.VAR1, DBVT_DWORD
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting
+ push sDBVariant.VAR2 ;backup the value
+ pop ddVar3
+ push ddVar3
+ pop ddVar2
+ and sDBVariant.VAR2, 1 ;select a flag
+ .IF eax==0
+ .IF sDBVariant.VAR2==0
+ ret
+ .ENDIF
+ .ENDIF
+ invoke CallService, offset MS_CLIST_GETSTATUSMODE, 0, 0
+ .IF eax!=0 ;on error, status=offline
+ sub eax, IDC_ENABLED
+ .ENDIF
+ push esi
+ mov esi, 1
+ .WHILE eax!=0 ;generate flag from status
+ shl esi, 1
+ dec eax
+ .ENDW
+ and ddVar3, esi ;check status filter
+ pop esi
+ .IF ddVar3==0
+ xor eax, eax
+ ret
+ .ENDIF
+ mov sDBEventInfo.cbSize, sizeof DBEVENTINFO ;load message info and protocol
+ mov sDBEventInfo.cbBlob, 150
+ mov sDBEventInfo.pBlob, offset szGeneral
+ invoke CallService, offset MS_DB_EVENT_GET, ddVar1, offset sDBEventInfo
+ mov sDBGetSetting.szModule, offset szOModule ;load protocol settings
+ push sDBEventInfo.szModule
+ pop sDBGetSetting.szSetting
+ mov sDBGetSetting.pValue, offset sDBVariant
+ mov sDBVariant.VAR1, DBVT_DWORD
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting
+ .IF eax==0
+ .IF sDBVariant.VAR2==0
+ ret
+ .ENDIF
+ .ENDIF
+ mov eax, sDBEventInfo.eventType ;check for message type
+ push esi
+ push edi
+ mov edi, offset IDC_ETYPE_MESSAGE_V
+ mov esi, 800h
+ .WHILE esi!=20000h && eax!=[edi] ;list message types
+ add edi, 08h
+ shl esi, 1
+ .ENDW
+ and esi, 1FFFFh
+ and esi, ddVar2
+ mov ddVar3, esi
+ pop edi
+ pop esi
+ .IF ddVar3==0
+ ret
+ .ENDIF
+ push ecx ;check time trigger
+ push ebx
+ invoke GetSystemTime, addr sSystemTime ;local time
+ xor eax, eax
+ mov ax, sSystemTime.wHour
+ shl eax, 16
+ mov ax, sSystemTime.wMinute
+ shl ax, 8
+ shr eax, 8
+ mov ddVar2, eax
+ mov sDBGetSetting.szSetting, offset szOTime ;load DB settings
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting
+ .IF eax==0
+ mov eax, sDBVariant.VAR2
+ xor ebx, ebx ;check time
+ mov bx, ax
+ shr eax, 16
+ mov ecx, ddVar2
+ mov ddVar3, 0
+ .IF eax<ebx
+ .IF eax<=ecx
+ .IF ecx<=ebx
+ mov ddVar3, 1
+ .ENDIF
+ .ENDIF
+ .ELSEIF eax>ebx
+ .IF ecx>=eax
+ mov ddVar3, 1
+ .ELSEIF ebx>=ecx
+ mov ddVar3, 1
+ .ENDIF
+ .ELSE
+ mov ddVar3, 1
+ .ENDIF
+ .ENDIF
+ pop ebx
+ pop ecx
+ .IF ddVar3
+ invoke SendMessage, HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, -1 ;turn monitor on
+ .ENDIF
+
+ xor eax, eax
+ ret
+Message Endp
+
+;##############################
+; First tab event proc
+;##############################
+Options1 proc, dhWnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD
+ .IF uMsg==WM_INITDIALOG ;if user opens options
+ invoke SetWindowPos, dhWnd, HWND_TOP, sDlgHdr.rcDisplay.left, sDlgHdr.rcDisplay.top, 0, 0, SWP_NOSIZE
+ .IF ddInt==0
+ or ddFlags, 2
+ push esi
+ push edi
+ mov edi, offset HC_ENABLED ;get control hWnd's from ID's
+ mov esi, IDC_ENABLED
+ .WHILE esi<=IDC_ENDTIME
+ invoke GetDlgItem, dhWnd, esi
+ mov [edi], eax
+ inc esi
+ add edi,4
+ .ENDW
+ pop edi
+ pop esi
+ mov ddInt, 1
+ invoke SendMessage, HC_STARTTIME, DTM_SETFORMAT, 0, addr szDtFormat ;datetime pickers format
+ invoke SendMessage, HC_ENDTIME, DTM_SETFORMAT, 0, addr szDtFormat
+ mov sDBGetSetting.szModule, offset szOModule ;load time triggers
+ mov sDBGetSetting.szSetting, offset szOTime
+ mov sDBGetSetting.pValue, offset sDBVariant
+ mov sDBVariant.VAR1, DBVT_DWORD
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting
+ mov eax, sDBVariant.VAR2 ;get start and end time
+ push ax
+ and ax, 00FFh
+ mov sSystemTime.wMinute, ax
+ pop ax
+ shr ax, 8
+ mov sSystemTime.wHour, ax
+ push eax
+ invoke SendMessage, HC_ENDTIME, DTM_SETSYSTEMTIME, GDT_VALID, addr sSystemTime
+ pop eax
+ shr eax, 16
+ push ax
+ and ax, 00FFh
+ mov sSystemTime.wMinute, ax
+ pop ax
+ shr ax, 8
+ mov sSystemTime.wHour, ax
+ invoke SendMessage, HC_STARTTIME, DTM_SETSYSTEMTIME, GDT_VALID, addr sSystemTime
+ mov sDBGetSetting.szModule, offset szOModule
+ mov sDBGetSetting.szSetting, offset szOFlags ;load flags
+ mov sDBGetSetting.pValue, offset sDBVariant
+ mov sDBVariant.VAR1, DBVT_DWORD
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting
+ push edi
+ push ebx
+ mov edi, offset HC_ENABLED ;disable controls if plugin disabled
+ push sDBVariant.VAR2
+ pop sDBVariant.VAR3
+ mov ebx, 01h
+ .WHILE edi<=offset HC_ETYPE_FILE
+ and sDBVariant.VAR2, ebx
+ .IF eax!=0 || (eax==0 && sDBVariant.VAR2 !=0)
+ push eax
+ Invoke SendMessage, [edi], BM_SETCHECK, BST_CHECKED, 0
+ pop eax
+ .ENDIF
+ shl ebx, 1
+ push sDBVariant.VAR3
+ pop sDBVariant.VAR2
+ add edi, 04h
+ .ENDW
+ pop ebx
+ pop edi
+ invoke CallService, offset MS_PROTO_ENUMPROTOCOLS, offset ddVar1, offset ddVar2 ;get protocol list
+ push esi ;then load them into list box
+ push edi
+ push ebx
+ mov esi, ddVar1
+ mov edi, esi
+ dec edi
+ shl edi, 2
+ add edi, ddVar2
+ mov sDBGetSetting.szModule, offset szOModule ;and also check if it's enabled
+ mov sDBGetSetting.pValue, offset sDBVariant
+ mov sDBVariant.VAR1, DBVT_DWORD
+ .WHILE esi!=0
+ mov ebx, [edi]
+ invoke IgnoreCheck, [ebx+04h] ;check for ignore list
+ .IF eax!=0
+ mov eax, [ebx+08h]
+ .IF eax==03E8h ;check if it really is a protocol
+ push [ebx+04h]
+ pop sDBGetSetting.szSetting
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting
+ .IF eax!=0
+ mov sDBVariant.VAR2, 01h
+ .ENDIF
+ invoke SendMessage, HC_PROTO, LB_INSERTSTRING, 0, [ebx+04h] ;add it to the list
+ invoke SendMessage, HC_PROTO, LB_SETSEL, sDBVariant.VAR2, 0
+ .ENDIF
+ .ENDIF
+ sub edi, 04h
+ dec esi
+ .ENDW
+ pop ebx
+ pop edi
+ pop esi
+ or ddFlags, 6
+ invoke PostMessage, dhWnd, WM_COMMAND, IDC_ENABLED, dhWnd
+ .ENDIF
+ .ELSEIF uMsg==WM_COMMAND ;if sth. happened in the dialog
+ mov eax, wParam
+ .IF lParam!=0
+ .IF ax==IDC_ENABLED
+ push edi ;enable/disable the controls on the dialog
+ push esi
+ invoke IsDlgButtonChecked, dhWnd, IDC_ENABLED
+ mov esi, eax
+ mov edi, offset HC_STATUS_ONLINE
+ .WHILE edi<=offset HC_ENDTIME
+ invoke EnableWindow, [edi], esi
+ add edi, 04h
+ .ENDW
+ pop esi
+ pop edi
+ .ENDIF
+ .ENDIF
+ mov eax, ddFlags
+ and eax, 6
+ .IF eax==0
+ invoke GetParent, dhWnd
+ invoke GetParent, eax
+ push eax
+ invoke SendMessage, eax, PSM_CHANGED, 0, 0 ;enable the Apply button
+ pop eax
+ invoke GetParent, eax
+ invoke SendMessage, eax, PSM_CHANGED, 0, 0 ;enable the Apply button
+ .ELSEIF ddFlags==6
+ and ddFlags, -7
+ .ENDIF
+ .ELSEIF uMsg==WM_NOTIFY
+ .IF wParam==IDC_STARTTIME || wParam==IDC_ENDTIME ;if a message from time controls
+ mov edi, lParam
+ assume edi:ptr NMHDR
+ .IF [edi].code==DTN_DATETIMECHANGE
+ invoke GetParent, dhWnd
+ invoke GetParent, eax
+ push eax
+ invoke SendMessage, eax, PSM_CHANGED, 0, 0 ;enable the Apply button
+ pop eax
+ invoke GetParent, eax
+ invoke SendMessage, eax, PSM_CHANGED, 0, 0 ;enable the Apply button
+ .ENDIF
+ assume edi:nothing
+ .ENDIF
+ mov eax, lParam ;check if apply or OK pressed
+ .IF eax==0
+ xor eax, eax
+ ret
+ .ENDIF
+ mov eax, [eax+8]
+ add eax, 201
+ .IF eax==0
+ push esi
+ mov esi, offset HC_ETYPE_FILE ;start saving all the settings
+ xor ebx, ebx
+ .WHILE esi>=offset HC_ENABLED
+ shl ebx, 1 ;shift ebx, to make room for next
+ invoke SendMessage, [esi], BM_GETCHECK, 0, 0 ;get state of buttons, 1=checked, 0=unchecked
+ .IF eax==BST_CHECKED
+ xor eax, eax
+ inc eax
+ .ELSE
+ xor eax, eax
+ .ENDIF
+ or ebx, eax ;add it to ebx
+ sub esi, 4
+ .ENDW
+ mov sDBWriteSetting.szModule, offset szOModule ;save them
+ mov sDBWriteSetting.szSetting, offset szOFlags
+ mov sDBWriteSetting.VAR1, DBVT_DWORD
+ mov sDBWriteSetting.VAR2, ebx
+ invoke CallService, offset MS_DB_CONTACT_WRITESETTING, 0, offset sDBWriteSetting
+ invoke SendMessage, HC_STARTTIME, DTM_GETSYSTEMTIME, 0, addr sSystemTime ;get start time
+ mov ax, sSystemTime.wHour
+ shl eax, 16
+ mov ax, sSystemTime.wMinute
+ shl ax, 8
+ shl eax, 8
+ push eax
+ invoke SendMessage, HC_ENDTIME, DTM_GETSYSTEMTIME, 0, addr sSystemTime ;get end time
+ pop eax
+ mov bx, sSystemTime.wHour
+ shl ebx, 16
+ mov bx, sSystemTime.wMinute
+ shl bx, 8
+ shr ebx, 8
+ mov ax, bx
+ mov sDBWriteSetting.szSetting, offset szOTime ;save time options in DB
+ mov sDBWriteSetting.VAR2, eax
+ invoke CallService, offset MS_DB_CONTACT_WRITESETTING, 0, offset sDBWriteSetting
+
+ invoke CallService, offset MS_PROTO_ENUMPROTOCOLS, offset ddVar1, offset ddVar2 ;get protocol list
+ push esi ;then load them into list box
+ push edi
+ push ebx
+ mov esi, ddVar1
+ mov edi, ddVar2
+ mov ddVar3, 0
+ mov sDBWriteSetting.szModule, offset szOModule ;and also check if it's enabled
+ mov sDBWriteSetting.VAR1, DBVT_DWORD
+ .WHILE esi!=0
+ mov ebx, [edi]
+ invoke IgnoreCheck, [ebx+04h] ;check for ignore list
+ .IF eax!=0
+ mov eax, [ebx+08h]
+ .IF eax==03E8h ;check if it really is a protocol
+ invoke SendMessage, HC_PROTO, LB_GETSEL, ddVar3, 0
+ mov sDBWriteSetting.VAR2, eax
+ push [ebx+04h]
+ pop sDBWriteSetting.szSetting
+ invoke CallService, offset MS_DB_CONTACT_WRITESETTING, 0, offset sDBWriteSetting
+ inc ddVar3
+ .ENDIF
+ .ENDIF
+ add edi, 04h
+ dec esi
+ .ENDW
+ pop ebx
+ pop edi
+ pop esi
+ .ENDIF
+ .ENDIF
+ xor eax,eax
+ ret
+Options1 endp
+
+;##############################
+; Second tab event proc
+;##############################
+Options2 proc, dhWnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD
+ LOCAL hContact, hItem, hitFlags, iImage, itemType, i:DWORD
+
+ push dhWnd
+ pop hDlgWnd
+ .IF uMsg==WM_INITDIALOG
+ invoke SetWindowPos, dhWnd, HWND_TOP, sDlgHdr.rcDisplay.left, sDlgHdr.rcDisplay.top, 0, 0, SWP_NOSIZE
+ invoke GetDlgItem, dhWnd, IDC_SHOWHIDDEN
+ mov HC_SHOWHIDDEN, eax
+ mov sDBGetSetting.szModule, offset szOModule ;load the flags
+ mov sDBGetSetting.szSetting, offset szOShowHidden
+ mov sDBGetSetting.pValue, offset sDBVariant
+ mov sDBVariant.VAR1, DBVT_DWORD
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting
+ .IF eax==0
+ .IF sDBVariant.VAR2!=0
+ Invoke SendMessage, HC_SHOWHIDDEN, BM_SETCHECK, BST_CHECKED, 0
+ .ENDIF
+ .ENDIF
+ invoke SendMessage, dhWnd, WM_IMGLIST, wParam, lParam
+ invoke GetDlgItem, dhWnd, IDC_CLIST
+ mov HC_CLIST, eax
+ invoke ResetListOptions, HC_CLIST
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_SETEXTRACOLUMNS, 1, 0 ;set no of icon columns
+ mov sClcInfoItem.cbSize, sizeof CLCINFOITEM ;add additional items
+ mov sClcInfoItem.flags, CLCIIF_GROUPFONT
+ invoke Translate, offset szAllContacts ;** All contacts **
+ mov sClcInfoItem.pszText, eax
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_ADDINFOITEM, 0, addr sClcInfoItem
+ mov hItemAll, eax
+ invoke Translate, offset szUnkContacts ;** Unknown contacts **
+ mov sClcInfoItem.pszText, eax
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_ADDINFOITEM, 0, addr sClcInfoItem
+ mov hItemUnk, eax
+
+ invoke SetAllContactIcons, HC_CLIST ;Init control values
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0
+ invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL
+ mov sDBGetSetting.szModule, offset szOModule ;load the flags
+ mov sDBGetSetting.szSetting, offset szONotOnList
+ mov sDBGetSetting.pValue, offset sDBVariant
+ mov sDBVariant.VAR1, DBVT_DWORD
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting
+ .IF eax==0
+ .IF sDBVariant.VAR2!=0
+ mov eax, 1
+ .ENDIF
+ .ELSE
+ mov eax, 1
+ .ENDIF
+ push eax
+ invoke SetUnkChildIcons, HC_CLIST, hItemUnk, 0, eax
+ pop eax
+ MAKELPARAM 0, eax
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_SETEXTRAIMAGE, hItemUnk, eax
+ .ELSEIF uMsg==WM_IMGLIST
+ invoke GetVersion ;check win version
+ .IF al==5
+ .IF ah!=0
+ mov eax, ILC_COLOR32 or ILC_MASK
+ .ELSEIF
+ mov eax, ILC_COLOR16 or ILC_MASK
+ .ENDIF
+ .ENDIF
+ invoke ImageList_Create, 16, 16, eax, 3, 3 ;create image list
+ mov hIml, eax
+ invoke LoadIcon, hApp, IDI_SMALLDOT ;add icon
+ push eax
+ invoke ImageList_AddIcon, hIml, eax
+ pop eax
+ invoke DeleteObject, eax
+ invoke CallService, offset MS_SKIN2_GETICON, 0, offset szIlName
+ invoke ImageList_AddIcon, hIml, eax
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_SETEXTRAIMAGELIST, 0, hIml ;link image list to CList
+ .ELSEIF uMsg==WM_SETFOCUS
+ invoke SetFocus, HC_CLIST
+ .ELSEIF uMsg==WM_COMMAND
+ mov eax, wParam
+ .IF lParam!=0
+ .IF ax==IDC_SHOWHIDDEN
+ mov sDBWriteSetting.szModule, offset szOModule
+ mov sDBWriteSetting.szSetting, offset szOShowHidden
+ mov sDBWriteSetting.VAR1, DBVT_DWORD
+ invoke SendMessage, HC_SHOWHIDDEN, BM_GETCHECK, 0, 0
+ .IF eax==BST_CHECKED
+ mov sDBWriteSetting.VAR2, 1
+ invoke GetWindowLong, HC_CLIST, GWL_STYLE
+ or eax, CLS_SHOWHIDDEN
+ .ELSE
+ mov sDBWriteSetting.VAR2, 0
+ invoke GetWindowLong, HC_CLIST, GWL_STYLE
+ mov ebx, -CLS_SHOWHIDDEN
+ dec ebx
+ and eax, ebx
+ .ENDIF
+ invoke SetWindowLong, HC_CLIST, GWL_STYLE, eax
+ invoke CallService, offset MS_DB_CONTACT_WRITESETTING, 0, offset sDBWriteSetting
+ invoke SendMessage, HC_CLIST, CLM_SETUSEGROUPS, 1, 0
+ invoke SetAllContactIcons, HC_CLIST
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0
+ invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL
+ .ENDIF
+ .ENDIF
+ .ELSEIF uMsg==WM_NOTIFY ;if sth changes
+ mov edi, lParam
+ assume edi:ptr NMHDR
+ .IF [edi].idFrom==IDC_CLIST
+ .IF [edi].code==CLN_NEWCONTACT
+ invoke SetAllContactIcons, HC_CLIST
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0
+ invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL
+ .ELSEIF [edi].code==CLN_LISTREBUILT
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0
+ invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL
+ .ELSEIF [edi].code==CLN_CONTACTMOVED
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0
+ invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL
+ .ELSEIF [edi].code==CLN_OPTIONSCHANGED
+ invoke ResetListOptions, HC_CLIST
+ .ELSEIF [edi].code==NM_CLICK ;Click on the CList
+ assume edi:ptr NMCLISTCONTROL
+ .IF [edi].iColumn!=-1
+ MAKELPARAM [edi].pt.x, [edi].pt.y
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_HITTEST, addr hitFlags, eax
+ mov hItem, eax
+ .IF hItem!=0
+ and hitFlags, CLCHT_ONITEMEXTRA ;if click on icon, then analyze and edit
+ .IF hitFlags!=0
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, hItem, [edi].iColumn
+ .IF eax==0
+ mov iImage, 1
+ .ELSE
+ mov iImage, 0
+ .ENDIF
+ MAKELPARAM [edi].iColumn, 0
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, hItem, eax
+ .IF eax!= 0FFh
+ MAKELPARAM [edi].iColumn, iImage
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_SETEXTRAIMAGE, hItem, eax
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETITEMTYPE, hItem, 0
+ mov itemType, eax
+ .IF itemType==CLCIT_CONTACT ;if click on contact
+ MAKELPARAM [edi].iColumn, iImage
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_SETEXTRAIMAGE, hItem, eax
+ mov sDBGetSetting.szModule, offset szOMetaContacts ;load settings
+ mov sDBGetSetting.szSetting, offset szOMetaCount
+ mov sDBGetSetting.pValue, offset sDBVariant
+ mov sDBVariant.VAR1, DBVT_WORD
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, hItem, offset sDBGetSetting
+ .IF eax==0
+ ;is MetaContact
+ invoke MetaConClick, hItem, sDBVariant.VAR2, iImage
+ .ELSE
+ mov sDBGetSetting.szSetting, offset szOMetaLink
+ invoke CallService, offset MS_DB_CONTACT_GETSETTING, hItem, offset sDBGetSetting
+ .IF eax==0
+ ;is subcontact
+ invoke MetaSubClick, hItem
+ .ENDIF
+ .ENDIF
+ .ENDIF
+ .IF itemType==CLCIT_INFO ;if click on extra item
+ mov eax, hItem
+ .IF eax==hItemAll
+ invoke SetAllChildIcons, HC_CLIST, hItem, [edi].iColumn, iImage
+ .ELSEIF eax==hItemUnk
+ invoke SetUnkChildIcons, HC_CLIST, hItem, [edi].iColumn, iImage
+ .ENDIF
+ .ENDIF
+ .IF itemType==CLCIT_GROUP ;if click on group
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_CHILD, hItem
+ mov hItem, eax
+ .IF hItem!=0
+ invoke SetAllChildIcons, HC_CLIST, hItem, [edi].iColumn, iImage
+ .ENDIF
+ .ENDIF
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0
+ invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL
+ invoke GetParent, dhWnd
+ invoke GetParent, eax
+ push eax
+ invoke SendMessage, eax, PSM_CHANGED, 0, 0 ;enable the Apply button
+ pop eax
+ invoke GetParent, eax
+ invoke SendMessage, eax, PSM_CHANGED, 0, 0 ;enable the Apply button
+ .ENDIF
+ .ENDIF
+ .ENDIF
+ .ENDIF
+ assume edi:ptr NMHDR
+ .ENDIF
+ .ELSEIF [edi].idFrom==0
+ .IF [edi].code==PSN_APPLY ;if OK/Apply pressed. Save options
+ invoke CallService, addr MS_DB_CONTACT_FINDFIRST, 0, 0
+ mov hContact, eax
+ .WHILE hContact!=0
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0
+ mov hItem, eax
+ .IF eax!=0
+ xor eax, eax ;Use (MAKELPARAM "column", "image") instead of just 0
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, hItem, eax
+ mov sDBWriteSetting.szModule, offset szOModule
+ mov sDBWriteSetting.szSetting, offset szOEnabled
+ mov sDBWriteSetting.VAR1, DBVT_DWORD
+ mov sDBWriteSetting.VAR2, eax
+ invoke CallService, offset MS_DB_CONTACT_WRITESETTING, hContact, offset sDBWriteSetting
+ .ENDIF
+ invoke CallService, addr MS_DB_CONTACT_FINDNEXT, hContact, 0
+ mov hContact, eax
+ .ENDW
+ invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, hItemUnk, 0
+ mov sDBWriteSetting.szModule, offset szOModule
+ mov sDBWriteSetting.szSetting, offset szONotOnList
+ mov sDBWriteSetting.VAR1, DBVT_DWORD
+ mov sDBWriteSetting.VAR2, eax
+ invoke CallService, offset MS_DB_CONTACT_WRITESETTING, 0, offset sDBWriteSetting
+ .ENDIF
+ .ENDIF
+ assume edi:nothing
+ .ELSEIF uMsg==WM_DESTROY
+ invoke ImageList_Destroy, hIml ;Free used resources
+ .ENDIF
+ xor eax, eax
+ ret
+Options2 endp
+
+TabOptions proc, dhWnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD
+ push dhWnd
+ pop sDlgHdr.hDlg
+ .IF uMsg==WM_INITDIALOG ;if user opens options
+ mov ddInt, 0
+ invoke InitCommonControls
+ invoke GetDlgItem, dhWnd, 1000 ;get hWnd of tabs control
+ mov sDlgHdr.hTab, eax
+ mov edi, offset sTCITEM ;insert tabs
+ mov eax, TCIF_TEXT
+ mov [edi], eax
+ invoke Translate, offset szTab1 ;translate Tab name
+ IFDEF _UNICODE
+ mov sTCITEM.pszText, eax
+ invoke SendMessage, sDlgHdr.hTab, TCM_INSERTITEMW, 0, addr sTCITEM
+ ELSE
+ mov sTCITEM.pszText, eax
+ invoke SendMessage, sDlgHdr.hTab, TCM_INSERTITEMA, 0, addr sTCITEM
+ ENDIF
+ mov sDlgHdr.hDisplay, NULL
+
+ invoke SetRectEmpty, addr sDlgHdr.rcDisplay
+ invoke SendMessage, sDlgHdr.hTab, TCM_ADJUSTRECT, FALSE, addr sDlgHdr.rcDisplay
+
+ invoke FindResource, hInstance, 101, RT_DIALOG ;load first tab in memory
+ invoke LoadResource, hInstance, eax
+ invoke LockResource, eax
+ invoke CreateDialogIndirectParam, hInstance, eax, sDlgHdr.hTab, Options1, NULL
+ mov sDlgHdr.hTab1, eax
+ mov sDlgHdr.hDisplay, eax
+
+ invoke Translate, offset szTab2 ;translate Tab name
+ IFDEF _UNICODE
+ mov sTCITEM.pszText, eax
+ invoke SendMessage, sDlgHdr.hTab, TCM_INSERTITEMW, 1, addr sTCITEM
+ ELSE
+ mov sTCITEM.pszText, eax
+ invoke SendMessage, sDlgHdr.hTab, TCM_INSERTITEMA, 1, addr sTCITEM
+ ENDIF
+ invoke FindResource, hInstance, 102, RT_DIALOG ;load second tab in memory
+ invoke LoadResource, hInstance, eax
+ invoke LockResource, eax
+ invoke CreateDialogIndirectParam, hInstance, eax, sDlgHdr.hTab, Options2, NULL
+ mov sDlgHdr.hTab2, eax
+ invoke ShowWindow, sDlgHdr.hTab2, SW_HIDE
+
+ mov sLngPackDialog.cbSize, sizeof LANGPACKTRANSLATEDIALOG
+ mov sLngPackDialog.flags, 0
+ push dhWnd
+ pop sLngPackDialog.hwndDlg
+ mov sLngPackDialog.ignoreControls, 0
+ invoke CallService, offset MS_LANGPACK_TRANSLATEDIALOG, LPTDF_NOTITLE, offset sLngPackDialog ;translate dialogs
+
+ .ELSEIF uMsg==WM_NOTIFY
+ .IF wParam==1000 ;if message from tab control
+ mov edi, lParam
+ assume edi:ptr NMHDR
+ .IF [edi].code==TCN_SELCHANGE ;if tab changed
+ .IF sDlgHdr.hDisplay!=0
+ invoke ShowWindow, sDlgHdr.hDisplay, SW_HIDE ;hide old tab
+ .ENDIF
+ invoke SendMessage, sDlgHdr.hTab, TCM_GETCURSEL, 0, 0 ;get current tab and show it
+ .IF eax==0
+ mov eax, sDlgHdr.hTab1
+ .ELSEIF eax==1
+ mov eax, sDlgHdr.hTab2
+ .ELSE
+ invoke Error, 0
+ .ENDIF
+ mov sDlgHdr.hDisplay, eax
+ invoke ShowWindow, sDlgHdr.hDisplay, SW_SHOW
+ .ENDIF
+ assume edi:nothing
+ .ELSEIF
+ invoke SendMessage, sDlgHdr.hTab1, WM_NOTIFY, wParam, lParam
+ invoke SendMessage, sDlgHdr.hTab2, WM_NOTIFY, wParam, lParam
+ .ENDIF
+ .ENDIF
+ xor eax, eax
+ ret
+TabOptions endp
+
+Unload proc
+ invoke UnhookEvent, hMsgHook ;unhook events and exit
+ invoke UnhookEvent, hOptHook
+ invoke UnhookEvent, hIcoLibEv
+ xor eax, eax
+ ret
+Unload Endp
+
+End DllMain
\ No newline at end of file diff --git a/dspcontrol/plugin/DspControl.def b/dspcontrol/plugin/DspControl.def new file mode 100644 index 0000000..4d866c0 --- /dev/null +++ b/dspcontrol/plugin/DspControl.def @@ -0,0 +1,4 @@ +LIBRARY DspControl
+EXPORTS MirandaPluginInfo
+EXPORTS Load
+EXPORTS Unload
\ No newline at end of file diff --git a/dspcontrol/res/DspControl.aps b/dspcontrol/res/DspControl.aps Binary files differnew file mode 100644 index 0000000..655b1a7 --- /dev/null +++ b/dspcontrol/res/DspControl.aps diff --git a/dspcontrol/res/DspControl.rc b/dspcontrol/res/DspControl.rc new file mode 100644 index 0000000..e9fce1f --- /dev/null +++ b/dspcontrol/res/DspControl.rc @@ -0,0 +1,166 @@ +// Microsoft Visual C++ generated resource script.
+//
+#include "..\inc\resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.K.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+100 DIALOGEX 0, 0, 314, 240
+STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD | WS_VISIBLE
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ CONTROL "",IDT_MAIN,"SysTabControl32",0x0,1,1,311,237
+END
+
+101 DIALOGEX 0, 0, 305, 220
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ CONTROL "Display Control enabled",IDC_ENABLED,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,29,1,143,10
+ GROUPBOX "Status trigger",IDC_STATIC,25,38,110,105
+ CONTROL "Online",IDC_STATUS_ONLINE,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,30,48,75,10
+ CONTROL "Away",IDC_STATUS_AWAY,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,30,58,75,10
+ CONTROL "DND",IDC_STATUS_DND,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,30,68,75,10
+ CONTROL "NA",IDC_STATUS_NA,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,30,78,75,10
+ CONTROL "Occupied",IDC_STATUS_OCCUPIED,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,30,88,75,10
+ CONTROL "Free for chat",IDC_STATUS_FREECHAT,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,30,98,75,10
+ CONTROL "Invisible",IDC_STATUS_INVISIBLE,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,30,108,75,10
+ CONTROL "On the phone",IDC_STATUS_ONTHEPHONE,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,30,118,75,10
+ CONTROL "Out to lunch",IDC_STATUS_OUTTOLUNCH,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,30,128,75,10
+ LTEXT "Protocol trigger",IDC_STATIC,169,38,90,8
+ LISTBOX IDC_PROTO,169,48,90,95,LBS_MULTIPLESEL | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_GROUP | WS_TABSTOP
+ GROUPBOX "Event type trigger",IDC_STATIC,25,144,110,75
+ CONTROL "Incoming message",IDC_ETYPE_MESSAGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,154,100,10
+ CONTROL "Incoming URL",IDC_ETYPE_URL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,164,100,10
+ CONTROL "Incoming contacts",IDC_ETYPE_CONTACTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,174,100,10
+ CONTROL "You Were Added Message",IDC_ETYPE_ADDED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,184,100,10
+ CONTROL "Authorisation Request",IDC_ETYPE_AUTHREQUEST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,194,100,10
+ CONTROL "Incoming file",IDC_ETYPE_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,30,204,100,10
+ LTEXT "Select when do you want the plugin to turn on your screen. Treat the following options as event triggers. Select only the options that you want to trigger the screen to turn on.",IDC_STATIC,39,11,233,25
+ CONTROL "",IDC_STARTTIME,"SysDateTimePick32",DTS_RIGHTALIGN | DTS_UPDOWN | WS_TABSTOP,185,202,35,12
+ CONTROL "",IDC_ENDTIME,"SysDateTimePick32",DTS_RIGHTALIGN | DTS_UPDOWN | WS_TABSTOP,241,202,35,12
+ GROUPBOX "Time trigger",IDC_STATIC,145,144,140,75
+ LTEXT "Enter the range in time, when you want your screen turning on. Note that starting time can be higher then the ending time.",IDC_STATIC,151,154,126,34
+ LTEXT "Enable plugin:",IDC_STATIC,151,191,123,8
+ RTEXT "From",IDC_STATIC,148,206,34,8
+ CTEXT "to",IDC_STATIC,222,206,16,8
+END
+
+102 DIALOGEX 0, 0, 305, 220
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ LTEXT "To enable or disable the plugin for an individual contact, click on the icon to the right of it. Clicking on the group's icon, enables/disables the plugin for all the contacts in that group.",IDC_STATIC,40,188,227,27
+ CONTROL "",IDC_CLIST,"CListControl",WS_TABSTOP | 0x1c0,10,10,285,165,WS_EX_CLIENTEDGE
+ CONTROL "Show hidden",IDC_SHOWHIDDEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,177,195,10
+END
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "..\\inc\\resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 0,1,1,30
+ PRODUCTVERSION 0,1,1,30
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "000004b0"
+ BEGIN
+ VALUE "FileDescription", "DspControl"
+ VALUE "FileVersion", "0, 1, 1, 30"
+ VALUE "InternalName", "DspControl"
+ VALUE "LegalCopyright", "Copyright © 2006-2007"
+ VALUE "OriginalFilename", "DspControl.dll"
+ VALUE "ProductName", " DspControl"
+ VALUE "ProductVersion", "0, 1, 1, 30"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0, 1200
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_PC ICON "settings pc.ico"
+#endif // English (U.K.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/dspcontrol/res/settings pc.ico b/dspcontrol/res/settings pc.ico Binary files differnew file mode 100644 index 0000000..bb71cb9 --- /dev/null +++ b/dspcontrol/res/settings pc.ico diff --git a/dspcontrol/vsproj/DspControl.vcproj b/dspcontrol/vsproj/DspControl.vcproj new file mode 100644 index 0000000..4dc435a --- /dev/null +++ b/dspcontrol/vsproj/DspControl.vcproj @@ -0,0 +1,195 @@ +<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="DspControl"
+ ProjectGUID="{C65292DB-BAC4-4B07-BF9F-2A8B83A429DC}"
+ RootNamespace="DspControl"
+ Keyword="MakeFileProj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="build.bat"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output="DspControl.dll"
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="release.bat"
+ ReBuildCommandLine=""
+ CleanCommandLine=""
+ Output="DspControl.dll"
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\plugin\DspControl.asm"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\inc\IcoLib.inc"
+ >
+ </File>
+ <File
+ RelativePath="..\inc\m_clc.inc"
+ >
+ </File>
+ <File
+ RelativePath="..\inc\m_clist.inc"
+ >
+ </File>
+ <File
+ RelativePath="..\inc\m_database.inc"
+ >
+ </File>
+ <File
+ RelativePath="..\inc\m_langpack.inc"
+ >
+ </File>
+ <File
+ RelativePath="..\inc\m_metacontacts.inc"
+ >
+ </File>
+ <File
+ RelativePath="..\inc\m_options.inc"
+ >
+ </File>
+ <File
+ RelativePath="..\inc\m_protocols.inc"
+ >
+ </File>
+ <File
+ RelativePath="..\inc\m_protosvc.inc"
+ >
+ </File>
+ <File
+ RelativePath="..\inc\m_updater.inc"
+ >
+ </File>
+ <File
+ RelativePath="..\inc\newpluginapi.inc"
+ >
+ </File>
+ <File
+ RelativePath="..\inc\resource.h"
+ >
+ </File>
+ <File
+ RelativePath="..\inc\statusmodes.inc"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath="..\res\DspControl.rc"
+ >
+ </File>
+ <File
+ RelativePath="..\res\settings pc.ico"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Batch Script"
+ >
+ <File
+ RelativePath=".\build.bat"
+ >
+ </File>
+ <File
+ RelativePath=".\release.bat"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Definition Files"
+ >
+ <File
+ RelativePath="..\plugin\DspControl.def"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Version Specific Files"
+ >
+ <File
+ RelativePath="..\BETA"
+ >
+ </File>
+ <File
+ RelativePath="..\CHANGELOG.txt"
+ >
+ </File>
+ <File
+ RelativePath="..\common.arg"
+ >
+ </File>
+ <File
+ RelativePath="..\README.txt"
+ >
+ </File>
+ <File
+ RelativePath="..\TRANSLATION.txt"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\LICENSE.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/dspcontrol/vsproj/build.bat b/dspcontrol/vsproj/build.bat new file mode 100644 index 0000000..c5eee8c --- /dev/null +++ b/dspcontrol/vsproj/build.bat @@ -0,0 +1,36 @@ +@echo off
+echo '
+echo Building Resources...
+rc /r /fo ".\DspControl.res" ..\res\DspControl.rc
+
+echo '
+echo Building ANSI version...
+
+\masm32\bin\ml /nologo /c /coff /Zi /Fl /Fm /Cp ..\plugin\DspControl.asm
+ if errorlevel 1 goto errasm
+\masm32\bin\Link /nologo /DEBUG /DEBUGTYPE:CV /DLL /DEF:..\plugin\DspControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib /OUT:"Debug\ANSI\DspControl.dll" DspControl.obj DspControl.res
+ if errorlevel 1 goto errlink
+
+echo '
+echo Building Unicode version...
+
+\masm32\bin\ml /nologo /D_UNICODE /c /coff /Zi /Fl /Fm /Cp ..\plugin\DspControl.asm
+ if errorlevel 1 goto errasm
+\masm32\bin\Link /nologo /DEBUG /DEBUGTYPE:CV /DLL /DEF:..\plugin\DspControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib /OUT:"Debug\Unicode\DspControl.dll" DspControl.obj DspControl.res
+ if errorlevel 1 goto errlink
+
+echo '
+echo Done.
+goto TheEnd
+
+:errasm
+echo '
+echo Assembly Error
+goto TheEnd
+
+:errlink
+echo '
+echo Link Error
+
+:TheEnd
+pause
\ No newline at end of file diff --git a/dspcontrol/vsproj/release.bat b/dspcontrol/vsproj/release.bat new file mode 100644 index 0000000..0bde609 --- /dev/null +++ b/dspcontrol/vsproj/release.bat @@ -0,0 +1,49 @@ +@echo off
+
+echo Building Resources...
+rc /r /fo ".\DspControl.res" ..\res\DspControl.rc
+
+
+echo Building ANSI version...
+
+\masm32\bin\ml /nologo /c /coff /Zi /Fl /Fm /Cp ..\plugin\DspControl.asm
+ if errorlevel 1 goto errasm
+\masm32\bin\Link /nologo /DEBUG /DEBUGTYPE:CV /DLL /DEF:..\plugin\DspControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib /OUT:"Release\ANSI\DspControl.dll" DspControl.obj DspControl.res
+ if errorlevel 1 goto errlink
+move /Y Release\ANSI\DspControl.dll ..\bin\ANSI\DspControl_d.dll
+
+\masm32\bin\ml /nologo /c /coff /Cp ..\plugin\DspControl.asm
+ if errorlevel 1 goto errasm
+\masm32\bin\Link /nologo /DLL /DEF:..\plugin\DspControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib /OUT:"Release\ANSI\DspControl.dll" DspControl.obj DspControl.res
+ if errorlevel 1 goto errlink
+move /Y Release\ANSI\DspControl.dll ..\bin\ANSI\DspControl.dll
+
+
+echo Building Unicode version...
+
+\masm32\bin\ml /nologo /D_UNICODE /c /coff /Zi /Fl /Fm /Cp ..\plugin\dspcontrol.asm
+ if errorlevel 1 goto errasm
+\masm32\bin\Link /nologo /DEBUG /DEBUGTYPE:CV /DLL /DEF:..\plugin\DspControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib /OUT:"Release\Unicode\DspControl.dll" DspControl.obj DspControl.res
+ if errorlevel 1 goto errlink
+move /Y Release\Unicode\DspControl.dll ..\bin\Unicode\DspControl_d.dll
+
+\masm32\bin\ml /nologo /D_UNICODE /c /coff /Cp ..\plugin\dspcontrol.asm
+ if errorlevel 1 goto errasm
+\masm32\bin\Link /nologo /DLL /DEF:..\plugin\DspControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib /OUT:"Release\Unicode\DspControl.dll" DspControl.obj DspControl.res
+ if errorlevel 1 goto errlink
+move /Y Release\Unicode\DspControl.dll ..\bin\Unicode\DspControl.dll
+
+Echo Done.
+cd
+
+goto TheEnd
+:errasm
+echo _
+echo Assembly Error
+goto TheEnd
+:errlink
+echo _
+echo Link Error
+
+:TheEnd
+pause
\ No newline at end of file |